Elisp:
(defun nano-data () (set-buffer (find-file-noselect "wordcount-history")) (goto-char (point-max)) (let* ((tm (current-time)) (str1 (int-to-string (car tm))) (str2 (int-to-string (cadr tm))) (shellcmd (concat "wc -w 2004-*.tex | tail -1 | perl -lane 'print ((" str1 " * 65536 + " str2 ") . \" $F[0]\" )' "))) (insert (shell-command-to-string shellcmd))) (basic-save-buffer)) (define-minor-mode nanowri-mode "just an after-save-hook hack for now" nil "NaNoWriMo" nil (if nanowri-mode (add-hook 'after-save-hook 'nano-data nil t) (remove-hook 'after-save-hook 'nano-data)))
Gnuplot:
set terminal x11 persist plot "wordcount-history" using ($1 / 1000 - 1.09928e6):($2) with lines notitle