Useful Things

Org-mode

Org-mode is a truly wonderful Emacs extension that makes working with structured plain text data a breeze. It can be used for note taking, time management and project planning, document writing, and many other things. Have a look at the tutorials to get an idea.

Agenda View: Only Today

I use org-mode as a day planner and wanted to see the times of sunrise and sunset of the day. So I added a diary sexp to an org file contributing to my daily agenda.

%%(diary-sunrise-sunset)

This dutifully adds a line for the times of sunrise and sunset to the agenda. However, it does so for every day shown. In the week view this means seven entries, which add lots of clutter and little value. So I wrote function that evaluates its argument only for today:

(defun cus/org-agenda-only-today (fn)
  "Show the result of calling FN in the agenda for today."
  (if (equal date (calendar-current-date))
      (funcall fn)))

Instead of the org file entry shown above, I pass the function diary-sunrise-sunset to my filtering function.

%%(cus/org-agenda-only-today (function diary-sunrise-sunset))

As a result, the times of sunrise and sunset are shown only for today.

Author: Christoph Ulrich Scholler (scholler@fnb.tu-darmstadt.de)

Date: 2011-07-11 23:56:34 CEST

Generated by Org version 7.6 with Emacs version 23

Validate XHTML 1.0