summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2023-12-13 14:27:54 +0800
committerJSDurand <mmemmew@gmail.com>2023-12-13 14:27:54 +0800
commit711175587fe8022dbaae300916006fdfe74ca442 (patch)
treea7b1c79ec98808461fe9acb4fb5239821e8070b7
parentc0e7b1bc0dc1fec9af3d60adba5620abba2756d6 (diff)
bookmark: jump to bookmark in a new tab
* bookmark-conf.el (durand-jump-bookmark-new-tab, tab-prefix-map): Jump to bookmark in a new tab.
-rw-r--r--bookmark-conf.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/bookmark-conf.el b/bookmark-conf.el
index eddb3d5..04973ba 100644
--- a/bookmark-conf.el
+++ b/bookmark-conf.el
@@ -473,5 +473,18 @@ Below are listed three possible scenarios:
(define-key ctl-x-r-map (vector ?s) #'durand-save-bookmark-or-desktop)
+;;; Jump to bookmark in a new tab
+
+(defun durand-jump-bookmark-new-tab (bookmark)
+ "Jump to BOOKMARK similar to `bookmark-jump'.
+But this always opens the bookmark in a new tab."
+ (interactive
+ (list (bookmark-completing-read "Jump to bookmark"
+ bookmark-current-bookmark)))
+ (bookmark-jump bookmark #'switch-to-buffer-other-tab))
+
+(define-key tab-prefix-map (vector ?B)
+ #'durand-jump-bookmark-new-tab)
+
(provide 'bookmark-conf)
;;; bookmark-conf.el ends here