all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#57848: 29.0.50; Problems with private tab-line-tab-name-function
@ 2022-09-16  4:39 Michael Heerdegen
  2022-10-30  7:24 ` Juri Linkov
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Heerdegen @ 2022-09-16  4:39 UTC (permalink / raw)
  To: 57848; +Cc: Alexandros Prekates, Robert Pluim, Juri Linkov


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)






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

end of thread, other threads:[~2023-01-10 17:44 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16  4:39 bug#57848: 29.0.50; Problems with private tab-line-tab-name-function Michael Heerdegen
2022-10-30  7:24 ` 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

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.