Subject: 29.1; force-mode-line-update does not refresh names of tab-lines

From: Al Haji-Ali <[email-masked]>
Date: Sun, 16 Jun 2024 23:58:02 +0100

In an `emacs -Q`, I tried the following code:

(progn
  (tab-line-mode)
  (setq-local tab-line-tab-name-function
	      (defun my/tab-name(tab &optional _)
	        (with-current-buffer tab
                  (concat (buffer-name) " " (format-time-string "%S"))))))

This works fine and I get the seconds after the buffer-name. However, I seem to have no way of updating the tab-line to cause the names to be refreshed (except to add or remove a tab).
The documentation of `force-mode-line-update` and the `:set` code of `tab-line-tab-name-function` suggest that calling `(force-mode-line-update t)` would do the trick, but on my Emacs, this does not work. Is this a bug or am I misunderstanding the documentation?

I apologize that I am unable to test this on Emacs 30.

-- Al

In GNU Emacs 29.1 (build 1, aarch64-apple-darwin22.5.0, Carbon Version
 169 AppKit 2299.6) of 2023-09-09 built on m2air.local
Windowing system distributor 'Apple Inc.', version 14.1.2
System Description:  macOS 14.1.2

Configured using:
 'configure --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
 --infodir=/opt/homebrew/Cellar/emacs-mac/emacs-29.1-mac-10.0/share/info
 --mandir=/opt/homebrew/Cellar/emacs-mac/emacs-29.1-mac-10.0/share/man
 --prefix=/opt/homebrew/Cellar/emacs-mac/emacs-29.1-mac-10.0 --with-mac
 --enable-mac-app=/opt/homebrew/Cellar/emacs-mac/emacs-29.1-mac-10.0
 --with-gnutls --with-modules --with-mac-metal --with-native-compilation
 --with-tree-sitter 'CFLAGS=-I/opt/homebrew/opt/gcc/include
 -I/opt/homebrew/opt/libgccjit/include'
 'LDFLAGS=-L/opt/homebrew/lib/gcc/13 -I/opt/homebrew/opt/gcc/include
 -I/opt/homebrew/opt/libgccjit/include''

Configured features:
ACL GLIB GMP GNUTLS JSON LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE
PDUMPER RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER XIM ZLIB

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tab-line-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mac-mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-fns radix-tree
cl-print byte-opt debug backtrace find-func tab-line time-date
cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv
cl-extra help-mode bytecomp byte-compile cl-lib jka-compr info rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/mac-win mac-win
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads kqueue mac multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 96353 12870)
 (symbols 48 8005 0)
 (strings 32 24415 2462)
 (string-bytes 1 758586)
 (vectors 16 19730)
 (vector-slots 8 372131 16557)
 (floats 8 35 184)
 (intervals 56 535 0)
 (buffers 984 17))