From: Po Lu Date: Thu, 10 Aug 2023 05:30:33 +0000 (+0800) Subject: Also fix calendar-scroll-left X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b556c180f6503536b355758c33104fb25b5f53fd;p=emacs.git Also fix calendar-scroll-left * lisp/calendar/cal-move.el (calendar-scroll-left): Use `calendar-event-buffer' instead of assuming that EVENT's posn-window is always a window. --- diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el index 07a813bb705..35adb2d80df 100644 --- a/lisp/calendar/cal-move.el +++ b/lisp/calendar/cal-move.el @@ -157,9 +157,10 @@ EVENT is an event like `last-nonmenu-event'." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) (unless arg (setq arg 1)) - (save-selected-window + (save-current-buffer ;; Nil if called from menu-bar. - (if (setq event (event-start event)) (select-window (posn-window event))) + (when (setq event (event-start event)) + (select-buffer (calendar-event-buffer event))) (calendar-cursor-to-nearest-date) (unless (zerop arg) (let ((old-date (calendar-cursor-to-date))