1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-01 11:14:55 +00:00

; Clarify documentation of "locked narrowing"

* src/editfns.c (Fwiden, Fnarrow_to_region):
* doc/lispref/positions.texi (Narrowing): Explain when
'narrow-to-region' and 'widen' might have no effect.
This commit is contained in:
Eli Zaretskii 2022-08-02 16:24:00 +03:00
parent bf47851e08
commit 7f59cadf6f
2 changed files with 10 additions and 4 deletions

View File

@ -1005,7 +1005,9 @@ of the current region (point and the mark, with the smallest first).
Note that, in rare circumstances, Emacs may decide to leave, for
performance reasons, the accessible portion of the buffer unchanged
after a call to @code{narrow-to-region}.
after a call to @code{narrow-to-region}. This can happen when a Lisp
program is called via low-level hooks, such as
@code{jit-lock-functions}, @code{post-command-hook}, etc.
@end deffn
@deffn Command narrow-to-page &optional move-count
@ -1033,7 +1035,9 @@ It is equivalent to the following expression:
Note that, in rare circumstances, Emacs may decide to leave, for
performance reasons, the accessible portion of the buffer unchanged
after a call to @code{widen}.
after a call to @code{widen}. This can happen when a Lisp program is
called via low-level hooks, such as @code{jit-lock-functions},
@code{post-command-hook}, etc.
@defun buffer-narrowed-p
This function returns non-@code{nil} if the buffer is narrowed, and

View File

@ -2663,7 +2663,8 @@ This allows the buffer's full text to be seen and edited.
Note that, when the current buffer contains one or more lines whose
length is above `long-line-threshold', Emacs may decide to leave, for
performance reasons, the accessible portion of the buffer unchanged
after this function is called. */)
after this function is called from low-level hooks, such as
`jit-lock-functions' or `post-command-hook'. */)
(void)
{
if (! NILP (Vrestrictions_locked))
@ -2756,7 +2757,8 @@ remain visible.
Note that, when the current buffer contains one or more lines whose
length is above `long-line-threshold', Emacs may decide to leave, for
performance reasons, the accessible portion of the buffer unchanged
after this function is called. */)
after this function is called from low-level hooks, such as
`jit-lock-functions' or `post-command-hook'. */)
(Lisp_Object start, Lisp_Object end)
{
return narrow_to_region_internal (start, end, false);