From 419b4d44914701cedf308df58c3e5789715c87e7 Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Sun, 9 Jul 2023 19:27:12 +0000 Subject: [PATCH] ; Improve documentation of with-restriction * lisp/subr.el (with-restriction): * doc/lispref/positions.texi (Narrowing): Make it clear that the argument is evaluated and that the result of the evaluation must not be nil. --- doc/lispref/positions.texi | 3 ++- lisp/subr.el | 15 +++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index e74a165b9ed..3d769bfe78a 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -1169,7 +1169,8 @@ saved bounds. In that case it is equivalent to @cindex labeled narrowing @cindex labeled restriction -When the optional argument @var{label}, a symbol, is present, the +When the optional argument @var{label}, which is evaluated to get the +label to use and must yield a non-@code{nil} value, is present, the narrowing is @dfn{labeled}. A labeled narrowing differs from a non-labeled one in several ways: diff --git a/lisp/subr.el b/lisp/subr.el index 0b397b7bebf..43cf4572fe2 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3964,11 +3964,11 @@ See also `locate-user-emacs-file'.") The current restrictions, if any, are restored upon return. -When the optional :label LABEL argument is present, in which -LABEL is a symbol, inside BODY, `narrow-to-region' and `widen' -can be used only within the START and END limits. To gain access -to other portions of the buffer, use `without-restriction' with the -same LABEL argument. +When the optional LABEL argument, which is evaluated to get the +label to use and must yield a non-nil value, is present, inside +BODY, `narrow-to-region' and `widen' can be used only within the +START and END limits. To gain access to other portions of the +buffer, use `without-restriction' with the same LABEL argument. \(fn START END [:label LABEL] BODY)" (declare (indent 2) (debug t)) @@ -3990,9 +3990,8 @@ same LABEL argument. The current restrictions, if any, are restored upon return. -When the optional :label LABEL argument is present, the -restrictions set by `with-restriction' with the same LABEL argument -are lifted. +When the optional LABEL argument is present, the restrictions set +by `with-restriction' with the same LABEL argument are lifted. \(fn [:label LABEL] BODY)" (declare (indent 0) (debug t)) -- 2.39.2