unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* tab-rename broken/changed?
@ 2021-03-21 13:47 T.V Raman
  2021-03-21 20:05 ` Juri Linkov
  2021-03-21 20:55 ` Juri Linkov
  0 siblings, 2 replies; 8+ messages in thread
From: T.V Raman @ 2021-03-21 13:47 UTC (permalink / raw)
  To: emacs-devel

As best I can tell, something has changed for the worse in tab-rename
-- after you rename a tab, either via C-x tr or from elisp, the alist
of tabs does not contain the explicitly given name, but continues to
use the name of the file currectnly displayed in that tab.


-- 

Thanks,

--Raman
♉ Id: kg:/m/0285kf1  🦮

-- 

Thanks,

--Raman
♉ Id: kg:/m/0285kf1  🦮



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

* Re: tab-rename broken/changed?
  2021-03-21 13:47 tab-rename broken/changed? T.V Raman
@ 2021-03-21 20:05 ` Juri Linkov
  2021-03-22  1:34   ` T.V Raman
  2021-03-21 20:55 ` Juri Linkov
  1 sibling, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2021-03-21 20:05 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

> As best I can tell, something has changed for the worse in tab-rename
> -- after you rename a tab, either via C-x tr or from elisp, the alist
> of tabs does not contain the explicitly given name, but continues to
> use the name of the file currectnly displayed in that tab.

It seems you have a customization incompatible with recent changes.
Do you have this problem when renaming a tab in emacs without customization?
Maybe you are using some elisp code that accesses internal functions?



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

* Re: tab-rename broken/changed?
  2021-03-21 13:47 tab-rename broken/changed? T.V Raman
  2021-03-21 20:05 ` Juri Linkov
@ 2021-03-21 20:55 ` Juri Linkov
  2021-03-22  1:35   ` T.V Raman
  1 sibling, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2021-03-21 20:55 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

> As best I can tell, something has changed for the worse in tab-rename
> -- after you rename a tab, either via C-x tr or from elisp, the alist
> of tabs does not contain the explicitly given name, but continues to
> use the name of the file currectnly displayed in that tab.

Sorry for the breakage.  The function tab-bar--current-tab was intended
to create a new current-tab structure.  Mistakenly it also supported
searching for the existing current-tab.  Recently the search part was
moved to a new function tab-bar--current-tab-find.



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

* Re: tab-rename broken/changed?
  2021-03-21 20:05 ` Juri Linkov
@ 2021-03-22  1:34   ` T.V Raman
  2021-03-22 18:56     ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: T.V Raman @ 2021-03-22  1:34 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 980 bytes --]

Juri Linkov <juri@linkov.net> writes:


The latter, fixed it by changing how I was accessing the tab-name.

Could you perhaps provide a simple tab-bar-tab-name function for use
from outside tab-bar (emacspeak in my case) to stay robust?

For now I'm accessing  the name of the current tab like so:

(format "%s"
           (cdr
             (assoc 'name (assoc 'current-tab (tab-bar-tabs)))))
>> As best I can tell, something has changed for the worse in tab-rename
>> -- after you rename a tab, either via C-x tr or from elisp, the alist
>> of tabs does not contain the explicitly given name, but continues to
>> use the name of the file currectnly displayed in that tab.
>
> It seems you have a customization incompatible with recent changes.
> Do you have this problem when renaming a tab in emacs without customization?
> Maybe you are using some elisp code that accesses internal functions?

-- 

Thanks,

--Raman
7©4 Id: kg:/m/0285kf1  •0Ü8



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

* Re: tab-rename broken/changed?
  2021-03-21 20:55 ` Juri Linkov
@ 2021-03-22  1:35   ` T.V Raman
  0 siblings, 0 replies; 8+ messages in thread
From: T.V Raman @ 2021-03-22  1:35 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 166 bytes --]

That explains it:-)

See my other reply asking for a stable tab-bar-tab-name function if
possible.

-- 

Thanks,

--Raman
7©4 Id: kg:/m/0285kf1  •0Ü8



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

* Re: tab-rename broken/changed?
  2021-03-22  1:34   ` T.V Raman
@ 2021-03-22 18:56     ` Juri Linkov
  2021-03-22 19:27       ` T.V Raman
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2021-03-22 18:56 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

> Could you perhaps provide a simple tab-bar-tab-name function for use
> from outside tab-bar (emacspeak in my case) to stay robust?

Maybe such function could be added as part of some new Tab API.
But now at least the internal function was reverted to its
previous behavior.

> For now I'm accessing  the name of the current tab like so:
>
> (format "%s"
>            (cdr
>              (assoc 'name (assoc 'current-tab (tab-bar-tabs)))))

Your change is even more reliable than using internal functions
and until a more general API is implemented.



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

* Re: tab-rename broken/changed?
  2021-03-22 18:56     ` Juri Linkov
@ 2021-03-22 19:27       ` T.V Raman
  2021-03-23 18:37         ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: T.V Raman @ 2021-03-22 19:27 UTC (permalink / raw)
  To: juri; +Cc: raman, emacs-devel

:-) And rather than waiting for the grand internal API arrives,
perhaps clone the simple solution I have into a
tab-bar-current-tab-name function --- botom-up APIs usually point the
way to the final top-down API
Juri Linkov writes:
 > > Could you perhaps provide a simple tab-bar-tab-name function for use
 > > from outside tab-bar (emacspeak in my case) to stay robust?
 > 
 > Maybe such function could be added as part of some new Tab API.
 > But now at least the internal function was reverted to its
 > previous behavior.
 > 
 > > For now I'm accessing  the name of the current tab like so:
 > >
 > > (format "%s"
 > >            (cdr
 > >              (assoc 'name (assoc 'current-tab (tab-bar-tabs)))))
 > 
 > Your change is even more reliable than using internal functions
 > and until a more general API is implemented.

-- 
♉Id: kg:/m/0285kf1  🦮♉

--
♉Id: kg:/m/0285kf1  🦮♉



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

* Re: tab-rename broken/changed?
  2021-03-22 19:27       ` T.V Raman
@ 2021-03-23 18:37         ` Juri Linkov
  0 siblings, 0 replies; 8+ messages in thread
From: Juri Linkov @ 2021-03-23 18:37 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

> :-) And rather than waiting for the grand internal API arrives,
> perhaps clone the simple solution I have into a
> tab-bar-current-tab-name function --- botom-up APIs usually point the
> way to the final top-down API

A tab can have more attributes than a 'name',
for example, there is a new attribute 'group'.
So it would be easier to continue accessing
tab data using 'assoc'.  BTW, there is a simpler function
than 'assoc' and 'cdr', just use (alist-get 'name tab).

Also there is an existing function 'tab-bar--current-tab'
to get the current tab.  The only problem is that it's
an internal function whose behavior is not guaranteed not to change.
Than maybe it would be easier just to create an alias to the
internal function, but without -- in its name.



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

end of thread, other threads:[~2021-03-23 18:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-21 13:47 tab-rename broken/changed? T.V Raman
2021-03-21 20:05 ` Juri Linkov
2021-03-22  1:34   ` T.V Raman
2021-03-22 18:56     ` Juri Linkov
2021-03-22 19:27       ` T.V Raman
2021-03-23 18:37         ` Juri Linkov
2021-03-21 20:55 ` Juri Linkov
2021-03-22  1:35   ` T.V Raman

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