From 1ef0fce2e4f3f508190e18c0189c3c452e4441c7 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 17 Jun 2024 12:47:19 +0200 Subject: [PATCH] Correct 'bookmark-display' --- lisp/bookmark.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 42fdbc9ca85..6056493c966 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1349,7 +1349,23 @@ and then show any annotations for this bookmark." (list (bookmark-completing-read "Display bookmark" bookmark-current-bookmark))) (unless bookmark (user-error "You didn't specify a bookmark")) - (bookmark-jump bookmark #'display-buffer)) + (let* ((buf-point + (save-current-buffer + (bookmark-handle-bookmark bookmark) + (when bookmark-fringe-mark + (let ((overlays (overlays-in (pos-bol) (1+ (pos-bol)))) + temp found) + (while (and (not found) (setq temp (pop overlays))) + (when (eq 'bookmark (overlay-get temp 'category)) + (setq found t))) + (unless found + (bookmark--set-fringe-mark)))) + (cons (current-buffer) (point)))) + (buf (car buf-point)) + (point (cdr buf-point))) + (display-buffer buf) + (when-let ((win (get-buffer-window buf 0))) + (set-window-point win point)))) (put 'bookmark-display 'minibuffer-action "display") -- 2.39.2