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.
This commit is contained in:
parent
2956e54b1d
commit
4297039bd1
1 changed files with 4 additions and 6 deletions
|
@ -2799,8 +2799,7 @@ narrowing_locks_save (void)
|
||||||
{
|
{
|
||||||
Lisp_Object buf = Fcurrent_buffer ();
|
Lisp_Object buf = Fcurrent_buffer ();
|
||||||
Lisp_Object locks = assq_no_quit (buf, narrowing_locks);
|
Lisp_Object locks = assq_no_quit (buf, narrowing_locks);
|
||||||
if (NILP (locks))
|
if (!NILP (locks))
|
||||||
return Qnil;
|
|
||||||
locks = XCAR (XCDR (locks));
|
locks = XCAR (XCDR (locks));
|
||||||
return Fcons (buf, Fcopy_sequence (locks));
|
return Fcons (buf, Fcopy_sequence (locks));
|
||||||
}
|
}
|
||||||
|
@ -2808,11 +2807,10 @@ narrowing_locks_save (void)
|
||||||
void
|
void
|
||||||
narrowing_locks_restore (Lisp_Object buf_and_saved_locks)
|
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 buf = XCAR (buf_and_saved_locks);
|
||||||
Lisp_Object saved_locks = XCDR (buf_and_saved_locks);
|
Lisp_Object saved_locks = XCDR (buf_and_saved_locks);
|
||||||
narrowing_locks_remove (buf);
|
narrowing_locks_remove (buf);
|
||||||
|
if (!NILP (saved_locks))
|
||||||
narrowing_locks_add (buf, saved_locks);
|
narrowing_locks_add (buf, saved_locks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue