diff options
author | Glenn Morris <rgm@gnu.org> | 2005-03-01 10:24:33 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2005-03-01 10:24:33 +0000 |
commit | cea82f86ac9e3d0b86681a7bdee5693e147be9cf (patch) | |
tree | 4576fb3e89b397eb01090a6d1920e3b74d1a06e1 | |
parent | a46c339d7af01d00c5472fabee7bf22f19419bf8 (diff) | |
download | emacs-cea82f86ac9e3d0b86681a7bdee5693e147be9cf.tar.gz |
(redraw-calendar): Work from any buffer, not just the calendar.
-rw-r--r-- | lisp/calendar/calendar.el | 10 |
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." |