On Wed, Mar 23 2016 08:16, Andreas Röhler wrote:
preventing unwanted widen instead seems the way to go.
That's precisely what extra limit do. Prevent unwanted widen. How do you propose
to implement that?
I see 4 ways to go about it:
1) Add an extra prog-widen and teach all modes out there to use it in
contexts
like syntax-parsing, indentation, font-lock and who know what else. A half
backed version of this in already part of emacs.
2) Have low level restrictions directly in `widen` and a macro
`with-widen-limit` that multi-modes can use. This is the current patch.
3) Have two types of narrowing (soft and hard). This is harder to implement
but has the benefit that it can be used in non-transient situations like
Info mode.
4) Bring widen to elisp and allow minor modes (and Info mode) advice widen in
whatever way they see.
I think (1) is a bad idea. (4) is simplest and very general. (3) might be useful
but it's hard. (2) is implemented to get rid of (1).
I proposed (4) very early in the thread, but didn't hear much support for
it. There are only three trivial usages of Fwiden in C code. Bringing `narrow`
to elisp is equally easy.
Vitalie