Next: Displaying the Diary, Up: Diary [Contents][Index]

#### 31.10.1 The Diary File

Your diary file is a file that records events associated with particular dates. The name of the diary file is specified by the variable `diary-file`. The default is `~/.emacs.d/diary`, though for compatibility with older versions Emacs will use `~/diary` if it exists.

Each entry in the diary file describes one event and consists of one or more lines. An entry always begins with a date specification at the left margin. The rest of the entry is simply text to describe the event. If the entry has more than one line, then the lines after the first must begin with whitespace to indicate they continue a previous entry. Lines that do not begin with valid dates and do not continue a preceding entry are ignored. Here’s an example:

    12/22/2015  Twentieth wedding anniversary!
    10/22       Ruth's birthday.
    * 21, *:    Payday
    Tuesday--weekly meeting with grad students at 10am
             Supowit, Shen, Bitner, and Kapoor to attend.
    1/13/89     Friday the thirteenth!!
    thu 4pm     squash game with Lloyd.
    mar 16      Dad's birthday
    April 15, 2016 Income tax due.
    * 15        time cards due.

This example uses extra spaces to align the event descriptions of most of the entries. Such formatting is purely a matter of taste.

You can also use a format where the first line of a diary entry consists only of the date or day name (with no following blanks or punctuation). For example:

    02/11/2012
          Bill B. visits Princeton today
          2pm Cognitive Studies Committee meeting
          2:30-5:30 Liz at Lawrenceville
          4:00pm Dentist appt
          7:30pm Dinner at George's
          8:00-10:00pm concert

This entry will have a different appearance if you use the simple diary display (see Diary Display). The simple diary display omits the date line at the beginning; only the continuation lines appear. This style of entry looks neater when you display just a single day’s entries, but can cause confusion if you ask for more than one day’s entries.

Next: Displaying the Diary, Up: Diary [Contents][Index]