* Display info nodes names in tabs.
@ 2022-09-14 7:33 Alexandros Prekates
2022-09-15 5:01 ` Michael Heerdegen
0 siblings, 1 reply; 8+ messages in thread
From: Alexandros Prekates @ 2022-09-14 7:33 UTC (permalink / raw)
To: help-gnu-emacs
Greetings.
My system:
I have Emacs 27.1 in a Devuan distro.
My issue:
Opening info buffers they get the name *info*<X>
That is displayed in the tabs.
In the mode line we see *info*<X> (node filename).
I'd like to be able to see in the tabs the node filename.
What i have found:
M-x rename-buffer will change the buffer name
both in mode line and in tabs.
So this is a solution but with the drawback that
the moment i visit a new info node i have a wrong name.
I've also read M-x info-display-manual.
With a prefix argument you can select from your
opened info nodes seeing their names so that
helps but with the drawback of having to execute
the command each time you want to switch to an info node.
But with a dozen info nodes that is needed.
Alexandros
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Display info nodes names in tabs.
2022-09-14 7:33 Display info nodes names in tabs Alexandros Prekates
@ 2022-09-15 5:01 ` Michael Heerdegen
2022-09-15 12:47 ` Robert Pluim
0 siblings, 1 reply; 8+ messages in thread
From: Michael Heerdegen @ 2022-09-15 5:01 UTC (permalink / raw)
To: help-gnu-emacs
Alexandros Prekates <aprekates@posteo.net> writes:
> Opening info buffers they get the name *info*<X>
> That is displayed in the tabs.
> In the mode line we see *info*<X> (node filename).
> I'd like to be able to see in the tabs the node filename.
Would be nice, yes. Do you use the tab-bar or the tab-line?
Michael.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Display info nodes names in tabs.
2022-09-15 5:01 ` Michael Heerdegen
@ 2022-09-15 12:47 ` Robert Pluim
2022-09-15 13:20 ` Michael Heerdegen
0 siblings, 1 reply; 8+ messages in thread
From: Robert Pluim @ 2022-09-15 12:47 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
>>>>> On Thu, 15 Sep 2022 07:01:31 +0200, Michael Heerdegen <michael_heerdegen@web.de> said:
Michael> Alexandros Prekates <aprekates@posteo.net> writes:
>> Opening info buffers they get the name *info*<X>
>> That is displayed in the tabs.
>> In the mode line we see *info*<X> (node filename).
>> I'd like to be able to see in the tabs the node filename.
Michael> Would be nice, yes. Do you use the tab-bar or the tab-line?
See `tab-bar-tab-name-function' and `tab-line-tab-name-function', both
of which allow you to write custom functions.
Robert
--
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Display info nodes names in tabs.
2022-09-15 12:47 ` Robert Pluim
@ 2022-09-15 13:20 ` Michael Heerdegen
2022-09-15 14:45 ` Robert Pluim
0 siblings, 1 reply; 8+ messages in thread
From: Michael Heerdegen @ 2022-09-15 13:20 UTC (permalink / raw)
To: help-gnu-emacs
Robert Pluim <rpluim@gmail.com> writes:
> Michael> Would be nice, yes. Do you use the tab-bar or the tab-line?
>
> See `tab-bar-tab-name-function' and `tab-line-tab-name-function', both
> of which allow you to write custom functions.
The problem with `tab-line-tab-name-function' (I guess with
`tab-bar-tab-name-function' too, but I didn't check) is that it is not
called often enough - because of the tab-line cache. The tab-line-cache
key never changes/ gets invalid for Info buffers (no tracked parameter
ever changes while you browse), so the tab name is never refreshed. I
need to invalidate the cache explicitly to make it work, e.g. with a
very ugly hack like this:
#+begin_src emacs-lisp
(add-variable-watcher
'mode-line-buffer-identification
(defun my-Info-mode-line-buffer-identification-watcher
(_symbol _newval _operation where)
(when (and (eq where (current-buffer))
(derived-mode-p 'Info-mode))
(set-window-parameter nil 'tab-line-cache nil))))
#+end_src
Michael.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Display info nodes names in tabs.
2022-09-15 13:20 ` Michael Heerdegen
@ 2022-09-15 14:45 ` Robert Pluim
2022-09-16 4:51 ` Michael Heerdegen
0 siblings, 1 reply; 8+ messages in thread
From: Robert Pluim @ 2022-09-15 14:45 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
>>>>> On Thu, 15 Sep 2022 15:20:58 +0200, Michael Heerdegen <michael_heerdegen@web.de> said:
Michael> Robert Pluim <rpluim@gmail.com> writes:
Michael> Would be nice, yes. Do you use the tab-bar or the tab-line?
>>
>> See `tab-bar-tab-name-function' and `tab-line-tab-name-function', both
>> of which allow you to write custom functions.
Michael> The problem with `tab-line-tab-name-function' (I guess with
Michael> `tab-bar-tab-name-function' too, but I didn't check) is that it is not
Michael> called often enough - because of the tab-line cache. The tab-line-cache
Michael> key never changes/ gets invalid for Info buffers (no tracked parameter
Michael> ever changes while you browse), so the tab name is never refreshed. I
Michael> need to invalidate the cache explicitly to make it work, e.g. with a
Michael> very ugly hack like this:
So tab-line should switch to using the info node name? That sounds
like you should use M-x report-emacs-bug to request an enhancement (or
perhaps we can figure out a way to disable the cache for Info mode
buffers).
Robert
--
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Display info nodes names in tabs.
2022-09-15 14:45 ` Robert Pluim
@ 2022-09-16 4:51 ` Michael Heerdegen
2022-09-16 18:35 ` Stefan Monnier via Users list for the GNU Emacs text editor
0 siblings, 1 reply; 8+ messages in thread
From: Michael Heerdegen @ 2022-09-16 4:51 UTC (permalink / raw)
To: help-gnu-emacs
Robert Pluim <rpluim@gmail.com> writes:
> So tab-line should switch to using the info node name? That sounds
> like you should use M-x report-emacs-bug to request an enhancement
Good idea - done. See Bug#57848.
> (or perhaps we can figure out a way to disable the cache for Info mode
> buffers).
That cache is a window parameter. There is no obvious way to control it
based on the major mode. And I don't think we want/need to disable it
completely. We need different cache keys (these are the expressions
used to decide when Emacs needs to refresh the tab line) in this case.
Providing a variable `tab-line-extra-cache-keys' would be good.
Thanks,
Michael.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Display info nodes names in tabs.
2022-09-16 4:51 ` Michael Heerdegen
@ 2022-09-16 18:35 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-09-17 8:13 ` Michael Heerdegen
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2022-09-16 18:35 UTC (permalink / raw)
To: help-gnu-emacs
> That cache is a window parameter. There is no obvious way to control it
> based on the major mode. And I don't think we want/need to disable it
> completely. We need different cache keys (these are the expressions
> used to decide when Emacs needs to refresh the tab line) in this case.
> Providing a variable `tab-line-extra-cache-keys' would be good.
Maybe advising `force-mode-line-update` to flush the cache is all
it takes?
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-09-17 8:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-14 7:33 Display info nodes names in tabs Alexandros Prekates
2022-09-15 5:01 ` Michael Heerdegen
2022-09-15 12:47 ` Robert Pluim
2022-09-15 13:20 ` Michael Heerdegen
2022-09-15 14:45 ` Robert Pluim
2022-09-16 4:51 ` Michael Heerdegen
2022-09-16 18:35 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-09-17 8:13 ` Michael Heerdegen
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).