Книга: Learning GNU Emacs, 3rd Edition

5.5.2.1 Creating a diary file

5.5.2.1 Creating a diary file

To use the diary, you must have a diary file that contains notations about important events or things to do. It can remind you to back up your system every Thursday, that you get paid every two weeks, that you're on vacation during the first two weeks in July, or that your mother's birthday is August 6.

The file must be called diary and must exist in your home directory. In this file, you insert lines—or have Emacs write lines for you—that note dates you want to remember. The diary file need not be all in one format and need not be sorted in any particular order. Date formats can be mixed: December 19, 2004 could be 12/19/04, Dec 19 04, or dec 19 2004. Here are a few lines from a diary file to illustrate what we mean.

11/14 My birthday
July 17 2004 Company picnic
March 18 2004 Annual report due
January 8 2004 Hair appointment
&Saturday Tea with Queen Elizabeth
Friday Payday

If you don't specify a year, Emacs assumes you want to mark that date every year, as in birthdays. If you don't specify a date but only the day of the week (as in tea with the queen on Saturday), Emacs displays the diary entry every Saturday. Putting an ampersand (&) before an entry tells Emacs not to mark it on the calendar (you don't want every Saturday marked, and you may not want everyone to know that you hang around with the royal family).

Date formats can be mixed, but the choice to use European date format (DD/MM/YYYY or 9 October 2004) versus the default American format (MM/DD/YYYY or October 9, 2004) must be made before you create the diary file. To specify European date format, add this line to your .emacs file:

(setq european-calendar-style 't)

Оглавление книги


Генерация: 1.093. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз