1 This is Info file ../../info/xemacs.info, produced by Makeinfo version
2 1.68 from the input file xemacs.texi.
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: Basic Picture, Next: Insert in Picture, Prev: Picture, Up: Picture
35 Basic Editing in Picture Mode
36 =============================
38 Most keys do the same thing in Picture mode that they usually do,
39 but do it in a quarter-plane style. For example, `C-f' is rebound to
40 run `picture-forward-column', which moves point one column to the
41 right, by inserting a space if necessary, so that the actual end of the
42 line makes no difference. `C-b' is rebound to run
43 `picture-backward-column', which always moves point left one column,
44 converting a tab to multiple spaces if necessary. `C-n' and `C-p' are
45 rebound to run `picture-move-down' and `picture-move-up', which can
46 either insert spaces or convert tabs as necessary to make sure that
47 point stays in exactly the same column. `C-e' runs
48 `picture-end-of-line', which moves to after the last non-blank
49 character on the line. There was no need to change `C-a', as the choice
50 of screen model does not affect beginnings of lines.
52 Insertion of text is adapted to the quarter-plane screen model
53 through the use of Overwrite mode (*note Minor Modes::.).
54 Self-inserting characters replace existing text, column by column,
55 rather than pushing existing text to the right. <RET> runs
56 `picture-newline', which just moves to the beginning of the following
57 line so that new text will replace that line.
59 Text is erased instead of deleted and killed. <DEL>
60 (`picture-backward-clear-column') replaces the preceding character with
61 a space rather than removing it. `C-d' (`picture-clear-column') does
62 the same in a forward direction. `C-k' (`picture-clear-line') really
63 kills the contents of lines, but never removes the newlines from a
66 To do actual insertion, you must use special commands. `C-o'
67 (`picture-open-line') creates a blank line, but does so after the
68 current line; it never splits a line. `C-M-o', `split-line', makes
69 sense in Picture mode, so it remains unchanged. <LFD>
70 (`picture-duplicate-line') inserts another line with the same contents
71 below the current line.
73 To actually delete parts of the picture, use `C-w', or with `C-c
74 C-d' (which is defined as `delete-char', as `C-d' is in other modes),
75 or with one of the picture rectangle commands (*note Rectangles in
79 File: xemacs.info, Node: Insert in Picture, Next: Tabs in Picture, Prev: Basic Picture, Up: Picture
81 Controlling Motion After Insert
82 ===============================
84 Since "self-inserting" characters just overwrite and move point in
85 Picture mode, there is no essential restriction on how point should be
86 moved. Normally point moves right, but you can specify any of the eight
87 orthogonal or diagonal directions for motion after a "self-inserting"
88 character. This is useful for drawing lines in the buffer.
91 Move left after insertion (`picture-movement-left').
94 Move right after insertion (`picture-movement-right').
97 Move up after insertion (`picture-movement-up').
100 Move down after insertion (`picture-movement-down').
103 Move up and left ("northwest") after insertion
104 (`picture-movement-nw').
107 Move up and right ("northeast") after insertion
108 (`picture-movement-ne').
111 Move down and left ("southwest") after insertion
112 (`picture-movement-sw').
115 Move down and right ("southeast") after insertion
116 (`picture-movement-se').
118 Two motion commands move based on the current Picture insertion
119 direction. The command `C-c C-f' (`picture-motion') moves in the same
120 direction as motion after "insertion" currently does, while `C-c C-b'
121 (`picture-motion-reverse') moves in the opposite direction.
124 File: xemacs.info, Node: Tabs in Picture, Next: Rectangles in Picture, Prev: Insert in Picture, Up: Picture
129 Two kinds of tab-like action are provided in Picture mode.
130 Context-based tabbing is done with `M-<TAB>' (`picture-tab-search').
131 With no argument, it moves to a point underneath the next "interesting"
132 character that follows whitespace in the previous non-blank line.
133 "Next" here means "appearing at a horizontal position greater than the
134 one point starts out at". With an argument, as in `C-u M-<TAB>', the
135 command moves to the next such interesting character in the current
136 line. `M-<TAB>' does not change the text; it only moves point.
137 "Interesting" characters are defined by the variable
138 `picture-tab-chars', which contains a string of characters considered
139 interesting. Its default value is `"!-~"'.
141 <TAB> itself runs `picture-tab', which operates based on the current
142 tab stop settings; it is the Picture mode equivalent of
143 `tab-to-tab-stop'. Without arguments it just moves point, but with a
144 numeric argument it clears the text that it moves over.
146 The context-based and tab-stop-based forms of tabbing are brought
147 together by the command `C-c <TAB>' (`picture-set-tab-stops'.) This
148 command sets the tab stops to the positions which `M-<TAB>' would
149 consider significant in the current line. If you use this command with
150 <TAB>, you can get the effect of context-based tabbing. But `M-<TAB>'
151 is more convenient in the cases where it is sufficient.
154 File: xemacs.info, Node: Rectangles in Picture, Prev: Tabs in Picture, Up: Picture
156 Picture Mode Rectangle Commands
157 ===============================
159 Picture mode defines commands for working on rectangular pieces of
160 the text in ways that fit with the quarter-plane model. The standard
161 rectangle commands may also be useful (*note Rectangles::.).
164 Clear out the region-rectangle (`picture-clear-rectangle'). With
168 Similar but save rectangle contents in register R first
169 (`picture-clear-rectangle-to-register').
172 Copy last killed rectangle into the buffer by overwriting, with
173 upper left corner at point (`picture-yank-rectangle'). With
174 argument, insert instead.
177 Similar, but use the rectangle in register R
178 (`picture-yank-rectangle-from-register').
180 The picture rectangle commands `C-c C-k' (`picture-clear-rectangle')
181 and `C-c C-w' (`picture-clear-rectangle-to-register') differ from the
182 standard rectangle commands in that they normally clear the rectangle
183 instead of deleting it; this is analogous with the way `C-d' is changed
186 However, deletion of rectangles can be useful in Picture mode, so
187 these commands delete the rectangle if given a numeric argument.
189 The Picture mode commands for yanking rectangles differ from the
190 standard ones in overwriting instead of inserting. This is the same
191 way that Picture mode insertion of other text is different from other
192 modes. `C-c C-y' (`picture-yank-rectangle') inserts (by overwriting)
193 the rectangle that was most recently killed, while `C-c C-x'
194 (`picture-yank-rectangle-from-register') does for the rectangle found
195 in a specified register.
197 Since most region commands in Picture mode operate on rectangles,
198 when you select a region of text with the mouse in Picture mode, it is
199 highlighted as a rectangle.
202 File: xemacs.info, Node: Sending Mail, Next: Reading Mail, Prev: Picture, Up: Top
207 To send a message in Emacs, start by typing the command (`C-x m') to
208 select and initialize the `*mail*' buffer. You can then edit the text
209 and headers of the message in the mail buffer, and type the command
210 (`C-c C-c') to send the message.
213 Begin composing a message to send (`mail').
216 Likewise, but display the message in another window
217 (`mail-other-window').
220 In Mail mode, send the message and switch to another buffer
221 (`mail-send-and-exit').
223 The command `C-x m' (`mail') selects a buffer named `*mail*' and
224 initializes it with the skeleton of an outgoing message. `C-x 4 m'
225 (`mail-other-window') selects the `*mail*' buffer in a different
226 window, leaving the previous current buffer visible.
228 Because the buffer for mail composition is an ordinary Emacs buffer,
229 you can switch to other buffers while in the middle of composing mail,
230 and switch back later (or never). If you use the `C-x m' command again
231 when you have been composing another message but have not sent it, a
232 new mail buffer will be created; in this way, you can compose multiple
233 messages at once. You can switch back to and complete an unsent
234 message by using the normal buffer selection mechanisms.
236 `C-u C-x m' is another way to switch back to a message in progress:
237 it will search for an existing, unsent mail message buffer and select
242 * Format: Mail Format. Format of the mail being composed.
243 * Headers: Mail Headers. Details of allowed mail header fields.
244 * Mode: Mail Mode. Special commands for editing mail being composed.
247 File: xemacs.info, Node: Mail Format, Next: Mail Headers, Prev: Sending Mail, Up: Sending Mail
249 The Format of the Mail Buffer
250 =============================
252 In addition to the "text" or contents, a message has "header
253 fields", which say who sent it, when, to whom, why, and so on. Some
254 header fields, such as the date and sender, are created automatically
255 after the message is sent. Others, such as the recipient names, must
256 be specified by you in order to send the message properly.
258 Mail mode provides a few commands to help you edit some header
259 fields, and some are preinitialized in the buffer automatically at
260 times. You can insert or edit any header fields using ordinary editing
263 The line in the buffer that says:
265 --text follows this line--
267 is a special delimiter that separates the headers you have specified
268 from the text. Whatever follows this line is the text of the message;
269 the headers precede it. The delimiter line itself does not appear in
270 the message actually sent. The text used for the delimiter line is
271 controlled by the variable `mail-header-separator'.
273 Here is an example of what the headers and text in the `*mail*'
274 buffer might look like.
278 Subject: The XEmacs User's Manual
279 --Text follows this line--
280 Please ignore this message.
283 File: xemacs.info, Node: Mail Headers, Next: Mail Mode, Prev: Mail Format, Up: Sending Mail
288 There are several header fields you can use in the `*mail*' buffer.
289 Each header field starts with a field name at the beginning of a line,
290 terminated by a colon. It does not matter whether you use upper or
291 lower case in the field name. After the colon and optional whitespace
292 comes the contents of the field.
295 This field contains the mailing addresses of the message.
298 The contents of the `Subject' field should be a piece of text that
299 says what the message is about. Subject fields are useful because
300 most mail-reading programs can provide a summary of messages,
301 listing the subject of each message but not its text.
304 This field contains additional mailing addresses to send the
305 message to, but whose readers should not regard the message as
309 This field contains additional mailing addresses to send the
310 message to, but which should not appear in the header of the
311 message actually sent.
314 This field contains the name of one file (in Unix mail file
315 format) to which a copy of the message should be appended when the
319 Use the `From' field to say who you are, when the account you are
320 using to send the mail is not your own. The contents of the
321 `From' field should be a valid mailing address, since replies will
325 Use the `Reply-To' field to direct replies to a different address,
326 not your own. `From' and `Reply-To' have the same effect on where
327 replies go, but they convey a different meaning to the person who
331 This field contains a piece of text describing a message you are
332 replying to. Some mail systems can use the information to
333 correlate related pieces of mail. This field is normally filled
334 in by your mail handling package when you are replying to a
335 message and you never need to think about it.
337 The `To', `CC', `BCC' and `FCC' fields can appear any number of times,
338 to specify many places to send the message.
340 The `To', `CC', and `BCC', fields can have continuation lines. All the
341 lines starting with whitespace, following the line on which the field
342 starts, are considered part of the field. For example,
344 To: foo@here, this@there,
345 me@gnu.cambridge.mass.usa.earth.spiral3281
347 If you have a `~/.mailrc' file, Emacs scans it for mail aliases the
348 first time you try to send mail in an Emacs session. Emacs expands
349 aliases found in the `To', `CC', and `BCC' fields where appropriate.
350 You can set the variable `mail-abbrev-mailrc-file' to the name of the
351 file with mail aliases. If `nil', `~/.mailrc' is used.
353 Your `.mailrc' file ensures that word-abbrevs are defined for each
354 of your mail aliases when point is in a `To', `CC', `BCC', or `From'
355 field. The aliases are defined in your `.mailrc' file or in a file
356 specified by the MAILRC environment variable if it exists. Your mail
357 aliases expand any time you type a word-delimiter at the end of an
360 In this version of Emacs, what you see is what you get: in contrast
361 to some other versions, no abbreviations are expanded after you have
362 sent the mail. This means you don't suffer the annoyance of having the
363 system do things behind your back -- if the system rewrites an address
364 you typed, you know it immediately, instead of after the mail has been
365 sent and it's too late to do anything about it. For example, you will
366 never again be in trouble because you forgot to delete an old alias
367 from your `.mailrc' and a new local user is given a userid which
368 conflicts with one of your aliases.
370 Your mail alias abbrevs are in effect only when point is in an
371 appropriate header field. The mail aliases will not expand in the body
372 of the message, or in other header fields. The default mode-specific
373 abbrev table `mail-mode-abbrev-table' is used instead if defined. That
374 means if you have been using mail-mode specific abbrevs, this code will
375 not adversely affect you. You can control which header fields the
376 abbrevs are used in by changing the variable `mail-abbrev-mode-regexp'.
378 If auto-fill mode is on, abbrevs wrap at commas instead of at word
379 boundaries, and header continuation lines will be properly indented.
381 You can also insert a mail alias with
382 `mail-interactive-insert-alias'. This function, which is bound to `C-c
383 C-a', prompts you for an alias (with completion) and inserts its
386 In this version of Emacs, it is possible to have lines like the
387 following in your `.mailrc' file:
389 alias someone "John Doe <doe@quux.com>"
391 That is, if you want an address to have embedded spaces, simply
392 surround it with double-quotes. The quotes are necessary because the
393 format of the `.mailrc' file uses spaces as address delimiters.
395 Aliases in the `.mailrc' file may be nested. For example, assume you
397 alias group1 fred ethel
398 alias group2 larry curly moe
399 alias everybody group1 group2
401 When you now type `everybody' on the `To' line, it will expand to:
402 fred, ethyl, larry, curly, moe
404 Aliases may contain forward references; the alias of `everybody' in
405 the example above can precede the aliases of `group1' and `group2'.
407 In this version of Emacs, you can use the `source' `.mailrc' command
408 for reading aliases from some other file as well.
410 Aliases may contain hyphens, as in `"alias foo-bar foo@bar"', even
411 though word-abbrevs normally cannot contain hyphens.
413 To read in the contents of another `.mailrc'-type file from Emacs,
414 use the command `M-x merge-mail-aliases'. The `rebuild-mail-aliases'
415 command is similar, but deletes existing aliases first.
417 If you want multiple addresses separated by a string other than `,'
418 (a comma), then set the variable `mail-alias-seperator-string' to it.
419 This has to be a comma bracketed by whitespace if you want any kind of
422 If the variable `mail-archive-file-name' is non-`nil', it should be
423 a string naming a file. Each time you start to edit a message to send,
424 an `FCC' field is entered for that file. Unless you remove the `FCC'
425 field, every message is written into that file when it is sent.
428 File: xemacs.info, Node: Mail Mode, Prev: Mail Headers, Up: Sending Mail
433 The major mode used in the `*mail*' buffer is Mail mode. Mail mode
434 is similar to Text mode, but several commands are provided on the `C-c'
435 prefix. These commands all deal specifically with editing or sending
439 Send the message, and leave the `*mail*' buffer selected
443 Send the message, and select some other buffer
444 (`mail-send-and-exit').
447 Move to the `To' header field, creating one if there is none
451 Move to the `Subject' header field, creating one if there is none
455 Move to the `CC' header field, creating one if there is none
459 Insert the file `~/.signature' at the end of the message text
463 Yank the selected message (`mail-yank-original').
466 Fill all paragraphs of yanked old messages, each individually
467 (`mail-fill-yanked-message').
470 Pops up a menu of useful mail-mode commands.
472 There are two ways to send a message. `C-c C-c'
473 (`mail-send-and-exit') is the usual way to send the message. It sends
474 the message and then deletes the window (if there is another window) or
475 switches to another buffer. It puts the `*mail*' buffer at the lowest
476 priority for automatic reselection, since you are finished with using
477 it. `C-c C-s' (`mail-send') sends the message and marks the `*mail*'
478 buffer unmodified, but leaves that buffer selected so that you can
479 modify the message (perhaps with new recipients) and send it again.
481 Mail mode provides some other special commands that are useful for
482 editing the headers and text of the message before you send it. There
483 are three commands defined to move point to particular header fields,
484 all based on the prefix `C-c C-f' (`C-f' is for "field"). They are
485 `C-c C-f C-t' (`mail-to') to move to the `To' field, `C-c C-f C-s'
486 (`mail-subject') for the `Subject' field, and `C-c C-f C-c' (`mail-cc')
487 for the `CC' field. These fields have special motion commands because
488 they are edited most frequently.
490 `C-c C-w' (`mail-signature') adds a standard piece of text at the
491 end of the message to say more about who you are. The text comes from
492 the file `.signature' in your home directory.
494 When you use an Rmail command to send mail from the Rmail mail
495 reader, you can use `C-c C-y' `mail-yank-original' inside the `*mail*'
496 buffer to insert the text of the message you are replying to. Normally
497 Rmail indents each line of that message four spaces and eliminates most
498 header fields. A numeric argument specifies the number of spaces to
499 indent. An argument of just `C-u' says not to indent at all and not to
500 eliminate anything. `C-c C-y' always uses the current message from the
501 `RMAIL' buffer, so you can insert several old messages by selecting one
502 in `RMAIL', switching to `*mail*' and yanking it, then switching back
503 to `RMAIL' to select another.
505 After using `C-c C-y', you can use the command `C-c C-q'
506 (`mail-fill-yanked-message') to fill the paragraphs of the yanked old
507 message or messages. One use of `C-c C-q' fills all such paragraphs,
510 Clicking the right mouse button in a mail buffer pops up a menu of
511 the above commands, for easy access.
513 Turning on Mail mode (which `C-x m' does automatically) calls the
514 value of `text-mode-hook', if it is not void or `nil', and then calls
515 the value of `mail-mode-hook' if that is not void or `nil'.
518 File: xemacs.info, Node: Reading Mail, Next: Calendar/Diary, Prev: Sending Mail, Up: Top
523 XEmacs provides three separate mail-reading packages. Each one
524 comes with its own manual, which is included standard with the XEmacs
527 The recommended mail-reading package for new users is VM. VM works
528 with standard Unix-mail-format folders and was designed as a replacement
531 XEmacs also provides a sophisticated and comfortable front-end to the
532 MH mail-processing system, called `mh-e'. Unlike in other mail
533 programs, folders in MH are stored as file-system directories, with
534 each message occupying one (numbered) file. This facilitates working
535 with mail using shell commands, and many other features of MH are also
536 designed to integrate well with the shell and with shell scripts. Keep
537 in mind, however, that in order to use mh-e you must have the MH
538 mail-processing system installed on your computer.
540 Finally, XEmacs provides the Rmail package. Rmail is (currently) the
541 only mail reading package distributed with FSF GNU Emacs, and is
542 powerful in its own right. However, it stores mail folders in a special
543 format called `Babyl', that is incompatible with all other
544 frequently-used mail programs. A utility program is provided for
545 converting Babyl folders to standard Unix-mail format; however, unless
546 you already have mail in Babyl-format folders, you should consider
547 using VM or mh-e instead. (If at times you have to use FSF Emacs, it is
548 not hard to obtain and install VM for that editor.)
551 File: xemacs.info, Node: Calendar/Diary, Next: Sorting, Prev: Reading Mail, Up: Top
553 Calendar Mode and the Diary
554 ===========================
556 Emacs provides the functions of a desk calendar, with a diary of
557 planned or past events. To enter the calendar, type `M-x calendar';
558 this displays a three-month calendar centered on the current month, with
559 point on the current date. With a numeric argument, as in `C-u M-x
560 calendar', it prompts you for the month and year to be the center of the
561 three-month calendar. The calendar uses its own buffer, whose major
562 mode is Calendar mode.
564 `Button2' in the calendar brings up a menu of operations on a
565 particular date; `Buttons3' brings up a menu of commonly used calendar
566 features that are independent of any particular date. To exit the
567 calendar, type `q'. *Note Customizing the Calendar and Diary:
568 (elisp)Calendar, for customization information about the calendar and
573 * Calendar Motion:: Moving through the calendar; selecting a date.
574 * Scroll Calendar:: Bringing earlier or later months onto the screen.
575 * Mark and Region:: Remembering dates, the mark ring.
576 * General Calendar:: Exiting or recomputing the calendar.
577 * LaTeX Calendar:: Print a calendar using LaTeX.
578 * Holidays:: Displaying dates of holidays.
579 * Sunrise/Sunset:: Displaying local times of sunrise and sunset.
580 * Lunar Phases:: Displaying phases of the moon.
581 * Other Calendars:: Converting dates to other calendar systems.
582 * Diary:: Displaying events from your diary.
583 * Calendar Customization:: Altering the behavior of the features above.
586 File: xemacs.info, Node: Calendar Motion, Next: Scroll Calendar, Prev: Calendar/Diary, Up: Calendar/Diary
588 Movement in the Calendar
589 ------------------------
591 Calendar mode lets you move through the calendar in logical units of
592 time such as days, weeks, months, and years. If you move outside the
593 three months originally displayed, the calendar display "scrolls"
594 automatically through time to make the selected date visible. Moving to
595 a date lets you view its holidays or diary entries, or convert it to
596 other calendars; moving longer time periods is also useful simply to
601 * Calendar Unit Motion:: Moving by days, weeks, months, and years.
602 * Move to Beginning or End:: Moving to start/end of weeks, months, and years.
603 * Specified Dates:: Moving to the current date or another
607 File: xemacs.info, Node: Calendar Unit Motion, Next: Move to Beginning or End, Prev: Calendar Motion, Up: Calendar Motion
609 Motion by Integral Days, Weeks, Months, Years
610 .............................................
612 The commands for movement in the calendar buffer parallel the
613 commands for movement in text. You can move forward and backward by
614 days, weeks, months, and years.
617 Move point one day forward (`calendar-forward-day').
620 Move point one day backward (`calendar-backward-day').
623 Move point one week forward (`calendar-forward-week').
626 Move point one week backward (`calendar-backward-week').
629 Move point one month forward (`calendar-forward-month').
632 Move point one month backward (`calendar-backward-month').
635 Move point one year forward (`calendar-forward-year').
638 Move point one year backward (`calendar-backward-year').
640 The day and week commands are natural analogues of the usual Emacs
641 commands for moving by characters and by lines. Just as `C-n' usually
642 moves to the same column in the following line, in Calendar mode it
643 moves to the same day in the following week. And `C-p' moves to the
644 same day in the previous week.
646 The arrow keys are equivalent to `C-f', `C-b', `C-n' and `C-p', just
647 as they normally are in other modes.
649 The commands for motion by months and years work like those for
650 weeks, but move a larger distance. The month commands `M-}' and `M-{'
651 move forward or backward by an entire month's time. The year commands
652 `C-x ]' and `C-x [' move forward or backward a whole year.
654 The easiest way to remember these commands is to consider months and
655 years analogous to paragraphs and pages of text, respectively. But the
656 commands themselves are not quite analogous. The ordinary Emacs
657 paragraph commands move to the beginning or end of a paragraph, whereas
658 these month and year commands move by an entire month or an entire
659 year, which usually involves skipping across the end of a month or year.
661 All these commands accept a numeric argument as a repeat count. For
662 convenience, the digit keys and the minus sign specify numeric
663 arguments in Calendar mode even without the Meta modifier. For example,
664 `100 C-f' moves point 100 days forward from its present location.
667 File: xemacs.info, Node: Move to Beginning or End, Next: Specified Dates, Prev: Calendar Unit Motion, Up: Calendar Motion
669 Beginning or End of Week, Month or Year
670 .......................................
672 A week (or month, or year) is not just a quantity of days; we think
673 of weeks (months, years) as starting on particular dates. So Calendar
674 mode provides commands to move to the beginning or end of a week, month
678 Move point to start of week (`calendar-beginning-of-week').
681 Move point to end of week (`calendar-end-of-week').
684 Move point to start of month (`calendar-beginning-of-month').
687 Move point to end of month (`calendar-end-of-month').
690 Move point to start of year (`calendar-beginning-of-year').
693 Move point to end of year (`calendar-end-of-year').
695 These commands also take numeric arguments as repeat counts, with the
696 repeat count indicating how many weeks, months, or years to move
699 By default, weeks begin on Sunday. To make them begin on Monday
700 instead, set the variable `calendar-week-start-day' to 1.
703 File: xemacs.info, Node: Specified Dates, Prev: Move to Beginning or End, Up: Calendar Motion
708 Calendar mode provides commands for moving to a particular date
709 specified in various ways.
712 Move point to specified date (`calendar-goto-date').
715 Center calendar around specified month (`calendar-other-month').
718 Move point to today's date (`calendar-goto-today').
720 `g d' (`calendar-goto-date') prompts for a year, a month, and a day
721 of the month, and then moves to that date. Because the calendar
722 includes all dates from the beginning of the current era, you must type
723 the year in its entirety; that is, type `1990', not `90'.
725 `o' (`calendar-other-month') prompts for a month and year, then
726 centers the three-month calendar around that month.
728 You can return to today's date with `.' (`calendar-goto-today').
731 File: xemacs.info, Node: Scroll Calendar, Next: Mark and Region, Prev: Calendar Motion, Up: Calendar/Diary
733 Scrolling the Calendar through Time
734 -----------------------------------
736 The calendar display scrolls automatically through time when you
737 move out of the visible portion. You can also scroll it manually.
738 Imagine that the calendar window contains a long strip of paper with
739 the months on it. Scrolling it means moving the strip so that new
740 months become visible in the window.
743 Scroll calendar one month forward (`scroll-calendar-left').
746 Scroll calendar one month backward (`scroll-calendar-right').
750 Scroll calendar three months forward
751 (`scroll-calendar-left-three-months').
755 Scroll calendar three months backward
756 (`scroll-calendar-right-three-months').
758 The most basic calendar scroll commands scroll by one month at a
759 time. This means that there are two months of overlap between the
760 display before the command and the display after. `C-x <' scrolls the
761 calendar contents one month to the left; that is, it moves the display
762 forward in time. `C-x >' scrolls the contents to the right, which
763 moves backwards in time.
765 The commands `C-v' and `M-v' scroll the calendar by an entire
766 "screenful"--three months--in analogy with the usual meaning of these
767 commands. `C-v' makes later dates visible and `M-v' makes earlier
768 dates visible. These commands take a numeric argument as a repeat
769 count; in particular, since `C-u' multiplies the next command by four,
770 typing `C-u C-v' scrolls the calendar forward by a year and typing `C-u
771 M-v' scrolls the calendar backward by a year.
773 The function keys <NEXT> and <PRIOR> are equivalent to `C-v' and
774 `M-v', just as they are in other modes.
777 File: xemacs.info, Node: Mark and Region, Next: General Calendar, Prev: Scroll Calendar, Up: Calendar/Diary
779 The Mark and the Region
780 -----------------------
782 The concept of the mark applies to the calendar just as to any other
783 buffer, but it marks a *date*, not a *position* in the buffer. The
784 region consists of the days between the mark and point (including the
785 starting and stopping dates).
788 Set the mark to today's date (`calendar-set-mark').
794 Interchange mark and point (`calendar-exchange-point-and-mark').
797 Display the number of days in the current region
798 (`calendar-count-days-region').
800 You set the mark in the calendar, as in any other buffer, by using
801 `C-@' or `C-SPC' (`calendar-set-mark'). You return to the marked date
802 with the command `C-x C-x' (`calendar-exchange-point-and-mark') which
803 puts the mark where point was and point where mark was. The calendar
804 is scrolled as necessary, if the marked date was not visible on the
805 screen. This does not change the extent of the region.
807 To determine the number of days in the region, type `M-='
808 (`calendar-count-days-region'). The numbers of days printed is
809 *inclusive*; that is, it includes the days specified by mark and point.
811 The main use of the mark in the calendar is to remember dates that
812 you may want to go back to. To make this feature more useful, the mark
813 ring (*note Mark Ring::.) operates exactly as in other buffers: Emacs
814 remembers 16 previous locations of the mark. To return to a marked
815 date, type `C-u C-SPC' (or `C-u C-@'); this is the command
816 `calendar-set-mark' given a numeric argument. It moves point to where
817 the mark was, restores the mark from the ring of former marks, and
818 stores the previous point at the end of the mark ring. So, repeated
819 use of this command moves point through all the old marks on the ring,
823 File: xemacs.info, Node: General Calendar, Next: LaTeX Calendar, Prev: Mark and Region, Up: Calendar/Diary
825 Miscellaneous Calendar Commands
826 -------------------------------
829 Display day-in-year (`calendar-print-day-of-year').
832 Briefly describe calendar commands (`describe-calendar-mode').
835 Regenerate the calendar window (`redraw-calendar').
838 Scroll the next window (`scroll-other-window').
841 Exit from calendar (`exit-calendar').
843 If you want to know how many days have elapsed since the start of
844 the year, or the number of days remaining in the year, type the `p d'
845 command (`calendar-print-day-of-year'). This displays both of those
846 numbers in the echo area.
848 To display a brief description of the calendar commands, type `?'
849 (`describe-calendar-mode'). For a fuller description, type `C-h m'.
851 You can use `SPC' (`scroll-other-window') to scroll the other
852 window. This is handy when you display a list of holidays or diary
853 entries in another window.
855 If the calendar window text gets corrupted, type `C-c C-l'
856 (`redraw-calendar') to redraw it. (This can only happen if you use
857 non-Calendar-mode editing commands.)
859 In Calendar mode, you can use `SPC' (`scroll-other-window') to
860 scroll the other window. This is handy when you display a list of
861 holidays or diary entries in another window.
863 To exit from the calendar, type `q' (`exit-calendar'). This buries
864 all buffers related to the calendar, selecting other buffers. (If a
865 frame contains a dedicated calendar window, exiting from the calendar
866 iconifies that frame.)
869 File: xemacs.info, Node: LaTeX Calendar, Next: Holidays, Prev: General Calendar, Up: Calendar/Diary
874 The Calendar LaTeX commands produce a buffer of LaTeX code that
875 prints as a calendar. Depending on the command you use, the printed
876 calendar covers the day, week, month or year that point is in.
879 Generate a one-month calendar (`cal-tex-cursor-month').
882 Generate a sideways-printing one-month calendar
883 (`cal-tex-cursor-month-landscape').
886 Generate a one-day calendar (`cal-tex-cursor-day').
889 Generate a one-page calendar for one week (`cal-tex-cursor-week').
892 Generate a two-page calendar for one week (`cal-tex-cursor-week2').
895 Generate an ISO-style calendar for one week
896 (`cal-tex-cursor-week-iso').
899 Generate a calendar for one Monday-starting week
900 (`cal-tex-cursor-week-monday').
903 Generate a Filofax-style two-weeks-at-a-glance calendar
904 (`cal-tex-cursor-filofax-2week').
907 Generate a Filofax-style one-week-at-a-glance calendar
908 (`cal-tex-cursor-filofax-week').
911 Generate a calendar for one year (`cal-tex-cursor-year').
914 Generate a sideways-printing calendar for one year
915 (`cal-tex-cursor-year-landscape').
918 Generate a Filofax-style calendar for one year
919 (`cal-tex-cursor-filofax-year').
921 Some of these commands print the calendar sideways (in "landscape
922 mode"), so it can be wider than it is long. Some of them use Filofax
923 paper size (3.75in x 6.75in). All of these commands accept a prefix
924 argument which specifies how many days, weeks, months or years to print
925 (starting always with the selected one).
927 If the variable `cal-tex-holidays' is non-`nil' (the default), then
928 the printed calendars show the holidays in `calendar-holidays'. If the
929 variable `cal-tex-diary' is non-`nil' (the default is `nil'), diary
930 entries are included also (in weekly and monthly calendars only).
933 File: xemacs.info, Node: Holidays, Next: Sunrise/Sunset, Prev: LaTeX Calendar, Up: Calendar/Diary
938 The Emacs calendar knows about all major and many minor holidays,
939 and can display them.
942 Display holidays for the selected date
943 (`calendar-cursor-holidays').
946 Display any holidays for the date you click on.
949 Mark holidays in the calendar window (`mark-calendar-holidays').
952 Unmark calendar window (`calendar-unmark').
955 List all holidays for the displayed three months in another window
956 (`list-calendar-holidays').
959 List all holidays for three months around today's date in another
963 List holidays in another window for a specified range of years.
965 To see if any holidays fall on a given date, position point on that
966 date in the calendar window and use the `h' command. Alternatively,
967 click on that date with `Button2' and then choose `Holidays' from the
968 menu that appears. Either way, this displays the holidays for that
969 date, in the echo area if they fit there, otherwise in a separate
972 To view the distribution of holidays for all the dates shown in the
973 calendar, use the `x' command. This displays the dates that are
974 holidays in a different face (or places a `*' after these dates, if
975 display with multiple faces is not available). The command applies both
976 to the currently visible months and to other months that subsequently
977 become visible by scrolling. To turn marking off and erase the current
978 marks, type `u', which also erases any diary marks (*note Diary::.).
980 To get even more detailed information, use the `a' command, which
981 displays a separate buffer containing a list of all holidays in the
982 current three-month range. You can use <SPC> in the calendar window to
985 The command `M-x holidays' displays the list of holidays for the
986 current month and the preceding and succeeding months; this works even
987 if you don't have a calendar window. If you want the list of holidays
988 centered around a different month, use `C-u M-x holidays', which
989 prompts for the month and year.
991 The holidays known to Emacs include United States holidays and the
992 major Christian, Jewish, and Islamic holidays; also the solstices and
995 The command `M-x list-holidays' displays the list of holidays for a
996 range of years. This function asks you for the starting and stopping
997 years, and allows you to choose all the holidays or one of several
998 categories of holidays. You can use this command even if you don't have
1001 The dates used by Emacs for holidays are based on *current
1002 practice*, not historical fact. Historically, for instance, the start
1003 of daylight savings time and even its existence have varied from year to
1004 year, but present United States law mandates that daylight savings time
1005 begins on the first Sunday in April. When the daylight savings rules
1006 are set up for the United States, Emacs always uses the present
1007 definition, even though it is wrong for some prior years.
1010 File: xemacs.info, Node: Sunrise/Sunset, Next: Lunar Phases, Prev: Holidays, Up: Calendar/Diary
1012 Times of Sunrise and Sunset
1013 ---------------------------
1015 Special calendar commands can tell you, to within a minute or two,
1016 the times of sunrise and sunset for any date.
1019 Display times of sunrise and sunset for the selected date
1020 (`calendar-sunrise-sunset').
1022 `Button2 Sunrise/Sunset'
1023 Display times of sunrise and sunset for the date you click on.
1025 `M-x sunrise-sunset'
1026 Display times of sunrise and sunset for today's date.
1028 `C-u M-x sunrise-sunset'
1029 Display times of sunrise and sunset for a specified date.
1031 Within the calendar, to display the *local times* of sunrise and
1032 sunset in the echo area, move point to the date you want, and type `S'.
1033 Alternatively, click `Button2' on the date, then choose
1034 `Sunrise/Sunset' from the menu that appears. The command `M-x
1035 sunrise-sunset' is available outside the calendar to display this
1036 information for today's date or a specified date. To specify a date
1037 other than today, use `C-u M-x sunrise-sunset', which prompts for the
1038 year, month, and day.
1040 You can display the times of sunrise and sunset for any location and
1041 any date with `C-u C-u M-x sunrise-sunset'. This asks you for a
1042 longitude, latitude, number of minutes difference from Coordinated
1043 Universal Time, and date, and then tells you the times of sunrise and
1044 sunset for that location on that date.
1046 Because the times of sunrise and sunset depend on the location on
1047 earth, you need to tell Emacs your latitude, longitude, and location
1048 name before using these commands. Here is an example of what to set:
1050 (setq calendar-latitude 40.1)
1051 (setq calendar-longitude -88.2)
1052 (setq calendar-location-name "Urbana, IL")
1054 Use one decimal place in the values of `calendar-latitude' and
1055 `calendar-longitude'.
1057 Your time zone also affects the local time of sunrise and sunset.
1058 Emacs usually gets time zone information from the operating system, but
1059 if these values are not what you want (or if the operating system does
1060 not supply them), you must set them yourself. Here is an example:
1062 (setq calendar-time-zone -360)
1063 (setq calendar-standard-time-zone-name "CST")
1064 (setq calendar-daylight-time-zone-name "CDT")
1066 The value of `calendar-time-zone' is the number of minutes difference
1067 between your local standard time and Coordinated Universal Time
1068 (Greenwich time). The values of `calendar-standard-time-zone-name' and
1069 `calendar-daylight-time-zone-name' are the abbreviations used in your
1070 time zone. Emacs displays the times of sunrise and sunset *corrected
1071 for daylight savings time*. *Note Daylight Savings::, for how daylight
1072 savings time is determined.
1074 As a user, you might find it convenient to set the calendar location
1075 variables for your usual physical location in your `.emacs' file. And
1076 when you install Emacs on a machine, you can create a `default.el' file
1077 which sets them properly for the typical location of most users of that
1078 machine. *Note Init File::.
1081 File: xemacs.info, Node: Lunar Phases, Next: Other Calendars, Prev: Sunrise/Sunset, Up: Calendar/Diary
1086 These calendar commands display the dates and times of the phases of
1087 the moon (new moon, first quarter, full moon, last quarter). This
1088 feature is useful for debugging problems that "depend on the phase of
1092 Display the dates and times for all the quarters of the moon for
1093 the three-month period shown (`calendar-phases-of-moon').
1095 `M-x phases-of-moon'
1096 Display dates and times of the quarters of the moon for three
1097 months around today's date.
1099 Within the calendar, use the `M' command to display a separate
1100 buffer of the phases of the moon for the current three-month range. The
1101 dates and times listed are accurate to within a few minutes.
1103 Outside the calendar, use the command `M-x phases-of-moon' to
1104 display the list of the phases of the moon for the current month and the
1105 preceding and succeeding months. For information about a different
1106 month, use `C-u M-x phases-of-moon', which prompts for the month and
1109 The dates and times given for the phases of the moon are given in
1110 local time (corrected for daylight savings, when appropriate); but if
1111 the variable `calendar-time-zone' is void, Coordinated Universal Time
1112 (the Greenwich time zone) is used. *Note Daylight Savings::.
1115 File: xemacs.info, Node: Other Calendars, Next: Calendar Systems, Prev: Lunar Phases, Up: Calendar/Diary
1117 Conversion To and From Other Calendars
1118 --------------------------------------
1120 The Emacs calendar displayed is *always* the Gregorian calendar,
1121 sometimes called the "new style" calendar, which is used in most of the
1122 world today. However, this calendar did not exist before the sixteenth
1123 century and was not widely used before the eighteenth century; it did
1124 not fully displace the Julian calendar and gain universal acceptance
1125 until the early twentieth century. The Emacs calendar can display any
1126 month since January, year 1 of the current era, but the calendar
1127 displayed is the Gregorian, even for a date at which the Gregorian
1128 calendar did not exist.
1130 While Emacs cannot display other calendars, it can convert dates to
1131 and from several other calendars.
1135 * Calendar Systems:: The calendars Emacs understands
1136 (aside from Gregorian).
1137 * To Other Calendar:: Converting the selected date to various calendars.
1138 * From Other Calendar:: Moving to a date specified in another calendar.
1139 * Mayan Calendar:: Moving to a date specified in a Mayan calendar.
1141 If you are interested in these calendars, you can convert dates one
1142 at a time. Put point on the desired date of the Gregorian calendar and
1143 press the appropriate keys. The `p' is a mnemonic for "print" since
1144 Emacs "prints' the equivalent date in the echo area.
1147 File: xemacs.info, Node: Calendar Systems, Next: To Other Calendar, Prev: Other Calendars, Up: Other Calendars
1149 Supported Calendar Systems
1150 ==========================
1152 The ISO commercial calendar is used largely in Europe.
1154 The Julian calendar, named after Julius Caesar, was the one used in
1155 Europe throughout medieval times, and in many countries up until the
1158 Astronomers use a simple counting of days elapsed since noon, Monday,
1159 January 1, 4713 B.C. on the Julian calendar. The number of days elapsed
1160 is called the *Julian day number* or the *Astronomical day number*.
1162 The Hebrew calendar is used by tradition in the Jewish religion. The
1163 Emacs calendar program uses the Hebrew calendar to determine the dates
1164 of Jewish holidays. Hebrew calendar dates begin and end at sunset.
1166 The Islamic calendar is used in many predominantly Islamic countries.
1167 Emacs uses it to determine the dates of Islamic holidays. There is no
1168 universal agreement in the Islamic world about the calendar; Emacs uses
1169 a widely accepted version, but the precise dates of Islamic holidays
1170 often depend on proclamation by religious authorities, not on
1171 calculations. As a consequence, the actual dates of observance can vary
1172 slightly from the dates computed by Emacs. Islamic calendar dates begin
1175 The French Revolutionary calendar was created by the Jacobins after
1176 the 1789 revolution, to represent a more secular and nature-based view
1177 of the annual cycle, and to install a 10-day week in a rationalization
1178 measure similar to the metric system. The French government officially
1179 abandoned this calendar at the end of 1805.
1181 The Maya of Central America used three separate, overlapping calendar
1182 systems, the *long count*, the *tzolkin*, and the *haab*. Emacs knows
1183 about all three of these calendars. Experts dispute the exact
1184 correlation between the Mayan calendar and our calendar; Emacs uses the
1185 Goodman-Martinez-Thompson correlation in its calculations.
1187 The Copts use a calendar based on the ancient Egyptian solar
1188 calendar. Their calendar consists of twelve 30-day months followed by
1189 an extra five-day period. Once every fourth year they add a leap day
1190 to this extra period to make it six days. The Ethiopic calendar is
1191 identical in structure, but has different year numbers and month names.
1193 The Persians use a solar calendar based on a design of Omar Khayyam.
1194 Their calendar consists of twelve months of which the first six have 31
1195 days, the next five have 30 days, and the last has 29 in ordinary years
1196 and 30 in leap years. Leap years occur in a complicated pattern every
1199 The Chinese calendar is a complicated system of lunar months arranged
1200 into solar years. The years go in cycles of sixty, each year containing
1201 either twelve months in an ordinary year or thirteen months in a leap
1202 year; each month has either 29 or 30 days. Years, ordinary months, and
1203 days are named by combining one of ten "celestial stems" with one of
1204 twelve "terrestrial branches" for a total of sixty names that are
1205 repeated in a cycle of sixty.