Subject: Re: bug#42522: Emacs 27: 100% CPU when setting mode-name with ligatures

From: Evan Moses <[email-masked]>
Date: Sat, 25 Jul 2020 14:13:17 -0700

FYI I was following the instructions here: https://github.com/tonsky/FiraCode/wiki/Emacs-instructions#using-composition-char-table to get Fira Code ligatures globally. It so happens that C-modes will add “//“ to the mode name in certain configurations; I just pared this down to a minimal repro case. 

--
Evan Moses
[email-masked]

> On Jul 24, 2020, at 11:25 PM, Eli Zaretskii <[email-masked]> wrote:
> 
> 
>> 
>> From: Evan Moses <[email-masked]>
>> Date: Fri, 24 Jul 2020 14:35:50 -0700
>> 
>> To reproduce, evaluate this
>> 
>> (set-char-table-range composition-function-table 47 '([".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)" 0
>> font-shape-gstring]))
>> 
>> And then evaluate 
>> 
>> (setq mode-name "test//")
>> 
>> Emacs will become unresponsive and consume 100% CPU.
> 
> It doesn't hang here.  Could this be macOS-specific?  Or maybe the
> problem happens only with some fonts?  Does it happen in "emacs -Q"?
> 
> In any case, did you really mean for Emacs to produce ligatures on the
> mode line?  More generally, what kind of ligatures are you trying to
> produce with this setup?