branch: externals/bufferlo
commit 2cd2b3a52f4456f00b90ffe767064f3c714b2a33
Author: Florian Rommel <m...@florommel.de>
Commit: Florian Rommel <m...@florommel.de>

    Add bookmark-jump workaround for bufferlo frame bookmarks
---
 bufferlo.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bufferlo.el b/bufferlo.el
index 488f30c309..c5009fd223 100644
--- a/bufferlo.el
+++ b/bufferlo.el
@@ -2450,6 +2450,14 @@ the message after successfully restoring the bookmark."
          ;; of with-selected-frame
          (select-frame-set-input-focus frame)))
 
+      (unless (or new-frame-p pop-up-frames)
+        ;; Switch to the to-be-selected buffer in the current frame.
+        ;; This is a workaround for bookmark-jump if called with display-func
+        ;; set to something like pop-to-buffer-same-window (the default).
+        ;; Without this, the previously selected buffer will leak into the
+        ;; loaded frame bookmark.
+        (switch-to-buffer (window-buffer (frame-selected-window nil))))
+
       ;; Log message
       (unless (or no-message bufferlo--bookmark-handler-no-message)
         (message "Restored bufferlo frame bookmark%s%s"

Reply via email to