From: Glenn Morris Date: Fri, 30 May 2008 02:58:01 +0000 (+0000) Subject: (calendar-dedicate-diary): Update for diary-display-function replacing X-Git-Tag: emacs-pretest-23.0.90~5206 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f082900a2bef989ef5bec078d1eac63bb69e42ab;p=emacs.git (calendar-dedicate-diary): Update for diary-display-function replacing diary-display-hook. --- diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el index 522b4c5f790..8b1ec868cec 100644 --- a/lisp/calendar/cal-x.el +++ b/lisp/calendar/cal-x.el @@ -90,21 +90,25 @@ Runs `calendar-after-frame-setup-hook', selects frame, iconifies if needed." (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