bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#57848: 29.0.50; Problems with private tab-line-tab-name-function


From: Michael Heerdegen
Subject: bug#57848: 29.0.50; Problems with private tab-line-tab-name-function
Date: Sun, 30 Oct 2022 13:02:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Juri Linkov <juri@linkov.net> writes:

> > #+begin_src emacs-lisp
> > (setq-local tab-line-tab-name-function
> >             (lambda (_b &optional _bs) "%b"))
> > #+end_src

> All mode-line format sequences are valid, but only in the context
> of the right buffer.  So you can use such tab-name function:
>
> #+begin_src emacs-lisp
> (setq tab-line-tab-name-function
>       (lambda (b &optional _bs)
>       (format-mode-line "%b" 'tab-line-tab nil b)))
> #+end_src

I didn't want to ask about `format-mode-line': my example (above)
returns a plain "%b" string - nonetheless a buffer name is being printed
as tab name.  Mode-line format specifiers seem to be handled without
`format-mode-line'.

My question is what the semantics of the return value of
`tab-line-tab-name-function' are.  Or is the above behavior a bug?

> A user-defined cache key function is a good idea.
> Please send an example of such function for Info,
> so I could test the implementation.

I guess something like

  (lambda (b) (buffer-local-value 'mode-line-buffer-identification b))

should do it - a tab's name needs to be changed when the buffer local
binding of `mode-line-buffer-identification' has been modified.


Thanks so far,

Michael.





reply via email to

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