Skip to main content

31.10.6 Appointments

If you have a diary entry for an appointment, and that diary entry begins with a recognizable time of day, Emacs can warn you in advance that an appointment is pending. Emacs alerts you to the appointment by displaying a message in your chosen format, as specified by the variable appt-display-format. If the value of appt-audible is non-nil, the warning includes an audible reminder. In addition, if appt-display-mode-line is non-nil, Emacs displays the number of minutes to the appointment on the mode line.

If appt-display-format has the value window, then the variable appt-display-duration controls how long the reminder window is visible for; and the variables appt-disp-window-function and appt-delete-window-function give the names of functions used to create and destroy the window, respectively.

To enable appointment notification, type M-x appt-activate. With a positive argument, it enables notification; with a negative argument, it disables notification; with no argument, it toggles. Enabling notification also sets up an appointment list for today from the diary file, giving all diary entries found with recognizable times of day, and reminds you just before each of them.

For example, suppose the diary file contains these lines:

Monday
9:30am Coffee break
12:00pm Lunch

Then on Mondays, you will be reminded at around 9:20am about your coffee break and at around 11:50am about lunch. The variable appt-message-warning-time specifies how many minutes (default 12) in advance to warn you. This is a default warning time. Each appointment can specify a different warning time by adding a piece matching appt-warning-time-regexp (see that variable’s documentation for details).

You can write times in am/pm style (with ‘12:00am’ standing for midnight and ‘12:00pm’ standing for noon), or 24-hour European/military style. You need not be consistent; your diary file can have a mixture of the two styles. Times must be at the beginning of diary entries if they are to be recognized.

Emacs updates the appointments list from the diary file automatically just after midnight. You can force an update at any time by re-enabling appointment notification. Both these actions also display the day’s diary buffer, unless you set appt-display-diary to nil. The appointments list is also updated whenever the diary file (or a file it includes; see Fancy Diary Display) is saved. If you use the Org Mode and keep appointments in your Org agenda files, you can add those appointments to the list using the org-agenda-to-appt command. See Appointment reminders in The Org Manual, for more about that command.

You can also use the appointment notification facility like an alarm clock. The command M-x appt-add adds entries to the appointment list without affecting your diary file. You delete entries from the appointment list with M-x appt-delete.