]> git.eshelyaron.com Git - emacs.git/commitdiff
Add 'minibuffer-action' for 'bookmark-jump'
authorEshel Yaron <me@eshelyaron.com>
Sun, 2 Jun 2024 11:15:38 +0000 (13:15 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 2 Jun 2024 11:15:38 +0000 (13:15 +0200)
lisp/bookmark.el

index 25a544ce3ac0e5651b7c031fedb68f08288c1dbe..42fdbc9ca858ca7d06ba1636ad60d7269c7e74b0 100644 (file)
@@ -1342,6 +1342,16 @@ and then show any annotations for this bookmark."
       ;; show it in a buffer.
       (bookmark-show-annotation bookmark-name-or-record)))
 
+;;;###autoload
+(defun bookmark-display (bookmark)
+  "Display BOOKMARK."
+  (interactive
+   (list
+    (bookmark-completing-read "Display bookmark" bookmark-current-bookmark)))
+  (unless bookmark (user-error "You didn't specify a bookmark"))
+  (bookmark-jump bookmark #'display-buffer))
+
+(put 'bookmark-display 'minibuffer-action "display")
 
 ;;;###autoload
 (defun bookmark-jump (bookmark &optional display-func)
@@ -1372,6 +1382,7 @@ DISPLAY-FUNC would be `switch-to-buffer-other-window'."
   ;; `switch-to-buffer-preserve-window-point' is non-nil.
   (bookmark--jump-via bookmark (or display-func 'pop-to-buffer-same-window)))
 
+(put 'bookmark-jump 'minibuffer-action 'bookmark-display)
 
 ;;;###autoload
 (defun bookmark-jump-other-window (bookmark)