GNU bug report logs -
#76980
[PATCH] 'window-state-normalize-buffer-name' variable for `uniquify' buffers
Previous Next
Reported by: Ship Mints <shipmints <at> gmail.com>
Date: Wed, 12 Mar 2025 16:47:01 UTC
Severity: normal
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.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 76980 in the body.
You can then email your comments to 76980 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76980
; Package
emacs
.
(Wed, 12 Mar 2025 16:47:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ship Mints <shipmints <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 12 Mar 2025 16:47:01 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)]
If 'window-state-normalize-buffer-name' is non-nil, 'window-state-get'
will normalize stored buffer names, making them easier to restore for
users that use 'uniquify' buffer naming.
I've been post-processing window states to deal with this and I think it
should be built in. Similar treatment exists in desktop.el.
-Stephane
[Message part 2 (text/html, inline)]
[0001-window-state-normalize-buffer-name-option-for-uniqui.patch (application/octet-stream, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76980
; Package
emacs
.
(Thu, 13 Mar 2025 17:32:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 76980 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Wed, Mar 12, 2025 at 12:48 PM Ship Mints <shipmints <at> gmail.com> wrote:
> If 'window-state-normalize-buffer-name' is non-nil, 'window-state-get'
> will normalize stored buffer names, making them easier to restore for
> users that use 'uniquify' buffer naming.
>
> I've been post-processing window states to deal with this and I think it
> should be built in. Similar treatment exists in desktop.el.
>
Updated patch with NEWS and doc files mentioned in the commit log.
[Message part 2 (text/html, inline)]
[0001-window-state-normalize-buffer-name-option-for-uniqui.patch (application/octet-stream, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76980
; Package
emacs
.
(Thu, 13 Mar 2025 19:22:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 76980 <at> debbugs.gnu.org (full text, mbox):
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Thu, 13 Mar 2025 13:31:09 -0400
>
> On Wed, Mar 12, 2025 at 12:48 PM Ship Mints <shipmints <at> gmail.com> wrote:
>
> If 'window-state-normalize-buffer-name' is non-nil, 'window-state-get'
> will normalize stored buffer names, making them easier to restore for
> users that use 'uniquify' buffer naming.
>
> I've been post-processing window states to deal with this and I think it should be built in. Similar
> treatment exists in desktop.el.
>
> Updated patch with NEWS and doc files mentioned in the commit log.
Thanks. The documentation parts of this say "normalize buffer name"
without ever explaining what that means. Please fill that gap.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76980
; Package
emacs
.
(Fri, 14 Mar 2025 14:27:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 76980 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Thu, Mar 13, 2025 at 3:21 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > From: Ship Mints <shipmints <at> gmail.com>
> > Date: Thu, 13 Mar 2025 13:31:09 -0400
> >
> > On Wed, Mar 12, 2025 at 12:48 PM Ship Mints <shipmints <at> gmail.com> wrote:
> >
> > If 'window-state-normalize-buffer-name' is non-nil, 'window-state-get'
> > will normalize stored buffer names, making them easier to restore for
> > users that use 'uniquify' buffer naming.
> >
> > I've been post-processing window states to deal with this and I think
> it should be built in. Similar
> > treatment exists in desktop.el.
> >
> > Updated patch with NEWS and doc files mentioned in the commit log.
>
> Thanks. The documentation parts of this say "normalize buffer name"
> without ever explaining what that means. Please fill that gap.
>
Good idea. Revised patch attached.
-Stephane
[Message part 2 (text/html, inline)]
[0001-window-state-normalize-buffer-name-option-for-uniqui.patch (application/octet-stream, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76980
; Package
emacs
.
(Fri, 14 Mar 2025 14:47:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 76980 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Fri, 14 Mar 2025 10:26:28 -0400, Ship Mints <shipmints <at> gmail.com> said:
Ship> ++++
Ship> +*** New variable 'window-state-normalize-buffer-name'.
Ship> +When bound to non-nil, 'window-state-get' will normalize buffer names by
Ship> +removing 'uniquify' adornments, otherwise using nominal buffer names.
Ship> +This helps restore window buffers across Emacs sessions.
Ship> +
This sounds like it could be useful as a user option rather than a
`defvar', no? Or perhaps a buffer-local variable?
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76980
; Package
emacs
.
(Fri, 14 Mar 2025 14:55:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 76980 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Fri, Mar 14, 2025 at 10:45 AM Robert Pluim <rpluim <at> gmail.com> wrote:
> >>>>> On Fri, 14 Mar 2025 10:26:28 -0400, Ship Mints <shipmints <at> gmail.com>
> said:
> Ship> ++++
> Ship> +*** New variable 'window-state-normalize-buffer-name'.
> Ship> +When bound to non-nil, 'window-state-get' will normalize buffer
> names by
> Ship> +removing 'uniquify' adornments, otherwise using nominal buffer
> names.
> Ship> +This helps restore window buffers across Emacs sessions.
> Ship> +
>
> This sounds like it could be useful as a user option rather than a
> `defvar', no? Or perhaps a buffer-local variable?
>
To me, this is a programmatic concern and only the program understands the
context in which it is called. In a sense, this is buffer-local equivalent
as uniquify-managed is itself buffer-local. If this is made global, I
sense there may be window-state-get uses that depend on uniquify names but
since I can't survey the field, I think this would be dangerous. We can
always promote this to a user option later.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76980
; Package
emacs
.
(Fri, 14 Mar 2025 16:13:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 76980 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Fri, 14 Mar 2025 10:54:05 -0400, Ship Mints <shipmints <at> gmail.com> said:
Ship> On Fri, Mar 14, 2025 at 10:45 AM Robert Pluim <rpluim <at> gmail.com> wrote:
>> >>>>> On Fri, 14 Mar 2025 10:26:28 -0400, Ship Mints <shipmints <at> gmail.com>
>> said:
Ship> ++++
Ship> +*** New variable 'window-state-normalize-buffer-name'.
Ship> +When bound to non-nil, 'window-state-get' will normalize buffer
>> names by
Ship> +removing 'uniquify' adornments, otherwise using nominal buffer
>> names.
Ship> +This helps restore window buffers across Emacs sessions.
Ship> +
>>
>> This sounds like it could be useful as a user option rather than a
>> `defvar', no? Or perhaps a buffer-local variable?
>>
Ship> To me, this is a programmatic concern and only the program understands the
Ship> context in which it is called. In a sense, this is buffer-local equivalent
Ship> as uniquify-managed is itself buffer-local. If this is made global, I
Ship> sense there may be window-state-get uses that depend on uniquify names but
Ship> since I can't survey the field, I think this would be dangerous. We can
Ship> always promote this to a user option later.
Fair enough. We can revisit later.
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76980
; Package
emacs
.
(Sat, 15 Mar 2025 12:23:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 76980 <at> debbugs.gnu.org (full text, mbox):
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Fri, 14 Mar 2025 10:26:28 -0400
> Cc: 76980 <at> debbugs.gnu.org
>
> +Bind @code{window-state-normalize-buffer-name} to non-@code{nil} to
> +normalize buffer names under @file{uniquify} management by removing its
> +adornments, otherwise using nominal buffer names. This helps restore
^^^^^^^^^^
I'd use a simpler "prefixes and suffixes" here.
And what is the "otherwise using nominal buffer names" part about?
> ++++
> +*** New variable 'window-state-normalize-buffer-name'.
> +When bound to non-nil, 'window-state-get' will normalize buffer names by
> +removing 'uniquify' adornments, otherwise using nominal buffer names.
> +This helps restore window buffers across Emacs sessions.
Same here.
> +(defun window--state-normalize-buffer-name (buffer)
> + "Normalize BUFFER name, accommodating `uniquify'.
> +If BUFFER is under `uniquify' management, return its `buffer-name' with
> +adornments removed; otherwise return BUFFER `buffer-name'."
And here.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76980
; Package
emacs
.
(Sun, 16 Mar 2025 21:30:04 GMT)
Full text and
rfc822 format available.
Message #29 received at 76980 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sat, Mar 15, 2025 at 8:21 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > From: Ship Mints <shipmints <at> gmail.com>
> > Date: Fri, 14 Mar 2025 10:26:28 -0400
> > Cc: 76980 <at> debbugs.gnu.org
> >
> > +Bind @code{window-state-normalize-buffer-name} to non-@code{nil} to
> > +normalize buffer names under @file{uniquify} management by removing its
> > +adornments, otherwise using nominal buffer names. This helps restore
> ^^^^^^^^^^
> I'd use a simpler "prefixes and suffixes" here.
>
> And what is the "otherwise using nominal buffer names" part about?
>
> > ++++
> > +*** New variable 'window-state-normalize-buffer-name'.
> > +When bound to non-nil, 'window-state-get' will normalize buffer names by
> > +removing 'uniquify' adornments, otherwise using nominal buffer names.
> > +This helps restore window buffers across Emacs sessions.
>
> Same here.
>
> > +(defun window--state-normalize-buffer-name (buffer)
> > + "Normalize BUFFER name, accommodating `uniquify'.
> > +If BUFFER is under `uniquify' management, return its `buffer-name' with
> > +adornments removed; otherwise return BUFFER `buffer-name'."
>
> And here.
>
Refined patch attached.
[Message part 2 (text/html, inline)]
[0001-window-state-normalize-buffer-name-option-for-uniqui.patch (application/octet-stream, attachment)]
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sat, 22 Mar 2025 12:16:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ship Mints <shipmints <at> gmail.com>
:
bug acknowledged by developer.
(Sat, 22 Mar 2025 12:16:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 76980-done <at> debbugs.gnu.org (full text, mbox):
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sun, 16 Mar 2025 17:28:53 -0400
> Cc: 76980 <at> debbugs.gnu.org
>
> Refined patch attached.
Thanks, now installed on the master branch, and closing the bug.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 20 Apr 2025 11:24:24 GMT)
Full text and
rfc822 format available.
This bug report was last modified 55 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.