diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/cal-xtra.texi | 131 |
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 |
| 336 | that fall on the date of the diary entries. The process of checking for | 336 | date of the diary entries, either in the mode line or the buffer itself. |
| 337 | holidays can be slow, depending on the defined holidays. In that case, | 337 | The process of checking for holidays can be slow, depending on the |
| 338 | setting @code{diary-show-holidays-flag} to @code{nil} will speed up the | 338 | defined holidays. In that case, setting @code{diary-show-holidays-flag} |
| 339 | diary display. | 339 | to @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 | |||
| 351 | Thursday, Friday through Monday's entries appear on Friday, while on | 351 | Thursday, Friday through Monday's entries appear on Friday, while on |
| 352 | Saturday only that day's entries appear. | 352 | Saturday 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 | ||
| 357 | after preparation of a temporary buffer containing just the diary | ||
| 358 | entries currently visible in the diary buffer. (The other, irrelevant | ||
| 359 | diary entries are really absent from the temporary buffer; in the diary | ||
| 360 | buffer, they are merely hidden.) The default value of this hook does | ||
| 361 | the printing with the command @code{lpr-buffer}. If you want to use a | ||
| 362 | different command to do the printing, just change the value of this | ||
| 363 | hook. Other uses might include, for example, rearranging the lines into | ||
| 364 | order 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 |
| 368 | variable @code{diary-date-forms}. This variable is a list of patterns | 356 | variable @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 | |||
| 529 | non-Gregorian day-within-month in every month, and the @samp{yearly} | 517 | non-Gregorian day-within-month in every month, and the @samp{yearly} |
| 530 | commands for the given non-Gregorian day and month in every year. | 518 | commands 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 |
| 540 | function specified by the variable @code{diary-display-function}. The | 528 | running the function specified by the variable |
| 541 | default value (@code{diary-simple-display}) hides the irrelevant diary | 529 | @code{diary-display-function}. The default value |
| 542 | entries 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 |
| 544 | copying them into a special buffer that exists only for the sake of | 531 | copying them into a special buffer that exists only for the sake of |
| 545 | display. Copying to a separate buffer provides an opportunity to change | 532 | display. Copying diary entries to a separate buffer provides an |
| 546 | the displayed text to make it prettier---for example, to sort the | 533 | opportunity to change the displayed text to make it prettier---for |
| 547 | entries by the dates they apply to. | 534 | example, 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 | ||
| 550 | with @code{diary-print-entries}. To print a hard copy of a day-by-day | ||
| 551 | diary 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 | ||
| 553 | inclusion of the holidays slows down the display slightly; you can speed | ||
| 554 | things 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 |
| 559 | no diary entries, even if that day is a holiday. If you want such days to be | 538 | are no diary entries, even if that day is a holiday. If you want such |
| 560 | shown in the fancy diary buffer, set the variable | 539 | days 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 | ||
| 543 | diary buffer, and uses invisible text to hide entries that don't apply. | ||
| 544 | Holidays are shown in the mode line. The advantage of this method is | ||
| 545 | that you can edit the buffer and save your changes directly to the diary | ||
| 546 | file. This method is not as flexible as the fancy method, however. For | ||
| 547 | example, it cannot sort entries. Another disadvantage is that invisible | ||
| 548 | text can be confusing. For example, if you copy a region of text in | ||
| 549 | order to paste it elsewhere, invisible text may be included. Similarly, | ||
| 550 | since the diary buffer as you see it is an illusion, simply printing the | ||
| 551 | buffer 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 | ||
| 556 | diary buffer @emph{as it appears}; this command is @kbd{M-x | ||
| 557 | diary-print-entries}. It works with either display method, although | ||
| 558 | with the fancy display you can also print the buffer like any other. To | ||
| 559 | print a hard copy of a day-by-day diary for a week, position point on | ||
| 560 | the first day of the week, type @kbd{7 d}, and then do @kbd{M-x | ||
| 561 | diary-print-entries}. As usual, the inclusion of the holidays slows | ||
| 562 | down the display slightly; you can speed things up by setting the | ||
| 563 | variable @code{diary-show-holidays-flag} to @code{nil}. | ||
| 564 | |||
| 565 | This command prepares a temporary buffer that contains only the diary | ||
| 566 | entries currently visible in the diary buffer. Unlike with the simple | ||
| 567 | display, the other irrelevant entries are really absent, not just | ||
| 568 | hidden. After preparing the buffer, it runs the hook | ||
| 569 | @code{diary-print-entries-hook}. The default value of this hook sends | ||
| 570 | the 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 | ||
| 572 | printing, just change the value of this hook. Other uses might include, | ||
| 573 | for 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 | ||
| 576 | window, but it is important to remember that the buffer displayed | ||
| 577 | contains the @emph{entire} diary file, with portions of it concealed | ||
| 578 | from view. This means, for instance, that the @kbd{C-f} | ||
| 579 | (@code{forward-char}) command can put point at what appears to be the | ||
| 580 | end of the line, but what is in reality the middle of some concealed | ||
| 581 | line. | ||
| 582 | |||
| 583 | @emph{Be careful when editing the diary entries in the simple display!} | ||
| 584 | Inserting additional lines or adding/deleting characters in the middle | ||
| 585 | of a visible line cannot cause problems, but editing at the end of a | ||
| 586 | line may not do what you expect. Deleting a line may delete other | ||
| 587 | invisible entries that follow it. Before editing the simple diary | ||
| 588 | buffer, 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 | |||
| 594 | The 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 | 598 | each day's diary entries by their time of day. Here's how: |
| 566 | time 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 | |||
| 576 | first within each day. | 608 | first 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 |
| 580 | files. This permits a group of people to share a diary file for events | 612 | people to share a diary file for events that apply to all of them. |
| 581 | that apply to all of them. Lines in the diary file starting with | 613 | Lines 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 | ||
| 604 | The include mechanism works only with the fancy diary display, because | 635 | The include mechanism works only with the fancy diary display, because |
| 605 | ordinary diary display shows the entries directly from your diary file. | 636 | simple 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 |
| 613 | conditions under which a diary entry applies. Sexp entries should be | 644 | conditions under which a diary entry applies. Sexp entries should be |
| 614 | preceded by @code{diary-sexp-entry-symbol} (default @samp{%%}) in the | 645 | preceded by @code{diary-sexp-entry-symbol} (default @samp{%%}) in the |
| 615 | diary file. If you use the fancy diary display, sexp entries can | 646 | diary file. With the fancy diary display, sexp entries can generate the |
| 616 | generate the text of the entry depending on the date itself. | 647 | text of the entry depending on the date itself. |
| 617 | 648 | ||
| 618 | For example, an anniversary diary entry can insert | 649 | For example, an anniversary diary entry can insert |
| 619 | the number of years since the anniversary date into the text of the | 650 | the number of years since the anniversary date into the text of the |