GNU bug report logs - #41225
[PATCH] Show bookmark list in new tab

Previous Next

Package: emacs;

Reported by: Matthias Meulien <orontee <at> gmail.com>

Date: Wed, 13 May 2020 00:06:02 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41225 in the body.
You can then email your comments to 41225 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41225; Package emacs. (Wed, 13 May 2020 00:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthias Meulien <orontee <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 13 May 2020 00:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Matthias Meulien <orontee <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Show bookmark list in new tab
Date: Wed, 13 May 2020 02:05:23 +0200
[Message part 1 (text/plain, inline)]
A small patch that adds a customize choice to 
`tab-bar-new-tab-choice` in order to show bookmark list in new 
tab.

[0001-lisp-bookmark.el-Customize-choice-to-show-bookmark-l.patch (text/x-diff, inline)]
From 67bc218224a548699e974d3276f54ae698987d93 Mon Sep 17 00:00:00 2001
From: Matthias Meulien <orontee <at> gmail.com>
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

[Message part 3 (text/plain, inline)]
-- 
Matthias Meulien

Severity set to 'wishlist' from 'normal' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 20 May 2020 15:49:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41225; Package emacs. (Sat, 08 Aug 2020 11:48:02 GMT) Full text and rfc822 format available.

Message #10 received at 41225 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Matthias Meulien <orontee <at> gmail.com>
Cc: 41225 <at> debbugs.gnu.org
Subject: Re: bug#41225: [PATCH] Show bookmark list in new tab
Date: Sat, 08 Aug 2020 13:47:38 +0200
Matthias Meulien <orontee <at> gmail.com> writes:

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

[...]

> +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.

Makes sense to me.

> +;;;###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))))))

I changed this bit into an `or' before committing.

> +(nconc (get 'tab-bar-new-tab-choice 'custom-type)
> +       '((const :tag "Bookmark List" bookmark-bmenu-get-buffer)))

And I'm not sure this is safe.  For one, if you load the file twice,
you'll get this added twice.  And it's destructively modifying a list
that's dumped with Emacs, which I think is undefined behaviour?

So I've added a new utility function custom-add-choice to custom.el that
checks for double entry, and doesn't modify anything destructively, and
pushed this to Emacs 28.1.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 08 Aug 2020 11:48:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 41225 <at> debbugs.gnu.org and Matthias Meulien <orontee <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 08 Aug 2020 11:48:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41225; Package emacs. (Sat, 08 Aug 2020 11:50:01 GMT) Full text and rfc822 format available.

Message #17 received at 41225 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Matthias Meulien <orontee <at> gmail.com>
Cc: 41225 <at> debbugs.gnu.org
Subject: Re: bug#41225: [PATCH] Show bookmark list in new tab
Date: Sat, 08 Aug 2020 13:49:19 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> So I've added a new utility function custom-add-choice to custom.el that
> checks for double entry, and doesn't modify anything destructively, and
> pushed this to Emacs 28.1.

(The function seems like a somewhat generally useful function for modes
to use to add more choices, which is why I didn't keep it as a
bookmark-specific change.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41225; Package emacs. (Sun, 09 Aug 2020 14:36:01 GMT) Full text and rfc822 format available.

Message #20 received at 41225 <at> debbugs.gnu.org (full text, mbox):

From: Matthias Meulien <orontee <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 41225 <at> debbugs.gnu.org
Subject: Re: bug#41225: [PATCH] Show bookmark list in new tab
Date: Sun, 09 Aug 2020 16:35:43 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> And I'm not sure this is safe.  For one, if you load the file 
> twice, you'll get this added twice.  And it's destructively 
> modifying a list that's dumped with Emacs, which I think is 
> undefined behaviour?

Nice catch. I must admit I don't know the dump mecanism at all...

> So I've added a new utility function custom-add-choice to 
> custom.el that checks for double entry, and doesn't modify 
> anything destructively, and pushed this to Emacs 28.1. 

I tested master today and it works like a charm. Thanks for your 
careful reading and improvements!
-- 
Matthias




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41225; Package emacs. (Sun, 09 Aug 2020 19:52:01 GMT) Full text and rfc822 format available.

Message #23 received at 41225 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Matthias Meulien <orontee <at> gmail.com>
Cc: 41225 <at> debbugs.gnu.org
Subject: Re: bug#41225: [PATCH] Show bookmark list in new tab
Date: Sun, 09 Aug 2020 21:51:14 +0200
Matthias Meulien <orontee <at> gmail.com> writes:

> I tested master today and it works like a charm. Thanks for your
> careful reading and improvements!

Thanks for checking.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 07 Sep 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.