]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Bug#71603
authorEshel Yaron <me@eshelyaron.com>
Mon, 17 Jun 2024 10:51:19 +0000 (12:51 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 17 Jun 2024 10:51:19 +0000 (12:51 +0200)
lisp/bookmark.el

index 6056493c966cf67a0fd6ccb4fa2e7bd427275fe1..062ef1146bef658230ee85202f5acaaee58b5c0a 100644 (file)
@@ -1322,10 +1322,12 @@ After calling DISPLAY-FUNCTION, set window point to the point specified
 by BOOKMARK-NAME-OR-RECORD, if necessary, run `bookmark-after-jump-hook',
 and then show any annotations for this bookmark."
   (bookmark-handle-bookmark bookmark-name-or-record)
-  (save-current-buffer
-    (funcall display-function (current-buffer)))
-  (let ((win (get-buffer-window (current-buffer) 0)))
-    (if win (set-window-point win (point))))
+  ;; Store `point', because `display-function' might change it.
+  (let ((bkmk-point (point)))
+    (save-current-buffer
+      (funcall display-function (current-buffer)))
+    (let ((win (get-buffer-window (current-buffer) 0)))
+      (if win (set-window-point win bkmk-point))))
   ;; FIXME: we used to only run bookmark-after-jump-hook in
   ;; `bookmark-jump' itself, but in none of the other commands.
   (when bookmark-fringe-mark
@@ -2374,14 +2376,12 @@ the related behaviors of `bookmark-save' and `bookmark-bmenu-save'."
   (interactive nil bookmark-bmenu-mode)
   (bookmark-jump (bookmark-bmenu-bookmark)))
 
-
 (defun bookmark-bmenu-other-window ()
   "Select this line's bookmark in other window, leaving bookmark menu visible."
   (interactive nil bookmark-bmenu-mode)
   (let ((bookmark (bookmark-bmenu-bookmark)))
     (bookmark--jump-via bookmark 'switch-to-buffer-other-window)))
 
-
 (defun bookmark-bmenu-other-frame ()
   "Select this line's bookmark in other frame."
   (interactive nil bookmark-bmenu-mode)