[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] widen-limits c331b66: Implement buffer-widen-limits fu

From: Vitalie Spinu
Subject: Re: [Emacs-diffs] widen-limits c331b66: Implement buffer-widen-limits functionality
Date: Wed, 23 Mar 2016 12:58:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux)

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]