|
From: | Dmitry Gutov |
Subject: | Re: Major modes using `widen' is a good, even essential, programming practice. |
Date: | Sun, 7 Aug 2022 20:57:59 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 |
On 06.08.2022 23:13, Alan Mackenzie wrote:
Narrowing is primarily a user feature. Users can arbitrarily narrow a buffer to ANY contiguous region of text. So when a major mode needs to examine text even slightly distant from point, it MUST widen, to be sure that the text to be examined is within the visible region.
Now wouldn't it have been nice if user-level narrowing didn't create an *actual* narrowing but only some visual perception of it? IIRC there is a third-party package which implements this approach.
From what I've seen of feature requests related to narrowing in my packages, it's always along the lines of "please add (save-restriction (widen) ...) around the whole implementation".
Are there actually user-level commands which should not ignore narrowing? If not, it would be better if user-level narrowing was implemented as something else (e.g. two invisible overlays). Then all other code wouldn't have to bother with undoing it.
[Prev in Thread] | Current Thread | [Next in Thread] |