Go to the first, previous, next, last section, table of contents.

Fancy Diary Display

After the diary buffer has been prepared, the functions specified by the variable diary-display-hook are called. The default value of this hook simply displays the diary file using selective display to conceal irrelevant diary entries. However, if you specify the hook as follows,

(setq diary-display-hook 'fancy-diary-display)

Emacs will prepare a noneditable buffer with a neatly organized day-by-day listing of relevant diary entries and known holidays. If you are using the fancy diary display, you get a hard copy of the buffer with M-x lpr-buffer; you should not use M-x print-diary-entries. Thus you can get a hard copy of a day-by-day diary for a week by positioning the point on Sunday of that week, using 7 d, switching to the fancy diary, and using M-x lpr-buffer. As in the standard diary buffer, the inclusion of the holidays slows down the display slightly; you can speed things up by setting the variable holidays-in-diary-buffer to nil.

Ordinarily, the fancy diary buffer will not show days for which there are no diary entries, even if that day is a holiday. If you want such days to be shown in the fancy diary buffer, set the variable diary-list-include-blanks to t.

If you use the fancy diary display, you can use the list-diary-entries-hook to sort each day's diary entries. Add the lines

(setq list-diary-entries-hook
      '(lambda nil
         (setq diary-entries-list
               (sort diary-entries-list 'diary-entry-compare))))

to your `.emacs' file. For each day, diary entries that begin with a recognizable time of day will be sorted into order, preceded by any diary entries that do not begin with a time of day.


Go to the first, previous, next, last section, table of contents.