diff options
| author | Glenn Morris | 2010-09-28 21:10:34 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-09-28 21:10:34 -0700 |
| commit | 7161e329ef71ee536d94e6cd0328ad1b7540cc23 (patch) | |
| tree | 644d845d957e8b27c7da7222fffda8612bb2d404 | |
| parent | d0de6cba6f2bc6ed9358a8f56fb25421e0e3471b (diff) | |
| download | emacs-7161e329ef71ee536d94e6cd0328ad1b7540cc23.tar.gz emacs-7161e329ef71ee536d94e6cd0328ad1b7540cc23.zip | |
Minor diary-lib change.
* lisp/calendar/diary-lib.el (diary-list-entries): Move the
"Preparing..." message entirely here.
(diary-simple-display, diary-fancy-display): Move "Preparing..."
messages to diary-list-entries.
(diary-include-other-diary-files): Use LIST-ONLY rather than setting
diary-display-function.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/calendar/diary-lib.el | 36 |
2 files changed, 23 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24a359cea77..5d65ecf5987 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2010-09-29 Glenn Morris <rgm@gnu.org> | 1 | 2010-09-29 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * calendar/diary-lib.el (diary-list-entries): Move the | ||
| 4 | "Preparing..." message entirely here. | ||
| 5 | (diary-simple-display, diary-fancy-display): Move "Preparing..." | ||
| 6 | messages to diary-list-entries. | ||
| 7 | (diary-include-other-diary-files): Use LIST-ONLY rather than setting | ||
| 8 | diary-display-function. | ||
| 9 | |||
| 3 | * calendar/diary-lib.el (diary-include-other-diary-files): | 10 | * calendar/diary-lib.el (diary-include-other-diary-files): |
| 4 | Trap some recursive includes. | 11 | Trap some recursive includes. |
| 5 | 12 | ||
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index ae244e0a1b6..37af75a7164 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -700,7 +700,6 @@ of the appropriate type." | |||
| 700 | (1+ (calendar-absolute-from-gregorian gdate)))))) | 700 | (1+ (calendar-absolute-from-gregorian gdate)))))) |
| 701 | (goto-char (point-min))) | 701 | (goto-char (point-min))) |
| 702 | 702 | ||
| 703 | (defvar diary-including) ; dynamically bound in diary-include-other-diary-files | ||
| 704 | (defvar diary-included-files nil | 703 | (defvar diary-included-files nil |
| 705 | "List of any diary files included in the last call to `diary-list-entries'.") | 704 | "List of any diary files included in the last call to `diary-list-entries'.") |
| 706 | 705 | ||
| @@ -759,10 +758,12 @@ LIST-ONLY is non-nil, in which case it just returns the list." | |||
| 759 | (let* ((original-date date) ; save for possible use in the hooks | 758 | (let* ((original-date date) ; save for possible use in the hooks |
| 760 | (date-string (calendar-date-string date)) | 759 | (date-string (calendar-date-string date)) |
| 761 | (diary-buffer (find-buffer-visiting diary-file)) | 760 | (diary-buffer (find-buffer-visiting diary-file)) |
| 761 | ;; Dynamically bound in diary-include-other-diary-files. | ||
| 762 | (d-incp (and (boundp 'diary-including) diary-including)) | ||
| 762 | diary-entries-list file-glob-attrs) | 763 | diary-entries-list file-glob-attrs) |
| 763 | (or (bound-and-true-p diary-including) | 764 | (unless d-incp |
| 764 | (setq diary-included-files nil)) | 765 | (setq diary-included-files nil) |
| 765 | (message "Preparing diary...") | 766 | (message "Preparing diary...")) |
| 766 | (save-current-buffer | 767 | (save-current-buffer |
| 767 | (if (not diary-buffer) | 768 | (if (not diary-buffer) |
| 768 | (set-buffer (find-file-noselect diary-file t)) | 769 | (set-buffer (find-file-noselect diary-file t)) |
| @@ -816,6 +817,7 @@ LIST-ONLY is non-nil, in which case it just returns the list." | |||
| 816 | (funcall (or diary-display-function | 817 | (funcall (or diary-display-function |
| 817 | 'diary-simple-display)))) | 818 | 'diary-simple-display)))) |
| 818 | (run-hooks 'diary-hook) | 819 | (run-hooks 'diary-hook) |
| 820 | (or d-incp (message "Preparing diary...done")) | ||
| 819 | diary-entries-list))))))) | 821 | diary-entries-list))))))) |
| 820 | 822 | ||
| 821 | (define-obsolete-function-alias 'list-diary-entries 'diary-list-entries "22.1") | 823 | (define-obsolete-function-alias 'list-diary-entries 'diary-list-entries "22.1") |
| @@ -846,22 +848,18 @@ the variable `diary-include-string'." | |||
| 846 | nil t) | 848 | nil t) |
| 847 | (let ((diary-file (match-string-no-properties 1)) | 849 | (let ((diary-file (match-string-no-properties 1)) |
| 848 | (diary-list-entries-hook 'diary-include-other-diary-files) | 850 | (diary-list-entries-hook 'diary-include-other-diary-files) |
| 849 | (diary-display-function 'ignore) | ||
| 850 | (diary-including t) | 851 | (diary-including t) |
| 851 | diary-hook diary-list-include-blanks efile) | 852 | diary-hook diary-list-include-blanks efile) |
| 852 | (if (file-exists-p diary-file) | 853 | (if (file-exists-p diary-file) |
| 853 | (if (file-readable-p diary-file) | 854 | (if (file-readable-p diary-file) |
| 854 | (unwind-protect | 855 | (if (member (setq efile (expand-file-name diary-file)) |
| 855 | (if (member (setq efile (expand-file-name diary-file)) | 856 | diary-included-files) |
| 856 | diary-included-files) | 857 | (error "Recursive diary include for %s" diary-file) |
| 857 | (error "Recursive diary include for %s" diary-file) | 858 | (setq diary-included-files |
| 858 | (setq diary-included-files | 859 | (append diary-included-files (list efile)) |
| 859 | (append diary-included-files (list efile)) | 860 | diary-entries-list |
| 860 | diary-entries-list | 861 | (append diary-entries-list |
| 861 | (append diary-entries-list | 862 | (diary-list-entries original-date number t)))) |
| 862 | (diary-list-entries original-date number)))) | ||
| 863 | (with-current-buffer (find-buffer-visiting diary-file) | ||
| 864 | (diary-unhide-everything))) | ||
| 865 | (beep) | 863 | (beep) |
| 866 | (message "Can't read included diary file %s" diary-file) | 864 | (message "Can't read included diary file %s" diary-file) |
| 867 | (sleep-for 2)) | 865 | (sleep-for 2)) |
| @@ -930,8 +928,7 @@ in the mode line. This is an option for `diary-display-function'." | |||
| 930 | (let ((window (display-buffer (current-buffer)))) | 928 | (let ((window (display-buffer (current-buffer)))) |
| 931 | ;; d-s-p is passed from diary-list-entries. | 929 | ;; d-s-p is passed from diary-list-entries. |
| 932 | (set-window-point window diary-saved-point) | 930 | (set-window-point window diary-saved-point) |
| 933 | (set-window-start window (point-min)))) | 931 | (set-window-start window (point-min))))))) |
| 934 | (message "Preparing diary...done")))) | ||
| 935 | 932 | ||
| 936 | (define-obsolete-function-alias 'simple-diary-display | 933 | (define-obsolete-function-alias 'simple-diary-display |
| 937 | 'diary-simple-display "23.1") | 934 | 'diary-simple-display "23.1") |
| @@ -1053,8 +1050,7 @@ This is an option for `diary-display-function'." | |||
| 1053 | (if (eq major-mode 'diary-fancy-display-mode) | 1050 | (if (eq major-mode 'diary-fancy-display-mode) |
| 1054 | (run-hooks 'diary-fancy-display-mode-hook) | 1051 | (run-hooks 'diary-fancy-display-mode-hook) |
| 1055 | (diary-fancy-display-mode)) | 1052 | (diary-fancy-display-mode)) |
| 1056 | (calendar-set-mode-line date-string) | 1053 | (calendar-set-mode-line date-string)))) |
| 1057 | (message "Preparing diary...done")))) | ||
| 1058 | 1054 | ||
| 1059 | (define-obsolete-function-alias 'fancy-diary-display | 1055 | (define-obsolete-function-alias 'fancy-diary-display |
| 1060 | 'diary-fancy-display "23.1") | 1056 | 'diary-fancy-display "23.1") |