Subject: Re: bug#40733: 28.0.50; Emacs locks up on paste (yank) of unicode characters

From: Will Bush <[email-masked]>
Date: Tue, 21 Apr 2020 07:19:56 -0500

Ok I've made some progress on this issue.

I was playing around with my fonts:

https://github.com/willbush/system/blob/085e4c547f0bd84729f12f82b920d867d05e1591/nixos/fonts.nix#L7

I was curious how many fonts I would have (using `fc-list | wc -l`) if I
removed
them all from that list. After removing them all, I checked my email in
Gmail
using Firefox and noticed the `︵` was rendering properly. Then I tried
pasting it
into Emacs and lo and behold no lag issue!

So I did a binary search through my font list commenting / uncommenting
them and
applying the changes with `sudo nixos rebuild switch` (as one does in
NixOS),
and found google-fonts is causing the issue.

I verified it several times. When I remove google-fonts, Firefox renders the
character fine and Emacs yanks it without issue. When I add google-fonts
back
Firefox doesn't render the character and Emacs yanking it lags like crazy.

The google-fonts Nix expression is here:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/fonts/google-fonts/default.nix

I tried Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.17) (A
version that just happens to be in nixpkgs) again to see what it would do
when
yanking that character with and without google-fonts installed.

With google-fonts installed it doesn't have latency issues, but it inserts
an
empty whitespace looking character (wider than a normal space). Without
google-fonts installed, it renders the character fine with no latency.

So I suspect even if there is an issue with google-fonts, there's still a
regression in Emacs since 26.3. I'll try newer versions of Emacs later to
try to
narrow the version gap between 26.3 and 28.0.50.

Perhaps someone can try to reproduce the issue by installing google-fonts
(note
the git rev used in default.nix above is
f113126dc4b9b1473d9354a86129c9d7b837aa1a
for https://github.com/google/fonts).

On Tue, Apr 21, 2020 at 5:01 AM Robert Pluim <[email-masked]> wrote:

> >>>>> On Mon, 20 Apr 2020 23:48:48 +0100, "Basil L. Contovounesios" <
> [email-masked]> said:
>
>     Basil> Will Bush <[email-masked]> writes:
>     >> Configured using:
>     >> 'configure
>     >>
> --prefix=/nix/store/2142cl219v49czkkrrddh3jy3415nax0-emacs-git-20200420.0
>     >> --disable-build-details --with-modules --with-x-toolkit=gtk3
> --with-xft
>     Basil>
>  ^^^^^^^^^^
>
>     Basil> I know next to nothing about fonts, and I'm sure others will
> correct me,
>     Basil> but etc/NEWS has the following to say:
>
>     Basil>   ** 'configure' now warns about building with libXft support.
>     Basil>   libXft is unmaintained, and causes a number of problems with
> modern
>     Basil>   fonts including but not limited to crashes; support for it
> may be
>     Basil>   removed in a future version of Emacs.  Please consider using
>     Basil>   Cairo + HarfBuzz instead.
>
>     Basil> I don't know if it's related (and the 'C-u C-x =' output in
> your other
>     Basil> message shows the ftcrhb backend in use), but perhaps you can
> try
>     Basil> building --without-xft to see if it makes any difference.
>
> If it does thatʼs a bug, since we implicitly do '--with-cairo' now.
>
> Robert
>