From: Michael Heerdegen <michael_heerdegen@web.de>
To: 57848@debbugs.gnu.org
Cc: Alexandros Prekates <aprekates@posteo.net>,
Robert Pluim <rpluim@gmail.com>, Juri Linkov <juri@linkov.net>
Subject: bug#57848: 29.0.50; Problems with private tab-line-tab-name-function
Date: Fri, 16 Sep 2022 06:39:56 +0200 [thread overview]
Message-ID: <8735cs53vn.fsf@web.de> (raw)
Hello,
(1) When using `tab-line-mode' together with
#+begin_src emacs-lisp
(setq-local tab-line-tab-name-function
(lambda (_b &optional _bs) "%b"))
#+end_src
I get tabs that are all named equally - all named after the currently
active tab's buffer.
I didn't know that mode-line format sequences are valid. Are they? If
they are (would be nice), could we document this, fix the behavior (I
guess the interpretation is done in the context of a wrong current
buffer), and maybe allow all kinds of mode-line-format values, like
lists?
If the interpretation of mode-line format specs is not intended, the
above example should just lead to a literal "%b" tab name. We would
need to add according escape characters then.
(2) What I actually had tried was to get nicely named tabs for Info
buffers (including the clones created with M-n).
I tried with something like this:
#+begin_src emacs-lisp
(add-hook 'Info-mode-hook
(defun my-setup-tab-line-for-Info-mode ()
(tab-line-mode +1)
(setq-local
tab-line-tab-name-function
(lambda (b &optional _bs)
(with-current-buffer b
(apply
#'concat
(cdr mode-line-buffer-identification)))))))
#+end_src
but with that the tab names are not updated while browsing Info pages.
The problem here seems to be related to the caching mechanism that
doesn't recognize the need to update; invalidating the cache explicitly
like with this very ugly hack:
#+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
makes it work.
It would be nice to provide a way to get cases like this work , e.g. by
allowing to specify buffer-local cache key returning functions.
I didn't try the above stuff with the tab bar, but I guess similar
improvements could be implemented for that as well.
TIA,
Michael.
In GNU Emacs 29.0.50 (build 12, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.16.0, Xaw scroll bars) of 2022-09-16 built on drachen
Repository revision: 833e80a0ef115a3fdc20a9d9a3190caab3b56621
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)
next reply other threads:[~2022-09-16 4:39 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 4:39 Michael Heerdegen [this message]
2022-10-30 7:24 ` bug#57848: 29.0.50; Problems with private tab-line-tab-name-function Juri Linkov
2022-10-30 12:02 ` Michael Heerdegen
2022-10-30 17:39 ` Juri Linkov
2022-10-31 8:58 ` Michael Heerdegen
2022-11-09 2:07 ` Michael Heerdegen
2022-11-09 7:41 ` Juri Linkov
2022-11-12 1:52 ` Michael Heerdegen
2022-11-12 18:19 ` Juri Linkov
2022-11-13 17:58 ` Juri Linkov
2022-11-14 3:49 ` Michael Heerdegen
2022-11-14 7:47 ` Juri Linkov
2022-11-15 3:43 ` Michael Heerdegen
2022-12-15 17:16 ` Juri Linkov
2022-12-17 7:35 ` Michael Heerdegen
2022-12-17 17:44 ` Juri Linkov
2022-12-18 1:16 ` Michael Heerdegen
2022-12-18 8:40 ` Juri Linkov
2023-01-10 14:06 ` Michael Heerdegen
2023-01-10 17:44 ` Juri Linkov
2022-11-18 11:49 ` Michael Heerdegen
2022-11-09 7:39 ` Juri Linkov
2022-11-09 23:30 ` Michael Heerdegen
2022-11-10 18:36 ` Juri Linkov
2022-11-12 2:44 ` Michael Heerdegen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735cs53vn.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=57848@debbugs.gnu.org \
--cc=aprekates@posteo.net \
--cc=juri@linkov.net \
--cc=rpluim@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.