emacs_v1.el

;;
;; TeXcount setup for TeXcount
;;
(defun texcount ()
 (interactive)
 (let*
   ( (this-file buffer-file-name)
     (word-count
       (with-output-to-string
         (with-current-buffer standard-output
           (call-process "texcount" nil t nil "-1" "-relaxed" this-file)
   ) ) ) )
   (string-match "\n*$" word-count)
   (message (replace-match "" nil nil word-count))
) )
(add-hook 'LaTeX-mode-hook (lambda () (define-key LaTeX-mode-map "\C-cw" 'texcount)))
(add-hook 'latex-mode-hook (lambda () (define-key latex-mode-map "\C-cw" 'texcount)))


Last modified January 29, 2017.