diff options
author | Gregory Heytings <gregory@heytings.org> | 2022-11-26 00:14:15 +0000 |
---|---|---|
committer | Gregory Heytings <gregory@heytings.org> | 2022-11-26 01:33:07 +0100 |
commit | 16b8b0d1e07d394e01f76d9eed6006219b4d745b (patch) | |
tree | a67c8a9238e131908b903a96a6dbf9f7fa8fe42d /lisp/subr.el | |
parent | a24652403951751b0bb7ed41033d3414a888310a (diff) | |
download | emacs-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.el | 10 |
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." |