Today I wanted to cook up a new entry, and I realized that when I do this, I always end up poking through the ongoing directory tree to the slot for the current date, opening the file, switching to my homegrown XML editing mode, importing an empty template, and start by entering its category. This is wrong, because whenever a human being is doing a repetitive, boring, error-prone task, that's wrong.

So I added the following lines to my ~/.emacs file:

;; Start an 'ongoing' note
(defun ongoing (o) "Write an Ongoing Note" (interactive "Mongoing: ")
  (find-file (concat
	      (format-time-string "~/ongoing/Date/200x/%Y/%m/%d/") o ".ong"))
  (if (= (buffer-size) 0) (insert-file-contents "~/ongoing/empty"))
  (structext-mode)
  (search-forward "<cat>"))

And there you have it.

(Later) It turns out that I wasn't using Alt-O for anything: now I am... so now it takes a keystroke to start editing an entry.

This note was created the little program you see above. It is probably the last ongoing entry that will be written any other way.


ongoing
software · G & M · Dad author · colophon · rights
picture of the day
Around January 29, 2003: Nick Hornby on Riffs for the Aged · dot-Emacs · The Window on Top · Cold Tea Blues · Writing the Hard Line of Code

What?
· Technology (61 fragments)
· · Emacs (7 more)


Serif · Sans-Serif
I work at Sun Microsystems. The opinions expressed here are my own, and neither Sun nor any other party necessarily agrees with them.