From cea82f86ac9e3d0b86681a7bdee5693e147be9cf Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 1 Mar 2005 10:24:33 +0000 Subject: [PATCH] (redraw-calendar): Work from any buffer, not just the calendar. --- lisp/calendar/calendar.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 291452db080..66ee1875a23 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -2169,11 +2169,13 @@ the inserted text. Value is always t." t) (defun redraw-calendar () - "Redraw the calendar display." + "Redraw the calendar display, if `calendar-buffer' is live." (interactive) - (let ((cursor-date (calendar-cursor-to-nearest-date))) - (generate-calendar-window displayed-month displayed-year) - (calendar-cursor-to-visible-date cursor-date))) + (if (get-buffer calendar-buffer) + (with-current-buffer calendar-buffer + (let ((cursor-date (calendar-cursor-to-nearest-date))) + (generate-calendar-window displayed-month displayed-year) + (calendar-cursor-to-visible-date cursor-date))))) (defcustom calendar-debug-sexp nil "*Turn debugging on when evaluating a sexp in the diary or holiday list." -- 2.39.2