unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Problems with unicode characters under emacs and Xorg
@ 2020-11-02  6:57 David Mazieres
  2020-11-02  8:49 ` David Edmondson
  0 siblings, 1 reply; 9+ messages in thread
From: David Mazieres @ 2020-11-02  6:57 UTC (permalink / raw)
  To: notmuch

I usually use notmuch in emacs under X windows on arch linux.  Recently,
I've had a problem where some screens in notmuch take several minutes of
100% CPU time to load.  For example, I'll just open a search, and emacs
will completely lock up (even Ctrl-G doesn't do anything) for 3 minutes
while my fan spins and my laptop battery drains significantly.

This appears to be related to the display of certain unicode characters
in email--particularly if they are in the email subject, because then
the whole search screen will freeze.  So far, the only workaround I've
found is to kill -15 emacs, start it again in an xterm or urxvt with
"emacs -nw", delete or archive the offending message, and then restart
the Xorg emacs.  This is quite painful particularly since it's not
always obvious which email message is causing the problem.

Has anyone else experienced this problem?  Is there any way to
workaround the problem by, for instance, defaulting to unibyte mode for
notmuch buffers?  I do use unicode for other languages, but I guess
wouldn't mind having to type "M-x toggle-enable-multibyte-characters" to
get them if as a result my emacs never locked up.

It's likely that this is an emacs-wide problem, but since whatever these
characters are only show up in email, I'm hoping there are people on
this list who know how to solve the problem or have better workarounds.

Thanks,
David

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with unicode characters under emacs and Xorg
  2020-11-02  6:57 Problems with unicode characters under emacs and Xorg David Mazieres
@ 2020-11-02  8:49 ` David Edmondson
  2020-11-02  9:21   ` dm-list-email-notmuch
  0 siblings, 1 reply; 9+ messages in thread
From: David Edmondson @ 2020-11-02  8:49 UTC (permalink / raw)
  To: David Mazieres expires 2021-01-31 CET, notmuch

On Sunday, 2020-11-01 at 22:57:58 -08, David Mazieres wrote:

> I usually use notmuch in emacs under X windows on arch linux.  Recently,
> I've had a problem where some screens in notmuch take several minutes of
> 100% CPU time to load.  For example, I'll just open a search, and emacs
> will completely lock up (even Ctrl-G doesn't do anything) for 3 minutes
> while my fan spins and my laptop battery drains significantly.
>
> This appears to be related to the display of certain unicode characters
> in email--particularly if they are in the email subject, because then
> the whole search screen will freeze.  So far, the only workaround I've
> found is to kill -15 emacs, start it again in an xterm or urxvt with
> "emacs -nw", delete or archive the offending message, and then restart
> the Xorg emacs.  This is quite painful particularly since it's not
> always obvious which email message is causing the problem.
>
> Has anyone else experienced this problem?  Is there any way to
> workaround the problem by, for instance, defaulting to unibyte mode for
> notmuch buffers?  I do use unicode for other languages, but I guess
> wouldn't mind having to type "M-x toggle-enable-multibyte-characters" to
> get them if as a result my emacs never locked up.
>
> It's likely that this is an emacs-wide problem, but since whatever these
> characters are only show up in email, I'm hoping there are people on
> this list who know how to solve the problem or have better workarounds.

I haven't seen this. Threads with a lot of complex HTML content (lots of
nested tables, for example) can take a long time to render for me, but
that is generally interruptable.

Could you share one of these messages, or a sufficiently similar test
case?

dme.
-- 
Driving at 90 down those country lanes, singing to "Tiny Dancer".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with unicode characters under emacs and Xorg
  2020-11-02  8:49 ` David Edmondson
@ 2020-11-02  9:21   ` dm-list-email-notmuch
  2020-11-02 10:09     ` David Edmondson
  0 siblings, 1 reply; 9+ messages in thread
From: dm-list-email-notmuch @ 2020-11-02  9:21 UTC (permalink / raw)
  To: David Edmondson, notmuch

David Edmondson <dme@dme.org> writes:

> I haven't seen this. Threads with a lot of complex HTML content (lots of
> nested tables, for example) can take a long time to render for me, but
> that is generally interruptable.
>
> Could you share one of these messages, or a sufficiently similar test
> case?

Thanks for the reply.  I can send one of these emails to you privately
if necessary, as it might contain semi-sensitive information.  However,
I think all you need is the subject line.  For example:

Subject: =?UTF-8?B?RGF2aWQ6IEhvdy1UbyBIaXJlIHRoZSBCZXN0IFJlbW9kZWxpbmcgQ29udHJhY3RvciDwn5Od?=

