Subject: bug#59208: 29.0.50; tab-bar-auto-width plus display space cpu spin

From: Aaron Jensen <[email-masked]>
Date: Sat, 12 Nov 2022 02:31:53 -0500

My tab-bar-tab-name-format-function causes 100% cpu spin as of
ca3763af5c. Disabling tab-bar-auto-width fixes it.

To repro: emacs -Q -l repro.el

repro.el:

(defun aj/tab-bar-tab-name-format (tab i)
  (propertize
   (propertize " " 'display '(space :width (8)))
   'face (funcall tab-bar-tab-face-function tab)))

(setq tab-bar-tab-name-format-function #'aj/tab-bar-tab-name-format)

(tab-bar-mode)

In GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.6.0, NS
 appkit-2113.60 Version 12.6 (Build 21G115)) of 2022-09-28 built on
 aaron-m1.local
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.6.1

Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
 --infodir=/opt/homebrew/Cellar/emacs-plus@29/29.0.50/share/info/emacs
 --prefix=/opt/homebrew/Cellar/emacs-plus@29/29.0.50 --with-xml2
 --with-gnutls --with-native-compilation --without-compress-install
 --without-dbus --without-imagemagick --with-modules --with-rsvg
 --with-ns --disable-ns-self-contained 'CFLAGS=-Os -w -pipe
 -mmacosx-version-min=12
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
 -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT'
 'CPPFLAGS=-I/opt/homebrew/opt/zlib/include
 -I/opt/homebrew/opt/jpeg/include -I/opt/homebrew/opt/icu4c/include
 -I/opt/homebrew/opt/[email-masked]/include
 -I/opt/homebrew/opt/readline/include -isystem/opt/homebrew/include
 -F/opt/homebrew/Frameworks
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk'
 'LDFLAGS=-L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/jpeg/lib
 -L/opt/homebrew/opt/icu4c/lib -L/opt/homebrew/opt/[email-masked]/lib
 -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/lib
 -F/opt/homebrew/Frameworks -Wl,-headerpad_max_install_names
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk''