GNU bug report logs - #36839
26.1: unique frame names

Previous Next

Package: emacs;

Reported by: Boruch Baum <boruch_baum <at> gmx.com>

Date: Mon, 29 Jul 2019 16:17:01 UTC

Severity: wishlist

Tags: wontfix

Found in version 26.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 36839 in the body.
You can then email your comments to 36839 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#36839; Package emacs. (Mon, 29 Jul 2019 16:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Boruch Baum <boruch_baum <at> gmx.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 29 Jul 2019 16:17:01 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Emacs Bug Reporting <bug-gnu-emacs <at> gnu.org>
Subject: 26.1: unique frame names
Date: Mon, 29 Jul 2019 12:16:06 -0400
Subject: 26.1; unique frame names

By default, emacs creates frames with unique names, in the form "Fnn".
Emacs also offers a documented variable `default-frame-alist', which one
can use to customize frame parameters, one of which is NAME. However, I
don't see documented anywhere how to specify that frame names should be
unique, and when setting the NAME parameter, all new frames are created with
identical names:

   (setq default-frame-alist '((name . "Frame_%")))

My attempt to trace the code ended with `make-terminal-frame', a
built-in function in ‘src/frame.c’, since I don't have that source file handy.

My expectation is that emacs should by default create frames with unique
names, similar to how it uniquely names buffers, by appending a number
to what would otherwise be a duplicate name.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Mon, 29 Jul 2019 17:02:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Mon, 29 Jul 2019 20:00:53 +0300
> Date: Mon, 29 Jul 2019 12:16:06 -0400
> From: Boruch Baum <boruch_baum <at> gmx.com>
> 
> My expectation is that emacs should by default create frames with unique
> names, similar to how it uniquely names buffers, by appending a number
> to what would otherwise be a duplicate name.

Are you sure you don't confuse a frame's name with its title?

In general, a frame's name is Emacs's internal business, and is rarely
if ever exposed to the user.  About the only exception I know of is
TTY frames.  I'd be interested to know why you care about a frame's
name, i.e. what is your use case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Mon, 29 Jul 2019 17:44:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Mon, 29 Jul 2019 19:43:07 +0200
On Jul 29 2019, Boruch Baum <boruch_baum <at> gmx.com> wrote:

> My expectation is that emacs should by default create frames with unique
> names, similar to how it uniquely names buffers, by appending a number
> to what would otherwise be a duplicate name.

There is nothing wrong with having duplicate frame names.  The name is
used for looking up X resources, but otherwise it is for information
only.  A frame doesn't need to have a name.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Mon, 29 Jul 2019 17:50:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Mon, 29 Jul 2019 13:49:33 -0400
On 2019-07-29 20:00, Eli Zaretskii wrote:
> > Date: Mon, 29 Jul 2019 12:16:06 -0400
> > From: Boruch Baum <boruch_baum <at> gmx.com>
> >
> > My expectation is that emacs should by default create frames with unique
> > names, similar to how it uniquely names buffers, by appending a number
> > to what would otherwise be a duplicate name.
>
> Are you sure you don't confuse a frame's name with its title?

I'm referring to the NAME parameter of the alist variable, which sets
the frame NAME that appears by default in the mode-line, and which is
used by function `select-frame-by-name'. I'm not sure what you mean by
frame title.

> In general, a frame's name is Emacs's internal business, and is rarely
> if ever exposed to the user. About the only exception I know of is TTY
> frames. I'd be interested to know why you care about a frame's name,
> i.e. what is your use case.

I'm using C-x 5 b (M-x select-frame-by-name) to switch between frames
and in my case, I would like the names to be more informative than just
Fnn. In a more general sense, if emacs is offering the NAME parameter,
it should assume the parameter will be used, and currently emacs isn't
handling its use well.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Mon, 29 Jul 2019 18:01:01 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Mon, 29 Jul 2019 14:00:12 -0400
On 2019-07-29 19:43, Andreas Schwab wrote:
> On Jul 29 2019, Boruch Baum <boruch_baum <at> gmx.com> wrote:
>
> > My expectation is that emacs should by default create frames with unique
> > names, similar to how it uniquely names buffers, by appending a number
> > to what would otherwise be a duplicate name.
>
> There is nothing wrong with having duplicate frame names.

Are you insisting that it's not confusing to navigate the selection of
function `select-frame-by-name' when it offers duplicate names?

> The name is used for looking up X resources, but otherwise it is for
> information only.

