This commit was generated by cvs2svn to compensate for changes in r6453,
[chise/xemacs-chise.git.1] / info / xemacs.info-13
1 This is Info file ../../info/xemacs.info, produced by Makeinfo version
2 1.68 from the input file xemacs.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * XEmacs: (xemacs).             XEmacs Editor.
7 END-INFO-DIR-ENTRY
8
9    This file documents the XEmacs editor.
10
11    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
12 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
13 Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
14
15    Permission is granted to make and distribute verbatim copies of this
16 manual provided the copyright notice and this permission notice are
17 preserved on all copies.
18
19    Permission is granted to copy and distribute modified versions of
20 this manual under the conditions for verbatim copying, provided also
21 that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
22 General Public License" are included exactly as in the original, and
23 provided that the entire resulting derived work is distributed under the
24 terms of a permission notice identical to this one.
25
26    Permission is granted to copy and distribute translations of this
27 manual into another language, under the above conditions for modified
28 versions, except that the sections entitled "The GNU Manifesto",
29 "Distribution" and "GNU General Public License" may be included in a
30 translation approved by the author instead of in the original English.
31
32 \1f
33 File: xemacs.info,  Node: Basic Picture,  Next: Insert in Picture,  Prev: Picture,  Up: Picture
34
35 Basic Editing in Picture Mode
36 =============================
37
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.
51
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.
58
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
64 buffer.
65
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.
72
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
76 Picture::.).
77
78 \1f
79 File: xemacs.info,  Node: Insert in Picture,  Next: Tabs in Picture,  Prev: Basic Picture,  Up: Picture
80
81 Controlling Motion After Insert
82 ===============================
83
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.
89
90 `C-c <'
91      Move left after insertion (`picture-movement-left').
92
93 `C-c >'
94      Move right after insertion (`picture-movement-right').
95
96 `C-c ^'
97      Move up after insertion (`picture-movement-up').
98
99 `C-c .'
100      Move down after insertion (`picture-movement-down').
101
102 `C-c `'
103      Move up and left ("northwest") after insertion
104      (`picture-movement-nw').
105
106 `C-c ''
107      Move up and right ("northeast") after insertion
108      (`picture-movement-ne').
109
110 `C-c /'
111      Move down and left ("southwest") after insertion
112      (`picture-movement-sw').
113
114 `C-c \'
115      Move down and right ("southeast") after insertion
116      (`picture-movement-se').
117
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.
122
123 \1f
124 File: xemacs.info,  Node: Tabs in Picture,  Next: Rectangles in Picture,  Prev: Insert in Picture,  Up: Picture
125
126 Picture Mode Tabs
127 =================
128
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 `"!-~"'.
140
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.
145
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.
152
153 \1f
154 File: xemacs.info,  Node: Rectangles in Picture,  Prev: Tabs in Picture,  Up: Picture
155
156 Picture Mode Rectangle Commands
157 ===============================
158
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::.).
162
163 `C-c C-k'
164      Clear out the region-rectangle (`picture-clear-rectangle').  With
165      argument, kill it.
166
167 `C-c C-w R'
168      Similar but save rectangle contents in register R first
169      (`picture-clear-rectangle-to-register').
170
171 `C-c C-y'
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.
175
176 `C-c C-x R'
177      Similar, but use the rectangle in register R
178      (`picture-yank-rectangle-from-register').
179
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
184 in Picture mode.
185
186    However, deletion of rectangles can be useful in Picture mode, so
187 these commands delete the rectangle if given a numeric argument.
188
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.
196
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.
200
201 \1f
202 File: xemacs.info,  Node: Sending Mail,  Next: Reading Mail,  Prev: Picture,  Up: Top
203
204 Sending Mail
205 ************
206
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.
211
212 `C-x m'
213      Begin composing a message to send (`mail').
214
215 `C-x 4 m'
216      Likewise, but display the message in another window
217      (`mail-other-window').
218
219 `C-c C-c'
220      In Mail mode, send the message and switch to another buffer
221      (`mail-send-and-exit').
222
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.
227
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.
235
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
238 it.
239
240 * Menu:
241
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.
245
246 \1f
247 File: xemacs.info,  Node: Mail Format,  Next: Mail Headers,  Prev: Sending Mail,  Up: Sending Mail
248
249 The Format of the Mail Buffer
250 =============================
251
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.
257
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
261 commands.
262
263    The line in the buffer that says:
264
265      --text follows this line--
266
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'.
272
273    Here is an example of what the headers and text in the `*mail*'
274 buffer might look like.
275
276      To: rms@mc
277      CC: mly@mc, rg@oz
278      Subject: The XEmacs User's Manual
279      --Text follows this line--
280      Please ignore this message.
281
282 \1f
283 File: xemacs.info,  Node: Mail Headers,  Next: Mail Mode,  Prev: Mail Format,  Up: Sending Mail
284
285 Mail Header Fields
286 ==================
287
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.
293
294 `To'
295      This field contains the mailing addresses of the message.
296
297 `Subject'
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.
302
303 `CC'
304      This field contains additional mailing addresses to send the
305      message to, but whose readers should not regard the message as
306      addressed to them.
307
308 `BCC'
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.
312
313 `FCC'
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
316      message is sent.
317
318 `From'
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
322      normally go there.
323
324 `Reply-To'
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
328      reads the message.
329
330 `In-Reply-To'
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.
336
337 The `To', `CC', `BCC' and `FCC' fields can appear any number of times,
338 to specify many places to send the message.
339
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,
343
344      To: foo@here, this@there,
345        me@gnu.cambridge.mass.usa.earth.spiral3281
346
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.
352
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
358 abbreviation.
359
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.
369
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'.
377
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.
380
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
384 expansion at point.
385
386    In this version of Emacs, it is possible to have lines like the
387 following in your `.mailrc' file:
388
389           alias someone "John Doe <doe@quux.com>"
390
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.
394
395    Aliases in the `.mailrc' file may be nested. For example, assume you
396 define aliases like:
397           alias group1 fred ethel
398           alias group2 larry curly moe
399           alias everybody group1 group2
400
401    When you now type `everybody' on the `To' line, it will expand to:
402           fred, ethyl, larry, curly, moe
403
404    Aliases may contain forward references; the alias of `everybody' in
405 the example above can precede the aliases of `group1' and `group2'.
406
407    In this version of Emacs, you can use the `source' `.mailrc' command
408 for reading aliases from some other file as well.
409
410    Aliases may contain hyphens, as in `"alias foo-bar foo@bar"', even
411 though word-abbrevs normally cannot contain hyphens.
412
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.
416
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
420 reasonable behavior.
421
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.
426
427 \1f
428 File: xemacs.info,  Node: Mail Mode,  Prev: Mail Headers,  Up: Sending Mail
429
430 Mail Mode
431 =========
432
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
436 the message.
437
438 `C-c C-s'
439      Send the message, and leave the `*mail*' buffer selected
440      (`mail-send').
441
442 `C-c C-c'
443      Send the message, and select some other buffer
444      (`mail-send-and-exit').
445
446 `C-c C-f C-t'
447      Move to the `To' header field, creating one if there is none
448      (`mail-to').
449
450 `C-c C-f C-s'
451      Move to the `Subject' header field, creating one if there is none
452      (`mail-subject').
453
454 `C-c C-f C-c'
455      Move to the `CC' header field, creating one if there is none
456      (`mail-cc').
457
458 `C-c C-w'
459      Insert the file `~/.signature' at the end of the message text
460      (`mail-signature').
461
462 `C-c C-y'
463      Yank the selected message (`mail-yank-original').
464
465 `C-c C-q'
466      Fill all paragraphs of yanked old messages, each individually
467      (`mail-fill-yanked-message').
468
469 `<button3>'
470      Pops up a menu of useful mail-mode commands.
471
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.
480
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.
489
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.
493
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.
504
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,
508 each one separately.
509
510    Clicking the right mouse button in a mail buffer pops up a menu of
511 the above commands, for easy access.
512
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'.
516
517 \1f
518 File: xemacs.info,  Node: Reading Mail,  Next: Calendar/Diary,  Prev: Sending Mail,  Up: Top
519
520 Reading Mail
521 ************
522
523    XEmacs provides three separate mail-reading packages.  Each one
524 comes with its own manual, which is included standard with the XEmacs
525 distribution.
526
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
529 for the older Rmail.
530
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.
539
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.)
549
550 \1f
551 File: xemacs.info,  Node: Calendar/Diary,  Next: Sorting,  Prev: Reading Mail,  Up: Top
552
553 Calendar Mode and the Diary
554 ===========================
555
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.
563
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
569 diary.
570
571 * Menu:
572
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.
584
585 \1f
586 File: xemacs.info,  Node: Calendar Motion,  Next: Scroll Calendar,  Prev: Calendar/Diary,  Up: Calendar/Diary
587
588 Movement in the Calendar
589 ------------------------
590
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
597 scroll the calendar.
598
599 * Menu:
600
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
604                                specific date.
605
606 \1f
607 File: xemacs.info,  Node: Calendar Unit Motion,  Next: Move to Beginning or End,  Prev: Calendar Motion,  Up: Calendar Motion
608
609 Motion by Integral Days, Weeks, Months, Years
610 .............................................
611
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.
615
616 `C-f'
617      Move point one day forward (`calendar-forward-day').
618
619 `C-b'
620      Move point one day backward (`calendar-backward-day').
621
622 `C-n'
623      Move point one week forward (`calendar-forward-week').
624
625 `C-p'
626      Move point one week backward (`calendar-backward-week').
627
628 `M-}'
629      Move point one month forward (`calendar-forward-month').
630
631 `M-{'
632      Move point one month backward (`calendar-backward-month').
633
634 `C-x ]'
635      Move point one year forward (`calendar-forward-year').
636
637 `C-x ['
638      Move point one year backward (`calendar-backward-year').
639
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.
645
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.
648
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.
653
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.
660
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.
665
666 \1f
667 File: xemacs.info,  Node: Move to Beginning or End,  Next: Specified Dates,  Prev: Calendar Unit Motion,  Up: Calendar Motion
668
669 Beginning or End of Week, Month or Year
670 .......................................
671
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
675 or year:
676
677 `C-a'
678      Move point to start of week (`calendar-beginning-of-week').
679
680 `C-e'
681      Move point to end of week (`calendar-end-of-week').
682
683 `M-a'
684      Move point to start of month (`calendar-beginning-of-month').
685
686 `M-e'
687      Move point to end of month (`calendar-end-of-month').
688
689 `M-<'
690      Move point to start of year (`calendar-beginning-of-year').
691
692 `M->'
693      Move point to end of year (`calendar-end-of-year').
694
695    These commands also take numeric arguments as repeat counts, with the
696 repeat count indicating how many weeks, months, or years to move
697 backward or forward.
698
699    By default, weeks begin on Sunday.  To make them begin on Monday
700 instead, set the variable `calendar-week-start-day' to 1.
701
702 \1f
703 File: xemacs.info,  Node: Specified Dates,  Prev: Move to Beginning or End,  Up: Calendar Motion
704
705 Particular Dates
706 ................
707
708    Calendar mode provides commands for moving to a particular date
709 specified in various ways.
710
711 `g d'
712      Move point to specified date (`calendar-goto-date').
713
714 `o'
715      Center calendar around specified month (`calendar-other-month').
716
717 `.'
718      Move point to today's date (`calendar-goto-today').
719
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'.
724
725    `o' (`calendar-other-month') prompts for a month and year, then
726 centers the three-month calendar around that month.
727
728    You can return to today's date with `.'  (`calendar-goto-today').
729
730 \1f
731 File: xemacs.info,  Node: Scroll Calendar,  Next: Mark and Region,  Prev: Calendar Motion,  Up: Calendar/Diary
732
733 Scrolling the Calendar through Time
734 -----------------------------------
735
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.
741
742 `C-x <'
743      Scroll calendar one month forward (`scroll-calendar-left').
744
745 `C-x >'
746      Scroll calendar one month backward (`scroll-calendar-right').
747
748 `C-v'
749 `<NEXT>'
750      Scroll calendar three months forward
751      (`scroll-calendar-left-three-months').
752
753 `M-v'
754 `<PRIOR>'
755      Scroll calendar three months backward
756      (`scroll-calendar-right-three-months').
757
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.
764
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.
772
773    The function keys <NEXT> and <PRIOR> are equivalent to `C-v' and
774 `M-v', just as they are in other modes.
775
776 \1f
777 File: xemacs.info,  Node: Mark and Region,  Next: General Calendar,  Prev: Scroll Calendar,  Up: Calendar/Diary
778
779 The Mark and the Region
780 -----------------------
781
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).
786
787 `C-SPC'
788      Set the mark to today's date (`calendar-set-mark').
789
790 `C-@'
791      The same.
792
793 `C-x C-x'
794      Interchange mark and point (`calendar-exchange-point-and-mark').
795
796 `M-='
797      Display the number of days in the current region
798      (`calendar-count-days-region').
799
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.
806
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.
810
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,
820 one by one.
821
822 \1f
823 File: xemacs.info,  Node: General Calendar,  Next: LaTeX Calendar,  Prev: Mark and Region,  Up: Calendar/Diary
824
825 Miscellaneous Calendar Commands
826 -------------------------------
827
828 `p d'
829      Display day-in-year (`calendar-print-day-of-year').
830
831 `?'
832      Briefly describe calendar commands (`describe-calendar-mode').
833
834 `C-c C-l'
835      Regenerate the calendar window (`redraw-calendar').
836
837 `SPC'
838      Scroll the next window (`scroll-other-window').
839
840 `q'
841      Exit from calendar (`exit-calendar').
842
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.
847
848    To display a brief description of the calendar commands, type `?'
849 (`describe-calendar-mode').  For a fuller description, type `C-h m'.
850
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.
854
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.)
858
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.
862
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.)
867
868 \1f
869 File: xemacs.info,  Node: LaTeX Calendar,  Next: Holidays,  Prev: General Calendar,  Up: Calendar/Diary
870
871 LaTeX Calendar
872 ==============
873
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.
877
878 `t m'
879      Generate a one-month calendar (`cal-tex-cursor-month').
880
881 `t M'
882      Generate a sideways-printing one-month calendar
883      (`cal-tex-cursor-month-landscape').
884
885 `t d'
886      Generate a one-day calendar (`cal-tex-cursor-day').
887
888 `t w 1'
889      Generate a one-page calendar for one week (`cal-tex-cursor-week').
890
891 `t w 2'
892      Generate a two-page calendar for one week (`cal-tex-cursor-week2').
893
894 `t w 3'
895      Generate an ISO-style calendar for one week
896      (`cal-tex-cursor-week-iso').
897
898 `t w 4'
899      Generate a calendar for one Monday-starting week
900      (`cal-tex-cursor-week-monday').
901
902 `t f w'
903      Generate a Filofax-style two-weeks-at-a-glance calendar
904      (`cal-tex-cursor-filofax-2week').
905
906 `t f W'
907      Generate a Filofax-style one-week-at-a-glance calendar
908      (`cal-tex-cursor-filofax-week').
909
910 `t y'
911      Generate a calendar for one year (`cal-tex-cursor-year').
912
913 `t Y'
914      Generate a sideways-printing calendar for one year
915      (`cal-tex-cursor-year-landscape').
916
917 `t f y'
918      Generate a Filofax-style calendar for one year
919      (`cal-tex-cursor-filofax-year').
920
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).
926
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).
931
932 \1f
933 File: xemacs.info,  Node: Holidays,  Next: Sunrise/Sunset,  Prev: LaTeX Calendar,  Up: Calendar/Diary
934
935 Holidays
936 --------
937
938    The Emacs calendar knows about all major and many minor holidays,
939 and can display them.
940
941 `h'
942      Display holidays for the selected date
943      (`calendar-cursor-holidays').
944
945 `Button2 Holidays'
946      Display any holidays for the date you click on.
947
948 `x'
949      Mark holidays in the calendar window (`mark-calendar-holidays').
950
951 `u'
952      Unmark calendar window (`calendar-unmark').
953
954 `a'
955      List all holidays for the displayed three months in another window
956      (`list-calendar-holidays').
957
958 `M-x holidays'
959      List all holidays for three months around today's date in another
960      window.
961
962 `M-x list-holidays'
963      List holidays in another window for a specified range of years.
964
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
970 window.
971
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::.).
979
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
983 scroll that list.
984
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.
990
991    The holidays known to Emacs include United States holidays and the
992 major Christian, Jewish, and Islamic holidays; also the solstices and
993 equinoxes.
994
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
999 a calendar window.
1000
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.
1008
1009 \1f
1010 File: xemacs.info,  Node: Sunrise/Sunset,  Next: Lunar Phases,  Prev: Holidays,  Up: Calendar/Diary
1011
1012 Times of Sunrise and Sunset
1013 ---------------------------
1014
1015    Special calendar commands can tell you, to within a minute or two,
1016 the times of sunrise and sunset for any date.
1017
1018 `S'
1019      Display times of sunrise and sunset for the selected date
1020      (`calendar-sunrise-sunset').
1021
1022 `Button2 Sunrise/Sunset'
1023      Display times of sunrise and sunset for the date you click on.
1024
1025 `M-x sunrise-sunset'
1026      Display times of sunrise and sunset for today's date.
1027
1028 `C-u M-x sunrise-sunset'
1029      Display times of sunrise and sunset for a specified date.
1030
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.
1039
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.
1045
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:
1049
1050      (setq calendar-latitude 40.1)
1051      (setq calendar-longitude -88.2)
1052      (setq calendar-location-name "Urbana, IL")
1053
1054 Use one decimal place in the values of `calendar-latitude' and
1055 `calendar-longitude'.
1056
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:
1061
1062      (setq calendar-time-zone -360)
1063      (setq calendar-standard-time-zone-name "CST")
1064      (setq calendar-daylight-time-zone-name "CDT")
1065
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.
1073
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::.
1079
1080 \1f
1081 File: xemacs.info,  Node: Lunar Phases,  Next: Other Calendars,  Prev: Sunrise/Sunset,  Up: Calendar/Diary
1082
1083 Phases of the Moon
1084 ------------------
1085
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
1089 the moon."
1090
1091 `M'
1092      Display the dates and times for all the quarters of the moon for
1093      the three-month period shown (`calendar-phases-of-moon').
1094
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.
1098
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.
1102
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
1107 year.
1108
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::.
1113
1114 \1f
1115 File: xemacs.info,  Node: Other Calendars,  Next: Calendar Systems,  Prev: Lunar Phases,  Up: Calendar/Diary
1116
1117 Conversion To and From Other Calendars
1118 --------------------------------------
1119
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.
1129
1130    While Emacs cannot display other calendars, it can convert dates to
1131 and from several other calendars.
1132
1133 * Menu:
1134
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.
1140
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.
1145
1146 \1f
1147 File: xemacs.info,  Node: Calendar Systems,  Next: To Other Calendar,  Prev: Other Calendars,  Up: Other Calendars
1148
1149 Supported Calendar Systems
1150 ==========================
1151
1152    The ISO commercial calendar is used largely in Europe.
1153
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
1156 nineteenth century.
1157
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*.
1161
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.
1165
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
1173 and end at sunset.
1174
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.
1180
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.
1186
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.
1192
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
1197 four or five years.
1198
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.
1206