Task management with Emacs: Text files

| emacs

With the wealth of code available for Emacs and the ease of
customization it provides, you’re certain to find a task management
tool that fits the way you think. Over the next few days, I’ll provide
a quick run-through of the methods I’ve tried out.

The simplest way to get started with Emacs for task management is to
keep your TODOs in a plain text file, like ~/TODO. You can keep this
text file in any format you want. To make it easier for you to see
what you need to do, you can keep active TODOs near the top and
completed tasks near the bottom.

If you load your TODO file every time you start up Emacs, then you’ll
be sure to check it every day. Put the following line in your ~/.emacs
to have it automatically loaded when you start:

(find-file "~/TODO")

You’ll also want to make it easy to open during an Emacs session. If
your TODO file is just a keyboard shortcut away, you’ll find it easier
to keep all of your reminders in the file. Here’s a snippet that shows
the TODO file in the current window.

(defun my/todo ()
 "Bring up the TODO file."
 (interactive)
 (find-file "~/TODO")
 (goto-char (point-min)))

;; Now bind it to a convenient shortcut key
(global-set-key (kbd " ") 'my/todo)

Now you can hit F5 F5 to show your TODO. If you want your TODO file to
show up in another window, remove that and use this snippet instead:

(defun my/todo ()
 "Bring up the TODO file."
 (interactive)
 (find-file-other-window "~/TODO")
 (goto-char (point-min)))

;; Now bind it to a convenient shortcut key
(global-set-key (kbd " ") 'my/todo)

If you want to be able to add stuff to your TODO without getting
distracted from your work, add this to your ~/.emacs:

(defun my/add-todo (task)
 "Add a line to the TODO file."
 (interactive "MTask: ")
 (with-current-buffer (find-file-noselect "~/TODO")
   (goto-char (point-min))
   (insert task "\n")
   (save-buffer)))
(global-set-key (kbd " t") 'my/add-todo)

See? Emacs is fun and easy to configure. You can store your tasks in a
plain text file and then add keyboard shortcuts to make your tasks
easier to manage.

There are many sophisticated task management packages for Emacs. I’ll
write about one of them tomorrow. In the meantime, if you want to find
out what task manager I _really_ like using, you can check out
PlannerMode! =)

You can comment with Disqus or you can e-mail me at sacha@sachachua.com.