summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorGregory Heytings <gregory@heytings.org>2022-11-26 00:14:15 +0000
committerGregory Heytings <gregory@heytings.org>2022-11-26 01:33:07 +0100
commit16b8b0d1e07d394e01f76d9eed6006219b4d745b (patch)
treea67c8a9238e131908b903a96a6dbf9f7fa8fe42d /lisp/subr.el
parenta24652403951751b0bb7ed41033d3414a888310a (diff)
downloademacs-16b8b0d1e07d394e01f76d9eed6006219b4d745b.tar.gz
emacs-16b8b0d1e07d394e01f76d9eed6006219b4d745b.tar.bz2
emacs-16b8b0d1e07d394e01f76d9eed6006219b4d745b.zip
Save and restore narrowing locks in 'save-restriction'.
* src/editfns.c: (Fsave_restriction): Save and restore narrowing locks. Suggested by Stefan Monnier. (narrowing_locks_save, narrowing_locks_restore): Helper functions. * lisp/subr.el (with-narrowing-1): Simplify.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el10
1 files changed, 4 insertions, 6 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 3e71f6f4edb..b83805e8986 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3956,12 +3956,10 @@ detailed description.
(defun with-narrowing-1 (start end tag body)
"Helper function for `with-narrowing', which see."
(save-restriction
- (unwind-protect
- (progn
- (narrow-to-region start end)
- (narrowing-lock tag)
- (funcall body))
- (narrowing-unlock tag))))
+ (progn
+ (narrow-to-region start end)
+ (narrowing-lock tag)
+ (funcall body))))
(defun with-narrowing-2 (start end body)
"Helper function for `with-narrowing', which see."