'Information only' sound pretty significant to me. Also, see function
`select-frame-by-name'.

> A frame doesn't need to have a name.

When doesn't a frame have a name?

How can one use function `select-frame-by-name' is such a case?

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Mon, 29 Jul 2019 18:02:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Mon, 29 Jul 2019 21:00:46 +0300
> Date: Mon, 29 Jul 2019 13:49:33 -0400
> From: Boruch Baum <boruch_baum <at> gmx.com>
> Cc: 36839 <at> debbugs.gnu.org
> 
> I'm referring to the NAME parameter of the alist variable, which sets
> the frame NAME that appears by default in the mode-line, and which is
> used by function `select-frame-by-name'. I'm not sure what you mean by
> frame title.

You are describing a TTY frame.  OK.

> I'm using C-x 5 b (M-x select-frame-by-name) to switch between frames
> and in my case, I would like the names to be more informative than just
> Fnn.

Then give your frames names, you have functions to do that.  What
exactly is the problem?

> In a more general sense, if emacs is offering the NAME parameter,
> it should assume the parameter will be used, and currently emacs isn't
> handling its use well.

Can you show an example of "not handling its use well"?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Mon, 29 Jul 2019 18:55:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Mon, 29 Jul 2019 14:54:29 -0400
On 2019-07-29 21:00, Eli Zaretskii wrote:
> > Date: Mon, 29 Jul 2019 13:49:33 -0400
> > From: Boruch Baum <boruch_baum <at> gmx.com>
> > Cc: 36839 <at> debbugs.gnu.org
> >
> > I'm referring to the NAME parameter of the alist variable, which sets
> > the frame NAME that appears by default in the mode-line, and which is
> > used by function `select-frame-by-name'. I'm not sure what you mean by
> > frame title.
>
> You are describing a TTY frame.  OK.
>
> > I'm using C-x 5 b (M-x select-frame-by-name) to switch between frames
> > and in my case, I would like the names to be more informative than just
> > Fnn.
>
> Then give your frames names, you have functions to do that.  What
> exactly is the problem?

I'm trying really hard not to repeat myself here... Emacs has the alist
variable with the NAME parameter, so the presumption is that a user
should be able to use it in a useful manner, but when it is used, the
behavior of emacs changes to become less useful. Prior to manually
setting the NAME parameter, all created frames have unique names, but
once the name parameter is set by a user, all frames will have identical
names. The behavior should continue to ensure unique frame names.

>
> > In a more general sense, if emacs is offering the NAME parameter,
> > it should assume the parameter will be used, and currently emacs isn't
> > handling its use well.
>
> Can you show an example of "not handling its use well"?

That's the entire point of this report -- that duplicate frame names is
"not handling its use well".

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Mon, 29 Jul 2019 19:30:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Mon, 29 Jul 2019 22:28:41 +0300
> Date: Mon, 29 Jul 2019 14:54:29 -0400
> From: Boruch Baum <boruch_baum <at> gmx.com>
> Cc: 36839 <at> debbugs.gnu.org
> 
> > Then give your frames names, you have functions to do that.  What
> > exactly is the problem?
> 
> I'm trying really hard not to repeat myself here... Emacs has the alist
> variable with the NAME parameter, so the presumption is that a user
> should be able to use it in a useful manner, but when it is used, the
> behavior of emacs changes to become less useful. Prior to manually
> setting the NAME parameter, all created frames have unique names, but
> once the name parameter is set by a user, all frames will have identical
> names. The behavior should continue to ensure unique frame names.

So you want Emacs to uniquify the frame's name using the 'name'
parameter as a template?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Mon, 29 Jul 2019 19:45:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Mon, 29 Jul 2019 15:43:54 -0400
On 2019-07-29 22:28, Eli Zaretskii wrote:
> So you want Emacs to uniquify the frame's name using the 'name'
> parameter as a template?

Yes.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Mon, 29 Jul 2019 20:43:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Mon, 29 Jul 2019 22:42:52 +0200
On Jul 29 2019, Boruch Baum <boruch_baum <at> gmx.com> wrote:

