Inside BODY, `narrow-to-region' and `widen' can be used only
within the START and END limits, unless the restrictions are
-unlocked by calling `narrowing-unlock' with TAG."
- `(unwind-protect
- (progn
- (narrow-to-region ,start ,end)
- (narrowing-lock ,tag)
- ,@body)
- (narrowing-unlock ,tag)
- (widen)))
+unlocked by calling `narrowing-unlock' with TAG. See
+`narrowing-lock' for a more detailed description. The current
+restrictions, if any, are restored upon return."
+ `(save-restriction
+ (unwind-protect
+ (progn
+ (narrow-to-region ,start ,end)
+ (narrowing-lock ,tag)
+ ,@body)
+ (narrowing-unlock ,tag)
+ (widen))))
(defun find-tag-default-bounds ()
"Determine the boundaries of the default tag, based on text at point.
doc: /* Remove restrictions (narrowing) from current buffer.
This allows the buffer's full text to be seen and edited, unless
-the restrictions have been locked with `narrowing-lock', which see,
-in which case the the restrictions that were current when
-`narrowing-lock' was called are restored. */)
+restrictions have been locked with `narrowing-lock', which see, in
+which case the restrictions that were current when `narrowing-lock'
+was called are restored. */)
(void)
{
Fset (Qoutermost_narrowing, Qnil);
Locking restrictions should be used sparingly, after carefully
considering the potential adverse effects on the code that will be
-executed with locked restrictions. It is meant to be used around
-portions of code that would become too slow, and make Emacs
+executed within locked restrictions. It is typically meant to be used
+around portions of code that would become too slow, and make Emacs
unresponsive, if they were executed in a large buffer. For example,
restrictions are locked by Emacs around low-level hooks such as
`fontification-functions' or `post-command-hook'.