Mercurial > emacs
annotate lispref/calendar.texi @ 25834:61793eeb4b68
#
author | Dave Love <fx@gnu.org> |
---|---|
date | Wed, 29 Sep 1999 22:08:57 +0000 |
parents | 467b88fab665 |
children | 6a17c48b52ef |
rev | line source |
---|---|
6387 | 1 @c -*-texinfo-*- |
2 @c This is part of the GNU Emacs Lisp Reference Manual. | |
21007
66d807bdc5b4
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
20360
diff
changeset
|
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1995, 1998 Free Software Foundation, Inc. |
6387 | 4 @c See the file elisp.texi for copying conditions. |
21682
90da2489c498
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
21007
diff
changeset
|
5 @node Calendar, System Interface, Display, Top |
6387 | 6 @chapter Customizing the Calendar and Diary |
7 | |
8 There are many customizations that you can use to make the calendar and | |
9 diary suit your personal tastes. | |
10 | |
11 @menu | |
12 * Calendar Customizing:: Defaults you can set. | |
13 * Holiday Customizing:: Defining your own holidays. | |
14 * Date Display Format:: Changing the format. | |
15 * Time Display Format:: Changing the format. | |
16 * Daylight Savings:: Changing the default. | |
17 * Diary Customizing:: Defaults you can set. | |
18 * Hebrew/Islamic Entries:: How to obtain them. | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
19 * Fancy Diary Display:: Enhancing the diary display, sorting entries, |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
20 using included diary files. |
6387 | 21 * Sexp Diary Entries:: Fancy things you can do. |
22 * Appt Customizing:: Customizing appointment reminders. | |
23 @end menu | |
24 | |
25 @node Calendar Customizing | |
26 @section Customizing the Calendar | |
27 @vindex view-diary-entries-initially | |
28 | |
29 If you set the variable @code{view-diary-entries-initially} to | |
30 @code{t}, calling up the calendar automatically displays the diary | |
31 entries for the current date as well. The diary dates appear only if | |
32 the current date is visible. If you add both of the following lines to | |
33 your @file{.emacs} file:@refill | |
34 | |
35 @example | |
36 (setq view-diary-entries-initially t) | |
37 (calendar) | |
38 @end example | |
39 | |
40 @noindent | |
7688 | 41 this displays both the calendar and diary windows whenever you start Emacs. |
6387 | 42 |
43 @vindex view-calendar-holidays-initially | |
44 Similarly, if you set the variable | |
45 @code{view-calendar-holidays-initially} to @code{t}, entering the | |
7688 | 46 calendar automatically displays a list of holidays for the current |
47 three-month period. The holiday list appears in a separate | |
48 window. | |
6387 | 49 |
50 @vindex mark-diary-entries-in-calendar | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
51 You can set the variable @code{mark-diary-entries-in-calendar} to |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
52 @code{t} in order to mark any dates with diary entries. This takes |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
53 effect whenever the calendar window contents are recomputed. There are |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
54 two ways of marking these dates: by changing the face (@pxref{Faces}), |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
55 if the display supports that, or by placing a plus sign (@samp{+}) |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
56 beside the date otherwise. |
6387 | 57 |
58 @vindex mark-holidays-in-calendar | |
59 Similarly, setting the variable @code{mark-holidays-in-calendar} to | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
60 @code{t} marks holiday dates, either with a change of face or with an |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
61 asterisk (@samp{*}). |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
62 |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
63 @vindex calendar-holiday-marker |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
64 @vindex diary-entry-marker |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
65 The variable @code{calendar-holiday-marker} specifies how to mark a |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
66 date as being a holiday. Its value may be a character to insert next to |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
67 the date, or a face name to use for displaying the date. Likewise, the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
68 variable @code{diary-entry-marker} specifies how to mark a date that has |
12067 | 69 diary entries. The calendar creates faces named @code{holiday-face} and |
70 @code{diary-face} for these purposes; those symbols are the default | |
71 values of these variables, when Emacs supports multiple faces on your | |
72 terminal. | |
6387 | 73 |
74 @vindex calendar-load-hook | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
75 The variable @code{calendar-load-hook} is a normal hook run when the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
76 calendar package is first loaded (before actually starting to display |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
77 the calendar). |
6387 | 78 |
79 @vindex initial-calendar-window-hook | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
80 Starting the calendar runs the normal hook |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
81 @code{initial-calendar-window-hook}. Recomputation of the calendar |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
82 display does not run this hook. But if you leave the calendar with the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
83 @kbd{q} command and reenter it, the hook runs again.@refill |
6387 | 84 |
85 @vindex today-visible-calendar-hook | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
86 The variable @code{today-visible-calendar-hook} is a normal hook run |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
87 after the calendar buffer has been prepared with the calendar when the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
88 current date is visible in the window. One use of this hook is to |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
89 replace today's date with asterisks; to do that, use the hook function |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
90 @code{calendar-star-date}. |
6387 | 91 |
92 @findex calendar-star-date | |
93 @example | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
94 (add-hook 'today-visible-calendar-hook 'calendar-star-date) |
6387 | 95 @end example |
96 | |
97 @noindent | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
98 Another standard hook function marks the current date, either by |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
99 changing its face or by adding an asterisk. Here's how to use it: |
6387 | 100 |
101 @findex calendar-mark-today | |
102 @example | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
103 (add-hook 'today-visible-calendar-hook 'calendar-mark-today) |
6387 | 104 @end example |
105 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
106 @noindent |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
107 @vindex calendar-today-marker |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
108 The variable @code{calendar-today-marker} specifies how to mark today's |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
109 date. Its value should be a character to insert next to the date or a |
12067 | 110 face name to use for displaying the date. A face named |
111 @code{calendar-today-face} is provided for this purpose; that symbol is | |
112 the default for this variable when Emacs supports multiple faces on your | |
113 terminal. | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
114 |
6387 | 115 @vindex today-invisible-calendar-hook |
116 @noindent | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
117 A similar normal hook, @code{today-invisible-calendar-hook} is run if |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
118 the current date is @emph{not} visible in the window. |
6387 | 119 |
25751
467b88fab665
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
24862
diff
changeset
|
120 @vindex calendar-move-hook |
467b88fab665
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
24862
diff
changeset
|
121 Starting in Emacs 21, each of the calendar cursor motion commands |
467b88fab665
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
24862
diff
changeset
|
122 runs the hook @code{calendar-move-hook} after it moves the cursor. |
467b88fab665
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
24862
diff
changeset
|
123 |
6387 | 124 @node Holiday Customizing |
125 @section Customizing the Holidays | |
126 | |
127 @vindex calendar-holidays | |
128 @vindex christian-holidays | |
129 @vindex hebrew-holidays | |
130 @vindex islamic-holidays | |
131 Emacs knows about holidays defined by entries on one of several lists. | |
7688 | 132 You can customize these lists of holidays to your own needs, adding or |
133 deleting holidays. The lists of holidays that Emacs uses are for | |
134 general holidays (@code{general-holidays}), local holidays | |
135 (@code{local-holidays}), Christian holidays (@code{christian-holidays}), | |
136 Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Moslem) | |
137 holidays (@code{islamic-holidays}), and other holidays | |
138 (@code{other-holidays}). | |
6387 | 139 |
140 @vindex general-holidays | |
141 The general holidays are, by default, holidays common throughout the | |
142 United States. To eliminate these holidays, set @code{general-holidays} | |
143 to @code{nil}. | |
144 | |
145 @vindex local-holidays | |
146 There are no default local holidays (but sites may supply some). You | |
147 can set the variable @code{local-holidays} to any list of holidays, as | |
148 described below. | |
149 | |
150 @vindex all-christian-calendar-holidays | |
151 @vindex all-hebrew-calendar-holidays | |
152 @vindex all-islamic-calendar-holidays | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
153 By default, Emacs does not include all the holidays of the religions |
7688 | 154 that it knows, only those commonly found in secular calendars. For a |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
155 more extensive collection of religious holidays, you can set any (or |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
156 all) of the variables @code{all-christian-calendar-holidays}, |
6387 | 157 @code{all-hebrew-calendar-holidays}, or |
158 @code{all-islamic-calendar-holidays} to @code{t}. If you want to | |
159 eliminate the religious holidays, set any or all of the corresponding | |
160 variables @code{christian-holidays}, @code{hebrew-holidays}, and | |
161 @code{islamic-holidays} to @code{nil}.@refill | |
162 | |
163 @vindex other-holidays | |
164 You can set the variable @code{other-holidays} to any list of | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
165 holidays. This list, normally empty, is intended for individual use. |
6387 | 166 |
167 @cindex holiday forms | |
168 Each of the lists (@code{general-holidays}, @code{local-holidays}, | |
169 @code{christian-holidays}, @code{hebrew-holidays}, | |
170 @code{islamic-holidays}, and @code{other-holidays}) is a list of | |
171 @dfn{holiday forms}, each holiday form describing a holiday (or | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
172 sometimes a list of holidays). |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
173 |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
174 Here is a table of the possible kinds of holiday form. Day numbers |
7688 | 175 and month numbers count starting from 1, but ``dayname'' numbers |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
176 count Sunday as 0. The element @var{string} is always the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
177 name of the holiday, as a string. |
6387 | 178 |
179 @table @code | |
180 @item (holiday-fixed @var{month} @var{day} @var{string}) | |
7688 | 181 A fixed date on the Gregorian calendar. |
6387 | 182 |
183 @item (holiday-float @var{month} @var{dayname} @var{k} @var{string}) | |
184 The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar | |
185 (@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
186 from the end of the month. |
6387 | 187 |
188 @item (holiday-hebrew @var{month} @var{day} @var{string}) | |
7688 | 189 A fixed date on the Hebrew calendar. |
6387 | 190 |
191 @item (holiday-islamic @var{month} @var{day} @var{string}) | |
7688 | 192 A fixed date on the Islamic calendar. |
6387 | 193 |
194 @item (holiday-julian @var{month} @var{day} @var{string}) | |
7688 | 195 A fixed date on the Julian calendar. |
6387 | 196 |
197 @item (holiday-sexp @var{sexp} @var{string}) | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
198 A date calculated by the Lisp expression @var{sexp}. The expression |
7688 | 199 should use the variable @code{year} to compute and return the date of a |
200 holiday, or @code{nil} if the holiday doesn't happen this year. The | |
201 value of @var{sexp} must represent the date as a list of the form | |
202 @code{(@var{month} @var{day} @var{year})}. | |
203 | |
204 @item (if @var{condition} @var{holiday-form}) | |
205 A holiday that happens only if @var{condition} is true. | |
6387 | 206 |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
207 @item (@var{function} @r{[}@var{args}@r{]}) |
7688 | 208 A list of dates calculated by the function @var{function}, called with |
209 arguments @var{args}. | |
6387 | 210 @end table |
211 | |
212 For example, suppose you want to add Bastille Day, celebrated in | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
213 France on July 14. You can do this as follows: |
6387 | 214 |
215 @smallexample | |
216 (setq other-holidays '((holiday-fixed 7 14 "Bastille Day"))) | |
217 @end smallexample | |
218 | |
219 @noindent | |
220 The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the | |
221 fourteenth day of the seventh month (July). | |
222 | |
223 Many holidays occur on a specific day of the week, at a specific time | |
224 of month. Here is a holiday form describing Hurricane Supplication Day, | |
225 celebrated in the Virgin Islands on the fourth Monday in August: | |
226 | |
227 @smallexample | |
228 (holiday-float 8 1 4 "Hurricane Supplication Day") | |
229 @end smallexample | |
230 | |
231 @noindent | |
232 Here the 8 specifies August, the 1 specifies Monday (Sunday is 0, | |
233 Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in | |
234 the month (1 specifies the first occurrence, 2 the second occurrence, | |
235 @minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and | |
236 so on). | |
237 | |
238 You can specify holidays that occur on fixed days of the Hebrew, | |
239 Islamic, and Julian calendars too. For example, | |
240 | |
241 @smallexample | |
242 (setq other-holidays | |
243 '((holiday-hebrew 10 2 "Last day of Hanukkah") | |
244 (holiday-islamic 3 12 "Mohammed's Birthday") | |
245 (holiday-julian 4 2 "Jefferson's Birthday"))) | |
246 @end smallexample | |
247 | |
248 @noindent | |
249 adds the last day of Hanukkah (since the Hebrew months are numbered with | |
250 1 starting from Nisan), the Islamic feast celebrating Mohammed's | |
251 birthday (since the Islamic months are numbered from 1 starting with | |
252 Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the | |
253 Julian calendar. | |
254 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
255 To include a holiday conditionally, use either Emacs Lisp's @code{if} or the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
256 @code{holiday-sexp} form. For example, American presidential elections |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
257 occur on the first Tuesday after the first Monday in November of years |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
258 divisible by 4: |
6387 | 259 |
260 @smallexample | |
261 (holiday-sexp (if (= 0 (% year 4)) | |
262 (calendar-gregorian-from-absolute | |
7688 | 263 (1+ (calendar-dayname-on-or-before |
264 1 (+ 6 (calendar-absolute-from-gregorian | |
265 (list 11 1 year)))))) | |
6387 | 266 "US Presidential Election")) |
267 @end smallexample | |
268 | |
269 @noindent | |
270 or | |
271 | |
272 @smallexample | |
273 (if (= 0 (% displayed-year 4)) | |
274 (fixed 11 | |
275 (extract-calendar-day | |
276 (calendar-gregorian-from-absolute | |
277 (1+ (calendar-dayname-on-or-before | |
278 1 (+ 6 (calendar-absolute-from-gregorian | |
279 (list 11 1 displayed-year))))))) | |
280 "US Presidential Election")) | |
281 @end smallexample | |
282 | |
283 Some holidays just don't fit into any of these forms because special | |
284 calculations are involved in their determination. In such cases you | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
285 must write a Lisp function to do the calculation. To include eclipses, |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
286 for example, add @code{(eclipses)} to @code{other-holidays} |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
287 and write an Emacs Lisp function @code{eclipses} that returns a |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
288 (possibly empty) list of the relevant Gregorian dates among the range |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
289 visible in the calendar window, with descriptive strings, like this: |
6387 | 290 |
291 @smallexample | |
292 (((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... ) | |
293 @end smallexample | |
294 | |
295 @node Date Display Format | |
296 @section Date Display Format | |
297 @vindex calendar-date-display-form | |
298 | |
7688 | 299 You can customize the manner of displaying dates in the diary, in mode |
300 lines, and in messages by setting @code{calendar-date-display-form}. | |
301 This variable holds a list of expressions that can involve the variables | |
302 @code{month}, @code{day}, and @code{year}, which are all numbers in | |
303 string form, and @code{monthname} and @code{dayname}, which are both | |
304 alphabetic strings. In the American style, the default value of this | |
305 list is as follows: | |
6387 | 306 |
307 @smallexample | |
308 ((if dayname (concat dayname ", ")) monthname " " day ", " year) | |
309 @end smallexample | |
310 | |
311 @noindent | |
312 while in the European style this value is the default: | |
313 | |
314 @smallexample | |
315 ((if dayname (concat dayname ", ")) day " " monthname " " year) | |
316 @end smallexample | |
317 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
318 @noindent |
6387 | 319 The ISO standard date representation is this: |
320 | |
321 @smallexample | |
322 (year "-" month "-" day) | |
323 @end smallexample | |
324 | |
325 @noindent | |
326 This specifies a typical American format: | |
327 | |
328 @smallexample | |
329 (month "/" day "/" (substring year -2)) | |
330 @end smallexample | |
331 | |
332 @node Time Display Format | |
333 @section Time Display Format | |
334 @vindex calendar-time-display-form | |
335 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
336 The calendar and diary by default display times of day in the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
337 conventional American style with the hours from 1 through 12, minutes, |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
338 and either @samp{am} or @samp{pm}. If you prefer the European style, |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
339 also known in the US as military, in which the hours go from 00 to 23, |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
340 you can alter the variable @code{calendar-time-display-form}. This |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
341 variable is a list of expressions that can involve the variables |
7688 | 342 @code{12-hours}, @code{24-hours}, and @code{minutes}, which are all |
343 numbers in string form, and @code{am-pm} and @code{time-zone}, which are | |
344 both alphabetic strings. The default value of | |
345 @code{calendar-time-display-form} is as follows: | |
6387 | 346 |
347 @smallexample | |
348 (12-hours ":" minutes am-pm | |
349 (if time-zone " (") time-zone (if time-zone ")")) | |
350 @end smallexample | |
351 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
352 @noindent |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
353 Here is a value that provides European style times: |
6387 | 354 |
355 @smallexample | |
356 (24-hours ":" minutes | |
357 (if time-zone " (") time-zone (if time-zone ")")) | |
358 @end smallexample | |
359 | |
360 @node Daylight Savings | |
361 @section Daylight Savings Time | |
362 @cindex daylight savings time | |
363 | |
364 Emacs understands the difference between standard time and daylight | |
365 savings time---the times given for sunrise, sunset, solstices, | |
366 equinoxes, and the phases of the moon take that into account. The rules | |
367 for daylight savings time vary from place to place and have also varied | |
368 historically from year to year. To do the job properly, Emacs needs to | |
369 know which rules to use. | |
370 | |
371 Some operating systems keep track of the rules that apply to the place | |
372 where you are; on these systems, Emacs gets the information it needs | |
373 from the system automatically. If some or all of this information is | |
374 missing, Emacs fills in the gaps with the rules currently used in | |
7688 | 375 Cambridge, Massachusetts, which is the center of GNU's world. |
376 | |
6387 | 377 |
378 @vindex calendar-daylight-savings-starts | |
379 @vindex calendar-daylight-savings-ends | |
7688 | 380 If the default choice of rules is not appropriate for your location, |
381 you can tell Emacs the rules to use by setting the variables | |
382 @code{calendar-daylight-savings-starts} and | |
383 @code{calendar-daylight-savings-ends}. Their values should be Lisp | |
6387 | 384 expressions that refer to the variable @code{year}, and evaluate to the |
385 Gregorian date on which daylight savings time starts or (respectively) | |
386 ends, in the form of a list @code{(@var{month} @var{day} @var{year})}. | |
387 The values should be @code{nil} if your area does not use daylight | |
388 savings time. | |
389 | |
7688 | 390 Emacs uses these expressions to determine the start and end dates of |
391 daylight savings time as holidays and for correcting times of day in the | |
392 solar and lunar calculations. | |
6387 | 393 |
394 The values for Cambridge, Massachusetts are as follows: | |
395 | |
396 @example | |
397 @group | |
398 (calendar-nth-named-day 1 0 4 year) | |
399 (calendar-nth-named-day -1 0 10 year) | |
400 @end group | |
401 @end example | |
402 | |
403 @noindent | |
404 i.e., the first 0th day (Sunday) of the fourth month (April) in | |
405 the year specified by @code{year}, and the last Sunday of the tenth month | |
406 (October) of that year. If daylight savings time were | |
407 changed to start on October 1, you would set | |
408 @code{calendar-daylight-savings-starts} to this: | |
409 | |
410 @example | |
411 (list 10 1 year) | |
412 @end example | |
413 | |
414 For a more complex example, suppose daylight savings time begins on | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
415 the first of Nisan on the Hebrew calendar. You should set |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
416 @code{calendar-daylight-savings-starts} to this value: |
6387 | 417 |
418 @example | |
419 (calendar-gregorian-from-absolute | |
420 (calendar-absolute-from-hebrew | |
421 (list 1 1 (+ year 3760)))) | |
422 @end example | |
423 | |
424 @noindent | |
425 because Nisan is the first month in the Hebrew calendar and the Hebrew | |
426 year differs from the Gregorian year by 3760 at Nisan. | |
427 | |
428 If there is no daylight savings time at your location, or if you want | |
429 all times in standard time, set @code{calendar-daylight-savings-starts} | |
430 and @code{calendar-daylight-savings-ends} to @code{nil}. | |
431 | |
432 @vindex calendar-daylight-time-offset | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
433 The variable @code{calendar-daylight-time-offset} specifies the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
434 difference between daylight savings time and standard time, measured in |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
435 minutes. The value for Cambridge is 60. |
6387 | 436 |
437 @vindex calendar-daylight-savings-starts-time | |
438 @vindex calendar-daylight-savings-ends-time | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
439 The variable @code{calendar-daylight-savings-starts-time} and the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
440 variable @code{calendar-daylight-savings-ends-time} specify the number |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
441 of minutes after midnight local time when the transition to and from |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
442 daylight savings time should occur. For Cambridge, both variables' |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
443 values are 120. |
6387 | 444 |
445 @node Diary Customizing | |
446 @section Customizing the Diary | |
447 | |
448 @vindex holidays-in-diary-buffer | |
449 Ordinarily, the mode line of the diary buffer window indicates any | |
450 holidays that fall on the date of the diary entries. The process of | |
451 checking for holidays can take several seconds, so including holiday | |
452 information delays the display of the diary buffer noticeably. If you'd | |
453 prefer to have a faster display of the diary buffer but without the | |
454 holiday information, set the variable @code{holidays-in-diary-buffer} to | |
455 @code{nil}.@refill | |
456 | |
457 @vindex number-of-diary-entries | |
458 The variable @code{number-of-diary-entries} controls the number of | |
459 days of diary entries to be displayed at one time. It affects the | |
460 initial display when @code{view-diary-entries-initially} is @code{t}, as | |
461 well as the command @kbd{M-x diary}. For example, the default value is | |
462 1, which says to display only the current day's diary entries. If the | |
463 value is 2, both the current day's and the next day's entries are | |
7688 | 464 displayed. The value can also be a vector of seven elements: for |
465 example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries | |
466 appear on Sunday, the current date's and the next day's diary entries | |
467 appear Monday through Thursday, Friday through Monday's entries appear | |
468 on Friday, while on Saturday only that day's entries appear. | |
6387 | 469 |
470 @vindex print-diary-entries-hook | |
471 @findex print-diary-entries | |
472 The variable @code{print-diary-entries-hook} is a normal hook run | |
473 after preparation of a temporary buffer containing just the diary | |
474 entries currently visible in the diary buffer. (The other, irrelevant | |
475 diary entries are really absent from the temporary buffer; in the diary | |
476 buffer, they are merely hidden.) The default value of this hook does | |
477 the printing with the command @code{lpr-buffer}. If you want to use a | |
478 different command to do the printing, just change the value of this | |
479 hook. Other uses might include, for example, rearranging the lines into | |
480 order by day and time. | |
481 | |
482 @vindex diary-date-forms | |
483 You can customize the form of dates in your diary file, if neither the | |
484 standard American nor European styles suits your needs, by setting the | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
485 variable @code{diary-date-forms}. This variable is a list of patterns |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
486 for recognizing a date. Each date pattern is a list whose elements may |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
487 be regular expressions (@pxref{Regular Expressions}) or the symbols |
6387 | 488 @code{month}, @code{day}, @code{year}, @code{monthname}, and |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
489 @code{dayname}. All these elements serve as patterns that match certain |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
490 kinds of text in the diary file. In order for the date pattern, as a |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
491 whole, to match, all of its elements must match consecutively. |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
492 |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
493 A regular expression in a date pattern matches in its usual fashion, |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
494 using the standard syntax table altered so that @samp{*} is a word |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
495 constituent. |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
496 |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
497 The symbols @code{month}, @code{day}, @code{year}, @code{monthname}, |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
498 and @code{dayname} match the month number, day number, year number, |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
499 month name, and day name of the date being considered. The symbols that |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
500 match numbers allow leading zeros; those that match names allow |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
501 three-letter abbreviations and capitalization. All the symbols can |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
502 match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
503 month'', and so on, it should match regardless of the date being |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
504 considered. |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
505 |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
506 The default value of @code{diary-date-forms} in the American style is |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
507 this: |
6387 | 508 |
509 @example | |
510 ((month "/" day "[^/0-9]") | |
511 (month "/" day "/" year "[^0-9]") | |
512 (monthname " *" day "[^,0-9]") | |
513 (monthname " *" day ", *" year "[^0-9]") | |
514 (dayname "\\W")) | |
515 @end example | |
516 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
517 The date patterns in the list must be @emph{mutually exclusive} and |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
518 must not match any portion of the diary entry itself, just the date and |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
519 one character of whitespace. If, to be mutually exclusive, the pattern |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
520 must match a portion of the diary entry text---beyond the whitespace |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
521 that ends the date---then the first element of the date pattern |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
522 @emph{must} be @code{backup}. This causes the date recognizer to back |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
523 up to the beginning of the current word of the diary entry, after |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
524 finishing the match. Even if you use @code{backup}, the date pattern |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
525 must absolutely not match more than a portion of the first word of the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
526 diary entry. The default value of @code{diary-date-forms} in the |
6387 | 527 European style is this list: |
528 | |
529 @example | |
530 ((day "/" month "[^/0-9]") | |
531 (day "/" month "/" year "[^0-9]") | |
532 (backup day " *" monthname "\\W+\\<[^*0-9]") | |
533 (day " *" monthname " *" year "[^0-9]") | |
534 (dayname "\\W")) | |
535 @end example | |
536 | |
537 @noindent | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
538 Notice the use of @code{backup} in the third pattern, because it needs |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
539 to match part of a word beyond the date itself to distinguish it from |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
540 the fourth pattern. |
6387 | 541 |
542 @node Hebrew/Islamic Entries | |
543 @section Hebrew- and Islamic-Date Diary Entries | |
544 | |
545 Your diary file can have entries based on Hebrew or Islamic dates, as | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
546 well as entries based on the world-standard Gregorian calendar. |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
547 However, because recognition of such entries is time-consuming and most |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
548 people don't use them, you must explicitly enable their use. If you |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
549 want the diary to recognize Hebrew-date diary entries, for example, |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
550 you must do this: |
6387 | 551 |
552 @vindex nongregorian-diary-listing-hook | |
553 @vindex nongregorian-diary-marking-hook | |
554 @findex list-hebrew-diary-entries | |
555 @findex mark-hebrew-diary-entries | |
556 @smallexample | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
557 (add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries) |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
558 (add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries) |
6387 | 559 @end smallexample |
560 | |
561 @noindent | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
562 If you want Islamic-date entries, do this: |
6387 | 563 |
564 @findex list-islamic-diary-entries | |
565 @findex mark-islamic-diary-entries | |
566 @smallexample | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
567 (add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries) |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
568 (add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries) |
6387 | 569 @end smallexample |
570 | |
571 Hebrew- and Islamic-date diary entries have the same formats as | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
572 Gregorian-date diary entries, except that @samp{H} precedes a Hebrew |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
573 date and @samp{I} precedes an Islamic date. Moreover, because the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
574 Hebrew and Islamic month names are not uniquely specified by the first |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
575 three letters, you may not abbreviate them. For example, a diary entry |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
576 for the Hebrew date Heshvan 25 could look like this: |
6387 | 577 |
578 @smallexample | |
579 HHeshvan 25 Happy Hebrew birthday! | |
580 @end smallexample | |
581 | |
582 @noindent | |
583 and would appear in the diary for any date that corresponds to Heshvan 25 | |
22252
40089afa2b1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
21682
diff
changeset
|
584 on the Hebrew calendar. And here is an Islamic-date diary entry that matches |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
585 Dhu al-Qada 25: |
6387 | 586 |
587 @smallexample | |
588 IDhu al-Qada 25 Happy Islamic birthday! | |
589 @end smallexample | |
590 | |
591 As with Gregorian-date diary entries, Hebrew- and Islamic-date entries | |
592 are nonmarking if they are preceded with an ampersand (@samp{&}). | |
593 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
594 Here is a table of commands used in the calendar to create diary entries |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
595 that match the selected date and other dates that are similar in the Hebrew |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
596 or Islamic calendar: |
6387 | 597 |
598 @table @kbd | |
599 @item i h d | |
600 Add a diary entry for the Hebrew date corresponding to the selected date | |
601 (@code{insert-hebrew-diary-entry}). | |
602 @item i h m | |
603 Add a diary entry for the day of the Hebrew month corresponding to the | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
604 selected date (@code{insert-monthly-hebrew-diary-entry}). This diary |
7688 | 605 entry matches any date that has the same Hebrew day-within-month as the |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
606 selected date. |
6387 | 607 @item i h y |
608 Add a diary entry for the day of the Hebrew year corresponding to the | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
609 selected date (@code{insert-yearly-hebrew-diary-entry}). This diary |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
610 entry matches any date which has the same Hebrew month and day-within-month |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
611 as the selected date. |
6387 | 612 @item i i d |
613 Add a diary entry for the Islamic date corresponding to the selected date | |
614 (@code{insert-islamic-diary-entry}). | |
615 @item i i m | |
616 Add a diary entry for the day of the Islamic month corresponding to the | |
617 selected date (@code{insert-monthly-islamic-diary-entry}). | |
618 @item i i y | |
619 Add a diary entry for the day of the Islamic year corresponding to the | |
620 selected date (@code{insert-yearly-islamic-diary-entry}). | |
621 @end table | |
622 | |
623 @findex insert-hebrew-diary-entry | |
624 @findex insert-monthly-hebrew-diary-entry | |
625 @findex insert-yearly-hebrew-diary-entry | |
626 @findex insert-islamic-diary-entry | |
627 @findex insert-monthly-islamic-diary-entry | |
628 @findex insert-yearly-islamic-diary-entry | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
629 These commands work much like the corresponding commands for ordinary |
7688 | 630 diary entries: they apply to the date that point is on in the calendar |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
631 window, and what they do is insert just the date portion of a diary entry |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
632 at the end of your diary file. You must then insert the rest of the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
633 diary entry. |
6387 | 634 |
635 @node Fancy Diary Display | |
636 @section Fancy Diary Display | |
637 @vindex diary-display-hook | |
638 @findex simple-diary-display | |
639 | |
640 Diary display works by preparing the diary buffer and then running the | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
641 hook @code{diary-display-hook}. The default value of this hook |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
642 (@code{simple-diary-display}) hides the irrelevant diary entries and |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
643 then displays the buffer. However, if you specify the hook as follows, |
6387 | 644 |
645 @cindex diary buffer | |
646 @findex fancy-diary-display | |
647 @example | |
648 (add-hook 'diary-display-hook 'fancy-diary-display) | |
649 @end example | |
650 | |
651 @noindent | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
652 this enables fancy diary display. It displays diary entries and |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
653 holidays by copying them into a special buffer that exists only for the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
654 sake of display. Copying to a separate buffer provides an opportunity |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
655 to change the displayed text to make it prettier---for example, to sort |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
656 the entries by the dates they apply to. |
6387 | 657 |
658 As with simple diary display, you can print a hard copy of the buffer | |
659 with @code{print-diary-entries}. To print a hard copy of a day-by-day | |
24862 | 660 diary for a week, position point on Sunday of that week, type |
661 @kbd{7 d}, and then do @kbd{M-x print-diary-entries}. As usual, the | |
6387 | 662 inclusion of the holidays slows down the display slightly; you can speed |
663 things up by setting the variable @code{holidays-in-diary-buffer} to | |
664 @code{nil}. | |
665 | |
666 @vindex diary-list-include-blanks | |
667 Ordinarily, the fancy diary buffer does not show days for which there are | |
668 no diary entries, even if that day is a holiday. If you want such days to be | |
669 shown in the fancy diary buffer, set the variable | |
670 @code{diary-list-include-blanks} to @code{t}.@refill | |
671 | |
672 @cindex sorting diary entries | |
673 If you use the fancy diary display, you can use the normal hook | |
674 @code{list-diary-entries-hook} to sort each day's diary entries by their | |
22252
40089afa2b1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
21682
diff
changeset
|
675 time of day. Here's how: |
6387 | 676 |
677 @findex sort-diary-entries | |
678 @example | |
10906
7601ae23cf92
Fix sort-diary-entries example.
Richard M. Stallman <rms@gnu.org>
parents:
7688
diff
changeset
|
679 (add-hook 'list-diary-entries-hook 'sort-diary-entries t) |
6387 | 680 @end example |
681 | |
682 @noindent | |
683 For each day, this sorts diary entries that begin with a recognizable | |
684 time of day according to their times. Diary entries without times come | |
685 first within each day. | |
686 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
687 Fancy diary display also has the ability to process included diary |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
688 files. This permits a group of people to share a diary file for events |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
689 that apply to all of them. Lines in the diary file of this form: |
6387 | 690 |
691 @smallexample | |
692 #include "@var{filename}" | |
693 @end smallexample | |
694 | |
695 @noindent | |
696 includes the diary entries from the file @var{filename} in the fancy | |
7688 | 697 diary buffer. The include mechanism is recursive, so that included files |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
698 can include other files, and so on; you must be careful not to have a |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
699 cycle of inclusions, of course. Here is how to enable the include |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
700 facility: |
6387 | 701 |
702 @vindex list-diary-entries-hook | |
703 @vindex mark-diary-entries-hook | |
704 @findex include-other-diary-files | |
705 @findex mark-included-diary-files | |
706 @smallexample | |
707 (add-hook 'list-diary-entries-hook 'include-other-diary-files) | |
708 (add-hook 'mark-diary-entries-hook 'mark-included-diary-files) | |
709 @end smallexample | |
710 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
711 The include mechanism works only with the fancy diary display, because |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
712 ordinary diary display shows the entries directly from your diary file. |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
713 |
6387 | 714 @node Sexp Diary Entries |
715 @section Sexp Entries and the Fancy Diary Display | |
716 @cindex sexp diary entries | |
717 | |
718 Sexp diary entries allow you to do more than just have complicated | |
719 conditions under which a diary entry applies. If you use the fancy | |
720 diary display, sexp entries can generate the text of the entry depending | |
721 on the date itself. For example, an anniversary diary entry can insert | |
722 the number of years since the anniversary date into the text of the | |
723 diary entry. Thus the @samp{%d} in this dairy entry: | |
724 | |
725 @findex diary-anniversary | |
726 @smallexample | |
727 %%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old) | |
728 @end smallexample | |
729 | |
730 @noindent | |
731 gets replaced by the age, so on October 31, 1990 the entry appears in | |
732 the fancy diary buffer like this: | |
733 | |
734 @smallexample | |
735 Arthur's birthday (42 years old) | |
736 @end smallexample | |
737 | |
738 @noindent | |
739 If the diary file instead contains this entry: | |
740 | |
741 @smallexample | |
742 %%(diary-anniversary 10 31 1948) Arthur's %d%s birthday | |
743 @end smallexample | |
744 | |
745 @noindent | |
746 the entry in the fancy diary buffer for October 31, 1990 appears like this: | |
747 | |
748 @smallexample | |
749 Arthur's 42nd birthday | |
750 @end smallexample | |
751 | |
752 Similarly, cyclic diary entries can interpolate the number of repetitions | |
753 that have occurred: | |
754 | |
755 @findex diary-cyclic | |
756 @smallexample | |
757 %%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time) | |
758 @end smallexample | |
759 | |
760 @noindent | |
761 looks like this: | |
762 | |
763 @smallexample | |
764 Renew medication (5th time) | |
765 @end smallexample | |
766 | |
767 @noindent | |
768 in the fancy diary display on September 8, 1990. | |
769 | |
20355
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
770 There is an early reminder diary sexp that includes its entry in the |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
771 diary not only on the date of occurrence, but also on earlier dates. |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
772 For example, if you want a reminder a week before your anniversary, you |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
773 can use |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
774 |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
775 @findex diary-remind |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
776 @smallexample |
21007
66d807bdc5b4
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
20360
diff
changeset
|
777 %%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary |
20355
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
778 @end smallexample |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
779 |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
780 @noindent |
20360
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
781 and the fancy diary will show |
20355
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
782 @smallexample |
25751
467b88fab665
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
24862
diff
changeset
|
783 Ed's anniversary |
20355
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
784 @end smallexample |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
785 @noindent |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
786 both on December 15 and on December 22. |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
787 |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
788 @findex diary-date |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
789 The function @code{diary-date} applies to dates described by a month, |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
790 day, year combination, each of which can be an integer, a list of |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
791 integers, or @code{t}. The value @code{t} means all values. For |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
792 example, |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
793 |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
794 @smallexample |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
795 %%(diary-date '(10 11 12) 22 t) Rake leaves |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
796 @end smallexample |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
797 |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
798 @noindent |
20360
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
799 causes the fancy diary to show |
20355
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
800 |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
801 @smallexample |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
802 Rake leaves |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
803 @end smallexample |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
804 |
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
805 @noindent |
20360
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
806 on October 22, November 22, and December 22 of every year. |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
807 |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
808 @findex diary-float |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
809 The function @code{diary-float} allows you to describe diary entries |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
810 that apply to dates like the third Friday of November, or the last |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
811 Tuesday in April. The parameters are the @var{month}, @var{dayname}, |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
812 and an index @var{n}. The entry appears on the @var{n}th @var{dayname} |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
813 of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
814 so on. If @var{n} is negative it counts backward from the end of |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
815 @var{month}. The value of @var{month} can be a list of months, a single |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
816 month, or @code{t} to specify all months. You can also use an optional |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
817 parameter @var{day} to specify the @var{n}th @var{dayname} of |
21007
66d807bdc5b4
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
20360
diff
changeset
|
818 @var{month} on or after/before @var{day}; the value of @var{day} defaults |
20360
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
819 to 1 if @var{n} is positive and to the last day of @var{month} if |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
820 @var{n} is negative. For example, |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
821 |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
822 @smallexample |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
823 %%(diary-float t 1 -1) Pay rent |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
824 @end smallexample |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
825 |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
826 @noindent |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
827 causes the fancy diary to show |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
828 |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
829 @smallexample |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
830 Pay rent |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
831 @end smallexample |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
832 |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
833 @noindent |
1645cf890b24
Describe diary-float function.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20355
diff
changeset
|
834 on the last Monday of every month. |
20355
41e0ec95fdef
Describe diary-remind and diary-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12067
diff
changeset
|
835 |
6387 | 836 The generality of sexp diary entries lets you specify any diary entry |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
837 that you can describe algorithmically. A sexp diary entry contains an |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
838 expression that computes whether the entry applies to any given date. |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
839 If its value is non-@code{nil}, the entry applies to that date; |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
840 otherwise, it does not. The expression can use the variable @code{date} |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
841 to find the date being considered; its value is a list (@var{month} |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
842 @var{day} @var{year}) that refers to the Gregorian calendar. |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
843 |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
844 Suppose you get paid on the 21st of the month if it is a weekday, and |
7688 | 845 on the Friday before if the 21st is on a weekend. Here is how to write |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
846 a sexp diary entry that matches those dates: |
6387 | 847 |
848 @smallexample | |
849 &%%(let ((dayname (calendar-day-of-week date)) | |
850 (day (car (cdr date)))) | |
851 (or (and (= day 21) (memq dayname '(1 2 3 4 5))) | |
852 (and (memq day '(19 20)) (= dayname 5))) | |
853 ) Pay check deposited | |
854 @end smallexample | |
855 | |
856 The following sexp diary entries take advantage of the ability (in the fancy | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
857 diary display) to concoct diary entries whose text varies based on the date: |
6387 | 858 |
859 @findex diary-sunrise-sunset | |
860 @findex diary-phases-of-moon | |
861 @findex diary-day-of-year | |
862 @findex diary-iso-date | |
863 @findex diary-julian-date | |
864 @findex diary-astro-day-number | |
865 @findex diary-hebrew-date | |
866 @findex diary-islamic-date | |
867 @findex diary-french-date | |
868 @findex diary-mayan-date | |
869 @table @code | |
870 @item %%(diary-sunrise-sunset) | |
871 Make a diary entry for the local times of today's sunrise and sunset. | |
872 @item %%(diary-phases-of-moon) | |
873 Make a diary entry for the phases (quarters) of the moon. | |
874 @item %%(diary-day-of-year) | |
875 Make a diary entry with today's day number in the current year and the number | |
876 of days remaining in the current year. | |
877 @item %%(diary-iso-date) | |
878 Make a diary entry with today's equivalent ISO commercial date. | |
879 @item %%(diary-julian-date) | |
880 Make a diary entry with today's equivalent date on the Julian calendar. | |
881 @item %%(diary-astro-day-number) | |
882 Make a diary entry with today's equivalent astronomical (Julian) day number. | |
883 @item %%(diary-hebrew-date) | |
884 Make a diary entry with today's equivalent date on the Hebrew calendar. | |
885 @item %%(diary-islamic-date) | |
886 Make a diary entry with today's equivalent date on the Islamic calendar. | |
887 @item %%(diary-french-date) | |
888 Make a diary entry with today's equivalent date on the French Revolutionary | |
889 calendar. | |
890 @item %%(diary-mayan-date) | |
891 Make a diary entry with today's equivalent date on the Mayan calendar. | |
892 @end table | |
893 | |
894 @noindent | |
895 Thus including the diary entry | |
896 | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
897 @example |
6387 | 898 &%%(diary-hebrew-date) |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
899 @end example |
6387 | 900 |
901 @noindent | |
902 causes every day's diary display to contain the equivalent date on the | |
903 Hebrew calendar, if you are using the fancy diary display. (With simple | |
904 diary display, the line @samp{&%%(diary-hebrew-date)} appears in the | |
905 diary for any date, but does nothing particularly useful.) | |
906 | |
7688 | 907 These functions can be used to construct sexp diary entries based on |
908 the Hebrew calendar in certain standard ways: | |
6387 | 909 |
910 @cindex rosh hodesh | |
911 @findex diary-rosh-hodesh | |
912 @cindex parasha, weekly | |
913 @findex diary-parasha | |
914 @cindex candle lighting times | |
915 @findex diary-sabbath-candles | |
916 @cindex omer count | |
917 @findex diary-omer | |
918 @cindex yahrzeits | |
919 @findex diary-yahrzeit | |
920 @table @code | |
921 @item %%(diary-rosh-hodesh) | |
922 Make a diary entry that tells the occurrence and ritual announcement of each | |
923 new Hebrew month. | |
924 @item %%(diary-parasha) | |
925 Make a Saturday diary entry that tells the weekly synagogue scripture reading. | |
926 @item %%(diary-sabbath-candles) | |
927 Make a Friday diary entry that tells the @emph{local time} of Sabbath | |
928 candle lighting. | |
929 @item %%(diary-omer) | |
930 Make a diary entry that gives the omer count, when appropriate. | |
931 @item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name} | |
932 Make a diary entry marking the anniversary of a date of death. The date | |
933 is the @emph{Gregorian} (civil) date of death. The diary entry appears | |
934 on the proper Hebrew calendar anniversary and on the day before. (In | |
935 the European style, the order of the parameters is changed to @var{day}, | |
936 @var{month}, @var{year}.) | |
937 @end table | |
938 | |
939 @node Appt Customizing | |
940 @section Customizing Appointment Reminders | |
941 | |
7688 | 942 You can specify exactly how Emacs reminds you of an appointment, and |
943 how far in advance it begins doing so, by setting these variables: | |
6387 | 944 |
945 @vindex appt-message-warning-time | |
946 @vindex appt-audible | |
947 @vindex appt-visible | |
948 @vindex appt-display-mode-line | |
949 @vindex appt-msg-window | |
950 @vindex appt-display-duration | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
951 @vindex appt-disp-window-function |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
952 @vindex appt-delete-window-function |
6387 | 953 @table @code |
954 @item appt-message-warning-time | |
955 The time in minutes before an appointment that the reminder begins. The | |
956 default is 10 minutes. | |
957 @item appt-audible | |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
958 If this is non-@code{nil}, Emacs rings the |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
959 terminal bell for appointment reminders. The default is @code{t}. |
6387 | 960 @item appt-visible |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
961 If this is non-@code{nil}, Emacs displays the appointment |
7688 | 962 message in the echo area. The default is @code{t}. |
6387 | 963 @item appt-display-mode-line |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
964 If this is non-@code{nil}, Emacs displays the number of minutes |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
965 to the appointment on the mode line. The default is @code{t}. |
6387 | 966 @item appt-msg-window |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
967 If this is non-@code{nil}, Emacs displays the appointment |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
968 message in another window. The default is @code{t}. |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
969 @item appt-disp-window-function |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
970 This variable holds a function to use to create the other window |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
971 for the appointment message. |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
972 @item appt-delete-window-function |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
973 This variable holds a function to use to get rid of the appointment |
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
974 message window, when its time is up. |
6387 | 975 @item appt-display-duration |
7401
afe506bf7264
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6387
diff
changeset
|
976 The number of seconds to display an appointment message. The default |
6387 | 977 is 5 seconds. |
978 @end table |