From b7c49febb0464b7c633ef44797833adfb2e7a7a8 Mon Sep 17 00:00:00 2001 From: "Edward M. Reingold" Date: Fri, 2 Jun 1995 14:44:34 +0000 Subject: [PATCH] New function to create (but not fill) the fancy diary buffer. --- lisp/diary-lib.el | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lisp/diary-lib.el b/lisp/diary-lib.el index ccf80d44de6..a78475bc916 100644 --- a/lisp/diary-lib.el +++ b/lisp/diary-lib.el @@ -357,11 +357,8 @@ This function is provided for optional use as the `diary-display-hook'." (display-buffer holiday-buffer) (message "No diary entries for %s" date-string))) (save-excursion;; Prepare the fancy diary buffer. - (set-buffer (get-buffer-create fancy-diary-buffer)) + (set-buffer (make-fancy-diary-buffer)) (setq buffer-read-only nil) - (make-local-variable 'mode-line-format) - (calendar-set-mode-line "Diary Entries") - (erase-buffer) (let ((entry-list diary-entries-list) (holiday-list) (holiday-list-last-month 1) @@ -418,6 +415,18 @@ This function is provided for optional use as the `diary-display-hook'." (display-buffer fancy-diary-buffer) (message "Preparing diary...done")))) +(defun make-fancy-diary-buffer () + "Create and return the initial fancy diary buffer." + (save-excursion + (set-buffer (get-buffer-create fancy-diary-buffer)) + (setq buffer-read-only nil) + (make-local-variable 'mode-line-format) + (calendar-set-mode-line "Diary Entries") + (erase-buffer) + (set-buffer-modified-p nil) + (setq buffer-read-only t) + (get-buffer fancy-diary-buffer))) + (defun print-diary-entries () "Print a hard copy of the diary display. -- 2.39.2