GNU bug report logs - #41441
26.3; mhtml misbehaving font-lock extend region can cause Emacs to hang

Previous Next

Package: emacs;

Reported by: Anders Lindgren <andlind <at> gmail.com>

Date: Thu, 21 May 2020 20:15:02 UTC

Severity: normal

Tags: fixed

Found in version 26.3

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 41441 <at> debbugs.gnu.org (full text, mbox):

From: Anders Lindgren <andlind <at> gmail.com>
To: Tom Tromey <tom <at> tromey.com>
Cc: 41441 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#41441: 26.3; mhtml misbehaving font-lock extend region can
 cause Emacs to hang
Date: Thu, 28 May 2020 21:31:15 +0200
[Message part 1 (text/plain, inline)]
Hi!

I have given some thought to the other end of the problem (if we should
allow shrinking regions) -- how should font-lock behave when there are
functions that pull in different directions (and it will also handle the
case when a single function returns non-nil without changing the region).

The loop could keep track of which regions it has stared with. When a
functions change the region, the new region it is recorded and the loop
restarts. When the region is resized into something that has already been
seen it doesn't restart. This would allow the region to shrink and grow,
without hanging.

When having conflicting functions, the result is somewhat arbitrary.
Effectively, functions later i the list take precedence over earlier, but
picking one result is better than a hanging Emacs.

    -- Anders


On Thu, May 28, 2020 at 9:15 PM Tom Tromey <tom <at> tromey.com> wrote:

> >> You can enlarge (or even reduce) the region to refontify by setting
> >> the following variable:
>
> Dmitry> This is about font-lock-extend-after-change-region-function,
> though,
> Dmitry> isn't it?
>
> Wow, I totally misread that.  Yeah, I agree.
>
> Dmitry> If we don't find good examples, though, and if we agree that the
> Dmitry> design seems sound, we can turn it off on master and see if anyone
> Dmitry> complains.
>
> I think it would be better to try it a bit first.
>
> Tom
>
[Message part 2 (text/html, inline)]

This bug report was last modified 4 years and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.