summaryrefslogtreecommitdiff
path: root/lisp/calendar
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2005-03-01 10:24:33 +0000
committerGlenn Morris <rgm@gnu.org>2005-03-01 10:24:33 +0000
commita20ae832b231a44944d63a78235fd9e426e60ea1 (patch)
treeee79c5dc0c77b73a7bcafd58a7970cfd058b5c88 /lisp/calendar
parent56567499020b0fbc126fb5c3fa32cff8c0e0ca11 (diff)
downloademacs-a20ae832b231a44944d63a78235fd9e426e60ea1.tar.gz
(redraw-calendar): Work from any buffer, not just the calendar.
Diffstat (limited to 'lisp/calendar')
-rw-r--r--lisp/calendar/calendar.el10
1 files 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."