Brad Lucas

Programming, Clojure and other interests
October 23, 2008

Simple Emacs Mark Completed Function

I’ve been in the habit of keeping track of things in todo lists using Emacs’s outline-mode. This works great to organize things but I needed a better way to mark completed items. I have the files in source control so I could delete them and still know of them using a diff with a previous version but this is clumsy. Otherwise, I could mark items with a date or a DONE but this gets ugly. instead I have this simple emacs function that takes the current line as moves it to the bottom of the file with the date prepended.

Simple.

(defun mark-completed ()
"Move the current line to the bottom of the file and prepend the date."
(interactive)
(save-excursion
(progn
(move-beginning-of-line nil)
(kill-line 1)
(end-of-buffer)
(if (not (eq 0 (current-column)))
(newline))
(insert-date)
(insert " - ")
(yank))))

Tags: emacs