summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-02-13 20:11:28 +0200
committerEli Zaretskii <eliz@gnu.org>2023-02-13 20:11:28 +0200
commit3d572ae0d507bba07f3cfc5ae2d2c7dd4937472c (patch)
treeddff8ab3f26f07bcb3694a7a5493871a9410ca85 /lisp/subr.el
parentdd8b720ee74e72359eb174aa5a27ab1770a349bd (diff)
downloademacs-3d572ae0d507bba07f3cfc5ae2d2c7dd4937472c.tar.gz
Rename with/without-narrowing to with/without-restriction
* doc/lispref/commands.texi: * doc/lispref/display.texi: * doc/lispref/positions.texi: * etc/NEWS: * lisp/subr.el: * src/buffer.c: * src/editfns.c: * src/keyboard.c: * src/xdisp.c: * test/src/buffer-tests.el: Rename with-narrowing and without-narrowing to with-restriction and without-restriction. Likewise with internal--with-narrowing and internal--without-narrowing. All callers and documentation changed.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el24
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 58a8e85b61d..c26cbb9a56c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3941,7 +3941,7 @@ See also `locate-user-emacs-file'.")
"Return non-nil if the current buffer is narrowed."
(/= (- (point-max) (point-min)) (buffer-size)))
-(defmacro with-narrowing (start end &rest rest)
+(defmacro with-restriction (start end &rest rest)
"Execute BODY with restrictions set to START and END.
The current restrictions, if any, are restored upon return.
@@ -3949,39 +3949,39 @@ 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-narrowing' with the
+to other portions of the buffer, use `without-restriction' with the
same LABEL argument.
\(fn START END [:label LABEL] BODY)"
(if (eq (car rest) :label)
- `(internal--with-narrowing ,start ,end (lambda () ,@(cddr rest))
+ `(internal--with-restriction ,start ,end (lambda () ,@(cddr rest))
,(cadr rest))
- `(internal--with-narrowing ,start ,end (lambda () ,@rest))))
+ `(internal--with-restriction ,start ,end (lambda () ,@rest))))
-(defun internal--with-narrowing (start end body &optional label)
- "Helper function for `with-narrowing', which see."
+(defun internal--with-restriction (start end body &optional label)
+ "Helper function for `with-restriction', which see."
(save-restriction
(narrow-to-region start end)
(if label (internal--lock-narrowing label))
(funcall body)))
-(defmacro without-narrowing (&rest rest)
+(defmacro without-restriction (&rest rest)
"Execute BODY without restrictions.
The current restrictions, if any, are restored upon return.
When the optional :label LABEL argument is present, the
-restrictions set by `with-narrowing' with the same LABEL argument
+restrictions set by `with-restriction' with the same LABEL argument
are lifted.
\(fn [:label LABEL] BODY)"
(if (eq (car rest) :label)
- `(internal--without-narrowing (lambda () ,@(cddr rest))
+ `(internal--without-restriction (lambda () ,@(cddr rest))
,(cadr rest))
- `(internal--without-narrowing (lambda () ,@rest))))
+ `(internal--without-restriction (lambda () ,@rest))))
-(defun internal--without-narrowing (body &optional label)
- "Helper function for `without-narrowing', which see."
+(defun internal--without-restriction (body &optional label)
+ "Helper function for `without-restriction', which see."
(save-restriction
(if label (internal--unlock-narrowing label))
(widen)