From b556c180f6503536b355758c33104fb25b5f53fd Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 10 Aug 2023 13:30:33 +0800 Subject: [PATCH] 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. --- lisp/calendar/cal-move.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)) -- 2.39.2