[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lifting all buffer restrictions in indentation functions
From: |
Eli Zaretskii |
Subject: |
Re: Lifting all buffer restrictions in indentation functions |
Date: |
Fri, 08 Dec 2017 22:02:47 +0200 |
> From: Stefan Monnier <address@hidden>
> Date: Fri, 08 Dec 2017 12:03:45 -0500
>
> While such code might exist somewhere [tho most likely calling
> indent-according-to-mode instead], the reasons why I think
> breaking such code is the right thing are:
> - it's very rare
> - it should be easy to change this code so it works with the new (and
> the old) convention, by replacing (indent-according-to-mode) with
> (funcall indent-line-function).
> - the reverse problem (i.e. where the restriction is currently obeyed
> while it shouldn't) is much more common.
>
> IOW the change could introduce breakage, but in my opinion, it will
> correct many more situations than it breaks, and those that it breaks
> are easy to fix.
To clarify: I'm not only afraid of breaking some existing code, I'm
also worried by disabling any _future_ code which could call these
functions in a narrowed buffer. This is AFAIU a legitimate usage, so
unconditionally disallowing it sounds gross.
And I don't think calling indent-line-function directly instead is the
solution, because indent-according-to-mode, indent-for-tab-command
etc. are not just trivial wrappers around the call to
indent-line-function, they have additional functionality (otherwise
why do we have them at all?).
Re: Lifting all buffer restrictions in indentation functions, Robert Weiner, 2017/12/08
Re: Lifting all buffer restrictions in indentation functions, Stephen Leake, 2017/12/08