> On 2019-07-29 19:43, Andreas Schwab wrote:
>> On Jul 29 2019, Boruch Baum <boruch_baum <at> gmx.com> wrote:
>>
>> > My expectation is that emacs should by default create frames with unique
>> > names, similar to how it uniquely names buffers, by appending a number
>> > to what would otherwise be a duplicate name.
>>
>> There is nothing wrong with having duplicate frame names.
>
> Are you insisting that it's not confusing to navigate the selection of
> function `select-frame-by-name' when it offers duplicate names?

No, why do you think so?

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Tue, 30 Jul 2019 15:13:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Tue, 30 Jul 2019 18:11:41 +0300
> Date: Mon, 29 Jul 2019 15:43:54 -0400
> From: Boruch Baum <boruch_baum <at> gmx.com>
> Cc: 36839 <at> debbugs.gnu.org
> 
> On 2019-07-29 22:28, Eli Zaretskii wrote:
> > So you want Emacs to uniquify the frame's name using the 'name'
> > parameter as a template?
> 
> Yes.

OK, but in that case I think it should be a different parameter, since
'name' is supposed to be the literal name of the frame.

In general, setting frame names was supposed to be done manually for
each frame, giving them meaningful names.  A template assumes some
kind of automated naming, which was not the goal of this feature's
design (if frame names don't have to be meaningful, we already have
the Fnn names that are assigned automatically).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Wed, 31 Jul 2019 09:14:01 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Boruch Baum <boruch_baum <at> gmx.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 36839 <at> debbugs.gnu.org
Subject: Re: bug#36839: 26.1: unique frame names
Date: Wed, 31 Jul 2019 11:13:40 +0200
> I'm using C-x 5 b (M-x select-frame-by-name) to switch between frames
> and in my case, I would like the names to be more informative than just
> Fnn. In a more general sense, if emacs is offering the NAME parameter,
> it should assume the parameter will be used, and currently emacs isn't
> handling its use well.

I think the current behavior (using the name of the buffer of the
selected window of each frame) works reasonably well as long as the
same buffer doesn't appear in more than one selected window.  It
simply delegates your problem to the buffer naming mechanism.

What you probably want is a mechanism that automatically assigns each
frame an explicit, unique name at creation time.  We could do that
(optionally, because otherwise we would interfere with the default
approach) but would have to invent a suitable naming scheme first.
This is non-trivial because a naive numbering scheme where a user
creates and subsequently deletes many frames might get out of hand
soon.  Such users need a mechanism for recycling the numbers of dead
frames which might confuse other users who rarely create new frames.

You could try putting a function that produces such names in your
early init file, assign the values it produces to each newly created
frame in a lambda you put on 'after-make-frame-functions' and tell us
your experiences.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Wed, 31 Jul 2019 14:11:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 36839 <at> debbugs.gnu.org, boruch_baum <at> gmx.com
Subject: Re: bug#36839: 26.1: unique frame names
Date: Wed, 31 Jul 2019 17:10:08 +0300
> Cc: 36839 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
> Date: Wed, 31 Jul 2019 11:13:40 +0200
> 
> What you probably want is a mechanism that automatically assigns each
> frame an explicit, unique name at creation time.

Not sure what this means, exactly, because we already do that: each
frame is named F1, F2, F3, etc.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Thu, 01 Aug 2019 08:55:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 36839 <at> debbugs.gnu.org, boruch_baum <at> gmx.com
Subject: Re: bug#36839: 26.1: unique frame names
Date: Thu, 1 Aug 2019 10:54:06 +0200
> Not sure what this means, exactly, because we already do that: each
> frame is named F1, F2, F3, etc.

Where do we do that?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Fri, 02 Aug 2019 08:58:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 36839 <at> debbugs.gnu.org, boruch_baum <at> gmx.com
Subject: Re: bug#36839: 26.1: unique frame names
Date: Fri, 02 Aug 2019 11:57:26 +0300
> Cc: boruch_baum <at> gmx.com, 36839 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
> Date: Thu, 1 Aug 2019 10:54:06 +0200
> 
>  > Not sure what this means, exactly, because we already do that: each
>  > frame is named F1, F2, F3, etc.
> 
> Where do we do that?

In make_terminal_frame and set_term_frame_name.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Fri, 02 Aug 2019 12:51:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 36839 <at> debbugs.gnu.org, boruch_baum <at> gmx.com
Subject: Re: bug#36839: 26.1: unique frame names
Date: Fri, 2 Aug 2019 14:50:40 +0200
>> Where do we do that?
>
> In make_terminal_frame and set_term_frame_name.

Sorry.  I missed the TTY connection.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36839; Package emacs. (Wed, 23 Mar 2022 13:39:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 36839 <at> debbugs.gnu.org, Boruch Baum <boruch_baum <at> gmx.com>
Subject: Re: bug#36839: 26.1: unique frame names
Date: Wed, 23 Mar 2022 14:38:21 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> > So you want Emacs to uniquify the frame's name using the 'name'
>> > parameter as a template?
>> 
>> Yes.
>
> OK, but in that case I think it should be a different parameter, since
> 'name' is supposed to be the literal name of the frame.
>
> In general, setting frame names was supposed to be done manually for
> each frame, giving them meaningful names.  A template assumes some
> kind of automated naming, which was not the goal of this feature's
> design (if frame names don't have to be meaningful, we already have
> the Fnn names that are assigned automatically).

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Reading this thread, I think the conclusion here is that the utility of
adding a new "template" parameter would be of limited value, so we don't
really want to do that.  And I'm therefore closing this bug report.

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




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 23 Mar 2022 13:39:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 36839 <at> debbugs.gnu.org and Boruch Baum <boruch_baum <at> gmx.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 23 Mar 2022 13:39:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 2 years and 6 days ago.

Previous Next


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