diff options
author | Gregory Heytings <gregory@heytings.org> | 2023-02-10 20:55:47 +0000 |
---|---|---|
committer | Gregory Heytings <gregory@heytings.org> | 2023-02-10 22:07:43 +0100 |
commit | 4297039bd1325166eac82d950951716ec122d465 (patch) | |
tree | 4c78d4d9a21ecacb629bdc22b4c658a575cac7c0 /src/editfns.c | |
parent | 2956e54b1dda1647a9399211c7d09b208b85dcfa (diff) | |
download | emacs-4297039bd1325166eac82d950951716ec122d465.tar.gz emacs-4297039bd1325166eac82d950951716ec122d465.tar.bz2 emacs-4297039bd1325166eac82d950951716ec122d465.zip |
Save and restore the absence of narrowing locks
* src/editfns.c (narrowing_locks_save): Return the buffer with a
empty locks list when the current buffer has no narrowing locks.
(narrowing_locks_restore): Remove the narrowing locks if the
buffer had no narrowing locks.
Diffstat (limited to 'src/editfns.c')
-rw-r--r-- | src/editfns.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/editfns.c b/src/editfns.c index 64906671be7..f9879662168 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2799,21 +2799,19 @@ narrowing_locks_save (void) { Lisp_Object buf = Fcurrent_buffer (); Lisp_Object locks = assq_no_quit (buf, narrowing_locks); - if (NILP (locks)) - return Qnil; - locks = XCAR (XCDR (locks)); + if (!NILP (locks)) + locks = XCAR (XCDR (locks)); return Fcons (buf, Fcopy_sequence (locks)); } void narrowing_locks_restore (Lisp_Object buf_and_saved_locks) { - if (NILP (buf_and_saved_locks)) - return; Lisp_Object buf = XCAR (buf_and_saved_locks); Lisp_Object saved_locks = XCDR (buf_and_saved_locks); narrowing_locks_remove (buf); - narrowing_locks_add (buf, saved_locks); + if (!NILP (saved_locks)) + narrowing_locks_add (buf, saved_locks); } static void |