bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71603: Mouse clicking on a list-bookmarks' entry can not jump the cu


From: Eshel Yaron
Subject: bug#71603: Mouse clicking on a list-bookmarks' entry can not jump the cursor
Date: Mon, 17 Jun 2024 08:34:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi there,

Siyuan Chen <chansey97@gmail.com> writes:

> The reproduce steps:
>
> 1. Open Emacs 29.3 on Windows with -Q
>
> 2. Open a .el file which included some code, e.g. init.el
>
> 3. M-x `bookmark-delete-all` to cleanup bookmarks if you have
>
> 4. M-x `bookmark-set` at some locations, e.g. bk1 bk2
>
> 5. M-x `list-bookmarks` to open *Bookmark List* which should have 2 entries
>
> 6. Split 2 windows, the up window displays init.el, the bottom window 
> displays *Bookmark List*
>
> 7. Mouse left click (or press 'on' ) on bk1 or bk2 in *Bookmark List* 
>
> The expected behavior: jump cursor to bk1 or bk2
>
> The actual behavior: nothing happens, except the left fringe displays an 
> additional bookmark icon if your current
> point is not at one of the bookmark locations.

Thanks, I can reproduce this issue on master.  Does the diff below yield
the expected behavior?

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 06f8e24b518..d87d4e473ac 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1265,10 +1265,11 @@ bookmark--jump-via
 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))))
+  (let ((point (point)))
+    (save-current-buffer
+      (funcall display-function (current-buffer)))
+    (let ((win (get-buffer-window (current-buffer) 0)))
+      (if win (set-window-point win 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]