Mercurial > emacs
changeset 95412:f8723a1032ed
(calendar-dedicate-diary): Update for diary-display-function replacing
diary-display-hook.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 30 May 2008 02:58:01 +0000 |
parents | 7a388916f4ae |
children | 2b0558bc8d53 |
files | lisp/calendar/cal-x.el |
diffstat | 1 files changed, 14 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/calendar/cal-x.el Fri May 30 02:57:43 2008 +0000 +++ b/lisp/calendar/cal-x.el Fri May 30 02:58:01 2008 +0000 @@ -90,21 +90,25 @@ (iconify-or-deiconify-frame))) ;; c-d-d is only called after (diary) has been run. -(defvar diary-display-hook) +(defvar diary-display-function) (defun calendar-dedicate-diary () "Display and dedicate the window associated with the diary buffer." (set-window-dedicated-p (display-buffer - (if (not (or (memq 'diary-fancy-display diary-display-hook) - (memq 'fancy-diary-display diary-display-hook))) - (get-file-buffer diary-file) - ;; If there are no diary entries, there won't be a fancy-diary - ;; to dedicate, so make a basic one. - (or (get-buffer diary-fancy-buffer) - (calendar-in-read-only-buffer diary-fancy-buffer - (calendar-set-mode-line "Diary Entries"))) - diary-fancy-buffer)) + (if (if (listp diary-display-function) + (or (memq 'diary-fancy-display diary-display-function) + (memq 'fancy-diary-display diary-display-function)) + (memq diary-display-function '(diary-fancy-display + fancy-diary-display))) + (progn + ;; If there are no diary entries, there won't be a fancy-diary + ;; to dedicate, so make a basic one. + (or (get-buffer diary-fancy-buffer) + (calendar-in-read-only-buffer diary-fancy-buffer + (calendar-set-mode-line "Diary Entries"))) + diary-fancy-buffer) + (get-file-buffer diary-file))) t)) ;;;###cal-autoload