unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Matthias Meulien <orontee@gmail.com>
Cc: 41225@debbugs.gnu.org
Subject: bug#41225: [PATCH] Show bookmark list in new tab
Date: Sat, 08 Aug 2020 13:47:38 +0200	[thread overview]
Message-ID: <87ft8x4aw5.fsf@gnus.org> (raw)
In-Reply-To: <87eerok8cc.fsf@gmail.com> (Matthias Meulien's message of "Wed, 13 May 2020 02:05:23 +0200")

Matthias Meulien <orontee@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





  reply	other threads:[~2020-08-08 11:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13  0:05 bug#41225: [PATCH] Show bookmark list in new tab Matthias Meulien
2020-08-08 11:47 ` Lars Ingebrigtsen [this message]
2020-08-08 11:49   ` Lars Ingebrigtsen
2020-08-09 14:35   ` Matthias Meulien
2020-08-09 19:51     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ft8x4aw5.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=41225@debbugs.gnu.org \
    --cc=orontee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).