That subject line alone triggers the problem, because any search
returning that thread triggers the problem.  When decoded, the subject
line ends with unicode code point 0x1F4DD (MEMO).  Indeed, if I open up
a fresh emacs, and, independent of notmuch, type "C-x 8 RET memo RET",
it causes the emacs to hang for a minute or so.

Arguably this is a limitation of emacs or fontconfig, or I've installed
too many fonts on my system, or I've installed too few fonts (because
after all that computation it just renders a box with hext digits 01F4DD
in it instead of showing the MEMO icon).  However, the problem only
happens with notmuch, because notmuch is the only emacs functionality I
need that renders anything other than a very limited set of unicode
characters.  So if there's any way either to workaround the problem, or
to copy whatever other notmuch users are doing (is there some particular
unicode font I should just install on my system?), I would be very
happy.

Thanks,
David

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with unicode characters under emacs and Xorg
  2020-11-02  9:21   ` dm-list-email-notmuch
@ 2020-11-02 10:09     ` David Edmondson
  2020-11-02 10:32       ` dm-list-email-notmuch
  0 siblings, 1 reply; 9+ messages in thread
From: David Edmondson @ 2020-11-02 10:09 UTC (permalink / raw)
  To: David Mazieres expires 2021-01-31 CET, notmuch

On Monday, 2020-11-02 at 01:21:00 -08, dm-list-email-notmuch@scs.stanford.edu wrote:

> David Edmondson <dme@dme.org> writes:
>
>> I haven't seen this. Threads with a lot of complex HTML content (lots of
>> nested tables, for example) can take a long time to render for me, but
>> that is generally interruptable.
>>
>> Could you share one of these messages, or a sufficiently similar test
>> case?
>
> Thanks for the reply.  I can send one of these emails to you privately
> if necessary, as it might contain semi-sensitive information.  However,
> I think all you need is the subject line.  For example:
>
> Subject: =?UTF-8?B?RGF2aWQ6IEhvdy1UbyBIaXJlIHRoZSBCZXN0IFJlbW9kZWxpbmcgQ29udHJhY3RvciDwn5Od?=
>
> That subject line alone triggers the problem, because any search
> returning that thread triggers the problem.  When decoded, the subject
> line ends with unicode code point 0x1F4DD (MEMO).  Indeed, if I open up
> a fresh emacs, and, independent of notmuch, type "C-x 8 RET memo RET",
> it causes the emacs to hang for a minute or so.

This works fine for me, and I get an appropriate character (not just the
hex box).

According to `describe-char' it's rendered using the Symbola font. Do
you have that installed? (It's the "font-symbola" package on Debian I
believe.)

For some time I've had:

  (set-fontset-font t 'symbol "Symbola" nil 'prepend)

in ~/.emacs.el, but I just tested without and it doesn't seem to be
required.

> Arguably this is a limitation of emacs or fontconfig, or I've installed
> too many fonts on my system, or I've installed too few fonts (because
> after all that computation it just renders a box with hext digits 01F4DD
> in it instead of showing the MEMO icon).  However, the problem only
> happens with notmuch, because notmuch is the only emacs functionality I
> need that renders anything other than a very limited set of unicode
> characters.  So if there's any way either to workaround the problem, or
> to copy whatever other notmuch users are doing (is there some particular
> unicode font I should just install on my system?), I would be very
> happy.
>
> Thanks,
> David

dme.
-- 
I walk like a building, I never get wet.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with unicode characters under emacs and Xorg
  2020-11-02 10:09     ` David Edmondson
@ 2020-11-02 10:32       ` dm-list-email-notmuch
  2020-11-02 12:26         ` David Mazieres
  0 siblings, 1 reply; 9+ messages in thread
From: dm-list-email-notmuch @ 2020-11-02 10:32 UTC (permalink / raw)
  To: David Edmondson, notmuch

David Edmondson <dme@dme.org> writes:

> This works fine for me, and I get an appropriate character (not just the
> hex box).
>
> According to `describe-char' it's rendered using the Symbola font. Do
> you have that installed? (It's the "font-symbola" package on Debian I
> believe.)

I just installed the ttf-symbola package from AUR and ran fc-cache (not
sure if necessary).  Now the problem is completely gone.  Not only that,
but I even get the little memo symbol instead of a box with the hex code
point number.

Thank you so much!  This was driving me nuts for months.

