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"))
  (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.

author · Dad
colophon · rights
picture of the day
January 29, 2003
· Technology (90 fragments)
· · Emacs (7 more)

By .

The opinions expressed here
are my own, and no other party
necessarily agrees with them.

A full disclosure of my
professional interests is
on the author page.

I’m on Mastodon!