unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36839: 26.1: unique frame names
@ 2019-07-29 16:16 Boruch Baum
  2019-07-29 17:00 ` Eli Zaretskii
  2019-07-29 17:43 ` Andreas Schwab
  0 siblings, 2 replies; 17+ messages in thread
From: Boruch Baum @ 2019-07-29 16:16 UTC (permalink / raw)
  To: 36839

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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 16:16 bug#36839: 26.1: unique frame names Boruch Baum
@ 2019-07-29 17:00 ` Eli Zaretskii
  2019-07-29 17:49   ` Boruch Baum
  2019-07-29 17:43 ` Andreas Schwab
  1 sibling, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2019-07-29 17:00 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 36839

> Date: Mon, 29 Jul 2019 12:16:06 -0400
> From: Boruch Baum <boruch_baum@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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 16:16 bug#36839: 26.1: unique frame names Boruch Baum
  2019-07-29 17:00 ` Eli Zaretskii
@ 2019-07-29 17:43 ` Andreas Schwab
  2019-07-29 18:00   ` Boruch Baum
  1 sibling, 1 reply; 17+ messages in thread
From: Andreas Schwab @ 2019-07-29 17:43 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 36839

On Jul 29 2019, Boruch Baum <boruch_baum@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@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 17:00 ` Eli Zaretskii
@ 2019-07-29 17:49   ` Boruch Baum
  2019-07-29 18:00     ` Eli Zaretskii
  2019-07-31  9:13     ` martin rudalics
  0 siblings, 2 replies; 17+ messages in thread
From: Boruch Baum @ 2019-07-29 17:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 36839

On 2019-07-29 20:00, Eli Zaretskii wrote:
> > Date: Mon, 29 Jul 2019 12:16:06 -0400
> > From: Boruch Baum <boruch_baum@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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 17:43 ` Andreas Schwab
@ 2019-07-29 18:00   ` Boruch Baum
  2019-07-29 20:42     ` Andreas Schwab
  0 siblings, 1 reply; 17+ messages in thread
From: Boruch Baum @ 2019-07-29 18:00 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 36839

On 2019-07-29 19:43, Andreas Schwab wrote:
> On Jul 29 2019, Boruch Baum <boruch_baum@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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 17:49   ` Boruch Baum
@ 2019-07-29 18:00     ` Eli Zaretskii
  2019-07-29 18:54       ` Boruch Baum
  2019-07-31  9:13     ` martin rudalics
  1 sibling, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2019-07-29 18:00 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 36839

> Date: Mon, 29 Jul 2019 13:49:33 -0400
> From: Boruch Baum <boruch_baum@gmx.com>
> Cc: 36839@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"?





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 18:00     ` Eli Zaretskii
@ 2019-07-29 18:54       ` Boruch Baum
  2019-07-29 19:28         ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Boruch Baum @ 2019-07-29 18:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 36839

On 2019-07-29 21:00, Eli Zaretskii wrote:
> > Date: Mon, 29 Jul 2019 13:49:33 -0400
> > From: Boruch Baum <boruch_baum@gmx.com>
> > Cc: 36839@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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 18:54       ` Boruch Baum
@ 2019-07-29 19:28         ` Eli Zaretskii
  2019-07-29 19:43           ` Boruch Baum
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2019-07-29 19:28 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 36839

> Date: Mon, 29 Jul 2019 14:54:29 -0400
> From: Boruch Baum <boruch_baum@gmx.com>
> Cc: 36839@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?





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 19:28         ` Eli Zaretskii
@ 2019-07-29 19:43           ` Boruch Baum
  2019-07-30 15:11             ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Boruch Baum @ 2019-07-29 19:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 36839

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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 18:00   ` Boruch Baum
@ 2019-07-29 20:42     ` Andreas Schwab
  0 siblings, 0 replies; 17+ messages in thread
From: Andreas Schwab @ 2019-07-29 20:42 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 36839

On Jul 29 2019, Boruch Baum <boruch_baum@gmx.com> wrote:

> On 2019-07-29 19:43, Andreas Schwab wrote:
>> On Jul 29 2019, Boruch Baum <boruch_baum@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@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 19:43           ` Boruch Baum
@ 2019-07-30 15:11             ` Eli Zaretskii
  2022-03-23 13:38               ` Lars Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2019-07-30 15:11 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 36839

> Date: Mon, 29 Jul 2019 15:43:54 -0400
> From: Boruch Baum <boruch_baum@gmx.com>
> Cc: 36839@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).





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-29 17:49   ` Boruch Baum
  2019-07-29 18:00     ` Eli Zaretskii
@ 2019-07-31  9:13     ` martin rudalics
  2019-07-31 14:10       ` Eli Zaretskii
  1 sibling, 1 reply; 17+ messages in thread
From: martin rudalics @ 2019-07-31  9:13 UTC (permalink / raw)
  To: Boruch Baum, Eli Zaretskii; +Cc: 36839

 > 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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-31  9:13     ` martin rudalics
@ 2019-07-31 14:10       ` Eli Zaretskii
  2019-08-01  8:54         ` martin rudalics
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2019-07-31 14:10 UTC (permalink / raw)
  To: martin rudalics; +Cc: 36839, boruch_baum

> Cc: 36839@debbugs.gnu.org
> From: martin rudalics <rudalics@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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-31 14:10       ` Eli Zaretskii
@ 2019-08-01  8:54         ` martin rudalics
  2019-08-02  8:57           ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: martin rudalics @ 2019-08-01  8:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 36839, boruch_baum

 > 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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-08-01  8:54         ` martin rudalics
@ 2019-08-02  8:57           ` Eli Zaretskii
  2019-08-02 12:50             ` martin rudalics
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2019-08-02  8:57 UTC (permalink / raw)
  To: martin rudalics; +Cc: 36839, boruch_baum

> Cc: boruch_baum@gmx.com, 36839@debbugs.gnu.org
> From: martin rudalics <rudalics@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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-08-02  8:57           ` Eli Zaretskii
@ 2019-08-02 12:50             ` martin rudalics
  0 siblings, 0 replies; 17+ messages in thread
From: martin rudalics @ 2019-08-02 12:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 36839, boruch_baum

 >> Where do we do that?
 >
 > In make_terminal_frame and set_term_frame_name.

Sorry.  I missed the TTY connection.

martin





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#36839: 26.1: unique frame names
  2019-07-30 15:11             ` Eli Zaretskii
@ 2022-03-23 13:38               ` Lars Ingebrigtsen
  0 siblings, 0 replies; 17+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-23 13:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 36839, Boruch Baum

Eli Zaretskii <eliz@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





^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-03-23 13:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 16:16 bug#36839: 26.1: unique frame names Boruch Baum
2019-07-29 17:00 ` Eli Zaretskii
2019-07-29 17:49   ` Boruch Baum
2019-07-29 18:00     ` Eli Zaretskii
2019-07-29 18:54       ` Boruch Baum
2019-07-29 19:28         ` Eli Zaretskii
2019-07-29 19:43           ` Boruch Baum
2019-07-30 15:11             ` Eli Zaretskii
2022-03-23 13:38               ` Lars Ingebrigtsen
2019-07-31  9:13     ` martin rudalics
2019-07-31 14:10       ` Eli Zaretskii
2019-08-01  8:54         ` martin rudalics
2019-08-02  8:57           ` Eli Zaretskii
2019-08-02 12:50             ` martin rudalics
2019-07-29 17:43 ` Andreas Schwab
2019-07-29 18:00   ` Boruch Baum
2019-07-29 20:42     ` Andreas Schwab

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