From: Glenn Morris Date: Wed, 18 Apr 2007 04:06:37 +0000 (+0000) Subject: (diary-header-line-format): Add a custom :set function. X-Git-Tag: emacs-pretest-22.0.99~185 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=253b50b47984d9410f1c2589bcfd7c4915e897cf;p=emacs.git (diary-header-line-format): Add a custom :set function. (diary-list-entries): Only switch to diary-mode from default-major-mode (reverts 2007-03-21 change). Otherwise, set header-line-format, in case of any customization. --- diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index df01a508031..5838851246f 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -276,6 +276,7 @@ The format of the header is specified by `diary-header-line-format'." :group 'diary :type 'boolean :initialize 'custom-initialize-default + ;; FIXME overkill. :set 'diary-set-maybe-redraw :version "22.1") @@ -292,6 +293,9 @@ before edit/copy" Only used if `diary-header-line-flag' is non-nil." :group 'diary :type 'sexp + :initialize 'custom-initialize-default + ;; FIXME overkill. + :set 'diary-set-maybe-redraw :version "22.1") (defvar diary-saved-point) ; internal @@ -434,10 +438,16 @@ If LIST-ONLY is non-nil don't modify or display the buffer, only return a list." (or (verify-visited-file-modtime diary-buffer) (revert-buffer t t)))) ;; Setup things like the header-line-format and invisibility-spec. - ;; This used to only run if the major-mode was default-major-mode, - ;; but that meant eg changes to header-line-format did not - ;; take effect from one diary invocation to the next. - (diary-mode) + (if (eq major-mode default-major-mode) + (diary-mode) + ;; This kludge is to make customizations to + ;; diary-header-line-flag after diary has been displayed + ;; take effect. Unconditionally calling (diary-mode) + ;; clobbers file local variables. + ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-03/msg00363.html + ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-04/msg00404.html + (setq header-line-format (and diary-header-line-flag + diary-header-line-format))) ;; d-s-p is passed to the diary display function. (let ((diary-saved-point (point))) (save-excursion