aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/emacs/cal-xtra.texi131
1 files changed, 81 insertions, 50 deletions
diff --git a/doc/emacs/cal-xtra.texi b/doc/emacs/cal-xtra.texi
index c05e1e8346b..3fba5e00434 100644
--- a/doc/emacs/cal-xtra.texi
+++ b/doc/emacs/cal-xtra.texi
@@ -20,9 +20,9 @@ diary suit your personal tastes.
20* Time Display Format:: Changing the format. 20* Time Display Format:: Changing the format.
21* Diary Customizing:: Defaults you can set. 21* Diary Customizing:: Defaults you can set.
22* Non-Gregorian Diary:: Diary entries based on other calendars. 22* Non-Gregorian Diary:: Diary entries based on other calendars.
23* Fancy Diary Display:: Enhancing the diary display, sorting entries, 23* Diary Display:: A choice of ways to display the diary.
24 using included diary files. 24* Fancy Diary Display:: Sorting diary entries, using included diary files.
25* Sexp Diary Entries:: Fancy things you can do. 25* Sexp Diary Entries:: More flexible diary entries.
26@end menu 26@end menu
27 27
28@node Calendar Customizing 28@node Calendar Customizing
@@ -332,11 +332,11 @@ solar functions).
332@subsection Customizing the Diary 332@subsection Customizing the Diary
333 333
334@vindex diary-show-holidays-flag 334@vindex diary-show-holidays-flag
335 Ordinarily, the mode line of the diary window indicates any holidays 335 Ordinarily, the diary window indicates any holidays that fall on the
336that fall on the date of the diary entries. The process of checking for 336date of the diary entries, either in the mode line or the buffer itself.
337holidays can be slow, depending on the defined holidays. In that case, 337The process of checking for holidays can be slow, depending on the
338setting @code{diary-show-holidays-flag} to @code{nil} will speed up the 338defined holidays. In that case, setting @code{diary-show-holidays-flag}
339diary display. 339to @code{nil} will speed up the diary display.
340 340
341@vindex diary-number-of-entries 341@vindex diary-number-of-entries
342 The variable @code{diary-number-of-entries} controls the number of 342 The variable @code{diary-number-of-entries} controls the number of
@@ -351,18 +351,6 @@ current date's and the next day's diary entries appear Monday through
351Thursday, Friday through Monday's entries appear on Friday, while on 351Thursday, Friday through Monday's entries appear on Friday, while on
352Saturday only that day's entries appear. 352Saturday only that day's entries appear.
353 353
354@vindex diary-print-entries-hook
355@findex diary-print-entries
356 The variable @code{diary-print-entries-hook} is a normal hook run
357after preparation of a temporary buffer containing just the diary
358entries currently visible in the diary buffer. (The other, irrelevant
359diary entries are really absent from the temporary buffer; in the diary
360buffer, they are merely hidden.) The default value of this hook does
361the printing with the command @code{lpr-buffer}. If you want to use a
362different command to do the printing, just change the value of this
363hook. Other uses might include, for example, rearranging the lines into
364order by day and time.
365
366@vindex diary-date-forms 354@vindex diary-date-forms
367 You can customize the form of dates in your diary file by setting the 355 You can customize the form of dates in your diary file by setting the
368variable @code{diary-date-forms}. This variable is a list of patterns 356variable @code{diary-date-forms}. This variable is a list of patterns
@@ -529,41 +517,85 @@ non-Gregorian date, the @samp{monthly} commands for the given
529non-Gregorian day-within-month in every month, and the @samp{yearly} 517non-Gregorian day-within-month in every month, and the @samp{yearly}
530commands for the given non-Gregorian day and month in every year. 518commands for the given non-Gregorian day and month in every year.
531 519
532@node Fancy Diary Display 520@node Diary Display
533@subsection Fancy Diary Display 521@subsection Diary Display
534@vindex diary-display-function 522@vindex diary-display-function
535@findex diary-simple-display 523@findex diary-simple-display
536@findex diary-fancy-display 524@findex diary-fancy-display
537@cindex diary buffer 525@cindex diary buffer
538 526
539 Diary display works by preparing the diary buffer and then running the 527 Diary display works by preparing the list of diary entries and then
540function specified by the variable @code{diary-display-function}. The 528running the function specified by the variable
541default value (@code{diary-simple-display}) hides the irrelevant diary 529@code{diary-display-function}. The default value
542entries and then displays the buffer. The alternative
543@code{diary-fancy-display} displays diary entries and holidays by 530@code{diary-fancy-display} displays diary entries and holidays by
544copying them into a special buffer that exists only for the sake of 531copying them into a special buffer that exists only for the sake of
545display. Copying to a separate buffer provides an opportunity to change 532display. Copying diary entries to a separate buffer provides an
546the displayed text to make it prettier---for example, to sort the 533opportunity to change the displayed text to make it prettier---for
547entries by the dates they apply to. 534example, to sort the entries by the dates they apply to.
548
549 As with simple diary display, you can print a hard copy of the buffer
550with @code{diary-print-entries}. To print a hard copy of a day-by-day
551diary for a week, position point on Sunday of that week, type
552@kbd{7 d}, and then do @kbd{M-x diary-print-entries}. As usual, the
553inclusion of the holidays slows down the display slightly; you can speed
554things up by setting the variable @code{diary-show-holidays-flag} to
555@code{nil}.
556 535
557@vindex diary-list-include-blanks 536@vindex diary-list-include-blanks
558 Ordinarily, the fancy diary buffer does not show days for which there are 537 Ordinarily, the fancy diary buffer does not show days for which there
559no diary entries, even if that day is a holiday. If you want such days to be 538are no diary entries, even if that day is a holiday. If you want such
560shown in the fancy diary buffer, set the variable 539days to be shown in the fancy diary buffer, set the variable
561@code{diary-list-include-blanks} to @code{t}.@refill 540@code{diary-list-include-blanks} to @code{t}.@refill
562 541
542 The alternative method @code{diary-simple-display} displays the actual
543diary buffer, and uses invisible text to hide entries that don't apply.
544Holidays are shown in the mode line. The advantage of this method is
545that you can edit the buffer and save your changes directly to the diary
546file. This method is not as flexible as the fancy method, however. For
547example, it cannot sort entries. Another disadvantage is that invisible
548text can be confusing. For example, if you copy a region of text in
549order to paste it elsewhere, invisible text may be included. Similarly,
550since the diary buffer as you see it is an illusion, simply printing the
551buffer may not print what you see on your screen.
552
553@vindex diary-print-entries-hook
554@findex diary-print-entries
555 For this reason, there is a special command to print hard copy of the
556diary buffer @emph{as it appears}; this command is @kbd{M-x
557diary-print-entries}. It works with either display method, although
558with the fancy display you can also print the buffer like any other. To
559print a hard copy of a day-by-day diary for a week, position point on
560the first day of the week, type @kbd{7 d}, and then do @kbd{M-x
561diary-print-entries}. As usual, the inclusion of the holidays slows
562down the display slightly; you can speed things up by setting the
563variable @code{diary-show-holidays-flag} to @code{nil}.
564
565 This command prepares a temporary buffer that contains only the diary
566entries currently visible in the diary buffer. Unlike with the simple
567display, the other irrelevant entries are really absent, not just
568hidden. After preparing the buffer, it runs the hook
569@code{diary-print-entries-hook}. The default value of this hook sends
570the data directly to the printer with the command @code{lpr-buffer}
571(@pxref{Printing}). If you want to use a different command to do the
572printing, just change the value of this hook. Other uses might include,
573for example, rearranging the lines into order by day and time.
574
575 You can edit the diary entries as they appear in the simple diary
576window, but it is important to remember that the buffer displayed
577contains the @emph{entire} diary file, with portions of it concealed
578from view. This means, for instance, that the @kbd{C-f}
579(@code{forward-char}) command can put point at what appears to be the
580end of the line, but what is in reality the middle of some concealed
581line.
582
583 @emph{Be careful when editing the diary entries in the simple display!}
584Inserting additional lines or adding/deleting characters in the middle
585of a visible line cannot cause problems, but editing at the end of a
586line may not do what you expect. Deleting a line may delete other
587invisible entries that follow it. Before editing the simple diary
588buffer, it is best to display the entire file with @kbd{s}
589(@code{diary-show-all-entries}).
590
591@node Fancy Diary Display
592@subsection Fancy Diary Display
593
594The following features only work with the fancy diary display.
595
563@cindex sorting diary entries 596@cindex sorting diary entries
564 If you use the fancy diary display, you can use the normal hook 597 You can use the normal hook @code{diary-list-entries-hook} to sort
565@code{diary-list-entries-hook} to sort each day's diary entries by their 598each day's diary entries by their time of day. Here's how:
566time of day. Here's how:
567 599
568@findex diary-sort-entries 600@findex diary-sort-entries
569@example 601@example
@@ -576,10 +608,9 @@ time of day according to their times. Diary entries without times come
576first within each day. 608first within each day.
577 609
578@vindex diary-include-string 610@vindex diary-include-string
579 Fancy diary display also has the ability to process included diary 611 Your main diary file can include other files. This permits a group of
580files. This permits a group of people to share a diary file for events 612people to share a diary file for events that apply to all of them.
581that apply to all of them. Lines in the diary file starting with 613Lines in the diary file starting with @code{diary-include-string}:
582@code{diary-include-string}:
583 614
584@smallexample 615@smallexample
585#include "@var{filename}" 616#include "@var{filename}"
@@ -602,7 +633,7 @@ include facility:
602@end smallexample 633@end smallexample
603 634
604The include mechanism works only with the fancy diary display, because 635The include mechanism works only with the fancy diary display, because
605ordinary diary display shows the entries directly from your diary file. 636simple diary display shows the entries directly from your diary file.
606 637
607@node Sexp Diary Entries 638@node Sexp Diary Entries
608@subsection Sexp Entries and the Fancy Diary Display 639@subsection Sexp Entries and the Fancy Diary Display
@@ -612,8 +643,8 @@ ordinary diary display shows the entries directly from your diary file.
612 Sexp diary entries allow you to do more than just have complicated 643 Sexp diary entries allow you to do more than just have complicated
613conditions under which a diary entry applies. Sexp entries should be 644conditions under which a diary entry applies. Sexp entries should be
614preceded by @code{diary-sexp-entry-symbol} (default @samp{%%}) in the 645preceded by @code{diary-sexp-entry-symbol} (default @samp{%%}) in the
615diary file. If you use the fancy diary display, sexp entries can 646diary file. With the fancy diary display, sexp entries can generate the
616generate the text of the entry depending on the date itself. 647text of the entry depending on the date itself.
617 648
618For example, an anniversary diary entry can insert 649For example, an anniversary diary entry can insert
619the number of years since the anniversary date into the text of the 650the number of years since the anniversary date into the text of the