Subject: Re: bug#24918: 25.1; Fonts can make Emacs grind to a halt

From: Klaus-Dieter Bauer <[email-masked]>
Date: Tue, 29 Nov 2016 11:29:03 +0100

The issue occurs with the default fonts too ("emacs -Q"). On Windows that
means `Courier New' for `default' and `Monospace' for `fixed-pitch',
`Monospace Serif` for `fixed-pitch-serif' and `Arial` for `variable-pitch'.

With these default settings, the `package-list-packages' buffer works
mostly fine, but the info page `(cl) Structures' for instace does not.
Using different fonts, e.g. `Linux Libertine Mono' or `Noto Mono', the
issue becomes only more widespread.

I detail, I noticed that the issue indeed does occur specifically *when
font substitution kicks in*. In the info-page for `(cl) Structure' this
occurs, because the "=>" is replaced by the unicode symbol "⇒", which is
displayed in a different font; Sadly I can't figure out a way to identify
the substituted font; It is definitely a variable-pitch font (the symbol is
wider than the default font, such that characters are no longer vertically
aligned with other lines).

For such font-substituted characters, there are multiple cases where I
observed delays.

   1. When the character becomes visible in the current window (small delay
   if caused by a single input event, but can crash Emacs when
   scrolling-events, and thus delays, queue up).
   2. When `point' is moved to the line containing the character, either
   with mouse or keyboard (somewhat bigger delay).
   3. When `point' is moved to the character itself, either with mouse or
   keyboard (extensive delay).
   4. Whenever there is any change to the Window-layout (e.g. splitting the
   window, or resizing the frame).

My guess would be that custom fonts only make the issue more apparent,
because font-substitution may become more widespread.

If there is any possibility to identify the font used in font substitution
(it doesn't affect the text-attributes apparently, so C-u C-x = doesn't
help), I could check if the issue is related to one of the fonts I have
installed on my system.

- Klaus

2016-11-28 16:47 GMT+01:00 Eli Zaretskii <[email-masked]>:

> > From: Klaus-Dieter Bauer <[email-masked]>
> > Date: Sun, 27 Nov 2016 22:12:48 +0100
> > Cc: [email-masked]
> >
> > I tried compiling the emacs-25 branch , freshly cloned (25.1.50.1) and
> ran it as "emacs -Q". I hope that is the
> > version you meant.
> >
> > The issue persists unless setting (setq inhibit-compacting-font-caches
> t), as before.
> >
> > It can be reproduced by scrolling (with mouse or keyboard) in info node
> `(cl) Structures'. If scrolling fast, such
> > that the multiple input events queue up while Emacs is hanging, Emacs
> freezes permanently and has to be
> > killed.
>
> Is this because you use the Noto Mono font, or is this with the
> default fonts?  If the latter, please show how you customized Emacs to
> use Noto Mono.
>
> Thanks.
>