all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anders Lindgren <andlind@gmail.com>
To: Tom Tromey <tom@tromey.com>
Cc: 41441@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#41441: 26.3; mhtml misbehaving font-lock extend region can cause Emacs to hang
Date: Thu, 28 May 2020 21:31:15 +0200	[thread overview]
Message-ID: <CABr8ebZKF5_cOwJM-rN8rTNF40bVjmRKgWgM0KnHYhJysuaM0A@mail.gmail.com> (raw)
In-Reply-To: <87ftbjdg7n.fsf@tromey.com>

[-- Attachment #1: Type: text/plain, Size: 1375 bytes --]

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@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
>

[-- Attachment #2: Type: text/html, Size: 1852 bytes --]

  reply	other threads:[~2020-05-28 19:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 20:14 bug#41441: 26.3; mhtml misbehaving font-lock extend region can cause Emacs to hang Anders Lindgren
2020-05-25 16:11 ` Tom Tromey
2020-05-27 20:40   ` Anders Lindgren
2020-05-28 16:13     ` Tom Tromey
2020-05-28 18:40       ` Dmitry Gutov
2020-05-28 19:14         ` Tom Tromey
2020-05-28 19:31           ` Anders Lindgren [this message]
2020-05-28 19:50             ` Dmitry Gutov
2020-05-31 16:08         ` Tom Tromey
2020-05-31 17:46           ` Dmitry Gutov
2020-05-27 21:32   ` Dmitry Gutov
2020-05-28 16:14     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABr8ebZKF5_cOwJM-rN8rTNF40bVjmRKgWgM0KnHYhJysuaM0A@mail.gmail.com \
    --to=andlind@gmail.com \
    --cc=41441@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.