;; set the TODO_FILE env in: ~/.zshenv ;; for zsh, see: ~/.zsh/todo ;; This file: http://user.it.uu.se/~embe8573/conf/emacs-init/todo-did.el (require 'linux-shell) (require 'revert-buffer-my) (defun todo (what) (interactive "sdo what: ") (let*((todo-file (getenv "TODO_FILE")) (todo-buffer (get-file-buffer todo-file)) ) (append-to-file (format "%s\n" what) nil todo-file) ; ignored (message nil) ; clear minibuffer (when todo-buffer (revert-buffer-force todo-buffer)) )) (defun show-todos () (interactive) (let*((todo-file (getenv "TODO_FILE")) (todo-buffer (get-file-buffer todo-file)) ) (if todo-buffer (progn (switch-to-buffer todo-buffer) (revert-buffer-force) (when (buffer-modified-p) (save-buffer)) ) (find-file todo-file) ) (goto-char (point-min)) (goto-char (point-max)) )) (defun did (what) (interactive "s did what: ") (let ((did-file "~/public_html/hs-linux/NEWS")) (with-temp-buffer (insert-shell-command "date") (insert " - " what) (append-to-file nil nil did-file) ; START END (i.e., whole buffer) (message nil) ; clear minibuffer )))