1 This is ../info/xemacs.info, produced by makeinfo version 4.0 from
4 INFO-DIR-SECTION XEmacs Editor
6 * XEmacs: (xemacs). XEmacs Editor.
9 This file documents the XEmacs editor.
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.
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.
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.
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.
33 File: xemacs.info, Node: Calendar Motion, Next: Scroll Calendar, Prev: Calendar/Diary, Up: Calendar/Diary
35 Movement in the Calendar
36 ------------------------
38 Calendar mode lets you move through the calendar in logical units of
39 time such as days, weeks, months, and years. If you move outside the
40 three months originally displayed, the calendar display "scrolls"
41 automatically through time to make the selected date visible. Moving to
42 a date lets you view its holidays or diary entries, or convert it to
43 other calendars; moving longer time periods is also useful simply to
48 * Calendar Unit Motion:: Moving by days, weeks, months, and years.
49 * Move to Beginning or End:: Moving to start/end of weeks, months, and years.
50 * Specified Dates:: Moving to the current date or another
54 File: xemacs.info, Node: Calendar Unit Motion, Next: Move to Beginning or End, Prev: Calendar Motion, Up: Calendar Motion
56 Motion by Integral Days, Weeks, Months, Years
57 .............................................
59 The commands for movement in the calendar buffer parallel the
60 commands for movement in text. You can move forward and backward by
61 days, weeks, months, and years.
64 Move point one day forward (`calendar-forward-day').
67 Move point one day backward (`calendar-backward-day').
70 Move point one week forward (`calendar-forward-week').
73 Move point one week backward (`calendar-backward-week').
76 Move point one month forward (`calendar-forward-month').
79 Move point one month backward (`calendar-backward-month').
82 Move point one year forward (`calendar-forward-year').
85 Move point one year backward (`calendar-backward-year').
87 The day and week commands are natural analogues of the usual Emacs
88 commands for moving by characters and by lines. Just as `C-n' usually
89 moves to the same column in the following line, in Calendar mode it
90 moves to the same day in the following week. And `C-p' moves to the
91 same day in the previous week.
93 The arrow keys are equivalent to `C-f', `C-b', `C-n' and `C-p', just
94 as they normally are in other modes.
96 The commands for motion by months and years work like those for
97 weeks, but move a larger distance. The month commands `M-}' and `M-{'
98 move forward or backward by an entire month's time. The year commands
99 `C-x ]' and `C-x [' move forward or backward a whole year.
101 The easiest way to remember these commands is to consider months and
102 years analogous to paragraphs and pages of text, respectively. But the
103 commands themselves are not quite analogous. The ordinary Emacs
104 paragraph commands move to the beginning or end of a paragraph, whereas
105 these month and year commands move by an entire month or an entire
106 year, which usually involves skipping across the end of a month or year.
108 All these commands accept a numeric argument as a repeat count. For
109 convenience, the digit keys and the minus sign specify numeric
110 arguments in Calendar mode even without the Meta modifier. For example,
111 `100 C-f' moves point 100 days forward from its present location.
114 File: xemacs.info, Node: Move to Beginning or End, Next: Specified Dates, Prev: Calendar Unit Motion, Up: Calendar Motion
116 Beginning or End of Week, Month or Year
117 .......................................
119 A week (or month, or year) is not just a quantity of days; we think
120 of weeks (months, years) as starting on particular dates. So Calendar
121 mode provides commands to move to the beginning or end of a week, month
125 Move point to start of week (`calendar-beginning-of-week').
128 Move point to end of week (`calendar-end-of-week').
131 Move point to start of month (`calendar-beginning-of-month').
134 Move point to end of month (`calendar-end-of-month').
137 Move point to start of year (`calendar-beginning-of-year').
140 Move point to end of year (`calendar-end-of-year').
142 These commands also take numeric arguments as repeat counts, with the
143 repeat count indicating how many weeks, months, or years to move
146 By default, weeks begin on Sunday. To make them begin on Monday
147 instead, set the variable `calendar-week-start-day' to 1.
150 File: xemacs.info, Node: Specified Dates, Prev: Move to Beginning or End, Up: Calendar Motion
155 Calendar mode provides commands for moving to a particular date
156 specified in various ways.
159 Move point to specified date (`calendar-goto-date').
162 Center calendar around specified month (`calendar-other-month').
165 Move point to today's date (`calendar-goto-today').
167 `g d' (`calendar-goto-date') prompts for a year, a month, and a day
168 of the month, and then moves to that date. Because the calendar
169 includes all dates from the beginning of the current era, you must type
170 the year in its entirety; that is, type `1990', not `90'.
172 `o' (`calendar-other-month') prompts for a month and year, then
173 centers the three-month calendar around that month.
175 You can return to today's date with `.' (`calendar-goto-today').
178 File: xemacs.info, Node: Scroll Calendar, Next: Mark and Region, Prev: Calendar Motion, Up: Calendar/Diary
180 Scrolling the Calendar through Time
181 -----------------------------------
183 The calendar display scrolls automatically through time when you
184 move out of the visible portion. You can also scroll it manually.
185 Imagine that the calendar window contains a long strip of paper with
186 the months on it. Scrolling it means moving the strip so that new
187 months become visible in the window.
190 Scroll calendar one month forward (`scroll-calendar-left').
193 Scroll calendar one month backward (`scroll-calendar-right').
197 Scroll calendar three months forward
198 (`scroll-calendar-left-three-months').
202 Scroll calendar three months backward
203 (`scroll-calendar-right-three-months').
205 The most basic calendar scroll commands scroll by one month at a
206 time. This means that there are two months of overlap between the
207 display before the command and the display after. `C-x <' scrolls the
208 calendar contents one month to the left; that is, it moves the display
209 forward in time. `C-x >' scrolls the contents to the right, which
210 moves backwards in time.
212 The commands `C-v' and `M-v' scroll the calendar by an entire
213 "screenful"--three months--in analogy with the usual meaning of these
214 commands. `C-v' makes later dates visible and `M-v' makes earlier
215 dates visible. These commands take a numeric argument as a repeat
216 count; in particular, since `C-u' multiplies the next command by four,
217 typing `C-u C-v' scrolls the calendar forward by a year and typing `C-u
218 M-v' scrolls the calendar backward by a year.
220 The function keys <NEXT> and <PRIOR> are equivalent to `C-v' and
221 `M-v', just as they are in other modes.
224 File: xemacs.info, Node: Mark and Region, Next: General Calendar, Prev: Scroll Calendar, Up: Calendar/Diary
226 The Mark and the Region
227 -----------------------
229 The concept of the mark applies to the calendar just as to any other
230 buffer, but it marks a _date_, not a _position_ in the buffer. The
231 region consists of the days between the mark and point (including the
232 starting and stopping dates).
235 Set the mark to today's date (`calendar-set-mark').
241 Interchange mark and point (`calendar-exchange-point-and-mark').
244 Display the number of days in the current region
245 (`calendar-count-days-region').
247 You set the mark in the calendar, as in any other buffer, by using
248 `C-@' or `C-SPC' (`calendar-set-mark'). You return to the marked date
249 with the command `C-x C-x' (`calendar-exchange-point-and-mark') which
250 puts the mark where point was and point where mark was. The calendar
251 is scrolled as necessary, if the marked date was not visible on the
252 screen. This does not change the extent of the region.
254 To determine the number of days in the region, type `M-='
255 (`calendar-count-days-region'). The numbers of days printed is
256 _inclusive_; that is, it includes the days specified by mark and point.
258 The main use of the mark in the calendar is to remember dates that
259 you may want to go back to. To make this feature more useful, the mark
260 ring (*note Mark Ring::) operates exactly as in other buffers: Emacs
261 remembers 16 previous locations of the mark. To return to a marked
262 date, type `C-u C-SPC' (or `C-u C-@'); this is the command
263 `calendar-set-mark' given a numeric argument. It moves point to where
264 the mark was, restores the mark from the ring of former marks, and
265 stores the previous point at the end of the mark ring. So, repeated
266 use of this command moves point through all the old marks on the ring,
270 File: xemacs.info, Node: General Calendar, Next: LaTeX Calendar, Prev: Mark and Region, Up: Calendar/Diary
272 Miscellaneous Calendar Commands
273 -------------------------------
276 Display day-in-year (`calendar-print-day-of-year').
279 Briefly describe calendar commands (`describe-calendar-mode').
282 Regenerate the calendar window (`redraw-calendar').
285 Scroll the next window (`scroll-other-window').
288 Exit from calendar (`exit-calendar').
290 If you want to know how many days have elapsed since the start of
291 the year, or the number of days remaining in the year, type the `p d'
292 command (`calendar-print-day-of-year'). This displays both of those
293 numbers in the echo area.
295 To display a brief description of the calendar commands, type `?'
296 (`describe-calendar-mode'). For a fuller description, type `C-h m'.
298 You can use `SPC' (`scroll-other-window') to scroll the other
299 window. This is handy when you display a list of holidays or diary
300 entries in another window.
302 If the calendar window text gets corrupted, type `C-c C-l'
303 (`redraw-calendar') to redraw it. (This can only happen if you use
304 non-Calendar-mode editing commands.)
306 In Calendar mode, you can use `SPC' (`scroll-other-window') to
307 scroll the other window. This is handy when you display a list of
308 holidays or diary entries in another window.
310 To exit from the calendar, type `q' (`exit-calendar'). This buries
311 all buffers related to the calendar, selecting other buffers. (If a
312 frame contains a dedicated calendar window, exiting from the calendar
313 iconifies that frame.)
316 File: xemacs.info, Node: LaTeX Calendar, Next: Holidays, Prev: General Calendar, Up: Calendar/Diary
321 The Calendar LaTeX commands produce a buffer of LaTeX code that
322 prints as a calendar. Depending on the command you use, the printed
323 calendar covers the day, week, month or year that point is in.
326 Generate a one-month calendar (`cal-tex-cursor-month').
329 Generate a sideways-printing one-month calendar
330 (`cal-tex-cursor-month-landscape').
333 Generate a one-day calendar (`cal-tex-cursor-day').
336 Generate a one-page calendar for one week (`cal-tex-cursor-week').
339 Generate a two-page calendar for one week (`cal-tex-cursor-week2').
342 Generate an ISO-style calendar for one week
343 (`cal-tex-cursor-week-iso').
346 Generate a calendar for one Monday-starting week
347 (`cal-tex-cursor-week-monday').
350 Generate a Filofax-style two-weeks-at-a-glance calendar
351 (`cal-tex-cursor-filofax-2week').
354 Generate a Filofax-style one-week-at-a-glance calendar
355 (`cal-tex-cursor-filofax-week').
358 Generate a calendar for one year (`cal-tex-cursor-year').
361 Generate a sideways-printing calendar for one year
362 (`cal-tex-cursor-year-landscape').
365 Generate a Filofax-style calendar for one year
366 (`cal-tex-cursor-filofax-year').
368 Some of these commands print the calendar sideways (in "landscape
369 mode"), so it can be wider than it is long. Some of them use Filofax
370 paper size (3.75in x 6.75in). All of these commands accept a prefix
371 argument which specifies how many days, weeks, months or years to print
372 (starting always with the selected one).
374 If the variable `cal-tex-holidays' is non-`nil' (the default), then
375 the printed calendars show the holidays in `calendar-holidays'. If the
376 variable `cal-tex-diary' is non-`nil' (the default is `nil'), diary
377 entries are included also (in weekly and monthly calendars only).
380 File: xemacs.info, Node: Holidays, Next: Sunrise/Sunset, Prev: LaTeX Calendar, Up: Calendar/Diary
385 The Emacs calendar knows about all major and many minor holidays,
386 and can display them.
389 Display holidays for the selected date
390 (`calendar-cursor-holidays').
393 Display any holidays for the date you click on.
396 Mark holidays in the calendar window (`mark-calendar-holidays').
399 Unmark calendar window (`calendar-unmark').
402 List all holidays for the displayed three months in another window
403 (`list-calendar-holidays').
406 List all holidays for three months around today's date in another
410 List holidays in another window for a specified range of years.
412 To see if any holidays fall on a given date, position point on that
413 date in the calendar window and use the `h' command. Alternatively,
414 click on that date with `Button2' and then choose `Holidays' from the
415 menu that appears. Either way, this displays the holidays for that
416 date, in the echo area if they fit there, otherwise in a separate
419 To view the distribution of holidays for all the dates shown in the
420 calendar, use the `x' command. This displays the dates that are
421 holidays in a different face (or places a `*' after these dates, if
422 display with multiple faces is not available). The command applies both
423 to the currently visible months and to other months that subsequently
424 become visible by scrolling. To turn marking off and erase the current
425 marks, type `u', which also erases any diary marks (*note Diary::).
427 To get even more detailed information, use the `a' command, which
428 displays a separate buffer containing a list of all holidays in the
429 current three-month range. You can use <SPC> in the calendar window to
432 The command `M-x holidays' displays the list of holidays for the
433 current month and the preceding and succeeding months; this works even
434 if you don't have a calendar window. If you want the list of holidays
435 centered around a different month, use `C-u M-x holidays', which
436 prompts for the month and year.
438 The holidays known to Emacs include United States holidays and the
439 major Christian, Jewish, and Islamic holidays; also the solstices and
442 The command `M-x list-holidays' displays the list of holidays for a
443 range of years. This function asks you for the starting and stopping
444 years, and allows you to choose all the holidays or one of several
445 categories of holidays. You can use this command even if you don't have
448 The dates used by Emacs for holidays are based on _current
449 practice_, not historical fact. Historically, for instance, the start
450 of daylight savings time and even its existence have varied from year to
451 year, but present United States law mandates that daylight savings time
452 begins on the first Sunday in April. When the daylight savings rules
453 are set up for the United States, Emacs always uses the present
454 definition, even though it is wrong for some prior years.
457 File: xemacs.info, Node: Sunrise/Sunset, Next: Lunar Phases, Prev: Holidays, Up: Calendar/Diary
459 Times of Sunrise and Sunset
460 ---------------------------
462 Special calendar commands can tell you, to within a minute or two,
463 the times of sunrise and sunset for any date.
466 Display times of sunrise and sunset for the selected date
467 (`calendar-sunrise-sunset').
469 `Button2 Sunrise/Sunset'
470 Display times of sunrise and sunset for the date you click on.
473 Display times of sunrise and sunset for today's date.
475 `C-u M-x sunrise-sunset'
476 Display times of sunrise and sunset for a specified date.
478 Within the calendar, to display the _local times_ of sunrise and
479 sunset in the echo area, move point to the date you want, and type `S'.
480 Alternatively, click `Button2' on the date, then choose
481 `Sunrise/Sunset' from the menu that appears. The command `M-x
482 sunrise-sunset' is available outside the calendar to display this
483 information for today's date or a specified date. To specify a date
484 other than today, use `C-u M-x sunrise-sunset', which prompts for the
485 year, month, and day.
487 You can display the times of sunrise and sunset for any location and
488 any date with `C-u C-u M-x sunrise-sunset'. This asks you for a
489 longitude, latitude, number of minutes difference from Coordinated
490 Universal Time, and date, and then tells you the times of sunrise and
491 sunset for that location on that date.
493 Because the times of sunrise and sunset depend on the location on
494 earth, you need to tell Emacs your latitude, longitude, and location
495 name before using these commands. Here is an example of what to set:
497 (setq calendar-latitude 40.1)
498 (setq calendar-longitude -88.2)
499 (setq calendar-location-name "Urbana, IL")
501 Use one decimal place in the values of `calendar-latitude' and
502 `calendar-longitude'.
504 Your time zone also affects the local time of sunrise and sunset.
505 Emacs usually gets time zone information from the operating system, but
506 if these values are not what you want (or if the operating system does
507 not supply them), you must set them yourself. Here is an example:
509 (setq calendar-time-zone -360)
510 (setq calendar-standard-time-zone-name "CST")
511 (setq calendar-daylight-time-zone-name "CDT")
513 The value of `calendar-time-zone' is the number of minutes difference
514 between your local standard time and Coordinated Universal Time
515 (Greenwich time). The values of `calendar-standard-time-zone-name' and
516 `calendar-daylight-time-zone-name' are the abbreviations used in your
517 time zone. Emacs displays the times of sunrise and sunset _corrected
518 for daylight savings time_. *Note Daylight Savings::, for how daylight
519 savings time is determined.
521 As a user, you might find it convenient to set the calendar location
522 variables for your usual physical location in your `.emacs' file. And
523 when you install Emacs on a machine, you can create a `default.el' file
524 which sets them properly for the typical location of most users of that
525 machine. *Note Init File::.
528 File: xemacs.info, Node: Lunar Phases, Next: Other Calendars, Prev: Sunrise/Sunset, Up: Calendar/Diary
533 These calendar commands display the dates and times of the phases of
534 the moon (new moon, first quarter, full moon, last quarter). This
535 feature is useful for debugging problems that "depend on the phase of
539 Display the dates and times for all the quarters of the moon for
540 the three-month period shown (`calendar-phases-of-moon').
543 Display dates and times of the quarters of the moon for three
544 months around today's date.
546 Within the calendar, use the `M' command to display a separate
547 buffer of the phases of the moon for the current three-month range. The
548 dates and times listed are accurate to within a few minutes.
550 Outside the calendar, use the command `M-x phases-of-moon' to
551 display the list of the phases of the moon for the current month and the
552 preceding and succeeding months. For information about a different
553 month, use `C-u M-x phases-of-moon', which prompts for the month and
556 The dates and times given for the phases of the moon are given in
557 local time (corrected for daylight savings, when appropriate); but if
558 the variable `calendar-time-zone' is void, Coordinated Universal Time
559 (the Greenwich time zone) is used. *Note Daylight Savings::.
562 File: xemacs.info, Node: Other Calendars, Next: Calendar Systems, Prev: Lunar Phases, Up: Calendar/Diary
564 Conversion To and From Other Calendars
565 --------------------------------------
567 The Emacs calendar displayed is _always_ the Gregorian calendar,
568 sometimes called the "new style" calendar, which is used in most of the
569 world today. However, this calendar did not exist before the sixteenth
570 century and was not widely used before the eighteenth century; it did
571 not fully displace the Julian calendar and gain universal acceptance
572 until the early twentieth century. The Emacs calendar can display any
573 month since January, year 1 of the current era, but the calendar
574 displayed is the Gregorian, even for a date at which the Gregorian
575 calendar did not exist.
577 While Emacs cannot display other calendars, it can convert dates to
578 and from several other calendars.
582 * Calendar Systems:: The calendars Emacs understands
583 (aside from Gregorian).
584 * To Other Calendar:: Converting the selected date to various calendars.
585 * From Other Calendar:: Moving to a date specified in another calendar.
586 * Mayan Calendar:: Moving to a date specified in a Mayan calendar.
588 If you are interested in these calendars, you can convert dates one
589 at a time. Put point on the desired date of the Gregorian calendar and
590 press the appropriate keys. The `p' is a mnemonic for "print" since
591 Emacs "prints' the equivalent date in the echo area.
594 File: xemacs.info, Node: Calendar Systems, Next: To Other Calendar, Prev: Other Calendars, Up: Other Calendars
596 Supported Calendar Systems
597 ==========================
599 The ISO commercial calendar is used largely in Europe.
601 The Julian calendar, named after Julius Caesar, was the one used in
602 Europe throughout medieval times, and in many countries up until the
605 Astronomers use a simple counting of days elapsed since noon, Monday,
606 January 1, 4713 B.C. on the Julian calendar. The number of days elapsed
607 is called the _Julian day number_ or the _Astronomical day number_.
609 The Hebrew calendar is used by tradition in the Jewish religion. The
610 Emacs calendar program uses the Hebrew calendar to determine the dates
611 of Jewish holidays. Hebrew calendar dates begin and end at sunset.
613 The Islamic calendar is used in many predominantly Islamic countries.
614 Emacs uses it to determine the dates of Islamic holidays. There is no
615 universal agreement in the Islamic world about the calendar; Emacs uses
616 a widely accepted version, but the precise dates of Islamic holidays
617 often depend on proclamation by religious authorities, not on
618 calculations. As a consequence, the actual dates of observance can vary
619 slightly from the dates computed by Emacs. Islamic calendar dates begin
622 The French Revolutionary calendar was created by the Jacobins after
623 the 1789 revolution, to represent a more secular and nature-based view
624 of the annual cycle, and to install a 10-day week in a rationalization
625 measure similar to the metric system. The French government officially
626 abandoned this calendar at the end of 1805.
628 The Maya of Central America used three separate, overlapping calendar
629 systems, the _long count_, the _tzolkin_, and the _haab_. Emacs knows
630 about all three of these calendars. Experts dispute the exact
631 correlation between the Mayan calendar and our calendar; Emacs uses the
632 Goodman-Martinez-Thompson correlation in its calculations.
634 The Copts use a calendar based on the ancient Egyptian solar
635 calendar. Their calendar consists of twelve 30-day months followed by
636 an extra five-day period. Once every fourth year they add a leap day
637 to this extra period to make it six days. The Ethiopic calendar is
638 identical in structure, but has different year numbers and month names.
640 The Persians use a solar calendar based on a design of Omar Khayyam.
641 Their calendar consists of twelve months of which the first six have 31
642 days, the next five have 30 days, and the last has 29 in ordinary years
643 and 30 in leap years. Leap years occur in a complicated pattern every
646 The Chinese calendar is a complicated system of lunar months arranged
647 into solar years. The years go in cycles of sixty, each year containing
648 either twelve months in an ordinary year or thirteen months in a leap
649 year; each month has either 29 or 30 days. Years, ordinary months, and
650 days are named by combining one of ten "celestial stems" with one of
651 twelve "terrestrial branches" for a total of sixty names that are
652 repeated in a cycle of sixty.
655 File: xemacs.info, Node: To Other Calendar, Next: From Other Calendar, Prev: Calendar Systems, Up: Other Calendars
657 Converting To Other Calendars
658 =============================
660 The following commands describe the selected date (the date at point)
661 in various other calendar systems:
663 `Button2 Other Calendars'
664 Display the date that you click on, expressed in various other
668 Display ISO commercial calendar equivalent for selected day
669 (`calendar-print-iso-date').
672 Display Julian date for selected day
673 (`calendar-print-julian-date').
676 Display astronomical (Julian) day number for selected day
677 (`calendar-print-astro-day-number').
680 Display Hebrew date for selected day
681 (`calendar-print-hebrew-date').
684 Display Islamic date for selected day
685 (`calendar-print-islamic-date').
688 Display French Revolutionary date for selected day
689 (`calendar-print-french-date').
692 Display Chinese date for selected day
693 (`calendar-print-chinese-date').
696 Display Coptic date for selected day
697 (`calendar-print-coptic-date').
700 Display Ethiopic date for selected day
701 (`calendar-print-ethiopic-date').
704 Display Persian date for selected day
705 (`calendar-print-persian-date').
708 Display Mayan date for selected day (`calendar-print-mayan-date').
710 If you are using X, the easiest way to translate a date into other
711 calendars is to click on it with `Button2', then choose `Other
712 Calendars' from the menu that appears. This displays the equivalent
713 forms of the date in all the calendars Emacs understands, in the form of
714 a menu. (Choosing an alternative from this menu doesn't actually do
715 anything--the menu is used only for display.)
717 Put point on the desired date of the Gregorian calendar, then type
718 the appropriate keys. The `p' is a mnemonic for "print" since Emacs
719 "prints" the equivalent date in the echo area.
722 File: xemacs.info, Node: From Other Calendar, Next: Mayan Calendar, Prev: To Other Calendar, Up: Other Calendars
724 Converting From Other Calendars
725 ===============================
727 You can use the other supported calendars to specify a date to move
728 to. This section describes the commands for doing this using calendars
729 other than Mayan; for the Mayan calendar, see the following section.
732 Move to a date specified in the ISO commercial calendar
733 (`calendar-goto-iso-date').
736 Move to a date specified in the Julian calendar
737 (`calendar-goto-julian-date').
740 Move to a date specified in astronomical (Julian) day number
741 (`calendar-goto-astro-day-number').
744 Move to a date specified in the Hebrew calendar
745 (`calendar-goto-hebrew-date').
748 Move to a date specified in the Islamic calendar
749 (`calendar-goto-islamic-date').
752 Move to a date specified in the French Revolutionary calendar
753 (`calendar-goto-french-date').
756 Move to a date specified in the Chinese calendar
757 (`calendar-goto-chinese-date').
760 Move to a date specified in the Persian calendar
761 (`calendar-goto-persian-date').
764 Move to a date specified in the Coptic calendar
765 (`calendar-goto-coptic-date').
768 Move to a date specified in the Ethiopic calendar
769 (`calendar-goto-ethiopic-date').
771 These commands ask you for a date on the other calendar, move point
772 to the Gregorian calendar date equivalent to that date, and display the
773 other calendar's date in the echo area. Emacs uses strict completion
774 (*note Completion::) whenever it asks you to type a month name, so you
775 don't have to worry about the spelling of Hebrew, Islamic, or French
778 One common question concerning the Hebrew calendar is the computation
779 of the anniversary of a date of death, called a "yahrzeit." The Emacs
780 calendar includes a facility for such calculations. If you are in the
781 calendar, the command `M-x list-yahrzeit-dates' asks you for a range of
782 years and then displays a list of the yahrzeit dates for those years
783 for the date given by point. If you are not in the calendar, this
784 command first asks you for the date of death and the range of years,
785 and then displays the list of yahrzeit dates.
788 File: xemacs.info, Node: Mayan Calendar, Next: Diary, Prev: From Other Calendar, Up: Other Calendars
790 Converting from the Mayan Calendar
791 ----------------------------------
793 Here are the commands to select dates based on the Mayan calendar:
796 Move to a date specified by the long count calendar
797 (`calendar-goto-mayan-long-count-date').
800 Move to the next occurrence of a place in the tzolkin calendar
801 (`calendar-next-tzolkin-date').
804 Move to the previous occurrence of a place in the tzolkin calendar
805 (`calendar-previous-tzolkin-date').
808 Move to the next occurrence of a place in the haab calendar
809 (`calendar-next-haab-date').
812 Move to the previous occurrence of a place in the haab calendar
813 (`calendar-previous-haab-date').
816 Move to the next occurrence of a place in the calendar round
817 (`calendar-next-calendar-round-date').
820 Move to the previous occurrence of a place in the calendar round
821 (`calendar-previous-calendar-round-date').
823 To understand these commands, you need to understand the Mayan
824 calendars. The "long count" is a counting of days with these units:
826 1 kin = 1 day 1 uinal = 20 kin 1 tun = 18 uinal
827 1 katun = 20 tun 1 baktun = 20 katun
829 Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11
830 tun, 16 uinal, and 6 kin. The Emacs calendar can handle Mayan long
831 count dates as early as 7.17.18.13.1, but no earlier. When you use the
832 `g m l' command, type the Mayan long count date with the baktun, katun,
833 tun, uinal, and kin separated by periods.
835 The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of
836 independent cycles of 13 and 20 days. Since this cycle repeats
837 endlessly, Emacs provides commands to move backward and forward to the
838 previous or next point in the cycle. Type `g m p t' to go to the
839 previous tzolkin date; Emacs asks you for a tzolkin date and moves point
840 to the previous occurrence of that date. Similarly, type `g m n t' to
841 go to the next occurrence of a tzolkin date.
843 The Mayan haab calendar is a cycle of 365 days arranged as 18 months
844 of 20 days each, followed a 5-day monthless period. Like the tzolkin
845 cycle, this cycle repeats endlessly, and there are commands to move
846 backward and forward to the previous or next point in the cycle. Type
847 `g m p h' to go to the previous haab date; Emacs asks you for a haab
848 date and moves point to the previous occurrence of that date.
849 Similarly, type `g m n h' to go to the next occurrence of a haab date.
851 The Maya also used the combination of the tzolkin date and the haab
852 date. This combination is a cycle of about 52 years called a _calendar
853 round_. If you type `g m p c', Emacs asks you for both a haab and a
854 tzolkin date and then moves point to the previous occurrence of that
855 combination. Use `g m n c' to move point to the next occurrence of a
856 combination. These commands signal an error if the haab/tzolkin date
857 combination you have typed is impossible.
859 Emacs uses strict completion (*note Completion::) whenever it asks
860 you to type a Mayan name, so you don't have to worry about spelling.
863 File: xemacs.info, Node: Diary, Next: Calendar Customization, Prev: Mayan Calendar, Up: Calendar/Diary
868 The Emacs diary keeps track of appointments or other events on a
869 daily basis, in conjunction with the calendar. To use the diary
870 feature, you must first create a "diary file" containing a list of
871 events and their dates. Then Emacs can automatically pick out and
872 display the events for today, for the immediate future, or for any
875 By default, Emacs uses `~/diary' as the diary file. This is the
876 same file that the `calendar' utility uses. A sample `~/diary' file is:
878 12/22/1988 Twentieth wedding anniversary!!
879 &1/1. Happy New Year!
880 10/22 Ruth's birthday.
882 Tuesday--weekly meeting with grad students at 10am
883 Supowit, Shen, Bitner, and Kapoor to attend.
884 1/13/89 Friday the thirteenth!!
885 &thu 4pm squash game with Lloyd.
886 mar 16 Dad's birthday
887 April 15, 1989 Income tax due.
888 &* 15 time cards due.
890 This example uses extra spaces to align the event descriptions of most
891 of the entries. Such formatting is purely a matter of taste.
893 Although you probably will start by creating a diary manually, Emacs
894 provides a number of commands to let you view, add, and change diary
895 entries. You can also share diary entries with other users (*note
896 Included Diary Files::).
900 * Diary Commands:: Viewing diary entries and associated calendar dates.
901 * Format of Diary File:: Entering events in your diary.
902 * Date Formats:: Various ways you can specify dates.
903 * Adding to Diary:: Commands to create diary entries.
904 * Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc.
907 File: xemacs.info, Node: Diary Commands, Next: Format of Diary File, Prev: Diary, Up: Diary
909 Commands Displaying Diary Entries
910 ---------------------------------
912 Once you have created a `~/diary' file, you can use the calendar to
913 view it. You can also view today's events outside of Calendar mode.
916 Display all diary entries for the selected date
917 (`view-diary-entries').
920 Display all diary entries for the date you click on.
923 Display the entire diary file (`show-all-diary-entries').
926 Mark all visible dates that have diary entries
927 (`mark-diary-entries').
930 Unmark the calendar window (`calendar-unmark').
932 `M-x print-diary-entries'
933 Print hard copy of the diary display as it appears.
936 Display all diary entries for today's date.
938 `M-x diary-mail-entries'
939 Mail yourself email reminders about upcoming diary entries.
941 Displaying the diary entries with `d' shows in a separate window the
942 diary entries for the selected date in the calendar. The mode line of
943 the new window shows the date of the diary entries and any holidays
944 that fall on that date. If you specify a numeric argument with `d', it
945 shows all the diary entries for that many successive days. Thus, `2 d'
946 displays all the entries for the selected date and for the following
949 Another way to display the diary entries for a date is to click
950 `Button2' on the date, and then choose `Diary' from the menu that
953 To get a broader view of which days are mentioned in the diary, use
954 the `m' command. This displays the dates that have diary entries in a
955 different face (or places a `+' after these dates, if display with
956 multiple faces is not available). The command applies both to the
957 currently visible months and to other months that subsequently become
958 visible by scrolling. To turn marking off and erase the current marks,
959 type `u', which also turns off holiday marks (*note Holidays::).
961 To see the full diary file, rather than just some of the entries, use
964 Display of selected diary entries uses the selective display feature
965 to hide entries that don't apply.
967 The diary buffer as you see it is an illusion, so simply printing the
968 buffer does not print what you see on your screen. There is a special
969 command to print hard copy of the diary buffer _as it appears_; this
970 command is `M-x print-diary-entries'. It sends the data directly to
971 the printer. You can customize it like `lpr-region' (*note Hardcopy::).
973 The command `M-x diary' displays the diary entries for the current
974 date, independently of the calendar display, and optionally for the next
975 few days as well; the variable `number-of-diary-entries' specifies how
976 many days to include (*note Customization::).
978 If you put `(diary)' in your `.emacs' file, this automatically
979 displays a window with the day's diary entries, when you enter Emacs.
980 The mode line of the displayed window shows the date and any holidays
981 that fall on that date.
983 Many users like to receive notice of events in their diary as email.
984 To send such mail to yourself, use the command `M-x
985 diary-mail-entries'. A prefix argument specifies how many days
986 (starting with today) to check; otherwise, the variable
987 `diary-mail-days' says how many days.
990 File: xemacs.info, Node: Format of Diary File, Next: Date Formats, Prev: Diary Commands, Up: Diary
995 Your "diary file" is a file that records events associated with
996 particular dates. The name of the diary file is specified by the
997 variable `diary-file'; `~/diary' is the default. The `calendar'
998 utility program supports a subset of the format allowed by the Emacs
999 diary facilities, so you can use that utility to view the diary file,
1000 with reasonable results aside from the entries it cannot understand.
1002 Each entry in the diary file describes one event and consists of one
1003 or more lines. An entry always begins with a date specification at the
1004 left margin. The rest of the entry is simply text to describe the
1005 event. If the entry has more than one line, then the lines after the
1006 first must begin with whitespace to indicate they continue a previous
1007 entry. Lines that do not begin with valid dates and do not continue a
1008 preceding entry are ignored.
1010 You can inhibit the marking of certain diary entries in the calendar
1011 window; to do this, insert an ampersand (`&') at the beginning of the
1012 entry, before the date. This has no effect on display of the entry in
1013 the diary window; it affects only marks on dates in the calendar
1014 window. Nonmarking entries are especially useful for generic entries
1015 that would otherwise mark many different dates.
1017 If the first line of a diary entry consists only of the date or day
1018 name with no following blanks or punctuation, then the diary window
1019 display doesn't include that line; only the continuation lines appear.
1020 For example, this entry:
1023 Bill B. visits Princeton today
1024 2pm Cognitive Studies Committee meeting
1025 2:30-5:30 Liz at Lawrenceville
1027 7:30pm Dinner at George's
1028 8:00-10:00pm concert
1030 appears in the diary window without the date line at the beginning.
1031 This style of entry looks neater when you display just a single day's
1032 entries, but can cause confusion if you ask for more than one day's
1035 You can edit the diary entries as they appear in the window, but it
1036 is important to remember that the buffer displayed contains the _entire_
1037 diary file, with portions of it concealed from view. This means, for
1038 instance, that the `C-f' (`forward-char') command can put point at what
1039 appears to be the end of the line, but what is in reality the middle of
1040 some concealed line.
1042 _Be careful when editing the diary entries!_ Inserting additional
1043 lines or adding/deleting characters in the middle of a visible line
1044 cannot cause problems, but editing at the end of a line may not do what
1045 you expect. Deleting a line may delete other invisible entries that
1046 follow it. Before editing the diary, it is best to display the entire
1047 file with `s' (`show-all-diary-entries').
1050 File: xemacs.info, Node: Date Formats, Next: Adding to Diary, Prev: Format of Diary File, Up: Diary
1055 Here are some sample diary entries, illustrating different ways of
1056 formatting a date. The examples all show dates in American order
1057 (month, day, year), but Calendar mode supports European order (day,
1058 month, year) as an option.
1060 4/20/93 Switch-over to new tabulation system
1061 apr. 25 Start tabulating annual results
1062 4/30 Results for April are due
1063 */25 Monthly cycle finishes
1064 Friday Don't leave without backing up files
1066 The first entry appears only once, on April 20, 1993. The second and
1067 third appear every year on the specified dates, and the fourth uses a
1068 wildcard (asterisk) for the month, so it appears on the 25th of every
1069 month. The final entry appears every week on Friday.
1071 You can use just numbers to express a date, as in `MONTH/DAY' or
1072 `MONTH/DAY/YEAR'. This must be followed by a nondigit. In the date
1073 itself, MONTH and DAY are numbers of one or two digits. The optional
1074 YEAR is also a number, and may be abbreviated to the last two digits;
1075 that is, you can use `11/12/1989' or `11/12/89'.
1077 Dates can also have the form `MONTHNAME DAY' or `MONTHNAME DAY,
1078 YEAR', where the month's name can be spelled in full or abbreviated to
1079 three characters (with or without a period). Case is not significant.
1081 A date may be "generic"; that is, partially unspecified. Then the
1082 entry applies to all dates that match the specification. If the date
1083 does not contain a year, it is generic and applies to any year.
1084 Alternatively, MONTH, DAY, or YEAR can be a `*'; this matches any
1085 month, day, or year, respectively. Thus, a diary entry `3/*/*' matches
1086 any day in March of any year; so does `march *'.
1088 If you prefer the European style of writing dates--in which the day
1089 comes before the month--type `M-x european-calendar' while in the
1090 calendar, or set the variable `european-calendar-style' to `t' _before_
1091 using any calendar or diary command. This mode interprets all dates in
1092 the diary in the European manner, and also uses European style for
1093 displaying diary dates. (Note that there is no comma after the
1094 MONTHNAME in the European style.) To go back to the (default) American
1095 style of writing dates, type `M-x american-calendar'.
1097 You can use the name of a day of the week as a generic date which
1098 applies to any date falling on that day of the week. You can abbreviate
1099 the day of the week to three letters (with or without a period) or spell
1100 it in full; case is not significant.
1103 File: xemacs.info, Node: Adding to Diary, Next: Special Diary Entries, Prev: Date Formats, Up: Diary
1105 Commands to Add to the Diary
1106 ----------------------------
1108 While in the calendar, there are several commands to create diary
1112 Add a diary entry for the selected date (`insert-diary-entry').
1115 Add a diary entry for the selected day of the week
1116 (`insert-weekly-diary-entry').
1119 Add a diary entry for the selected day of the month
1120 (`insert-monthly-diary-entry').
1123 Add a diary entry for the selected day of the year
1124 (`insert-yearly-diary-entry').
1126 You can make a diary entry for a specific date by selecting that date
1127 in the calendar window and typing the `i d' command. This command
1128 displays the end of your diary file in another window and inserts the
1129 date; you can then type the rest of the diary entry.
1131 If you want to make a diary entry that applies to a specific day of
1132 the week, select that day of the week (any occurrence will do) and type
1133 `i w'. This inserts the day-of-week as a generic date; you can then
1134 type the rest of the diary entry. You can make a monthly diary entry in
1135 the same fashion. Select the day of the month, use the `i m' command,
1136 and type rest of the entry. Similarly, you can insert a yearly diary
1137 entry with the `i y' command.
1139 All of the above commands make marking diary entries by default. To
1140 make a nonmarking diary entry, give a numeric argument to the command.
1141 For example, `C-u i w' makes a nonmarking weekly diary entry.
1143 When you modify the diary file, be sure to save the file before
1147 File: xemacs.info, Node: Special Diary Entries, Prev: Adding to Diary, Up: Diary
1149 Special Diary Entries
1150 ---------------------
1152 In addition to entries based on calendar dates, the diary file can
1153 contain "sexp entries" for regular events such as anniversaries. These
1154 entries are based on Lisp expressions (sexps) that Emacs evaluates as
1155 it scans the diary file. Instead of a date, a sexp entry contains `%%'
1156 followed by a Lisp expression which must begin and end with
1157 parentheses. The Lisp expression determines which dates the entry
1160 Calendar mode provides commands to insert certain commonly used sexp
1164 Add an anniversary diary entry for the selected date
1165 (`insert-anniversary-diary-entry').
1168 Add a block diary entry for the current region
1169 (`insert-block-diary-entry').
1172 Add a cyclic diary entry starting at the date
1173 (`insert-cyclic-diary-entry').
1175 If you want to make a diary entry that applies to the anniversary of
1176 a specific date, move point to that date and use the `i a' command.
1177 This displays the end of your diary file in another window and inserts
1178 the anniversary description; you can then type the rest of the diary
1179 entry. The entry looks like this:
1181 The effect of `i a' is to add a `diary-anniversary' sexp to your
1182 diary file. You can also add one manually, for instance:
1184 %%(diary-anniversary 10 31 1948) Arthur's birthday
1186 This entry applies to October 31 in any year after 1948; `10 31 1948'
1187 specifies the date. (If you are using the European calendar style, the
1188 month and day are interchanged.) The reason this expression requires a
1189 beginning year is that advanced diary functions can use it to calculate
1190 the number of elapsed years.
1192 A "block" diary entry applies to a specified range of consecutive
1193 dates. Here is a block diary entry that applies to all dates from June
1194 24, 1990 through July 10, 1990:
1196 %%(diary-block 6 24 1990 7 10 1990) Vacation
1198 The `6 24 1990' indicates the starting date and the `7 10 1990'
1199 indicates the stopping date. (Again, if you are using the European
1200 calendar style, the month and day are interchanged.)
1202 To insert a block entry, place point and the mark on the two dates
1203 that begin and end the range, and type `i b'. This command displays
1204 the end of your diary file in another window and inserts the block
1205 description; you can then type the diary entry.
1207 "Cyclic" diary entries repeat after a fixed interval of days. To
1208 create one, select the starting date and use the `i c' command. The
1209 command prompts for the length of interval, then inserts the entry,
1210 which looks like this:
1212 %%(diary-cyclic 50 3 1 1990) Renew medication
1214 This entry applies to March 1, 1990 and every 50th day following; `3 1
1215 1990' specifies the starting date. (If you are using the European
1216 calendar style, the month and day are interchanged.)
1218 All three of these commands make marking diary entries. To insert a
1219 nonmarking entry, give a numeric argument to the command. For example,
1220 `C-u i a' makes a nonmarking anniversary diary entry.
1222 Marking sexp diary entries in the calendar is _extremely_
1223 time-consuming, since every date visible in the calendar window must be
1224 individually checked. So it's a good idea to make sexp diary entries
1225 nonmarking (with `&') when possible.
1227 Another sophisticated kind of sexp entry, a "floating" diary entry,
1228 specifies a regularly occurring event by offsets specified in days,
1229 weeks, and months. It is comparable to a crontab entry interpreted by
1230 the `cron' utility. Here is a nonmarking, floating diary entry that
1231 applies to the last Thursday in November:
1233 &%%(diary-float 11 4 -1) American Thanksgiving
1235 The 11 specifies November (the eleventh month), the 4 specifies Thursday
1236 (the fourth day of the week, where Sunday is numbered zero), and the -1
1237 specifies "last" (1 would mean "first", 2 would mean "second", -2 would
1238 mean "second-to-last", and so on). The month can be a single month or
1239 a list of months. Thus you could change the 11 above to `'(1 2 3)' and
1240 have the entry apply to the last Thursday of January, February, and
1241 March. If the month is `t', the entry applies to all months of the
1244 The sexp feature of the diary allows you to specify diary entries
1245 based on any Emacs Lisp expression. You can use the library of built-in
1246 functions or you can write your own functions. The built-in functions
1247 include the ones shown in this section, plus a few others (*note Sexp
1250 The generality of sexps lets you specify any diary entry that you can
1251 describe algorithmically. Suppose you get paid on the 21st of the month
1252 if it is a weekday, and to the Friday before if the 21st is on a
1253 weekend. The diary entry
1255 &%%(let ((dayname (calendar-day-of-week date))
1256 (day (car (cdr date))))
1257 (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
1258 (and (memq day '(19 20)) (= dayname 5)))
1259 ) Pay check deposited
1261 to just those dates. This example illustrates how the sexp can depend
1262 on the variable `date'; this variable is a list (MONTH DAY YEAR) that
1263 gives the Gregorian date for which the diary entries are being found.
1264 If the value of the sexp is `t', the entry applies to that date. If
1265 the sexp evaluates to `nil', the entry does _not_ apply to that date.