David

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with unicode characters under emacs and Xorg
  2020-11-02 10:32       ` dm-list-email-notmuch
@ 2020-11-02 12:26         ` David Mazieres
  2020-11-02 12:55           ` David Edmondson
  0 siblings, 1 reply; 9+ messages in thread
From: David Mazieres @ 2020-11-02 12:26 UTC (permalink / raw)
  To: David Edmondson, notmuch

dm-list-email-notmuch@scs.stanford.edu writes:

> I just installed the ttf-symbola package from AUR and ran fc-cache (not
> sure if necessary).  Now the problem is completely gone.  Not only that,
> but I even get the little memo symbol instead of a box with the hex code
> point number.
>
> Thank you so much!  This was driving me nuts for months.

Sadly, I spoke too soon.  This does fix the particular problem that I
posted, and makes the situation better, but I'm still getting occasional
lockups, presumably because symbola does not cover every possible
symbol.  For example, I had another email containing U+8BDD (CJK UNIFIED
IDEOGRAPH-8BDD), and this one still caused my emacs to spin for many
minutes, before displaying a box with 8BDD in it.

So unfortunately the problem seems to be that any character not
supported by an installed font takes about 2-5 minutes of CPU time to
resolve.  And of course most characters that I'd use are in installed
fonts, except that I can control what's in the emails I receive, so this
makes notmuch very painful to use.  But if no one else is running into
the problems, then I may be able to get around it by installing whatever
fonts other people have installed.

Thanks,
David

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with unicode characters under emacs and Xorg
  2020-11-02 12:26         ` David Mazieres
@ 2020-11-02 12:55           ` David Edmondson
  2020-11-03 21:59             ` Tomi Ollila
  0 siblings, 1 reply; 9+ messages in thread
From: David Edmondson @ 2020-11-02 12:55 UTC (permalink / raw)
  To: David Mazieres expires 2021-01-31 CET, notmuch

On Monday, 2020-11-02 at 04:26:27 -08, David Mazieres wrote:

> dm-list-email-notmuch@scs.stanford.edu writes:
>
>> I just installed the ttf-symbola package from AUR and ran fc-cache (not
>> sure if necessary).  Now the problem is completely gone.  Not only that,
>> but I even get the little memo symbol instead of a box with the hex code
>> point number.
>>
>> Thank you so much!  This was driving me nuts for months.
>
> Sadly, I spoke too soon.  This does fix the particular problem that I
> posted, and makes the situation better, but I'm still getting occasional
> lockups, presumably because symbola does not cover every possible
> symbol.  For example, I had another email containing U+8BDD (CJK UNIFIED
> IDEOGRAPH-8BDD), and this one still caused my emacs to spin for many
> minutes, before displaying a box with 8BDD in it.

That one is from:

-isas-song ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0

though I'm not sure which package provides that.

> So unfortunately the problem seems to be that any character not
> supported by an installed font takes about 2-5 minutes of CPU time to
> resolve.  And of course most characters that I'd use are in installed
> fonts, except that I can control what's in the emails I receive, so this
> makes notmuch very painful to use.  But if no one else is running into
> the problems, then I may be able to get around it by installing whatever
> fonts other people have installed.

I don't seem to have the root problem - that unknown characters cause a
delay. I get the hex-filled box immediately.

dme.
-- 
Maybe then I'll fade away and not have to face the facts.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with unicode characters under emacs and Xorg
  2020-11-02 12:55           ` David Edmondson
@ 2020-11-03 21:59             ` Tomi Ollila
  2020-11-03 22:19               ` dm-list-email-notmuch
  0 siblings, 1 reply; 9+ messages in thread
From: Tomi Ollila @ 2020-11-03 21:59 UTC (permalink / raw)
  To: David Edmondson, David Mazieres expires 2021-01-31 CET, notmuch


Emacs versions involved ?

Tomi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with unicode characters under emacs and Xorg
  2020-11-03 21:59             ` Tomi Ollila
@ 2020-11-03 22:19               ` dm-list-email-notmuch
  0 siblings, 0 replies; 9+ messages in thread
From: dm-list-email-notmuch @ 2020-11-03 22:19 UTC (permalink / raw)
  To: Tomi Ollila, David Edmondson, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> Emacs versions involved ?

I'm using the latest version with arch linux, namely emacs 27.1-3.
Also, for what it's worth, "fc-list | wc -l" shows 4769 fonts installed
on my system.  Could that be too many if emacs does some sort of linear
search for characters?

Thanks,
David

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-03 22:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02  6:57 Problems with unicode characters under emacs and Xorg David Mazieres
2020-11-02  8:49 ` David Edmondson
2020-11-02  9:21   ` dm-list-email-notmuch
2020-11-02 10:09     ` David Edmondson
2020-11-02 10:32       ` dm-list-email-notmuch
2020-11-02 12:26         ` David Mazieres
2020-11-02 12:55           ` David Edmondson
2020-11-03 21:59             ` Tomi Ollila
2020-11-03 22:19               ` dm-list-email-notmuch

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).