GNU bug report logs -
#80003
Add bookmark-after-load-hook
Previous Next
To reply to this bug, email your comments to 80003 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80003; Package
emacs.
(Sat, 13 Dec 2025 22:39:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stéphane Marks <shipmints <at> gmail.com>:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org.
(Sat, 13 Dec 2025 22:39:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
As bookmarks can contain pretty much anything representable in Elisp, the
uses of bookmarks now include things beyond its original scope. Packages
such as https://elpa.gnu.org/packages/activities.html and
https://elpa.gnu.org/packages/bufferlo.html (both of which I've contributed
to), and others, use bookmarks to record named persistable and recallable
state. These packages could react when the bookmarks file has been
reloaded, as it often may need to be when running more than one Emacs
session, and compare the package's active state to the refreshed
'bookmark-alist'.
To do that, I propose adding the regular hook 'bookmark-after-load-hook'.
If agreeable, I will submit a patch.
-Stéphane
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80003; Package
emacs.
(Sun, 14 Dec 2025 16:51:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 80003 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Sat 13 Dec 2025 at 05:37pm -05, Stéphane Marks wrote:
> As bookmarks can contain pretty much anything representable in Elisp, the uses
> of bookmarks now include things beyond its original scope. Packages such as
> https://elpa.gnu.org/packages/activities.html and
> https://elpa.gnu.org/packages/bufferlo.html (both of which I've contributed to),
> and others, use bookmarks to record named persistable and recallable state.
> These packages could react when the bookmarks file has been reloaded, as it often
> may need to be when running more than one Emacs session, and compare the
> package's active state to the refreshed 'bookmark-alist'.
>
> To do that, I propose adding the regular hook 'bookmark-after-load-hook'.
A hook run after reloading the bookmarks file seems simple enough,
though how about a name like bookmark-after-load-bookmark-file-hook to
make that explicit?
Can you sketch an example of responding to the refreshed bookmark-alist
for those of us who use only fairly simple bookmarks?
--
Sean Whitton
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80003; Package
emacs.
(Sun, 14 Dec 2025 18:05:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 80003 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sun, Dec 14, 2025 at 11:50 AM Sean Whitton <spwhitton <at> spwhitton.name>
wrote:
> Hello,
>
> On Sat 13 Dec 2025 at 05:37pm -05, Stéphane Marks wrote:
>
> > As bookmarks can contain pretty much anything representable in Elisp,
> the uses
> > of bookmarks now include things beyond its original scope. Packages
> such as
> > https://elpa.gnu.org/packages/activities.html and
> > https://elpa.gnu.org/packages/bufferlo.html (both of which I've
> contributed to),
> > and others, use bookmarks to record named persistable and recallable
> state.
> > These packages could react when the bookmarks file has been reloaded, as
> it often
> > may need to be when running more than one Emacs session, and compare the
> > package's active state to the refreshed 'bookmark-alist'.
> >
> > To do that, I propose adding the regular hook 'bookmark-after-load-hook'.
>
> A hook run after reloading the bookmarks file seems simple enough,
> though how about a name like bookmark-after-load-bookmark-file-hook to
> make that explicit?
>
If we want. The only thing that can be "loaded" in the bookmark context is
the bookmark file, and the loading function is called 'bookmark-load' not
'bookmark-load-file', so it seems redundant and a bit more verbose for not
a lot of gain.
Can you sketch an example of responding to the refreshed bookmark-alist
> for those of us who use only fairly simple bookmarks?
>
Here's one example. bufferlo maintains named workspace context based on
bookmark names. In the case when bookmarks are reloaded, and a currently
"active" bufferlo workspace that had been named and bookmarked is now no
longer bookmarked in the refreshed bookmark-alist, bufferlo could reconcile
and provide some infrastructure to warn users and offer to save context
previously saved to avoid workflow data loss. I need this often as I run
sometimes 3 or 4 Emacs sessions all sharing the same ~/.emacs.d and hence
sharing the default bookmark file. I like this set up and occasionally
make a mistake and overwrite or delete a bookmark. Hence the safety belt.
Make sense?
>
> --
> Sean Whitton
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80003; Package
emacs.
(Mon, 15 Dec 2025 11:53:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 80003 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Sun 14 Dec 2025 at 01:04pm -05, Stéphane Marks wrote:
> If we want. The only thing that can be "loaded" in the bookmark
> context is the bookmark file, and the loading function is called
> 'bookmark-load' not 'bookmark-load-file', so it seems redundant and a
> bit more verbose for not a lot of gain.
Thanks for pointing out the function name.
I still find bookmark-after-load-hook too brief because the "bookmark"
is pure namespacing so I immediately think, "after loading what?"
> Can you sketch an example of responding to the refreshed bookmark-alist
> for those of us who use only fairly simple bookmarks?
>
> Here's one example. bufferlo maintains named workspace context based on
> bookmark names. In the case when bookmarks are reloaded, and a currently
> "active" bufferlo workspace that had been named and bookmarked is now no
> longer bookmarked in the refreshed bookmark-alist, bufferlo could reconcile and
> provide some infrastructure to warn users and offer to save context previously
> saved to avoid workflow data loss. I need this often as I run sometimes 3 or 4
> Emacs sessions all sharing the same ~/.emacs.d and hence sharing the default
> bookmark file. I like this set up and occasionally make a mistake and overwrite or
> delete a bookmark. Hence the safety belt.
>
> Make sense?
Yes, that makes sense, thanks. Makes a hook seem appropriate.
--
Sean Whitton
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80003; Package
emacs.
(Mon, 15 Dec 2025 20:28:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 80003 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Mon, Dec 15, 2025 at 6:51 AM Sean Whitton <spwhitton <at> spwhitton.name>
wrote:
> Hello,
>
> On Sun 14 Dec 2025 at 01:04pm -05, Stéphane Marks wrote:
>
> > If we want. The only thing that can be "loaded" in the bookmark
> > context is the bookmark file, and the loading function is called
> > 'bookmark-load' not 'bookmark-load-file', so it seems redundant and a
> > bit more verbose for not a lot of gain.
>
> Thanks for pointing out the function name.
>
> I still find bookmark-after-load-hook too brief because the "bookmark"
> is pure namespacing so I immediately think, "after loading what?"
>
> > Can you sketch an example of responding to the refreshed bookmark-alist
> > for those of us who use only fairly simple bookmarks?
> >
> > Here's one example. bufferlo maintains named workspace context based on
> > bookmark names. In the case when bookmarks are reloaded, and a currently
> > "active" bufferlo workspace that had been named and bookmarked is now no
> > longer bookmarked in the refreshed bookmark-alist, bufferlo could
> reconcile and
> > provide some infrastructure to warn users and offer to save context
> previously
> > saved to avoid workflow data loss. I need this often as I run sometimes
> 3 or 4
> > Emacs sessions all sharing the same ~/.emacs.d and hence sharing the
> default
> > bookmark file. I like this set up and occasionally make a mistake and
> overwrite or
> > delete a bookmark. Hence the safety belt.
> >
> > Make sense?
>
> Yes, that makes sense, thanks. Makes a hook seem appropriate.
>
I wound up using the more explicit name `bookmark-after-load-file-hook` as
there is an obsolete hook called `bookmark-load-hook` and I figured let's
differentiate more clearly.
Patch attached.
-Stéphane
[Message part 2 (text/html, inline)]
[0001-New-bookmark-after-load-file-hook.patch (application/octet-stream, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80003; Package
emacs.
(Tue, 16 Dec 2025 12:06:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 80003 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Mon 15 Dec 2025 at 03:27pm -05, Stéphane Marks wrote:
> From f868eb32da35183f9ffb7f9f0a03d54f7c7e90f6 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?St=C3=A9phane=20Marks?= <shipmints <at> gmail.com>
> Date: Mon, 15 Dec 2025 15:21:23 -0500
> Subject: [PATCH] New bookmark-after-load-file-hook
>
> This hook can be used, for example, to reconcile
> 'bookmark-alist' against bookmark state you or a package you use
> maintains.
Please move this text out of the commit message and into the docstring
for the new hook.
> * etc/NEWS: Announce the new hook.
> * lisp/bookmark.el (bookmark-after-load-file-hook): New defcustom.
> (bookmark-load): Call the new hook.
You can shorten this to just
* lisp/bookmark.el (bookmark-after-load-file-hook): New hook.
(bookmark-load): Run it.
* etc/NEWS: Announce it.
> +---
> +*** New hook 'bookmark-after-load-file-hook.
Missing closing quotation mark here.
--
Sean Whitton
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#80003; Package
emacs.
(Tue, 16 Dec 2025 13:34:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 80003 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Tue, Dec 16, 2025 at 7:05 AM Sean Whitton <spwhitton <at> spwhitton.name>
wrote:
> Hello,
>
> On Mon 15 Dec 2025 at 03:27pm -05, Stéphane Marks wrote:
>
> > From f868eb32da35183f9ffb7f9f0a03d54f7c7e90f6 Mon Sep 17 00:00:00 2001
> > From: =?UTF-8?q?St=C3=A9phane=20Marks?= <shipmints <at> gmail.com>
> > Date: Mon, 15 Dec 2025 15:21:23 -0500
> > Subject: [PATCH] New bookmark-after-load-file-hook
> >
> > This hook can be used, for example, to reconcile
> > 'bookmark-alist' against bookmark state you or a package you use
> > maintains.
>
> Please move this text out of the commit message and into the docstring
> for the new hook.
>
Done.
> * etc/NEWS: Announce the new hook.
> > * lisp/bookmark.el (bookmark-after-load-file-hook): New defcustom.
> > (bookmark-load): Call the new hook.
>
> You can shorten this to just
>
> * lisp/bookmark.el (bookmark-after-load-file-hook): New hook.
> (bookmark-load): Run it.
> * etc/NEWS: Announce it.
>
Done.
> +---
> > +*** New hook 'bookmark-after-load-file-hook.
>
> Missing closing quotation mark here.
>
Done.
Thanks for the review. Revised patch attached.
-Stéphane
[Message part 2 (text/html, inline)]
[0001-New-bookmark-after-load-file-hook-bug-80003.patch (application/octet-stream, attachment)]
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.