diff options
| author | Richard M. Stallman | 1993-08-04 23:01:24 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-08-04 23:01:24 +0000 |
| commit | 6e72e7952da3f1b09e77d15ad0b64f9d6e9cb64f (patch) | |
| tree | 0deabed8e77f05b56def5911b36883d8507860a0 | |
| parent | 298b760ea5b6c1ccc07290160eb60dc1d63ca1a3 (diff) | |
| download | emacs-6e72e7952da3f1b09e77d15ad0b64f9d6e9cb64f.tar.gz emacs-6e72e7952da3f1b09e77d15ad0b64f9d6e9cb64f.zip | |
(list-diary-entries): Split diary-display-hook into two
pieces, diary-display-hook and diary-hook. If diary-display-hook
is nil, use simple display.
(include-other-diary-files): Set those hooks properly for other files.
| -rw-r--r-- | lisp/diary-lib.el | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/lisp/diary-lib.el b/lisp/diary-lib.el index 61843e56256..d1b0255d73d 100644 --- a/lisp/diary-lib.el +++ b/lisp/diary-lib.el | |||
| @@ -124,8 +124,8 @@ The list entries have the form ((month day year) string). If the variable | |||
| 124 | \(consisting of the empty string) for a date with no diary entries. | 124 | \(consisting of the empty string) for a date with no diary entries. |
| 125 | 125 | ||
| 126 | After the list is prepared, the hooks `nongregorian-diary-listing-hook', | 126 | After the list is prepared, the hooks `nongregorian-diary-listing-hook', |
| 127 | `list-diary-entries-hook', and `diary-display-hook' are run. These hooks | 127 | `list-diary-entries-hook', `diary-display-hook', and `diary-hook' are run. |
| 128 | have the following distinct roles: | 128 | These hooks have the following distinct roles: |
| 129 | 129 | ||
| 130 | `nongregorian-diary-listing-hook' can cull dates from the diary | 130 | `nongregorian-diary-listing-hook' can cull dates from the diary |
| 131 | and each included file. Usually used for Hebrew or Islamic | 131 | and each included file. Usually used for Hebrew or Islamic |
| @@ -133,10 +133,16 @@ have the following distinct roles: | |||
| 133 | 133 | ||
| 134 | `list-diary-entries-hook' adds or manipulates diary entries from | 134 | `list-diary-entries-hook' adds or manipulates diary entries from |
| 135 | external sources. Used, for example, to include diary entries | 135 | external sources. Used, for example, to include diary entries |
| 136 | from other files or to sort the diary entries. Invoked *once* only. | 136 | from other files or to sort the diary entries. Invoked *once* only, |
| 137 | before the display hook is run. | ||
| 137 | 138 | ||
| 138 | `diary-display-hook' does the actual display of information. Could be | 139 | `diary-display-hook' does the actual display of information. If this is |
| 139 | used also for an appointment notification function." | 140 | nil, simple-diary-display will be used. Use add-hook to set this to |
| 141 | fancy-diary-display, if desired. If you want no diary display, use | ||
| 142 | add-hook to set this to ignore. | ||
| 143 | |||
| 144 | `diary-hook' is run last. This can be used for an appointment | ||
| 145 | notification function." | ||
| 140 | 146 | ||
| 141 | (if (< 0 number) | 147 | (if (< 0 number) |
| 142 | (let* ((original-date date);; save for possible use in the hooks | 148 | (let* ((original-date date);; save for possible use in the hooks |
| @@ -239,8 +245,11 @@ have the following distinct roles: | |||
| 239 | (set-syntax-table old-diary-syntax-table)) | 245 | (set-syntax-table old-diary-syntax-table)) |
| 240 | (goto-char (point-min)) | 246 | (goto-char (point-min)) |
| 241 | (run-hooks 'nongregorian-diary-listing-hook | 247 | (run-hooks 'nongregorian-diary-listing-hook |
| 242 | 'list-diary-entries-hook | 248 | 'list-diary-entries-hook) |
| 243 | 'diary-display-hook) | 249 | (if diary-display-hook |
| 250 | (run-hooks 'diary-display-hook) | ||
| 251 | (simple-diary-display)) | ||
| 252 | (run-hooks 'diary-hook) | ||
| 244 | diary-entries-list)))) | 253 | diary-entries-list)))) |
| 245 | 254 | ||
| 246 | (defun include-other-diary-files () | 255 | (defun include-other-diary-files () |
| @@ -263,7 +272,8 @@ changing the variable `diary-include-string'." | |||
| 263 | (buffer-substring (match-beginning 2) (match-end 2)))) | 272 | (buffer-substring (match-beginning 2) (match-end 2)))) |
| 264 | (diary-list-include-blanks nil) | 273 | (diary-list-include-blanks nil) |
| 265 | (list-diary-entries-hook 'include-other-diary-files) | 274 | (list-diary-entries-hook 'include-other-diary-files) |
| 266 | (diary-display-hook nil)) | 275 | (diary-display-hook 'ignore) |
| 276 | (diary-hook nil)) | ||
| 267 | (if (file-exists-p diary-file) | 277 | (if (file-exists-p diary-file) |
| 268 | (if (file-readable-p diary-file) | 278 | (if (file-readable-p diary-file) |
| 269 | (unwind-protect | 279 | (unwind-protect |