Subject: bug#41225: [PATCH] Show bookmark list in new tab

From: Matthias Meulien <[email-masked]>
Date: Wed, 13 May 2020 02:05:23 +0200

A small patch that adds a customize choice to 
`tab-bar-new-tab-choice` in order to show bookmark list in new 
tab.

>From 67bc218224a548699e974d3276f54ae698987d93 Mon Sep 17 00:00:00 2001
From: Matthias Meulien <[email-masked]>
Date: Tue, 12 May 2020 21:51:40 +0200
Subject: [PATCH] lisp/bookmark.el: Customize choice to show bookmark list in a
 new tab

---
 etc/NEWS         |  5 +++++
 lisp/bookmark.el | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 01c584833b..f3725e954b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -348,6 +348,11 @@ symbol property to the browsing functions.  With a new command
 'browse-url-with-browser-kind', an URL can explicitly be browsed with
 either an internal or external browser.
 
+** bookmark
+
+When the 'bookmark.el' library is loaded, a customize choice is added
+to 'tab-bar-new-tab-choice' for new tab to show the bookmark list.
+
 ** vc-dir.el
 
 *** Support for bookmark.el.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 0fa77ed322..3a8b07f241 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1666,6 +1666,20 @@ bookmark-bmenu-surreptitiously-rebuild-list
           (bookmark-bmenu-list)))))

+;;;###autoload
+(defun bookmark-bmenu-get-buffer ()
+  "Return the Bookmark List, building it if it doesn't exists.
+Don't affect the buffer ring order."
+  (cond
+     ((get-buffer bookmark-bmenu-buffer))
+     (t (save-excursion
+	  (save-window-excursion
+	    (bookmark-bmenu-list)
+	    (get-buffer bookmark-bmenu-buffer))))))
+
+(nconc (get 'tab-bar-new-tab-choice 'custom-type)
+       '((const :tag "Bookmark List" bookmark-bmenu-get-buffer)))
+
 ;;;###autoload
 (defun bookmark-bmenu-list ()
   "Display a list of existing bookmarks.
-- 
2.20.1

-- 
Matthias Meulien