GNU bug report logs -
#56682
Fix the long lines font locking related slowdowns
Previous Next
Full log
Message #1693 received at 56682 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>>>> 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).
Then, can Emacs throw an error if widen must not be allowed in certain
scenarios? In complex codebase like Org, we cannot guarantee that some
user-customized function does not widen. Or spurious advice. Debugging
absence of widening somewhere inside deep function calls will be a
nightmare.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
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.