diff options
| author | Glenn Morris | 2007-04-18 04:06:37 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-04-18 04:06:37 +0000 |
| commit | 253b50b47984d9410f1c2589bcfd7c4915e897cf (patch) | |
| tree | 1d6c857b294c8ee192b41cb6254bf58390be1eb8 | |
| parent | a26a08f25356de3880964533394dd956bf438d90 (diff) | |
| download | emacs-253b50b47984d9410f1c2589bcfd7c4915e897cf.tar.gz emacs-253b50b47984d9410f1c2589bcfd7c4915e897cf.zip | |
(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.
| -rw-r--r-- | lisp/calendar/diary-lib.el | 18 |
1 files changed, 14 insertions, 4 deletions
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'." | |||
| 276 | :group 'diary | 276 | :group 'diary |
| 277 | :type 'boolean | 277 | :type 'boolean |
| 278 | :initialize 'custom-initialize-default | 278 | :initialize 'custom-initialize-default |
| 279 | ;; FIXME overkill. | ||
| 279 | :set 'diary-set-maybe-redraw | 280 | :set 'diary-set-maybe-redraw |
| 280 | :version "22.1") | 281 | :version "22.1") |
| 281 | 282 | ||
| @@ -292,6 +293,9 @@ before edit/copy" | |||
| 292 | Only used if `diary-header-line-flag' is non-nil." | 293 | Only used if `diary-header-line-flag' is non-nil." |
| 293 | :group 'diary | 294 | :group 'diary |
| 294 | :type 'sexp | 295 | :type 'sexp |
| 296 | :initialize 'custom-initialize-default | ||
| 297 | ;; FIXME overkill. | ||
| 298 | :set 'diary-set-maybe-redraw | ||
| 295 | :version "22.1") | 299 | :version "22.1") |
| 296 | 300 | ||
| 297 | (defvar diary-saved-point) ; internal | 301 | (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." | |||
| 434 | (or (verify-visited-file-modtime diary-buffer) | 438 | (or (verify-visited-file-modtime diary-buffer) |
| 435 | (revert-buffer t t)))) | 439 | (revert-buffer t t)))) |
| 436 | ;; Setup things like the header-line-format and invisibility-spec. | 440 | ;; Setup things like the header-line-format and invisibility-spec. |
| 437 | ;; This used to only run if the major-mode was default-major-mode, | 441 | (if (eq major-mode default-major-mode) |
| 438 | ;; but that meant eg changes to header-line-format did not | 442 | (diary-mode) |
| 439 | ;; take effect from one diary invocation to the next. | 443 | ;; This kludge is to make customizations to |
| 440 | (diary-mode) | 444 | ;; diary-header-line-flag after diary has been displayed |
| 445 | ;; take effect. Unconditionally calling (diary-mode) | ||
| 446 | ;; clobbers file local variables. | ||
| 447 | ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-03/msg00363.html | ||
| 448 | ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-04/msg00404.html | ||
| 449 | (setq header-line-format (and diary-header-line-flag | ||
| 450 | diary-header-line-format))) | ||
| 441 | ;; d-s-p is passed to the diary display function. | 451 | ;; d-s-p is passed to the diary display function. |
| 442 | (let ((diary-saved-point (point))) | 452 | (let ((diary-saved-point (point))) |
| 443 | (save-excursion | 453 | (save-excursion |