Subject: Re: bug#52947: 29.0.50; Newline in tab-bar-format causes lockup

From: Juri Linkov <[email-masked]>
Date: Sun, 02 Jan 2022 19:47:14 +0200

> Execute the following elisp:

Thanks for the bug report.

> #+begin_src emacs-lisp
>   (defun broken-tab-bar-format ()
>     (let* ((str (format "%s \n %s"
>                         "foo" "bar")))
>       `((global menu-item ,(s-trim str) ignore))))

This also can be reproduced without s-trim, with just:

       `((global menu-item ,str ignore))))

>   (progn
>     (setq tab-bar-format '(tab-bar-format-align-right
> broken-tab-bar-format))
>     (tab-bar-mode 1))
> #+end_src
>
> Emacs will lockup and spin the core it's on.

If the display engine doesn't support newlines in the
menu-bar/tool-bar/tab-bar, then we could simply remove newlines
before feeding the tab-bar items to the display engine.