X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/b6ae404e617391c33b7dc13583a80552bf58bf28..c5c927519c95b69cf998228a975c66e0d75d3215:/lispref/calendar.texi diff --git a/lispref/calendar.texi b/lispref/calendar.texi index ad521822e8..6b62582993 100644 --- a/lispref/calendar.texi +++ b/lispref/calendar.texi @@ -30,7 +30,7 @@ diary suit your personal tastes. @code{t}, calling up the calendar automatically displays the diary entries for the current date as well. The diary dates appear only if the current date is visible. If you add both of the following lines to -your @file{.emacs} file:@refill +your init file:@refill @example (setq view-diary-entries-initially t) @@ -52,8 +52,7 @@ window. @code{t} in order to mark any dates with diary entries. This takes effect whenever the calendar window contents are recomputed. There are two ways of marking these dates: by changing the face (@pxref{Faces}), -if the display supports that, or by placing a plus sign (@samp{+}) -beside the date otherwise. +or by placing a plus sign (@samp{+}) beside the date. @vindex mark-holidays-in-calendar Similarly, setting the variable @code{mark-holidays-in-calendar} to @@ -68,8 +67,7 @@ the date, or a face name to use for displaying the date. Likewise, the variable @code{diary-entry-marker} specifies how to mark a date that has diary entries. The calendar creates faces named @code{holiday-face} and @code{diary-face} for these purposes; those symbols are the default -values of these variables, when Emacs supports multiple faces on your -terminal. +values of these variables. @vindex calendar-load-hook The variable @code{calendar-load-hook} is a normal hook run when the @@ -109,14 +107,17 @@ The variable @code{calendar-today-marker} specifies how to mark today's date. Its value should be a character to insert next to the date or a face name to use for displaying the date. A face named @code{calendar-today-face} is provided for this purpose; that symbol is -the default for this variable when Emacs supports multiple faces on your -terminal. +the default for this variable. @vindex today-invisible-calendar-hook @noindent A similar normal hook, @code{today-invisible-calendar-hook} is run if the current date is @emph{not} visible in the window. +@vindex calendar-move-hook + Starting in Emacs 21, each of the calendar cursor motion commands +runs the hook @code{calendar-move-hook} after it moves the cursor. + @node Holiday Customizing @section Customizing the Holidays @@ -776,7 +777,7 @@ can use @noindent and the fancy diary will show @smallexample -Ruth & Ed's anniversary +Ed's anniversary @end smallexample @noindent both on December 15 and on December 22. @@ -829,13 +830,25 @@ Pay rent @noindent on the last Monday of every month. - The generality of sexp diary entries lets you specify any diary entry -that you can describe algorithmically. A sexp diary entry contains an -expression that computes whether the entry applies to any given date. -If its value is non-@code{nil}, the entry applies to that date; -otherwise, it does not. The expression can use the variable @code{date} -to find the date being considered; its value is a list (@var{month} -@var{day} @var{year}) that refers to the Gregorian calendar. + The generality of sexp diary entries lets you specify any diary +entry that you can describe algorithmically. A sexp diary entry +contains an expression that computes whether the entry applies to any +given date. If its value is non-@code{nil}, the entry applies to that +date; otherwise, it does not. The expression can use the variable +@code{date} to find the date being considered; its value is a list +(@var{month} @var{day} @var{year}) that refers to the Gregorian +calendar. + + The sexp diary entry applies to a date when the expression's value +is non-@code{nil}, but some values have more specific meanings. If +the value is a string, that string is a description of the event which +occurs on that date. The value can also have the form +@code{(@var{mark} . @var{string})}; then @var{mark} specifies how to +mark the date in the calendar, and @var{string} is the description of +the event. If @var{mark} is a single-character string, that character +appears next to the date in the calendar. If @var{mark} is a face +name, the date is displayed in that face. If @var{mark} is +@code{nil}, that specifies no particular highlighting for the date. Suppose you get paid on the 21st of the month if it is a weekday, and on the Friday before if the 21st is on a weekend. Here is how to write @@ -932,6 +945,11 @@ the European style, the order of the parameters is changed to @var{day}, @var{month}, @var{year}.) @end table + All the functions documented above take an optional argument +@var{mark} which specifies how to mark the date in the calendar display. +If one of these functions decides that it applies to a certain date, +it returns a value that contains @var{mark}. + @node Appt Customizing @section Customizing Appointment Reminders