[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Enable persistent naming for tabs

From: Juri Linkov
Subject: Re: [PATCH] Enable persistent naming for tabs
Date: Fri, 11 Oct 2019 00:43:00 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> But please give me an additional day to think about a possibility of
>> avoiding `no-auto-name` to not make code unnecessarily complicated.
> [...]
> Other than that, I'm happy to wait a little bit to get the best possible
> implementation for the benefit of everyone. Thanks for your attention
> and encouragement on this. :)

Meanwhile I looked at prior art of how this feature in already implemented
in Emacs.  I think we should avoid needlessly introducing new concepts,
but instead use the existing solutions to reduce entropy and improve
maintainability of code.  Tabs were implemented to represent frame-like
window configurations inside one frame, so tab renaming could work like
frame renaming where M-x set-frame-name reads a new name and sets the
frame parameter `name`.  What it also does is to set additional parameter
`explicit-name`.  Please use the same parameter name in tabs to not
divert too much from frame name handling.

What we could do is to improve both implementations, e.g. neither
set-frame-name nor your patch provide a default value, but it would
be useful to be able to type M-n in the renaming minibuffer to
bring the current name for editing.

Also I don't see a need to add `(explicit-name . nil)` by default.
It seems it should be enough to add only `(explicit-name . t)`
after manual renaming.  But maybe prefilling all possible parameters
initially really simplifies implementation?

Finally what needs to be improved is to make tab-bar--tab and
tab-bar--current-tab consistent.  In your patch tab-bar--tab
gets current-tab directly from parameters, but tab-bar--current-tab
accepts a tab from its argument.  Shouldn't tab-bar--tab also
accept the current tab from its argument?

In other regards your choice of a command name `tab-bar-rename-tab-by-name`
fits nicely into naming convention with the existing `select-frame-by-name`.
We also have `tab-bar-close-tab-by-name`.  There is also the command
`tab-bar-switch-to-tab` that selects a tab by name, it was named after
`switch-to-buffer`, maybe better name would be `tab-bar-select-tab-by-name`?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]