828a37cdc818e9238b45020702bcc5ed769f0dd1
[chise/xemacs-chise.git-] / info / xemacs.info-14
1 This is ../info/xemacs.info, produced by makeinfo version 4.0 from
2 xemacs/xemacs.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * XEmacs: (xemacs).             XEmacs Editor.
7 END-INFO-DIR-ENTRY
8
9    This file documents the XEmacs editor.
10
11    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
12 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
13 Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
14
15    Permission is granted to make and distribute verbatim copies of this
16 manual provided the copyright notice and this permission notice are
17 preserved on all copies.
18
19    Permission is granted to copy and distribute modified versions of
20 this manual under the conditions for verbatim copying, provided also
21 that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
22 General Public License" are included exactly as in the original, and
23 provided that the entire resulting derived work is distributed under the
24 terms of a permission notice identical to this one.
25
26    Permission is granted to copy and distribute translations of this
27 manual into another language, under the above conditions for modified
28 versions, except that the sections entitled "The GNU Manifesto",
29 "Distribution" and "GNU General Public License" may be included in a
30 translation approved by the author instead of in the original English.
31
32 \1f
33 File: xemacs.info,  Node: General Calendar,  Next: LaTeX Calendar,  Prev: Mark and Region,  Up: Calendar/Diary
34
35 Miscellaneous Calendar Commands
36 -------------------------------
37
38 `p d'
39      Display day-in-year (`calendar-print-day-of-year').
40
41 `?'
42      Briefly describe calendar commands (`describe-calendar-mode').
43
44 `C-c C-l'
45      Regenerate the calendar window (`redraw-calendar').
46
47 `SPC'
48      Scroll the next window (`scroll-other-window').
49
50 `q'
51      Exit from calendar (`exit-calendar').
52
53    If you want to know how many days have elapsed since the start of
54 the year, or the number of days remaining in the year, type the `p d'
55 command (`calendar-print-day-of-year').  This displays both of those
56 numbers in the echo area.
57
58    To display a brief description of the calendar commands, type `?'
59 (`describe-calendar-mode').  For a fuller description, type `C-h m'.
60
61    You can use `SPC' (`scroll-other-window') to scroll the other
62 window.  This is handy when you display a list of holidays or diary
63 entries in another window.
64
65    If the calendar window text gets corrupted, type `C-c C-l'
66 (`redraw-calendar') to redraw it.  (This can only happen if you use
67 non-Calendar-mode editing commands.)
68
69    In Calendar mode, you can use `SPC' (`scroll-other-window') to
70 scroll the other window.  This is handy when you display a list of
71 holidays or diary entries in another window.
72
73    To exit from the calendar, type `q' (`exit-calendar').  This buries
74 all buffers related to the calendar, selecting other buffers.  (If a
75 frame contains a dedicated calendar window, exiting from the calendar
76 iconifies that frame.)
77
78 \1f
79 File: xemacs.info,  Node: LaTeX Calendar,  Next: Holidays,  Prev: General Calendar,  Up: Calendar/Diary
80
81 LaTeX Calendar
82 ==============
83
84    The Calendar LaTeX commands produce a buffer of LaTeX code that
85 prints as a calendar.  Depending on the command you use, the printed
86 calendar covers the day, week, month or year that point is in.
87
88 `t m'
89      Generate a one-month calendar (`cal-tex-cursor-month').
90
91 `t M'
92      Generate a sideways-printing one-month calendar
93      (`cal-tex-cursor-month-landscape').
94
95 `t d'
96      Generate a one-day calendar (`cal-tex-cursor-day').
97
98 `t w 1'
99      Generate a one-page calendar for one week (`cal-tex-cursor-week').
100
101 `t w 2'
102      Generate a two-page calendar for one week (`cal-tex-cursor-week2').
103
104 `t w 3'
105      Generate an ISO-style calendar for one week
106      (`cal-tex-cursor-week-iso').
107
108 `t w 4'
109      Generate a calendar for one Monday-starting week
110      (`cal-tex-cursor-week-monday').
111
112 `t f w'
113      Generate a Filofax-style two-weeks-at-a-glance calendar
114      (`cal-tex-cursor-filofax-2week').
115
116 `t f W'
117      Generate a Filofax-style one-week-at-a-glance calendar
118      (`cal-tex-cursor-filofax-week').
119
120 `t y'
121      Generate a calendar for one year (`cal-tex-cursor-year').
122
123 `t Y'
124      Generate a sideways-printing calendar for one year
125      (`cal-tex-cursor-year-landscape').
126
127 `t f y'
128      Generate a Filofax-style calendar for one year
129      (`cal-tex-cursor-filofax-year').
130
131    Some of these commands print the calendar sideways (in "landscape
132 mode"), so it can be wider than it is long.  Some of them use Filofax
133 paper size (3.75in x 6.75in).  All of these commands accept a prefix
134 argument which specifies how many days, weeks, months or years to print
135 (starting always with the selected one).
136
137    If the variable `cal-tex-holidays' is non-`nil' (the default), then
138 the printed calendars show the holidays in `calendar-holidays'.  If the
139 variable `cal-tex-diary' is non-`nil' (the default is `nil'), diary
140 entries are included also (in weekly and monthly calendars only).
141
142 \1f
143 File: xemacs.info,  Node: Holidays,  Next: Sunrise/Sunset,  Prev: LaTeX Calendar,  Up: Calendar/Diary
144
145 Holidays
146 --------
147
148    The Emacs calendar knows about all major and many minor holidays,
149 and can display them.
150
151 `h'
152      Display holidays for the selected date
153      (`calendar-cursor-holidays').
154
155 `Button2 Holidays'
156      Display any holidays for the date you click on.
157
158 `x'
159      Mark holidays in the calendar window (`mark-calendar-holidays').
160
161 `u'
162      Unmark calendar window (`calendar-unmark').
163
164 `a'
165      List all holidays for the displayed three months in another window
166      (`list-calendar-holidays').
167
168 `M-x holidays'
169      List all holidays for three months around today's date in another
170      window.
171
172 `M-x list-holidays'
173      List holidays in another window for a specified range of years.
174
175    To see if any holidays fall on a given date, position point on that
176 date in the calendar window and use the `h' command.  Alternatively,
177 click on that date with `Button2' and then choose `Holidays' from the
178 menu that appears.  Either way, this displays the holidays for that
179 date, in the echo area if they fit there, otherwise in a separate
180 window.
181
182    To view the distribution of holidays for all the dates shown in the
183 calendar, use the `x' command.  This displays the dates that are
184 holidays in a different face (or places a `*' after these dates, if
185 display with multiple faces is not available). The command applies both
186 to the currently visible months and to other months that subsequently
187 become visible by scrolling.  To turn marking off and erase the current
188 marks, type `u', which also erases any diary marks (*note Diary::).
189
190    To get even more detailed information, use the `a' command, which
191 displays a separate buffer containing a list of all holidays in the
192 current three-month range.  You can use <SPC> in the calendar window to
193 scroll that list.
194
195    The command `M-x holidays' displays the list of holidays for the
196 current month and the preceding and succeeding months; this works even
197 if you don't have a calendar window.  If you want the list of holidays
198 centered around a different month, use `C-u M-x holidays', which
199 prompts for the month and year.
200
201    The holidays known to Emacs include United States holidays and the
202 major Christian, Jewish, and Islamic holidays; also the solstices and
203 equinoxes.
204
205    The command `M-x list-holidays' displays the list of holidays for a
206 range of years.  This function asks you for the starting and stopping
207 years, and allows you to choose all the holidays or one of several
208 categories of holidays.  You can use this command even if you don't have
209 a calendar window.
210
211    The dates used by Emacs for holidays are based on _current
212 practice_, not historical fact.  Historically, for instance, the start
213 of daylight savings time and even its existence have varied from year to
214 year, but present United States law mandates that daylight savings time
215 begins on the first Sunday in April.  When the daylight savings rules
216 are set up for the United States, Emacs always uses the present
217 definition, even though it is wrong for some prior years.
218
219 \1f
220 File: xemacs.info,  Node: Sunrise/Sunset,  Next: Lunar Phases,  Prev: Holidays,  Up: Calendar/Diary
221
222 Times of Sunrise and Sunset
223 ---------------------------
224
225    Special calendar commands can tell you, to within a minute or two,
226 the times of sunrise and sunset for any date.
227
228 `S'
229      Display times of sunrise and sunset for the selected date
230      (`calendar-sunrise-sunset').
231
232 `Button2 Sunrise/Sunset'
233      Display times of sunrise and sunset for the date you click on.
234
235 `M-x sunrise-sunset'
236      Display times of sunrise and sunset for today's date.
237
238 `C-u M-x sunrise-sunset'
239      Display times of sunrise and sunset for a specified date.
240
241    Within the calendar, to display the _local times_ of sunrise and
242 sunset in the echo area, move point to the date you want, and type `S'.
243 Alternatively, click `Button2' on the date, then choose
244 `Sunrise/Sunset' from the menu that appears.  The command `M-x
245 sunrise-sunset' is available outside the calendar to display this
246 information for today's date or a specified date.  To specify a date
247 other than today, use `C-u M-x sunrise-sunset', which prompts for the
248 year, month, and day.
249
250    You can display the times of sunrise and sunset for any location and
251 any date with `C-u C-u M-x sunrise-sunset'.  This asks you for a
252 longitude, latitude, number of minutes difference from Coordinated
253 Universal Time, and date, and then tells you the times of sunrise and
254 sunset for that location on that date.
255
256    Because the times of sunrise and sunset depend on the location on
257 earth, you need to tell Emacs your latitude, longitude, and location
258 name before using these commands.  Here is an example of what to set:
259
260      (setq calendar-latitude 40.1)
261      (setq calendar-longitude -88.2)
262      (setq calendar-location-name "Urbana, IL")
263
264 Use one decimal place in the values of `calendar-latitude' and
265 `calendar-longitude'.
266
267    Your time zone also affects the local time of sunrise and sunset.
268 Emacs usually gets time zone information from the operating system, but
269 if these values are not what you want (or if the operating system does
270 not supply them), you must set them yourself.  Here is an example:
271
272      (setq calendar-time-zone -360)
273      (setq calendar-standard-time-zone-name "CST")
274      (setq calendar-daylight-time-zone-name "CDT")
275
276 The value of `calendar-time-zone' is the number of minutes difference
277 between your local standard time and Coordinated Universal Time
278 (Greenwich time).  The values of `calendar-standard-time-zone-name' and
279 `calendar-daylight-time-zone-name' are the abbreviations used in your
280 time zone.  Emacs displays the times of sunrise and sunset _corrected
281 for daylight savings time_.  *Note Daylight Savings::, for how daylight
282 savings time is determined.
283
284    As a user, you might find it convenient to set the calendar location
285 variables for your usual physical location in your `.emacs' file.  And
286 when you install Emacs on a machine, you can create a `default.el' file
287 which sets them properly for the typical location of most users of that
288 machine.  *Note Init File::.
289
290 \1f
291 File: xemacs.info,  Node: Lunar Phases,  Next: Other Calendars,  Prev: Sunrise/Sunset,  Up: Calendar/Diary
292
293 Phases of the Moon
294 ------------------
295
296    These calendar commands display the dates and times of the phases of
297 the moon (new moon, first quarter, full moon, last quarter).  This
298 feature is useful for debugging problems that "depend on the phase of
299 the moon."
300
301 `M'
302      Display the dates and times for all the quarters of the moon for
303      the three-month period shown (`calendar-phases-of-moon').
304
305 `M-x phases-of-moon'
306      Display dates and times of the quarters of the moon for three
307      months around today's date.
308
309    Within the calendar, use the `M' command to display a separate
310 buffer of the phases of the moon for the current three-month range.  The
311 dates and times listed are accurate to within a few minutes.
312
313    Outside the calendar, use the command `M-x phases-of-moon' to
314 display the list of the phases of the moon for the current month and the
315 preceding and succeeding months.  For information about a different
316 month, use `C-u M-x phases-of-moon', which prompts for the month and
317 year.
318
319    The dates and times given for the phases of the moon are given in
320 local time (corrected for daylight savings, when appropriate); but if
321 the variable `calendar-time-zone' is void, Coordinated Universal Time
322 (the Greenwich time zone) is used.  *Note Daylight Savings::.
323
324 \1f
325 File: xemacs.info,  Node: Other Calendars,  Next: Calendar Systems,  Prev: Lunar Phases,  Up: Calendar/Diary
326
327 Conversion To and From Other Calendars
328 --------------------------------------
329
330    The Emacs calendar displayed is _always_ the Gregorian calendar,
331 sometimes called the "new style" calendar, which is used in most of the
332 world today.  However, this calendar did not exist before the sixteenth
333 century and was not widely used before the eighteenth century; it did
334 not fully displace the Julian calendar and gain universal acceptance
335 until the early twentieth century.  The Emacs calendar can display any
336 month since January, year 1 of the current era, but the calendar
337 displayed is the Gregorian, even for a date at which the Gregorian
338 calendar did not exist.
339
340    While Emacs cannot display other calendars, it can convert dates to
341 and from several other calendars.
342
343 * Menu:
344
345 * Calendar Systems::      The calendars Emacs understands
346                             (aside from Gregorian).
347 * To Other Calendar::     Converting the selected date to various calendars.
348 * From Other Calendar::   Moving to a date specified in another calendar.
349 * Mayan Calendar::        Moving to a date specified in a Mayan calendar.
350
351    If you are interested in these calendars, you can convert dates one
352 at a time.  Put point on the desired date of the Gregorian calendar and
353 press the appropriate keys.  The `p' is a mnemonic for "print" since
354 Emacs "prints' the equivalent date in the echo area.
355
356 \1f
357 File: xemacs.info,  Node: Calendar Systems,  Next: To Other Calendar,  Prev: Other Calendars,  Up: Other Calendars
358
359 Supported Calendar Systems
360 ==========================
361
362    The ISO commercial calendar is used largely in Europe.
363
364    The Julian calendar, named after Julius Caesar, was the one used in
365 Europe throughout medieval times, and in many countries up until the
366 nineteenth century.
367
368    Astronomers use a simple counting of days elapsed since noon, Monday,
369 January 1, 4713 B.C. on the Julian calendar.  The number of days elapsed
370 is called the _Julian day number_ or the _Astronomical day number_.
371
372    The Hebrew calendar is used by tradition in the Jewish religion.  The
373 Emacs calendar program uses the Hebrew calendar to determine the dates
374 of Jewish holidays.  Hebrew calendar dates begin and end at sunset.
375
376    The Islamic calendar is used in many predominantly Islamic countries.
377 Emacs uses it to determine the dates of Islamic holidays.  There is no
378 universal agreement in the Islamic world about the calendar; Emacs uses
379 a widely accepted version, but the precise dates of Islamic holidays
380 often depend on proclamation by religious authorities, not on
381 calculations.  As a consequence, the actual dates of observance can vary
382 slightly from the dates computed by Emacs.  Islamic calendar dates begin
383 and end at sunset.
384
385    The French Revolutionary calendar was created by the Jacobins after
386 the 1789 revolution, to represent a more secular and nature-based view
387 of the annual cycle, and to install a 10-day week in a rationalization
388 measure similar to the metric system.  The French government officially
389 abandoned this calendar at the end of 1805.
390
391    The Maya of Central America used three separate, overlapping calendar
392 systems, the _long count_, the _tzolkin_, and the _haab_.  Emacs knows
393 about all three of these calendars.  Experts dispute the exact
394 correlation between the Mayan calendar and our calendar; Emacs uses the
395 Goodman-Martinez-Thompson correlation in its calculations.
396
397    The Copts use a calendar based on the ancient Egyptian solar
398 calendar.  Their calendar consists of twelve 30-day months followed by
399 an extra five-day period.  Once every fourth year they add a leap day
400 to this extra period to make it six days.  The Ethiopic calendar is
401 identical in structure, but has different year numbers and month names.
402
403    The Persians use a solar calendar based on a design of Omar Khayyam.
404 Their calendar consists of twelve months of which the first six have 31
405 days, the next five have 30 days, and the last has 29 in ordinary years
406 and 30 in leap years.  Leap years occur in a complicated pattern every
407 four or five years.
408
409    The Chinese calendar is a complicated system of lunar months arranged
410 into solar years.  The years go in cycles of sixty, each year containing
411 either twelve months in an ordinary year or thirteen months in a leap
412 year; each month has either 29 or 30 days.  Years, ordinary months, and
413 days are named by combining one of ten "celestial stems" with one of
414 twelve "terrestrial branches" for a total of sixty names that are
415 repeated in a cycle of sixty.
416
417 \1f
418 File: xemacs.info,  Node: To Other Calendar,  Next: From Other Calendar,  Prev: Calendar Systems,  Up: Other Calendars
419
420 Converting To Other Calendars
421 =============================
422
423    The following commands describe the selected date (the date at point)
424 in various other calendar systems:
425
426 `Button2  Other Calendars'
427      Display the date that you click on, expressed in various other
428      calendars.
429
430 `p c'
431      Display ISO commercial calendar equivalent for selected day
432      (`calendar-print-iso-date').
433
434 `p j'
435      Display Julian date for selected day
436      (`calendar-print-julian-date').
437
438 `p a'
439      Display astronomical (Julian) day number for selected day
440      (`calendar-print-astro-day-number').
441
442 `p h'
443      Display Hebrew date for selected day
444      (`calendar-print-hebrew-date').
445
446 `p i'
447      Display Islamic date for selected day
448      (`calendar-print-islamic-date').
449
450 `p f'
451      Display French Revolutionary date for selected day
452      (`calendar-print-french-date').
453
454 `p C'
455      Display Chinese date for selected day
456      (`calendar-print-chinese-date').
457
458 `p k'
459      Display Coptic date for selected day
460      (`calendar-print-coptic-date').
461
462 `p e'
463      Display Ethiopic date for selected day
464      (`calendar-print-ethiopic-date').
465
466 `p p'
467      Display Persian date for selected day
468      (`calendar-print-persian-date').
469
470 `p m'
471      Display Mayan date for selected day (`calendar-print-mayan-date').
472
473    If you are using X, the easiest way to translate a date into other
474 calendars is to click on it with `Button2', then choose `Other
475 Calendars' from the menu that appears.  This displays the equivalent
476 forms of the date in all the calendars Emacs understands, in the form of
477 a menu.  (Choosing an alternative from this menu doesn't actually do
478 anything--the menu is used only for display.)
479
480    Put point on the desired date of the Gregorian calendar, then type
481 the appropriate keys.  The `p' is a mnemonic for "print" since Emacs
482 "prints" the equivalent date in the echo area.
483
484 \1f
485 File: xemacs.info,  Node: From Other Calendar,  Next: Mayan Calendar,  Prev: To Other Calendar,  Up: Other Calendars
486
487 Converting From Other Calendars
488 ===============================
489
490    You can use the other supported calendars to specify a date to move
491 to.  This section describes the commands for doing this using calendars
492 other than Mayan; for the Mayan calendar, see the following section.
493
494 `g c'
495      Move to a date specified in the ISO commercial calendar
496      (`calendar-goto-iso-date').
497
498 `g j'
499      Move to a date specified in the Julian calendar
500      (`calendar-goto-julian-date').
501
502 `g a'
503      Move to a date specified in astronomical (Julian) day number
504      (`calendar-goto-astro-day-number').
505
506 `g h'
507      Move to a date specified in the Hebrew calendar
508      (`calendar-goto-hebrew-date').
509
510 `g i'
511      Move to a date specified in the Islamic calendar
512      (`calendar-goto-islamic-date').
513
514 `g f'
515      Move to a date specified in the French Revolutionary calendar
516      (`calendar-goto-french-date').
517
518 `g C'
519      Move to a date specified in the Chinese calendar
520      (`calendar-goto-chinese-date').
521
522 `g p'
523      Move to a date specified in the Persian calendar
524      (`calendar-goto-persian-date').
525
526 `g k'
527      Move to a date specified in the Coptic calendar
528      (`calendar-goto-coptic-date').
529
530 `g e'
531      Move to a date specified in the Ethiopic calendar
532      (`calendar-goto-ethiopic-date').
533
534    These commands ask you for a date on the other calendar, move point
535 to the Gregorian calendar date equivalent to that date, and display the
536 other calendar's date in the echo area.  Emacs uses strict completion
537 (*note Completion::) whenever it asks you to type a month name, so you
538 don't have to worry about the spelling of Hebrew, Islamic, or French
539 names.
540
541    One common question concerning the Hebrew calendar is the computation
542 of the anniversary of a date of death, called a "yahrzeit."  The Emacs
543 calendar includes a facility for such calculations.  If you are in the
544 calendar, the command `M-x list-yahrzeit-dates' asks you for a range of
545 years and then displays a list of the yahrzeit dates for those years
546 for the date given by point.  If you are not in the calendar, this
547 command first asks you for the date of death and the range of years,
548 and then displays the list of yahrzeit dates.
549
550 \1f
551 File: xemacs.info,  Node: Mayan Calendar,  Next: Diary,  Prev: From Other Calendar,  Up: Other Calendars
552
553 Converting from the Mayan Calendar
554 ----------------------------------
555
556    Here are the commands to select dates based on the Mayan calendar:
557
558 `g m l'
559      Move to a date specified by the long count calendar
560      (`calendar-goto-mayan-long-count-date').
561
562 `g m n t'
563      Move to the next occurrence of a place in the tzolkin calendar
564      (`calendar-next-tzolkin-date').
565
566 `g m p t'
567      Move to the previous occurrence of a place in the tzolkin calendar
568      (`calendar-previous-tzolkin-date').
569
570 `g m n h'
571      Move to the next occurrence of a place in the haab calendar
572      (`calendar-next-haab-date').
573
574 `g m p h'
575      Move to the previous occurrence of a place in the haab calendar
576      (`calendar-previous-haab-date').
577
578 `g m n c'
579      Move to the next occurrence of a place in the calendar round
580      (`calendar-next-calendar-round-date').
581
582 `g m p c'
583      Move to the previous occurrence of a place in the calendar round
584      (`calendar-previous-calendar-round-date').
585
586    To understand these commands, you need to understand the Mayan
587 calendars.  The "long count" is a counting of days with these units:
588
589      1 kin = 1 day   1 uinal = 20 kin   1 tun = 18 uinal
590      1 katun = 20 tun   1 baktun = 20 katun
591
592 Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11
593 tun, 16 uinal, and 6 kin.  The Emacs calendar can handle Mayan long
594 count dates as early as 7.17.18.13.1, but no earlier.  When you use the
595 `g m l' command, type the Mayan long count date with the baktun, katun,
596 tun, uinal, and kin separated by periods.
597
598    The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of
599 independent cycles of 13 and 20 days.  Since this cycle repeats
600 endlessly, Emacs provides commands to move backward and forward to the
601 previous or next point in the cycle.  Type `g m p t' to go to the
602 previous tzolkin date; Emacs asks you for a tzolkin date and moves point
603 to the previous occurrence of that date.  Similarly, type `g m n t' to
604 go to the next occurrence of a tzolkin date.
605
606    The Mayan haab calendar is a cycle of 365 days arranged as 18 months
607 of 20 days each, followed a 5-day monthless period.  Like the tzolkin
608 cycle, this cycle repeats endlessly, and there are commands to move
609 backward and forward to the previous or next point in the cycle.  Type
610 `g m p h' to go to the previous haab date; Emacs asks you for a haab
611 date and moves point to the previous occurrence of that date.
612 Similarly, type `g m n h' to go to the next occurrence of a haab date.
613
614    The Maya also used the combination of the tzolkin date and the haab
615 date.  This combination is a cycle of about 52 years called a _calendar
616 round_.  If you type `g m p c', Emacs asks you for both a haab and a
617 tzolkin date and then moves point to the previous occurrence of that
618 combination.  Use `g m n c' to move point to the next occurrence of a
619 combination.  These commands signal an error if the haab/tzolkin date
620 combination you have typed is impossible.
621
622    Emacs uses strict completion (*note Completion::) whenever it asks
623 you to type a Mayan name, so you don't have to worry about spelling.
624
625 \1f
626 File: xemacs.info,  Node: Diary,  Next: Calendar Customization,  Prev: Mayan Calendar,  Up: Calendar/Diary
627
628 The Diary
629 ---------
630
631    The Emacs diary keeps track of appointments or other events on a
632 daily basis, in conjunction with the calendar.  To use the diary
633 feature, you must first create a "diary file" containing a list of
634 events and their dates.  Then Emacs can automatically pick out and
635 display the events for today, for the immediate future, or for any
636 specified date.
637
638    By default, Emacs uses `~/diary' as the diary file.  This is the
639 same file that the `calendar' utility uses.  A sample `~/diary' file is:
640
641      12/22/1988 Twentieth wedding anniversary!!
642      &1/1. Happy New Year!
643      10/22 Ruth's birthday.
644      * 21, *: Payday
645      Tuesday--weekly meeting with grad students at 10am
646               Supowit, Shen, Bitner, and Kapoor to attend.
647      1/13/89 Friday the thirteenth!!
648      &thu 4pm squash game with Lloyd.
649      mar 16 Dad's birthday
650      April 15, 1989 Income tax due.
651      &* 15 time cards due.
652
653 This example uses extra spaces to align the event descriptions of most
654 of the entries.  Such formatting is purely a matter of taste.
655
656    Although you probably will start by creating a diary manually, Emacs
657 provides a number of commands to let you view, add, and change diary
658 entries.  You can also share diary entries with other users (*note
659 Included Diary Files::).
660
661 * Menu:
662
663 * Diary Commands::         Viewing diary entries and associated calendar dates.
664 * Format of Diary File::   Entering events in your diary.
665 * Date Formats::           Various ways you can specify dates.
666 * Adding to Diary::        Commands to create diary entries.
667 * Special Diary Entries::  Anniversaries, blocks of dates, cyclic entries, etc.
668
669 \1f
670 File: xemacs.info,  Node: Diary Commands,  Next: Format of Diary File,  Prev: Diary,  Up: Diary
671
672 Commands Displaying Diary Entries
673 ---------------------------------
674
675    Once you have created a `~/diary' file, you can use the calendar to
676 view it.  You can also view today's events outside of Calendar mode.
677
678 `d'
679      Display all diary entries for the selected date
680      (`view-diary-entries').
681
682 `Button2 Diary'
683      Display all diary entries for the date you click on.
684
685 `s'
686      Display the entire diary file (`show-all-diary-entries').
687
688 `m'
689      Mark all visible dates that have diary entries
690      (`mark-diary-entries').
691
692 `u'
693      Unmark the calendar window (`calendar-unmark').
694
695 `M-x print-diary-entries'
696      Print hard copy of the diary display as it appears.
697
698 `M-x diary'
699      Display all diary entries for today's date.
700
701 `M-x diary-mail-entries'
702      Mail yourself email reminders about upcoming diary entries.
703
704    Displaying the diary entries with `d' shows in a separate window the
705 diary entries for the selected date in the calendar.  The mode line of
706 the new window shows the date of the diary entries and any holidays
707 that fall on that date.  If you specify a numeric argument with `d', it
708 shows all the diary entries for that many successive days.  Thus, `2 d'
709 displays all the entries for the selected date and for the following
710 day.
711
712    Another way to display the diary entries for a date is to click
713 `Button2' on the date, and then choose `Diary' from the menu that
714 appears.
715
716    To get a broader view of which days are mentioned in the diary, use
717 the `m' command.  This displays the dates that have diary entries in a
718 different face (or places a `+' after these dates, if display with
719 multiple faces is not available).  The command applies both to the
720 currently visible months and to other months that subsequently become
721 visible by scrolling.  To turn marking off and erase the current marks,
722 type `u', which also turns off holiday marks (*note Holidays::).
723
724    To see the full diary file, rather than just some of the entries, use
725 the `s' command.
726
727    Display of selected diary entries uses the selective display feature
728 to hide entries that don't apply.
729
730    The diary buffer as you see it is an illusion, so simply printing the
731 buffer does not print what you see on your screen.  There is a special
732 command to print hard copy of the diary buffer _as it appears_; this
733 command is `M-x print-diary-entries'.  It sends the data directly to
734 the printer.  You can customize it like `lpr-region' (*note Hardcopy::).
735
736    The command `M-x diary' displays the diary entries for the current
737 date, independently of the calendar display, and optionally for the next
738 few days as well; the variable `number-of-diary-entries' specifies how
739 many days to include (*note Customization::).
740
741    If you put `(diary)' in your `.emacs' file, this automatically
742 displays a window with the day's diary entries, when you enter Emacs.
743 The mode line of the displayed window shows the date and any holidays
744 that fall on that date.
745
746    Many users like to receive notice of events in their diary as email.
747 To send such mail to yourself, use the command `M-x
748 diary-mail-entries'.  A prefix argument specifies how many days
749 (starting with today) to check; otherwise, the variable
750 `diary-mail-days' says how many days.
751
752 \1f
753 File: xemacs.info,  Node: Format of Diary File,  Next: Date Formats,  Prev: Diary Commands,  Up: Diary
754
755 The Diary File
756 --------------
757
758    Your "diary file" is a file that records events associated with
759 particular dates.  The name of the diary file is specified by the
760 variable `diary-file'; `~/diary' is the default.  The `calendar'
761 utility program supports a subset of the format allowed by the Emacs
762 diary facilities, so you can use that utility to view the diary file,
763 with reasonable results aside from the entries it cannot understand.
764
765    Each entry in the diary file describes one event and consists of one
766 or more lines.  An entry always begins with a date specification at the
767 left margin.  The rest of the entry is simply text to describe the
768 event.  If the entry has more than one line, then the lines after the
769 first must begin with whitespace to indicate they continue a previous
770 entry.  Lines that do not begin with valid dates and do not continue a
771 preceding entry are ignored.
772
773    You can inhibit the marking of certain diary entries in the calendar
774 window; to do this, insert an ampersand (`&') at the beginning of the
775 entry, before the date.  This has no effect on display of the entry in
776 the diary window; it affects only marks on dates in the calendar
777 window.  Nonmarking entries are especially useful for generic entries
778 that would otherwise mark many different dates.
779
780    If the first line of a diary entry consists only of the date or day
781 name with no following blanks or punctuation, then the diary window
782 display doesn't include that line; only the continuation lines appear.
783 For example, this entry:
784
785      02/11/1989
786            Bill B. visits Princeton today
787            2pm Cognitive Studies Committee meeting
788            2:30-5:30 Liz at Lawrenceville
789            4:00pm Dentist appt
790            7:30pm Dinner at George's
791            8:00-10:00pm concert
792
793 appears in the diary window without the date line at the beginning.
794 This style of entry looks neater when you display just a single day's
795 entries, but can cause confusion if you ask for more than one day's
796 entries.
797
798    You can edit the diary entries as they appear in the window, but it
799 is important to remember that the buffer displayed contains the _entire_
800 diary file, with portions of it concealed from view.  This means, for
801 instance, that the `C-f' (`forward-char') command can put point at what
802 appears to be the end of the line, but what is in reality the middle of
803 some concealed line.
804
805    _Be careful when editing the diary entries!_  Inserting additional
806 lines or adding/deleting characters in the middle of a visible line
807 cannot cause problems, but editing at the end of a line may not do what
808 you expect.  Deleting a line may delete other invisible entries that
809 follow it.  Before editing the diary, it is best to display the entire
810 file with `s' (`show-all-diary-entries').
811
812 \1f
813 File: xemacs.info,  Node: Date Formats,  Next: Adding to Diary,  Prev: Format of Diary File,  Up: Diary
814
815 Date Formats
816 ------------
817
818    Here are some sample diary entries, illustrating different ways of
819 formatting a date.  The examples all show dates in American order
820 (month, day, year), but Calendar mode supports European order (day,
821 month, year) as an option.
822
823      4/20/93  Switch-over to new tabulation system
824      apr. 25  Start tabulating annual results
825      4/30  Results for April are due
826      */25  Monthly cycle finishes
827      Friday  Don't leave without backing up files
828
829    The first entry appears only once, on April 20, 1993.  The second and
830 third appear every year on the specified dates, and the fourth uses a
831 wildcard (asterisk) for the month, so it appears on the 25th of every
832 month.  The final entry appears every week on Friday.
833
834    You can use just numbers to express a date, as in `MONTH/DAY' or
835 `MONTH/DAY/YEAR'.  This must be followed by a nondigit.  In the date
836 itself, MONTH and DAY are numbers of one or two digits.  The optional
837 YEAR is also a number, and may be abbreviated to the last two digits;
838 that is, you can use `11/12/1989' or `11/12/89'.
839
840    Dates can also have the form `MONTHNAME DAY' or `MONTHNAME DAY,
841 YEAR', where the month's name can be spelled in full or abbreviated to
842 three characters (with or without a period).  Case is not significant.
843
844    A date may be "generic"; that is, partially unspecified.  Then the
845 entry applies to all dates that match the specification.  If the date
846 does not contain a year, it is generic and applies to any year.
847 Alternatively, MONTH, DAY, or YEAR can be a `*'; this matches any
848 month, day, or year, respectively.  Thus, a diary entry `3/*/*' matches
849 any day in March of any year; so does `march *'.
850
851    If you prefer the European style of writing dates--in which the day
852 comes before the month--type `M-x european-calendar' while in the
853 calendar, or set the variable `european-calendar-style' to `t' _before_
854 using any calendar or diary command.  This mode interprets all dates in
855 the diary in the European manner, and also uses European style for
856 displaying diary dates.  (Note that there is no comma after the
857 MONTHNAME in the European style.)  To go back to the (default) American
858 style of writing dates, type `M-x american-calendar'.
859
860    You can use the name of a day of the week as a generic date which
861 applies to any date falling on that day of the week.  You can abbreviate
862 the day of the week to three letters (with or without a period) or spell
863 it in full; case is not significant.
864
865 \1f
866 File: xemacs.info,  Node: Adding to Diary,  Next: Special Diary Entries,  Prev: Date Formats,  Up: Diary
867
868 Commands to Add to the Diary
869 ----------------------------
870
871    While in the calendar, there are several commands to create diary
872 entries:
873
874 `i d'
875      Add a diary entry for the selected date (`insert-diary-entry').
876
877 `i w'
878      Add a diary entry for the selected day of the week
879      (`insert-weekly-diary-entry').
880
881 `i m'
882      Add a diary entry for the selected day of the month
883      (`insert-monthly-diary-entry').
884
885 `i y'
886      Add a diary entry for the selected day of the year
887      (`insert-yearly-diary-entry').
888
889    You can make a diary entry for a specific date by selecting that date
890 in the calendar window and typing the `i d' command.  This command
891 displays the end of your diary file in another window and inserts the
892 date; you can then type the rest of the diary entry.
893
894    If you want to make a diary entry that applies to a specific day of
895 the week, select that day of the week (any occurrence will do) and type
896 `i w'.  This inserts the day-of-week as a generic date; you can then
897 type the rest of the diary entry.  You can make a monthly diary entry in
898 the same fashion.  Select the day of the month, use the `i m' command,
899 and type rest of the entry.  Similarly, you can insert a yearly diary
900 entry with the `i y' command.
901
902    All of the above commands make marking diary entries by default.  To
903 make a nonmarking diary entry, give a numeric argument to the command.
904 For example, `C-u i w' makes a nonmarking weekly diary entry.
905
906    When you modify the diary file, be sure to save the file before
907 exiting Emacs.
908
909 \1f
910 File: xemacs.info,  Node: Special Diary Entries,  Prev: Adding to Diary,  Up: Diary
911
912 Special Diary Entries
913 ---------------------
914
915    In addition to entries based on calendar dates, the diary file can
916 contain "sexp entries" for regular events such as anniversaries.  These
917 entries are based on Lisp expressions (sexps) that Emacs evaluates as
918 it scans the diary file.  Instead of a date, a sexp entry contains `%%'
919 followed by a Lisp expression which must begin and end with
920 parentheses.  The Lisp expression determines which dates the entry
921 applies to.
922
923    Calendar mode provides commands to insert certain commonly used sexp
924 entries:
925
926 `i a'
927      Add an anniversary diary entry for the selected date
928      (`insert-anniversary-diary-entry').
929
930 `i b'
931      Add a block diary entry for the current region
932      (`insert-block-diary-entry').
933
934 `i c'
935      Add a cyclic diary entry starting at the date
936      (`insert-cyclic-diary-entry').
937
938    If you want to make a diary entry that applies to the anniversary of
939 a specific date, move point to that date and use the `i a' command.
940 This displays the end of your diary file in another window and inserts
941 the anniversary description; you can then type the rest of the diary
942 entry. The entry looks like this:
943
944    The effect of `i a' is to add a `diary-anniversary' sexp to your
945 diary file.  You can also add one manually, for instance:
946
947      %%(diary-anniversary 10 31 1948) Arthur's birthday
948
949 This entry applies to October 31 in any year after 1948; `10 31 1948'
950 specifies the date.  (If you are using the European calendar style, the
951 month and day are interchanged.)  The reason this expression requires a
952 beginning year is that advanced diary functions can use it to calculate
953 the number of elapsed years.
954
955    A "block" diary entry applies to a specified range of consecutive
956 dates.  Here is a block diary entry that applies to all dates from June
957 24, 1990 through July 10, 1990:
958
959      %%(diary-block 6 24 1990 7 10 1990) Vacation
960
961 The `6 24 1990' indicates the starting date and the `7 10 1990'
962 indicates the stopping date.  (Again, if you are using the European
963 calendar style, the month and day are interchanged.)
964
965    To insert a block entry, place point and the mark on the two dates
966 that begin and end the range, and type `i b'.  This command displays
967 the end of your diary file in another window and inserts the block
968 description; you can then type the diary entry.
969
970    "Cyclic" diary entries repeat after a fixed interval of days.  To
971 create one, select the starting date and use the `i c' command.  The
972 command prompts for the length of interval, then inserts the entry,
973 which looks like this:
974
975      %%(diary-cyclic 50 3 1 1990) Renew medication
976
977 This entry applies to March 1, 1990 and every 50th day following; `3 1
978 1990' specifies the starting date.  (If you are using the European
979 calendar style, the month and day are interchanged.)
980
981    All three of these commands make marking diary entries.  To insert a
982 nonmarking entry, give a numeric argument to the command.  For example,
983 `C-u i a' makes a nonmarking anniversary diary entry.
984
985    Marking sexp diary entries in the calendar is _extremely_
986 time-consuming, since every date visible in the calendar window must be
987 individually checked.  So it's a good idea to make sexp diary entries
988 nonmarking (with `&') when possible.
989
990    Another sophisticated kind of sexp entry, a "floating" diary entry,
991 specifies a regularly occurring event by offsets specified in days,
992 weeks, and months.  It is comparable to a crontab entry interpreted by
993 the `cron' utility.  Here is a nonmarking, floating diary entry that
994 applies to the last Thursday in November:
995
996      &%%(diary-float 11 4 -1) American Thanksgiving
997
998 The 11 specifies November (the eleventh month), the 4 specifies Thursday
999 (the fourth day of the week, where Sunday is numbered zero), and the -1
1000 specifies "last" (1 would mean "first", 2 would mean "second", -2 would
1001 mean "second-to-last", and so on).  The month can be a single month or
1002 a list of months.  Thus you could change the 11 above to `'(1 2 3)' and
1003 have the entry apply to the last Thursday of January, February, and
1004 March.  If the month is `t', the entry applies to all months of the
1005 year.
1006
1007    The sexp feature of the diary allows you to specify diary entries
1008 based on any Emacs Lisp expression.  You can use the library of built-in
1009 functions or you can write your own functions.  The built-in functions
1010 include the ones shown in this section, plus a few others (*note Sexp
1011 Diary Entries::).
1012
1013    The generality of sexps lets you specify any diary entry that you can
1014 describe algorithmically.  Suppose you get paid on the 21st of the month
1015 if it is a weekday, and to the Friday before if the 21st is on a
1016 weekend.  The diary entry
1017
1018      &%%(let ((dayname (calendar-day-of-week date))
1019               (day (car (cdr date))))
1020            (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
1021                (and (memq day '(19 20)) (= dayname 5)))
1022               ) Pay check deposited
1023
1024 to just those dates.  This example illustrates how the sexp can depend
1025 on the variable `date'; this variable is a list (MONTH DAY YEAR) that
1026 gives the Gregorian date for which the diary entries are being found.
1027 If the value of the sexp is `t', the entry applies to that date.  If
1028 the sexp evaluates to `nil', the entry does _not_ apply to that date.
1029
1030 \1f
1031 File: xemacs.info,  Node: Calendar Customization,  Prev: Diary,  Up: Calendar/Diary
1032
1033 Customizing the Calendar and Diary
1034 ----------------------------------
1035
1036    There are many customizations that you can use to make the calendar
1037 and diary suit your personal tastes.
1038
1039 * Menu:
1040
1041 * Calendar Customizing::   Defaults you can set.
1042 * Holiday Customizing::    Defining your own holidays.
1043 * Date Display Format::    Changing the format.
1044 * Time Display Format::    Changing the format.
1045 * Daylight Savings::       Changing the default.
1046 * Diary Customizing::      Defaults you can set.
1047 * Hebrew/Islamic Entries:: How to obtain them.
1048 * Fancy Diary Display::    Enhancing the diary display, sorting entries.
1049 * Included Diary Files::   Sharing a common diary file.
1050 * Sexp Diary Entries::     Fancy things you can do.
1051 * Appt Customizing::       Customizing appointment reminders.
1052
1053 \1f
1054 File: xemacs.info,  Node: Calendar Customizing,  Next: Holiday Customizing,  Up: Calendar Customization
1055
1056 Customizing the Calendar
1057 ........................
1058
1059    If you set the variable `view-diary-entries-initially' to `t',
1060 calling up the calendar automatically displays the diary entries for
1061 the current date as well.  The diary dates appear only if the current
1062 date is visible.  If you add both of the following lines to your
1063 `.emacs' file:
1064
1065      (setq view-diary-entries-initially t)
1066      (calendar)
1067
1068 this displays both the calendar and diary windows whenever you start
1069 Emacs.
1070
1071    Similarly, if you set the variable
1072 `view-calendar-holidays-initially' to `t', entering the calendar
1073 automatically displays a list of holidays for the current three-month
1074 period.  The holiday list appears in a separate window.
1075
1076    You can set the variable `mark-diary-entries-in-calendar' to `t' in
1077 order to mark any dates with diary entries.  This takes effect whenever
1078 the calendar window contents are recomputed.  There are two ways of
1079 marking these dates: by changing the face (*note Faces::), if the
1080 display supports that, or by placing a plus sign (`+') beside the date
1081 otherwise.
1082
1083    Similarly, setting the variable `mark-holidays-in-calendar' to `t'
1084 marks holiday dates, either with a change of face or with an asterisk
1085 (`*').
1086
1087    The variable `calendar-holiday-marker' specifies how to mark a date
1088 as being a holiday.  Its value may be a character to insert next to the
1089 date, or a face name to use for displaying the date.  Likewise, the
1090 variable `diary-entry-marker' specifies how to mark a date that has
1091 diary entries.  The calendar creates faces named `holiday-face' and
1092 `diary-face' for these purposes; those symbols are the default values
1093 of these variables, when Emacs supports multiple faces on your terminal.
1094
1095    The variable `calendar-load-hook' is a normal hook run when the
1096 calendar package is first loaded (before actually starting to display
1097 the calendar).
1098
1099    Starting the calendar runs the normal hook
1100 `initial-calendar-window-hook'.  Recomputation of the calendar display
1101 does not run this hook.  But if you leave the calendar with the `q'
1102 command and reenter it, the hook runs again.
1103
1104    The variable `today-visible-calendar-hook' is a normal hook run
1105 after the calendar buffer has been prepared with the calendar when the
1106 current date is visible in the window.  One use of this hook is to
1107 replace today's date with asterisks; to do that, use the hook function
1108 `calendar-star-date'.
1109
1110      (add-hook 'today-visible-calendar-hook 'calendar-star-date)
1111
1112 Another standard hook function marks the current date, either by
1113 changing its face or by adding an asterisk.  Here's how to use it:
1114
1115      (add-hook 'today-visible-calendar-hook 'calendar-mark-today)
1116
1117 The variable `calendar-today-marker' specifies how to mark today's
1118 date.  Its value should be a character to insert next to the date or a
1119 face name to use for displaying the date.  A face named
1120 `calendar-today-face' is provided for this purpose; that symbol is the
1121 default for this variable when Emacs supports multiple faces on your
1122 terminal.
1123
1124 A similar normal hook, `today-invisible-calendar-hook' is run if the
1125 current date is _not_ visible in the window.
1126