emacs-diffs
[Top][All Lists]
Advanced

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

master 1b8f908 2/2: lisp/bookmark.el: Customize choice to show bookmark


From: Lars Ingebrigtsen
Subject: master 1b8f908 2/2: lisp/bookmark.el: Customize choice to show bookmark list in a new tab
Date: Sat, 8 Aug 2020 07:45:40 -0400 (EDT)

branch: master
commit 1b8f9081b9d06575e81cb2b52bf7f62089f844ac
Author: Matthias Meulien <orontee@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    lisp/bookmark.el: Customize choice to show bookmark list in a new tab
    
    * lisp/bookmark.el (bookmark-bmenu-get-buffer): Add as a choice
    for new-tab targets (bug#41225).
---
 etc/NEWS         |  4 ++++
 lisp/bookmark.el | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 2b3cc80..01245d1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -138,6 +138,10 @@ The width now depends of the width of the window, but will 
never be
 wider than the length of the longest buffer name, except that it will
 never be narrower than 19 characters.
 
+*** Bookmarks can now be targets for new tabs.
+When the 'bookmark.el' library is loaded, a customize choice is added
+to 'tab-bar-new-tab-choice' for new tabs to show the bookmark list.
+
 ** Windows
 
 *** The key prefix 'C-x 4 1' displays next command buffer in the same window.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index de7d60f..fb293ad 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1667,6 +1667,19 @@ Don't affect the buffer ring order."
 
 
 ;;;###autoload
+(defun bookmark-bmenu-get-buffer ()
+  "Return the Bookmark List, building it if it doesn't exists.
+Don't affect the buffer ring order."
+  (or (get-buffer bookmark-bmenu-buffer)
+      (save-excursion
+       (save-window-excursion
+         (bookmark-bmenu-list)
+         (get-buffer bookmark-bmenu-buffer)))))
+
+(custom-add-choice 'tab-bar-new-tab-choice
+                   '(const :tag "Bookmark List" bookmark-bmenu-get-buffer))
+
+;;;###autoload
 (defun bookmark-bmenu-list ()
   "Display a list of existing bookmarks.
 The list is displayed in a buffer named `*Bookmark List*'.



reply via email to

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