[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display info nodes names in tabs.
From: |
Michael Heerdegen |
Subject: |
Re: Display info nodes names in tabs. |
Date: |
Thu, 15 Sep 2022 15:20:58 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
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.