emacs-devel
[Top][All Lists]
Advanced

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

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


From: Drew Adams
Subject: RE: [Emacs-diffs] widen-limits c331b66: Implement buffer-widen-limits functionality
Date: Wed, 23 Mar 2016 07:29:55 -0700 (PDT)

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

At least now you're backing up to talk about multiple possible
solutions, instead of digging in deeper in your discussion of a
single implementation (or is it two implementations that you and
Stefan are considering?).

I asked for a clear statement (at least a summary, but preferably a
mini-spec) of the _problem_ you are trying to solve.  My request was
ignored.  So be it.  Continue on, the two of you ... but don't be
surprised if people wonder about your solution after a while.

As for solutions (for what I'm only guessing might be the problem),
I suppose there are additional possibilities, including perhaps a
`with-buffer-limits' macro or perhaps even adapting `point-min' and
`point-max' (e.g. by let-binding global variables that they respond
to - e.g., variables `point-min' and `point-max').

Dunno.  It's hard to guess at a solution without understanding the
problem.  All I've gathered so far is that you want certain zones
of the buffer to act as if the major mode is this or that, and in
those zones you want some code (which code? all code?) to treat
`point-min' and `point-max' as the zone limits, i.e., to act as if
there is nothing outside of the zone limits.

Just what that means in detail is not clear (not specified).
Something about font-locking ... and some other blah.  Not clear.

No, I don't need to understand; I'm just one user, and I probably
have nothing useful to offer as a suggestion.  But my guess is
that if more people here had an idea of what problem you are
trying to solve then you might get some useful input.  Just a guess.



reply via email to

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