]> git.eshelyaron.com Git - emacs.git/commitdiff
Also fix calendar-scroll-left
authorPo Lu <luangruo@yahoo.com>
Thu, 10 Aug 2023 05:30:33 +0000 (13:30 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 10 Aug 2023 05:30:33 +0000 (13:30 +0800)
* 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

index 07a813bb7053d08288ed566073a98dcdabb13830..35adb2d80dfa614a0936d798f804cf4fc28e6a52 100644 (file)
@@ -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))