[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master abd1825: Ensure that we can find definitions wh
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] master abd1825: Ensure that we can find definitions when buffer is narrowed |
Date: |
Tue, 12 Dec 2017 15:56:44 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>> Non-nil means it is ok for commands to call ‘widen’ when they want to.
>> Some commands will do this in order to go to positions outside
>> the current accessible part of the buffer.
>> If ‘widen-automatically’ is nil, these commands will do something else
>> as a fallback, and won’t change the buffer bounds.
> I wonder if we're using this variable in all the places we should.
> A recent, heated discussion comes to mind.
Its docstring also doesn't really make it clear what it means and how to
use it. Looking at the current users, a slightly different var might
work better. E.g.
(defvar widen-to-pos-function
(lambda (pos)
(if (not (<= (point-min) pos (point-max)))
(widen))))
this would simplify the two places I could find which check the value of
this var (xref and pop-global-mark). And it would let the only user
who sets it (to nil) set it to a more useful value (a function which
jumps to the page in which that position is visible).
Also I think the docstring should clarify that it is meant for "user
commands" (i.e. not to replace things like font-lock-dont-widen).
Stefan