]> git.eshelyaron.com Git - emacs.git/commitdiff
(redraw-calendar): Work from any buffer, not just the calendar.
authorGlenn Morris <rgm@gnu.org>
Tue, 1 Mar 2005 10:24:33 +0000 (10:24 +0000)
committerGlenn Morris <rgm@gnu.org>
Tue, 1 Mar 2005 10:24:33 +0000 (10:24 +0000)
lisp/calendar/calendar.el

index 291452db080f7d5b504fb32fd5085b362f50dc8e..66ee1875a2347800659316732a2dad9e4e827a8e 100644 (file)
@@ -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."