From: Eshel Yaron Date: Mon, 17 Jun 2024 10:47:19 +0000 (+0200) Subject: Correct 'bookmark-display' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1ef0fce2e4f3f508190e18c0189c3c452e4441c7;p=emacs.git Correct 'bookmark-display' --- 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")