Commit 253b50b4 authored by Glenn Morris's avatar Glenn Morris

(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.
parent a26a08f2
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment