annotate man/emacs-xtra.texi @ 65555:69b3598a61c5

Update all manuals to specify GFDL version 1.2. * doclicense.texi (GNU Free Documentation License): Update to version 1.2.
author Romain Francoise <romain@orebokech.com>
date Fri, 16 Sep 2005 22:11:06 +0000
parents 3723093a21fd
children dc2d5a6655a3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
1 \input texinfo @c -*-texinfo-*-
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
2 @comment %**start of header
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
3 @setfilename ../info/emacs-xtra
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
4 @settitle Specialized Emacs Features
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
5 @syncodeindex fn cp
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
6 @syncodeindex vr cp
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
7 @syncodeindex ky cp
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
8 @comment %**end of header
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
9
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
10 @copying
56160
6ad083598109 (Supporting additional buffers): Minor change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56149
diff changeset
11 This manual describes specialized features of Emacs.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
12
64890
3723093a21fd Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 61004
diff changeset
13 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
14
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
15 @quotation
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
16 Permission is granted to copy, distribute and/or modify this document
65555
69b3598a61c5 Update all manuals to specify GFDL version 1.2.
Romain Francoise <romain@orebokech.com>
parents: 64890
diff changeset
17 under the terms of the GNU Free Documentation License, Version 1.2 or
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
18 any later version published by the Free Software Foundation; with no
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
19 Invariant Sections, with the Front-Cover texts being ``A GNU
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
20 Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
21 license is included in the section entitled ``GNU Free Documentation
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
22 License'' in the Emacs manual.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
23
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
24 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
25 this GNU Manual, like GNU software. Copies published by the Free
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
26 Software Foundation raise funds for GNU development.''
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
27
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
28 This document is part of a collection distributed under the GNU Free
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
29 Documentation License. If you want to distribute this document
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
30 separately from the collection, you can do so by adding a copy of the
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
31 license to the document, as described in section 6 of the license.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
32 @end quotation
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
33 @end copying
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
34
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
35 @dircategory Emacs
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
36 @direntry
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
37 * Emacs-Xtra: (emacs-xtra). Specialized Emacs features.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
38 @end direntry
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
39
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
40 @titlepage
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
41 @title Specialized Emacs Features
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
42 @page
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
43 @vskip 0pt plus 1filll
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
44 @insertcopying
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
45 @end titlepage
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
46
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
47 @contents
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
48
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
49 @ifnottex
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
50 @node Top
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
51 @top Specialized Emacs Features
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
52
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
53 @insertcopying
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
54
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
55 @end ifnottex
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
56
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
57 @menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
58 * Introduction:: What documentation belongs here?
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
59 * Autorevert:: Auto Reverting non-file buffers.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
60 * Subdir switches:: Subdirectory switches in Dired.
61000
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
61 * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
62 * Index::
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
63 @end menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
64
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
65 @node Introduction
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
66 @unnumbered Introduction
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
67
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
68 This manual contains detailed information about various features that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
69 are too specialized to be included in the Emacs manual. It is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
70 intended to be readable by anyone having a basic knowledge of Emacs.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
71 However, certain sections may be intended for a more specialized
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
72 audience, such as Elisp authors. This should be clearly pointed out
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
73 at the beginning of these sections.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
74
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
75 This manual is intended as a complement, rather than an alternative,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
76 to other ways to gain a more detailed knowledge of Emacs than the
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
77 Emacs manual can provide, such as browsing packages using @kbd{C-h p},
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
78 accessing mode documentation using @kbd{C-h m} and browsing user
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
79 options using Custom. Also, certain packages, or collections of
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
80 related features, have their own manuals. The present manual is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
81 mainly intended to be a collection of smaller specialized features,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
82 too small to get their own manual.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
83
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
84 Sections intended specifically for Elisp programmers can follow the
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
85 style of the Elisp manual. Other sections should follow the style of
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
86 the Emacs manual.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
87
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
88 @node Autorevert
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
89 @chapter Auto Reverting non-file Buffers
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
90
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
91 Normally Global Auto Revert Mode only reverts file buffers. There are
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
92 two ways to auto-revert certain non-file buffers: enabling Auto Revert
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
93 Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
94 @code{global-auto-revert-non-file-buffers} to @code{t}. The latter
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
95 enables Auto Reverting for all types of buffers for which it is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
96 implemented, that is, for the types of buffers listed in the menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
97 below.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
98
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
99 Like file buffers, non-file buffers should normally not revert while
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
100 you are working on them, or while they contain information that might
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
101 get lost after reverting. Therefore, they do not revert if they are
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
102 ``modified''. This can get tricky, because deciding when a non-file
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
103 buffer should be marked modified is usually more difficult than for
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
104 file buffers.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
105
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
106 Another tricky detail is that, for efficiency reasons, Auto Revert
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
107 often does not try to detect all possible changes in the buffer, only
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
108 changes that are ``major'' or easy to detect. Hence, enabling
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
109 auto-reverting for a non-file buffer does not always guarantee that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
110 all information in the buffer is up to date and does not necessarily
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
111 make manual reverts useless.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
112
56128
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
113 At the other extreme, certain buffers automatically auto-revert every
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
114 @code{auto-revert-interval} seconds. (This currently only applies to
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
115 the Buffer Menu.) In this case, Auto Revert does not print any
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
116 messages while reverting, even when @code{auto-revert-verbose} is
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
117 non-@code{nil}.
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
118
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
119 The details depend on the particular types of buffers and are
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
120 explained in the corresponding sections.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
121
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
122 @menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
123 * Auto Reverting the Buffer Menu::
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
124 * Auto Reverting Dired::
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
125 * Supporting additional buffers::
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
126 @end menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
127
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
128 @node Auto Reverting the Buffer Menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
129 @section Auto Reverting the Buffer Menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
130
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
131 If auto-reverting of non-file buffers is enabled, the Buffer Menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
132 automatically reverts every @code{auto-revert-interval} seconds,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
133 whether there is a need for it or not. (It would probably take longer
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
134 to check whether there is a need than to actually revert.)
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
135
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
136 If the Buffer Menu inappropriately gets marked modified, just revert
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
137 it manually using @kbd{g} and auto-reverting will resume. However, if
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
138 you marked certain buffers to get deleted or to be displayed, you have
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
139 to be careful, because reverting erases all marks. The fact that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
140 adding marks sets the buffer's modified flag prevents Auto Revert from
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
141 automatically erasing the marks.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
142
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
143 @node Auto Reverting Dired
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
144 @section Auto Reverting Dired buffers
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
145
56149
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
146 Auto-reverting Dired buffers currently works on GNU or Unix style
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
147 operating systems. It may not work satisfactorily on some other
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
148 systems.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
149
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
150 Dired buffers only auto-revert when the file list of the buffer's main
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
151 directory changes. They do not auto-revert when information about a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
152 particular file changes or when inserted subdirectories change. To be
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
153 sure that @emph{all} listed information is up to date, you have to
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
154 manually revert using @kbd{g}, @emph{even} if auto-reverting is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
155 enabled in the Dired buffer. Sometimes, you might get the impression
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
156 that modifying or saving files listed in the main directory actually
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
157 does cause auto-reverting. This is because making changes to a file,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
158 or saving it, very often causes changes in the directory itself, for
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
159 instance, through backup files or auto-save files. However, this is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
160 not guaranteed.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
161
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
162 If the Dired buffer is marked modified and there are no changes you
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
163 want to protect, then most of the time you can make auto-reverting
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
164 resume by manually reverting the buffer using @kbd{g}. There is one
56149
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
165 exception. If you flag or mark files, you can safely revert the
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
166 buffer. This will not erase the flags or marks (unless the marked
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
167 file has been deleted, of course). However, the buffer will stay
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
168 modified, even after reverting, and auto-reverting will not resume.
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
169 This is because, if you flag or mark files, you may be working on the
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
170 buffer and you might not want the buffer to change without warning.
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
171 If you want auto-reverting to resume in the presence of marks and
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
172 flags, mark the buffer non-modified using @kbd{M-~}. However, adding,
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
173 deleting or changing marks or flags will mark it modified again.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
174
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
175 Remote Dired buffers are not auto-reverted. Neither are Dired buffers
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
176 for which you used shell wildcards or file arguments to list only some
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
177 of the files. @samp{*Find*} and @samp{*Locate*} buffers do not
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
178 auto-revert either.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
179
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
180 @node Supporting additional buffers
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
181 @section Adding Support for Auto-Reverting additional Buffers.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
182
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
183 This section is intended for Elisp programmers who would like to add
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
184 support for auto-reverting new types of buffers.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
185
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
186 To support auto-reverting the buffer must first of all have a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
187 @code{revert-buffer-function}. @xref{Definition of
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
188 revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
189
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
190 In addition, it @emph{must} have a @code{buffer-stale-function}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
191
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
192 @defvar buffer-stale-function
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
193 The value of this variable is a function to check whether a non-file
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
194 buffer needs reverting. This should be a function with one optional
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
195 argument @var{noconfirm}. The function should return non-@code{nil}
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
196 if the buffer should be reverted. The buffer is current when this
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
197 function is called.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
198
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
199 While this function is mainly intended for use in auto-reverting, it
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
200 could be used for other purposes as well. For instance, if
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
201 auto-reverting is not enabled, it could be used to warn the user that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
202 the buffer needs reverting. The idea behind the @var{noconfirm}
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
203 argument is that it should be @code{t} if the buffer is going to be
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
204 reverted without asking the user and @code{nil} if the function is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
205 just going to be used to warn the user that the buffer is out of date.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
206 In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
207 If the function is only going to be used for auto-reverting, you can
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
208 ignore the @var{noconfirm} argument.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
209
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
210 If you just want to automatically auto-revert every
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
211 @code{auto-revert-interval} seconds, use:
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
212
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
213 @example
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
214 (set (make-local-variable 'buffer-stale-function)
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
215 #'(lambda (&optional noconfirm) 'fast))
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
216 @end example
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
217
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
218 @noindent
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
219 in the buffer's mode function.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
220
56128
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
221 The special return value @samp{fast} tells the caller that the need
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
222 for reverting was not checked, but that reverting the buffer is fast.
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
223 It also tells Auto Revert not to print any revert messages, even if
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
224 @code{auto-revert-verbose} is non-@code{nil}. This is important, as
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
225 getting revert messages every @code{auto-revert-interval} seconds can
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
226 be very annoying. The information provided by this return value could
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
227 also be useful if the function is consulted for purposes other than
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
228 auto-reverting.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
229 @end defvar
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
230
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
231 Once the buffer has a @code{revert-buffer-function} and a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
232 @code{buffer-stale-function}, several problems usually remain.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
233
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
234 The buffer will only auto-revert if it is marked unmodified. Hence,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
235 you will have to make sure that various functions mark the buffer
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
236 modified if and only if either the buffer contains information that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
237 might be lost by reverting or there is reason to believe that the user
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
238 might be inconvenienced by auto-reverting, because he is actively
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
239 working on the buffer. The user can always override this by manually
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
240 adjusting the modified status of the buffer. To support this, calling
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
241 the @code{revert-buffer-function} on a buffer that is marked
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
242 unmodified should always keep the buffer marked unmodified.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
243
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
244 It is important to assure that point does not continuously jump around
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
245 as a consequence of auto-reverting. Of course, moving point might be
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
246 inevitable if the buffer radically changes.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
247
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
248 You should make sure that the @code{revert-buffer-function} does not
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
249 print messages that unnecessarily duplicate Auto Revert's own messages
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
250 if @code{auto-revert-verbose} is @code{t} and effectively override a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
251 @code{nil} value for @code{auto-revert-verbose}. Hence, adapting a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
252 mode for auto-reverting often involves getting rid of such messages.
56128
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
253 This is especially important for buffers that automatically
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
254 auto-revert every @code{auto-revert-interval} seconds.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
255
56160
6ad083598109 (Supporting additional buffers): Minor change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56149
diff changeset
256 Also, you may want to update the documentation string of
6ad083598109 (Supporting additional buffers): Minor change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56149
diff changeset
257 @code{global-auto-revert-non-file-buffers}.
6ad083598109 (Supporting additional buffers): Minor change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56149
diff changeset
258
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
259 @ifinfo
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
260 Finally, you should add a node to this chapter's menu. This node
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
261 @end ifinfo
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
262 @ifnotinfo
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
263 Finally, you should add a section to this chapter. This section
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
264 @end ifnotinfo
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
265 should at the very least make clear whether enabling auto-reverting
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
266 for the buffer reliably assures that all information in the buffer is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
267 completely up to date (or will be after @code{auto-revert-interval}
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
268 seconds).
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
269
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
270 @node Subdir switches
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
271 @chapter Subdirectory Switches in Dired
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
272
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
273 You can insert subdirectories with specified @code{ls} switches in
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
274 Dired buffers, using @kbd{C-u i}. You can change the @code{ls}
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
275 switches of an already inserted subdirectory using @kbd{C-u l}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
276
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 56473
diff changeset
277 In Emacs versions 22.1 and later, Dired remembers the switches, so
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
278 that reverting the buffer will not change them back to the main
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
279 directory's switches. Deleting a subdirectory forgets about its
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
280 switches.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
281
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
282 Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u})
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
283 to reinsert or delete subdirectories, that were inserted with explicit
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
284 switches, can bypass Dired's machinery for remembering (or forgetting)
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
285 switches. Deleting a subdirectory using @code{dired-undo} does not
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
286 forget its switches. When later reinserted using @kbd{i}, it will be
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
287 reinserted using its old switches. Using @code{dired-undo} to
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
288 reinsert a subdirectory that was deleted using the regular
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
289 Dired commands (not @code{dired-undo}) will originally insert it with
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
290 its old switches. However, reverting the buffer will relist it using
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
291 the buffer's default switches. If any of this yields problems, you
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
292 can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
293
56471
ca944d885fe6 (Subdir switches): Dired does not remember the `R' switch.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56160
diff changeset
294 Dired does not remember the @code{R} switch. Inserting a subdirectory
ca944d885fe6 (Subdir switches): Dired does not remember the `R' switch.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56160
diff changeset
295 with switches that include the @code{R} switch is equivalent with
ca944d885fe6 (Subdir switches): Dired does not remember the `R' switch.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56160
diff changeset
296 inserting each of its subdirectories using all remaining switches.
56473
d9fdff5fee26 (Subdir switches): Minor fix to previous change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56471
diff changeset
297 For instance, updating or killing a subdirectory that was inserted
d9fdff5fee26 (Subdir switches): Minor fix to previous change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56471
diff changeset
298 with the @code{R} switch will not update or kill its subdirectories.
56471
ca944d885fe6 (Subdir switches): Dired does not remember the `R' switch.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56160
diff changeset
299
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
300 The buffer's default switches do not affect subdirectories that were
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
301 inserted using explicitly specified switches. In particular,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
302 commands such as @kbd{s}, that change the buffer's switches do not
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
303 affect such subdirectories. (They do affect subdirectories without
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
304 explicitly assigned switches, however.)
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
305
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
306 You can make Dired forget about all subdirectory switches and relist
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
307 all subdirectories with the buffer's default switches using
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
308 @kbd{M-x dired-reset-subdir-switches}. This also reverts the Dired buffer.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
309
61000
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
310
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
311 @c Moved here from the Emacs Lisp Reference Manual, 2005-03-26.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
312 @node Advanced Calendar/Diary Usage
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
313 @chapter Customizing the Calendar and Diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
314
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
315 There are many customizations that you can use to make the calendar and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
316 diary suit your personal tastes.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
317
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
318 @menu
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
319 * Calendar Customizing:: Defaults you can set.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
320 * Holiday Customizing:: Defining your own holidays.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
321 * Date Display Format:: Changing the format.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
322 * Time Display Format:: Changing the format.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
323 * Daylight Savings:: Changing the default.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
324 * Diary Customizing:: Defaults you can set.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
325 * Hebrew/Islamic Entries:: How to obtain them.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
326 * Fancy Diary Display:: Enhancing the diary display, sorting entries,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
327 using included diary files.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
328 * Sexp Diary Entries:: Fancy things you can do.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
329 @end menu
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
330
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
331 @node Calendar Customizing
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
332 @section Customizing the Calendar
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
333 @vindex calendar-holiday-marker
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
334 @vindex diary-entry-marker
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
335 The variable @code{calendar-holiday-marker} specifies how to mark a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
336 date as being a holiday. Its value may be a single-character string
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
337 to insert next to the date, or a face name to use for displaying the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
338 date. Likewise, the variable @code{diary-entry-marker} specifies how
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
339 to mark a date that has diary entries. The calendar creates faces
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
340 named @code{holiday-face} and @code{diary-face} for these purposes;
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
341 those symbols are the default values of these variables.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
342
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
343 @vindex calendar-load-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
344 The variable @code{calendar-load-hook} is a normal hook run when the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
345 calendar package is first loaded (before actually starting to display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
346 the calendar).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
347
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
348 @vindex initial-calendar-window-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
349 Starting the calendar runs the normal hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
350 @code{initial-calendar-window-hook}. Recomputation of the calendar
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
351 display does not run this hook. But if you leave the calendar with the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
352 @kbd{q} command and reenter it, the hook runs again.@refill
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
353
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
354 @vindex today-visible-calendar-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
355 The variable @code{today-visible-calendar-hook} is a normal hook run
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
356 after the calendar buffer has been prepared with the calendar when the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
357 current date is visible in the window. One use of this hook is to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
358 replace today's date with asterisks; to do that, use the hook function
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
359 @code{calendar-star-date}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
360
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
361 @findex calendar-star-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
362 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
363 (add-hook 'today-visible-calendar-hook 'calendar-star-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
364 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
365
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
366 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
367 Another standard hook function marks the current date, either by
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
368 changing its face or by adding an asterisk. Here's how to use it:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
369
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
370 @findex calendar-mark-today
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
371 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
372 (add-hook 'today-visible-calendar-hook 'calendar-mark-today)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
373 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
374
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
375 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
376 @vindex calendar-today-marker
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
377 The variable @code{calendar-today-marker} specifies how to mark
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
378 today's date. Its value should be a single-character string to insert
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
379 next to the date or a face name to use for displaying the date. A
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
380 face named @code{calendar-today-face} is provided for this purpose;
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
381 that symbol is the default for this variable.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
382
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
383 @vindex today-invisible-calendar-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
384 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
385 A similar normal hook, @code{today-invisible-calendar-hook} is run if
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
386 the current date is @emph{not} visible in the window.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
387
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
388 @vindex calendar-move-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
389 Each of the calendar cursor motion commands runs the hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
390 @code{calendar-move-hook} after it moves the cursor.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
391
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
392 @node Holiday Customizing
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
393 @section Customizing the Holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
394
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
395 @vindex calendar-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
396 @vindex christian-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
397 @vindex hebrew-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
398 @vindex islamic-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
399 Emacs knows about holidays defined by entries on one of several lists.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
400 You can customize these lists of holidays to your own needs, adding or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
401 deleting holidays. The lists of holidays that Emacs uses are for
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
402 general holidays (@code{general-holidays}), local holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
403 (@code{local-holidays}), Christian holidays (@code{christian-holidays}),
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
404 Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Muslim)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
405 holidays (@code{islamic-holidays}), and other holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
406 (@code{other-holidays}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
407
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
408 @vindex general-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
409 The general holidays are, by default, holidays common throughout the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
410 United States. To eliminate these holidays, set @code{general-holidays}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
411 to @code{nil}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
412
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
413 @vindex local-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
414 There are no default local holidays (but sites may supply some). You
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
415 can set the variable @code{local-holidays} to any list of holidays, as
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
416 described below.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
417
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
418 @vindex all-christian-calendar-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
419 @vindex all-hebrew-calendar-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
420 @vindex all-islamic-calendar-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
421 By default, Emacs does not include all the holidays of the religions
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
422 that it knows, only those commonly found in secular calendars. For a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
423 more extensive collection of religious holidays, you can set any (or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
424 all) of the variables @code{all-christian-calendar-holidays},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
425 @code{all-hebrew-calendar-holidays}, or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
426 @code{all-islamic-calendar-holidays} to @code{t}. If you want to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
427 eliminate the religious holidays, set any or all of the corresponding
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
428 variables @code{christian-holidays}, @code{hebrew-holidays}, and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
429 @code{islamic-holidays} to @code{nil}.@refill
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
430
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
431 @vindex other-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
432 You can set the variable @code{other-holidays} to any list of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
433 holidays. This list, normally empty, is intended for individual use.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
434
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
435 @cindex holiday forms
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
436 Each of the lists (@code{general-holidays}, @code{local-holidays},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
437 @code{christian-holidays}, @code{hebrew-holidays},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
438 @code{islamic-holidays}, and @code{other-holidays}) is a list of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
439 @dfn{holiday forms}, each holiday form describing a holiday (or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
440 sometimes a list of holidays).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
441
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
442 Here is a table of the possible kinds of holiday form. Day numbers
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
443 and month numbers count starting from 1, but ``dayname'' numbers
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
444 count Sunday as 0. The element @var{string} is always the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
445 name of the holiday, as a string.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
446
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
447 @table @code
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
448 @item (holiday-fixed @var{month} @var{day} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
449 A fixed date on the Gregorian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
450
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
451 @item (holiday-float @var{month} @var{dayname} @var{k} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
452 The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
453 (@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
454 from the end of the month.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
455
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
456 @item (holiday-hebrew @var{month} @var{day} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
457 A fixed date on the Hebrew calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
458
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
459 @item (holiday-islamic @var{month} @var{day} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
460 A fixed date on the Islamic calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
461
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
462 @item (holiday-julian @var{month} @var{day} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
463 A fixed date on the Julian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
464
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
465 @item (holiday-sexp @var{sexp} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
466 A date calculated by the Lisp expression @var{sexp}. The expression
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
467 should use the variable @code{year} to compute and return the date of a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
468 holiday, or @code{nil} if the holiday doesn't happen this year. The
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
469 value of @var{sexp} must represent the date as a list of the form
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
470 @code{(@var{month} @var{day} @var{year})}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
471
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
472 @item (if @var{condition} @var{holiday-form})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
473 A holiday that happens only if @var{condition} is true.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
474
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
475 @item (@var{function} @r{[}@var{args}@r{]})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
476 A list of dates calculated by the function @var{function}, called with
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
477 arguments @var{args}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
478 @end table
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
479
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
480 For example, suppose you want to add Bastille Day, celebrated in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
481 France on July 14. You can do this as follows:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
482
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
483 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
484 (setq other-holidays '((holiday-fixed 7 14 "Bastille Day")))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
485 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
486
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
487 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
488 The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
489 fourteenth day of the seventh month (July).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
490
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
491 Many holidays occur on a specific day of the week, at a specific time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
492 of month. Here is a holiday form describing Hurricane Supplication Day,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
493 celebrated in the Virgin Islands on the fourth Monday in August:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
494
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
495 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
496 (holiday-float 8 1 4 "Hurricane Supplication Day")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
497 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
498
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
499 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
500 Here the 8 specifies August, the 1 specifies Monday (Sunday is 0,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
501 Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
502 the month (1 specifies the first occurrence, 2 the second occurrence,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
503 @minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
504 so on).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
505
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
506 You can specify holidays that occur on fixed days of the Hebrew,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
507 Islamic, and Julian calendars too. For example,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
508
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
509 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
510 (setq other-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
511 '((holiday-hebrew 10 2 "Last day of Hanukkah")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
512 (holiday-islamic 3 12 "Mohammed's Birthday")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
513 (holiday-julian 4 2 "Jefferson's Birthday")))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
514 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
515
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
516 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
517 adds the last day of Hanukkah (since the Hebrew months are numbered with
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
518 1 starting from Nisan), the Islamic feast celebrating Mohammed's
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
519 birthday (since the Islamic months are numbered from 1 starting with
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
520 Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
521 Julian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
522
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
523 To include a holiday conditionally, use either Emacs Lisp's @code{if} or the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
524 @code{holiday-sexp} form. For example, American presidential elections
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
525 occur on the first Tuesday after the first Monday in November of years
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
526 divisible by 4:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
527
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
528 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
529 (holiday-sexp '(if (= 0 (% year 4))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
530 (calendar-gregorian-from-absolute
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
531 (1+ (calendar-dayname-on-or-before
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
532 1 (+ 6 (calendar-absolute-from-gregorian
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
533 (list 11 1 year)))))))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
534 "US Presidential Election")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
535 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
536
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
537 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
538 or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
539
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
540 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
541 (if (= 0 (% displayed-year 4))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
542 (fixed 11
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
543 (extract-calendar-day
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
544 (calendar-gregorian-from-absolute
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
545 (1+ (calendar-dayname-on-or-before
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
546 1 (+ 6 (calendar-absolute-from-gregorian
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
547 (list 11 1 displayed-year)))))))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
548 "US Presidential Election"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
549 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
550
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
551 Some holidays just don't fit into any of these forms because special
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
552 calculations are involved in their determination. In such cases you
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
553 must write a Lisp function to do the calculation. To include eclipses,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
554 for example, add @code{(eclipses)} to @code{other-holidays}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
555 and write an Emacs Lisp function @code{eclipses} that returns a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
556 (possibly empty) list of the relevant Gregorian dates among the range
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
557 visible in the calendar window, with descriptive strings, like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
558
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
559 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
560 (((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... )
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
561 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
562
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
563 @node Date Display Format
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
564 @section Date Display Format
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
565 @vindex calendar-date-display-form
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
566
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
567 You can customize the manner of displaying dates in the diary, in mode
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
568 lines, and in messages by setting @code{calendar-date-display-form}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
569 This variable holds a list of expressions that can involve the variables
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
570 @code{month}, @code{day}, and @code{year}, which are all numbers in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
571 string form, and @code{monthname} and @code{dayname}, which are both
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
572 alphabetic strings. In the American style, the default value of this
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
573 list is as follows:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
574
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
575 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
576 ((if dayname (concat dayname ", ")) monthname " " day ", " year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
577 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
578
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
579 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
580 while in the European style this value is the default:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
581
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
582 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
583 ((if dayname (concat dayname ", ")) day " " monthname " " year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
584 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
585
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
586 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
587 The ISO standard date representation is this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
588
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
589 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
590 (year "-" month "-" day)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
591 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
592
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
593 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
594 This specifies a typical American format:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
595
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
596 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
597 (month "/" day "/" (substring year -2))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
598 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
599
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
600 @node Time Display Format
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
601 @section Time Display Format
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
602 @vindex calendar-time-display-form
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
603
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
604 The calendar and diary by default display times of day in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
605 conventional American style with the hours from 1 through 12, minutes,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
606 and either @samp{am} or @samp{pm}. If you prefer the European style,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
607 also known in the US as military, in which the hours go from 00 to 23,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
608 you can alter the variable @code{calendar-time-display-form}. This
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
609 variable is a list of expressions that can involve the variables
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
610 @code{12-hours}, @code{24-hours}, and @code{minutes}, which are all
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
611 numbers in string form, and @code{am-pm} and @code{time-zone}, which are
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
612 both alphabetic strings. The default value of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
613 @code{calendar-time-display-form} is as follows:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
614
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
615 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
616 (12-hours ":" minutes am-pm
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
617 (if time-zone " (") time-zone (if time-zone ")"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
618 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
619
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
620 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
621 Here is a value that provides European style times:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
622
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
623 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
624 (24-hours ":" minutes
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
625 (if time-zone " (") time-zone (if time-zone ")"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
626 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
627
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
628 @node Daylight Savings
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
629 @section Daylight Savings Time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
630 @cindex daylight savings time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
631
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
632 Emacs understands the difference between standard time and daylight
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
633 savings time---the times given for sunrise, sunset, solstices,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
634 equinoxes, and the phases of the moon take that into account. The rules
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
635 for daylight savings time vary from place to place and have also varied
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
636 historically from year to year. To do the job properly, Emacs needs to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
637 know which rules to use.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
638
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
639 Some operating systems keep track of the rules that apply to the place
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
640 where you are; on these systems, Emacs gets the information it needs
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
641 from the system automatically. If some or all of this information is
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
642 missing, Emacs fills in the gaps with the rules currently used in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
643 Cambridge, Massachusetts, which is the center of GNU's world.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
644
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
645
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
646 @vindex calendar-daylight-savings-starts
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
647 @vindex calendar-daylight-savings-ends
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
648 If the default choice of rules is not appropriate for your location,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
649 you can tell Emacs the rules to use by setting the variables
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
650 @code{calendar-daylight-savings-starts} and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
651 @code{calendar-daylight-savings-ends}. Their values should be Lisp
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
652 expressions that refer to the variable @code{year}, and evaluate to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
653 Gregorian date on which daylight savings time starts or (respectively)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
654 ends, in the form of a list @code{(@var{month} @var{day} @var{year})}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
655 The values should be @code{nil} if your area does not use daylight
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
656 savings time.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
657
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
658 Emacs uses these expressions to determine the start and end dates of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
659 daylight savings time as holidays and for correcting times of day in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
660 solar and lunar calculations.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
661
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
662 The values for Cambridge, Massachusetts are as follows:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
663
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
664 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
665 @group
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
666 (calendar-nth-named-day 1 0 4 year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
667 (calendar-nth-named-day -1 0 10 year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
668 @end group
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
669 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
670
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
671 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
672 i.e., the first 0th day (Sunday) of the fourth month (April) in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
673 the year specified by @code{year}, and the last Sunday of the tenth month
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
674 (October) of that year. If daylight savings time were
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
675 changed to start on October 1, you would set
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
676 @code{calendar-daylight-savings-starts} to this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
677
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
678 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
679 (list 10 1 year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
680 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
681
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
682 For a more complex example, suppose daylight savings time begins on
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
683 the first of Nisan on the Hebrew calendar. You should set
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
684 @code{calendar-daylight-savings-starts} to this value:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
685
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
686 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
687 (calendar-gregorian-from-absolute
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
688 (calendar-absolute-from-hebrew
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
689 (list 1 1 (+ year 3760))))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
690 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
691
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
692 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
693 because Nisan is the first month in the Hebrew calendar and the Hebrew
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
694 year differs from the Gregorian year by 3760 at Nisan.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
695
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
696 If there is no daylight savings time at your location, or if you want
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
697 all times in standard time, set @code{calendar-daylight-savings-starts}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
698 and @code{calendar-daylight-savings-ends} to @code{nil}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
699
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
700 @vindex calendar-daylight-time-offset
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
701 The variable @code{calendar-daylight-time-offset} specifies the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
702 difference between daylight savings time and standard time, measured in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
703 minutes. The value for Cambridge is 60.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
704
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
705 @vindex calendar-daylight-savings-starts-time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
706 @vindex calendar-daylight-savings-ends-time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
707 The variable @code{calendar-daylight-savings-starts-time} and the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
708 variable @code{calendar-daylight-savings-ends-time} specify the number
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
709 of minutes after midnight local time when the transition to and from
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
710 daylight savings time should occur. For Cambridge, both variables'
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
711 values are 120.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
712
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
713 @node Diary Customizing
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
714 @section Customizing the Diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
715
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
716 @vindex holidays-in-diary-buffer
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
717 Ordinarily, the mode line of the diary buffer window indicates any
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
718 holidays that fall on the date of the diary entries. The process of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
719 checking for holidays can take several seconds, so including holiday
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
720 information delays the display of the diary buffer noticeably. If you'd
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
721 prefer to have a faster display of the diary buffer but without the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
722 holiday information, set the variable @code{holidays-in-diary-buffer} to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
723 @code{nil}.@refill
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
724
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
725 @vindex number-of-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
726 The variable @code{number-of-diary-entries} controls the number of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
727 days of diary entries to be displayed at one time. It affects the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
728 initial display when @code{view-diary-entries-initially} is @code{t}, as
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
729 well as the command @kbd{M-x diary}. For example, the default value is
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
730 1, which says to display only the current day's diary entries. If the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
731 value is 2, both the current day's and the next day's entries are
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
732 displayed. The value can also be a vector of seven elements: for
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
733 example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
734 appear on Sunday, the current date's and the next day's diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
735 appear Monday through Thursday, Friday through Monday's entries appear
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
736 on Friday, while on Saturday only that day's entries appear.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
737
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
738 @vindex print-diary-entries-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
739 @findex print-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
740 The variable @code{print-diary-entries-hook} is a normal hook run
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
741 after preparation of a temporary buffer containing just the diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
742 entries currently visible in the diary buffer. (The other, irrelevant
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
743 diary entries are really absent from the temporary buffer; in the diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
744 buffer, they are merely hidden.) The default value of this hook does
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
745 the printing with the command @code{lpr-buffer}. If you want to use a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
746 different command to do the printing, just change the value of this
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
747 hook. Other uses might include, for example, rearranging the lines into
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
748 order by day and time.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
749
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
750 @vindex diary-date-forms
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
751 You can customize the form of dates in your diary file, if neither the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
752 standard American nor European styles suits your needs, by setting the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
753 variable @code{diary-date-forms}. This variable is a list of patterns
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
754 for recognizing a date. Each date pattern is a list whose elements may
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
755 be regular expressions (@pxref{Regular Expressions,,, elisp, the Emacs
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
756 Lisp Reference Manual}) or the symbols @code{month}, @code{day},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
757 @code{year}, @code{monthname}, and @code{dayname}. All these elements
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
758 serve as patterns that match certain kinds of text in the diary file.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
759 In order for the date pattern, as a whole, to match, all of its elements
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
760 must match consecutively.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
761
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
762 A regular expression in a date pattern matches in its usual fashion,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
763 using the standard syntax table altered so that @samp{*} is a word
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
764 constituent.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
765
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
766 The symbols @code{month}, @code{day}, @code{year}, @code{monthname},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
767 and @code{dayname} match the month number, day number, year number,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
768 month name, and day name of the date being considered. The symbols that
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
769 match numbers allow leading zeros; those that match names allow
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
770 three-letter abbreviations and capitalization. All the symbols can
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
771 match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
772 month'', and so on, it should match regardless of the date being
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
773 considered.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
774
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
775 The default value of @code{diary-date-forms} in the American style is
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
776 this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
777
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
778 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
779 ((month "/" day "[^/0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
780 (month "/" day "/" year "[^0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
781 (monthname " *" day "[^,0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
782 (monthname " *" day ", *" year "[^0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
783 (dayname "\\W"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
784 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
785
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
786 The date patterns in the list must be @emph{mutually exclusive} and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
787 must not match any portion of the diary entry itself, just the date and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
788 one character of whitespace. If, to be mutually exclusive, the pattern
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
789 must match a portion of the diary entry text---beyond the whitespace
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
790 that ends the date---then the first element of the date pattern
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
791 @emph{must} be @code{backup}. This causes the date recognizer to back
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
792 up to the beginning of the current word of the diary entry, after
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
793 finishing the match. Even if you use @code{backup}, the date pattern
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
794 must absolutely not match more than a portion of the first word of the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
795 diary entry. The default value of @code{diary-date-forms} in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
796 European style is this list:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
797
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
798 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
799 ((day "/" month "[^/0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
800 (day "/" month "/" year "[^0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
801 (backup day " *" monthname "\\W+\\<[^*0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
802 (day " *" monthname " *" year "[^0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
803 (dayname "\\W"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
804 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
805
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
806 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
807 Notice the use of @code{backup} in the third pattern, because it needs
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
808 to match part of a word beyond the date itself to distinguish it from
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
809 the fourth pattern.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
810
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
811 @node Hebrew/Islamic Entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
812 @section Hebrew- and Islamic-Date Diary Entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
813
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
814 Your diary file can have entries based on Hebrew or Islamic dates, as
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
815 well as entries based on the world-standard Gregorian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
816 However, because recognition of such entries is time-consuming and most
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
817 people don't use them, you must explicitly enable their use. If you
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
818 want the diary to recognize Hebrew-date diary entries, for example,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
819 you must do this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
820
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
821 @vindex nongregorian-diary-listing-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
822 @vindex nongregorian-diary-marking-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
823 @findex list-hebrew-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
824 @findex mark-hebrew-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
825 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
826 (add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
827 (add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
828 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
829
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
830 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
831 If you want Islamic-date entries, do this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
832
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
833 @findex list-islamic-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
834 @findex mark-islamic-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
835 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
836 (add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
837 (add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
838 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
839
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
840 Hebrew- and Islamic-date diary entries have the same formats as
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
841 Gregorian-date diary entries, except that @samp{H} precedes a Hebrew
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
842 date and @samp{I} precedes an Islamic date. Moreover, because the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
843 Hebrew and Islamic month names are not uniquely specified by the first
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
844 three letters, you may not abbreviate them. For example, a diary entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
845 for the Hebrew date Heshvan 25 could look like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
846
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
847 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
848 HHeshvan 25 Happy Hebrew birthday!
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
849 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
850
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
851 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
852 and would appear in the diary for any date that corresponds to Heshvan 25
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
853 on the Hebrew calendar. And here is an Islamic-date diary entry that matches
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
854 Dhu al-Qada 25:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
855
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
856 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
857 IDhu al-Qada 25 Happy Islamic birthday!
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
858 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
859
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
860 As with Gregorian-date diary entries, Hebrew- and Islamic-date entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
861 are nonmarking if they are preceded with an ampersand (@samp{&}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
862
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
863 Here is a table of commands used in the calendar to create diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
864 that match the selected date and other dates that are similar in the Hebrew
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
865 or Islamic calendar:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
866
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
867 @table @kbd
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
868 @item i h d
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
869 Add a diary entry for the Hebrew date corresponding to the selected date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
870 (@code{insert-hebrew-diary-entry}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
871 @item i h m
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
872 Add a diary entry for the day of the Hebrew month corresponding to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
873 selected date (@code{insert-monthly-hebrew-diary-entry}). This diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
874 entry matches any date that has the same Hebrew day-within-month as the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
875 selected date.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
876 @item i h y
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
877 Add a diary entry for the day of the Hebrew year corresponding to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
878 selected date (@code{insert-yearly-hebrew-diary-entry}). This diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
879 entry matches any date which has the same Hebrew month and day-within-month
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
880 as the selected date.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
881 @item i i d
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
882 Add a diary entry for the Islamic date corresponding to the selected date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
883 (@code{insert-islamic-diary-entry}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
884 @item i i m
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
885 Add a diary entry for the day of the Islamic month corresponding to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
886 selected date (@code{insert-monthly-islamic-diary-entry}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
887 @item i i y
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
888 Add a diary entry for the day of the Islamic year corresponding to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
889 selected date (@code{insert-yearly-islamic-diary-entry}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
890 @end table
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
891
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
892 @findex insert-hebrew-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
893 @findex insert-monthly-hebrew-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
894 @findex insert-yearly-hebrew-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
895 @findex insert-islamic-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
896 @findex insert-monthly-islamic-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
897 @findex insert-yearly-islamic-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
898 These commands work much like the corresponding commands for ordinary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
899 diary entries: they apply to the date that point is on in the calendar
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
900 window, and what they do is insert just the date portion of a diary entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
901 at the end of your diary file. You must then insert the rest of the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
902 diary entry.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
903
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
904 @node Fancy Diary Display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
905 @section Fancy Diary Display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
906 @vindex diary-display-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
907 @findex simple-diary-display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
908
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
909 Diary display works by preparing the diary buffer and then running the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
910 hook @code{diary-display-hook}. The default value of this hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
911 (@code{simple-diary-display}) hides the irrelevant diary entries and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
912 then displays the buffer. However, if you specify the hook as follows,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
913
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
914 @cindex diary buffer
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
915 @findex fancy-diary-display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
916 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
917 (add-hook 'diary-display-hook 'fancy-diary-display)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
918 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
919
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
920 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
921 this enables fancy diary display. It displays diary entries and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
922 holidays by copying them into a special buffer that exists only for the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
923 sake of display. Copying to a separate buffer provides an opportunity
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
924 to change the displayed text to make it prettier---for example, to sort
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
925 the entries by the dates they apply to.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
926
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
927 As with simple diary display, you can print a hard copy of the buffer
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
928 with @code{print-diary-entries}. To print a hard copy of a day-by-day
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
929 diary for a week, position point on Sunday of that week, type
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
930 @kbd{7 d}, and then do @kbd{M-x print-diary-entries}. As usual, the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
931 inclusion of the holidays slows down the display slightly; you can speed
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
932 things up by setting the variable @code{holidays-in-diary-buffer} to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
933 @code{nil}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
934
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
935 @vindex diary-list-include-blanks
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
936 Ordinarily, the fancy diary buffer does not show days for which there are
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
937 no diary entries, even if that day is a holiday. If you want such days to be
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
938 shown in the fancy diary buffer, set the variable
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
939 @code{diary-list-include-blanks} to @code{t}.@refill
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
940
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
941 @cindex sorting diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
942 If you use the fancy diary display, you can use the normal hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
943 @code{list-diary-entries-hook} to sort each day's diary entries by their
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
944 time of day. Here's how:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
945
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
946 @findex sort-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
947 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
948 (add-hook 'list-diary-entries-hook 'sort-diary-entries t)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
949 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
950
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
951 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
952 For each day, this sorts diary entries that begin with a recognizable
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
953 time of day according to their times. Diary entries without times come
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
954 first within each day.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
955
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
956 Fancy diary display also has the ability to process included diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
957 files. This permits a group of people to share a diary file for events
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
958 that apply to all of them. Lines in the diary file of this form:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
959
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
960 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
961 #include "@var{filename}"
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
962 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
963
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
964 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
965 includes the diary entries from the file @var{filename} in the fancy
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
966 diary buffer. The include mechanism is recursive, so that included files
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
967 can include other files, and so on; you must be careful not to have a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
968 cycle of inclusions, of course. Here is how to enable the include
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
969 facility:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
970
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
971 @vindex list-diary-entries-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
972 @vindex mark-diary-entries-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
973 @findex include-other-diary-files
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
974 @findex mark-included-diary-files
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
975 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
976 (add-hook 'list-diary-entries-hook 'include-other-diary-files)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
977 (add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
978 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
979
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
980 The include mechanism works only with the fancy diary display, because
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
981 ordinary diary display shows the entries directly from your diary file.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
982
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
983 @node Sexp Diary Entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
984 @section Sexp Entries and the Fancy Diary Display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
985 @cindex sexp diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
986
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
987 Sexp diary entries allow you to do more than just have complicated
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
988 conditions under which a diary entry applies. If you use the fancy
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
989 diary display, sexp entries can generate the text of the entry depending
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
990 on the date itself. For example, an anniversary diary entry can insert
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
991 the number of years since the anniversary date into the text of the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
992 diary entry. Thus the @samp{%d} in this dairy entry:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
993
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
994 @findex diary-anniversary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
995 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
996 %%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
997 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
998
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
999 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1000 gets replaced by the age, so on October 31, 1990 the entry appears in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1001 the fancy diary buffer like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1002
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1003 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1004 Arthur's birthday (42 years old)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1005 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1006
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1007 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1008 If the diary file instead contains this entry:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1009
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1010 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1011 %%(diary-anniversary 10 31 1948) Arthur's %d%s birthday
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1012 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1013
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1014 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1015 the entry in the fancy diary buffer for October 31, 1990 appears like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1016
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1017 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1018 Arthur's 42nd birthday
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1019 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1020
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1021 Similarly, cyclic diary entries can interpolate the number of repetitions
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1022 that have occurred:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1023
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1024 @findex diary-cyclic
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1025 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1026 %%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1027 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1028
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1029 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1030 looks like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1031
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1032 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1033 Renew medication (5th time)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1034 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1035
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1036 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1037 in the fancy diary display on September 8, 1990.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1038
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1039 There is an early reminder diary sexp that includes its entry in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1040 diary not only on the date of occurrence, but also on earlier dates.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1041 For example, if you want a reminder a week before your anniversary, you
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1042 can use
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1043
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1044 @findex diary-remind
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1045 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1046 %%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1047 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1048
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1049 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1050 and the fancy diary will show
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1051 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1052 Ed's anniversary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1053 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1054 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1055 both on December 15 and on December 22.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1056
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1057 @findex diary-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1058 The function @code{diary-date} applies to dates described by a month,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1059 day, year combination, each of which can be an integer, a list of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1060 integers, or @code{t}. The value @code{t} means all values. For
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1061 example,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1062
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1063 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1064 %%(diary-date '(10 11 12) 22 t) Rake leaves
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1065 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1066
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1067 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1068 causes the fancy diary to show
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1069
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1070 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1071 Rake leaves
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1072 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1073
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1074 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1075 on October 22, November 22, and December 22 of every year.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1076
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1077 @findex diary-float
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1078 The function @code{diary-float} allows you to describe diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1079 that apply to dates like the third Friday of November, or the last
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1080 Tuesday in April. The parameters are the @var{month}, @var{dayname},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1081 and an index @var{n}. The entry appears on the @var{n}th @var{dayname}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1082 of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1083 so on. If @var{n} is negative it counts backward from the end of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1084 @var{month}. The value of @var{month} can be a list of months, a single
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1085 month, or @code{t} to specify all months. You can also use an optional
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1086 parameter @var{day} to specify the @var{n}th @var{dayname} of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1087 @var{month} on or after/before @var{day}; the value of @var{day} defaults
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1088 to 1 if @var{n} is positive and to the last day of @var{month} if
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1089 @var{n} is negative. For example,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1090
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1091 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1092 %%(diary-float t 1 -1) Pay rent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1093 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1094
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1095 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1096 causes the fancy diary to show
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1097
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1098 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1099 Pay rent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1100 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1101
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1102 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1103 on the last Monday of every month.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1104
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1105 The generality of sexp diary entries lets you specify any diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1106 entry that you can describe algorithmically. A sexp diary entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1107 contains an expression that computes whether the entry applies to any
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1108 given date. If its value is non-@code{nil}, the entry applies to that
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1109 date; otherwise, it does not. The expression can use the variable
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1110 @code{date} to find the date being considered; its value is a list
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1111 (@var{month} @var{day} @var{year}) that refers to the Gregorian
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1112 calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1113
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1114 The sexp diary entry applies to a date when the expression's value
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1115 is non-@code{nil}, but some values have more specific meanings. If
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1116 the value is a string, that string is a description of the event which
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1117 occurs on that date. The value can also have the form
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1118 @code{(@var{mark} . @var{string})}; then @var{mark} specifies how to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1119 mark the date in the calendar, and @var{string} is the description of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1120 the event. If @var{mark} is a single-character string, that character
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1121 appears next to the date in the calendar. If @var{mark} is a face
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1122 name, the date is displayed in that face. If @var{mark} is
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1123 @code{nil}, that specifies no particular highlighting for the date.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1124
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1125 Suppose you get paid on the 21st of the month if it is a weekday, and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1126 on the Friday before if the 21st is on a weekend. Here is how to write
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1127 a sexp diary entry that matches those dates:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1128
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1129 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1130 &%%(let ((dayname (calendar-day-of-week date))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1131 (day (car (cdr date))))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1132 (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1133 (and (memq day '(19 20)) (= dayname 5)))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1134 ) Pay check deposited
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1135 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1136
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1137 The following sexp diary entries take advantage of the ability (in the fancy
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1138 diary display) to concoct diary entries whose text varies based on the date:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1139
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1140 @findex diary-sunrise-sunset
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1141 @findex diary-phases-of-moon
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1142 @findex diary-day-of-year
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1143 @findex diary-iso-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1144 @findex diary-julian-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1145 @findex diary-astro-day-number
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1146 @findex diary-hebrew-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1147 @findex diary-islamic-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1148 @findex diary-french-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1149 @findex diary-mayan-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1150 @table @code
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1151 @item %%(diary-sunrise-sunset)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1152 Make a diary entry for the local times of today's sunrise and sunset.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1153 @item %%(diary-phases-of-moon)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1154 Make a diary entry for the phases (quarters) of the moon.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1155 @item %%(diary-day-of-year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1156 Make a diary entry with today's day number in the current year and the number
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1157 of days remaining in the current year.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1158 @item %%(diary-iso-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1159 Make a diary entry with today's equivalent ISO commercial date.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1160 @item %%(diary-julian-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1161 Make a diary entry with today's equivalent date on the Julian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1162 @item %%(diary-astro-day-number)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1163 Make a diary entry with today's equivalent astronomical (Julian) day number.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1164 @item %%(diary-hebrew-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1165 Make a diary entry with today's equivalent date on the Hebrew calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1166 @item %%(diary-islamic-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1167 Make a diary entry with today's equivalent date on the Islamic calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1168 @item %%(diary-french-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1169 Make a diary entry with today's equivalent date on the French Revolutionary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1170 calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1171 @item %%(diary-mayan-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1172 Make a diary entry with today's equivalent date on the Mayan calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1173 @end table
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1174
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1175 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1176 Thus including the diary entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1177
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1178 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1179 &%%(diary-hebrew-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1180 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1181
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1182 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1183 causes every day's diary display to contain the equivalent date on the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1184 Hebrew calendar, if you are using the fancy diary display. (With simple
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1185 diary display, the line @samp{&%%(diary-hebrew-date)} appears in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1186 diary for any date, but does nothing particularly useful.)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1187
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1188 These functions can be used to construct sexp diary entries based on
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1189 the Hebrew calendar in certain standard ways:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1190
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1191 @cindex rosh hodesh
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1192 @findex diary-rosh-hodesh
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1193 @cindex parasha, weekly
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1194 @findex diary-parasha
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1195 @cindex candle lighting times
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1196 @findex diary-sabbath-candles
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1197 @cindex omer count
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1198 @findex diary-omer
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1199 @cindex yahrzeits
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1200 @findex diary-yahrzeit
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1201 @table @code
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1202 @item %%(diary-rosh-hodesh)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1203 Make a diary entry that tells the occurrence and ritual announcement of each
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1204 new Hebrew month.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1205 @item %%(diary-parasha)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1206 Make a Saturday diary entry that tells the weekly synagogue scripture reading.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1207 @item %%(diary-sabbath-candles)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1208 Make a Friday diary entry that tells the @emph{local time} of Sabbath
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1209 candle lighting.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1210 @item %%(diary-omer)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1211 Make a diary entry that gives the omer count, when appropriate.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1212 @item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1213 Make a diary entry marking the anniversary of a date of death. The date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1214 is the @emph{Gregorian} (civil) date of death. The diary entry appears
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1215 on the proper Hebrew calendar anniversary and on the day before. (In
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1216 the European style, the order of the parameters is changed to @var{day},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1217 @var{month}, @var{year}.)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1218 @end table
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1219
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1220 All the functions documented above take an optional argument
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1221 @var{mark} which specifies how to mark the date in the calendar display.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1222 If one of these functions decides that it applies to a certain date,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1223 it returns a value that contains @var{mark}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1224
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1225
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
1226 @node Index
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
1227 @unnumbered Index
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
1228
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
1229 @printindex cp
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
1230
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
1231 @bye
56131
0806d31e3c9c Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56128
diff changeset
1232
0806d31e3c9c Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56128
diff changeset
1233 @ignore
0806d31e3c9c Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56128
diff changeset
1234 arch-tag: 75c33f13-32c6-41b6-9537-847a312e2e49
0806d31e3c9c Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56128
diff changeset
1235 @end ignore