GNU bug report logs - #56682
Fix the long lines font locking related slowdowns

Previous Next

Package: emacs;

Reported by: Gregory Heytings <gregory <at> heytings.org>

Date: Thu, 21 Jul 2022 18:01:01 UTC

Severity: normal

Done: Gregory Heytings <gregory <at> heytings.org>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ihor Radchenko <yantar92 <at> gmail.com>
Cc: 56682 <at> debbugs.gnu.org, Gregory Heytings <gregory <at> heytings.org>,
 Eli Zaretskii <eliz <at> gnu.org>, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#56682: Fix the long lines font locking related slowdowns
Date: Tue, 16 Aug 2022 09:20:21 -0400
> I agree that major-mode doing (widen) may be problematic. However, at
> least Org mode does need to do it in order to parse the buffer.

There's no doubt that a major mode may need to override a user's
narrowing in order to work correctly.  That doesn't mean that it
absolutely always needs to have access to the whole buffer.

>>> There are valid cases when a major mode needs to examine
>>> the whole buffer.
>> Not if the whole buffer contains text which the major mode can't
>> understand.  There are valid cases where a major mode needs to widen,
>> indeed, but not when called from font-lock or from
>> `indent-line-function`.
> `org-indent-line' (the value of `indent-line-function' in Org mode) does
> require invoking parser in order to determine the syntactic object at
> point, which, in turn, needs to consider the full buffer contents.

*All* indentation code needs to look at the context.  For that reason
`indent-according-to-mode` already widens as appropriate before calling
`indent-line-function`.  For that reason the function placed on
`indent-line-function` *never* needs to widen (and should never widen).


        Stefan





This bug report was last modified 2 years and 8 days ago.

Previous Next


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