: Learning GNU Emacs, 3rd Edition Displaying diary entries Displaying diary entries

If you want to review the diary entries for a given date, press d from the calendar. In order to see the whole diary file, press s from the calendar. If you want today's diary entries to display automatically when you start Emacs, add this line to your .emacs file:


That way, when you start up Emacs on a day for which there is a diary entry, the diary entry displays automatically. For example, let's say you marked your best friend's birthday some time ago, and today is the day. When you start Emacs, the screen would look like this:

You start Emacs.

Emacs displays the diary entry for your friend's birthday.

If there are no diary entries for a given day, the diary is not displayed. If you start Emacs with two files so that you are editing in two windows, the diary is also not displayed.

If you have already put in a (calendar) entry in your .emacs file to have the calendar displayed automatically, the calendar supersedes the diary, and you'll have to remove the calendar if you prefer to see the diary instead.

To mark dates with diary entries in red, press m from the calendar. To remove the marks, press u. (This command removes highlighting for diary entries as well as for holidays.)

Table 5-5 summarizes the calendar and diary commands.

Table5-5.Holiday and diary commands

Keystrokes Command name Action
p d calendar-print-day-of-year Display the day of the year this is (for example, Day 364 of 365).
p o calendar-print-other-dates Display information about this date for all calendars.
Space scroll-other-window Scroll the other window.
q exit-calendar Quit calendar.
a Holidays ? For Window list-calendar-holidays Display holidays for calendar period shown.
h Holidays ? For Cursor Date calendar-cursor-holidays In the minibuffer, display holiday information for the day the cursor is on.
x Holidays ? Mark mark-calendar-holidays Display holidays in a different typeface, color, or with an asterisk beside them.
u Holidays ? Unmark Calendar calendar-unmark Remove marks for holidays and diary entries (opposite of x command).
i w Diary ? Insert Weekly insert-weekly-diary-entry Add a weekly entry based on the day of the week.
i y Diary ? Insert Yearly insert-yearly-diary-entry Add an annual entry.
i d Diary ? Insert Daily insert-diary-entry Add an entry for a particular day.
i m Diary ? Insert Monthly insert-monthly-diary-entry Add an entry for the day of the month.
i c Diary ? Insert Cyclic insert-cyclic-diary-entry Add an entry to recur every n days.
i a Diary ? Insert Anniversary insert-anniversary-diary-entry Add an annual entry (the year is included for reference).
i b Diary ? Insert Block insert-block-diary-entry Add a block entry.
m mark-diary-entries Display diary entries in a different typeface, color, or with a plus sign beside them.
d view-diary-entries Display diary entries for the current date.
s Diary ? Show All show-all-diary-entries Display diary file.
M-= calendar-count-days-region Count the number of days in a region.
M Moon ? Lunar Phases calendar-phases-of-moon Display phases of the moon for a three-month period.
S calendar-sunrise-sunset Given longitude and latitude, display sunrise and sunset times for the current date.
C-Space or C-@ calendar-set-mark Mark regions by time rather than horizontally.

: 0.312. /Cache: 3 / 1