[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/improved-locked-narrowing bf4373f90a: Simplify narrowing_locks_r
From: |
Gregory Heytings |
Subject: |
feature/improved-locked-narrowing bf4373f90a: Simplify narrowing_locks_restore |
Date: |
Sat, 26 Nov 2022 19:53:39 -0500 (EST) |
branch: feature/improved-locked-narrowing
commit bf4373f90a8c396d1e26e13cd144ac4022424081
Author: Gregory Heytings <gregory@heytings.org>
Commit: Gregory Heytings <gregory@heytings.org>
Simplify narrowing_locks_restore
* src/editfns.c (narrowing_locks_restore): Simplify.
---
src/editfns.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/src/editfns.c b/src/editfns.c
index ec1eec8877..a57ae823e5 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2669,8 +2669,8 @@ narrowing_locks_add (Lisp_Object buf, Lisp_Object locks)
narrowing_locks = nconc2 (list1 (list2 (buf, locks)), narrowing_locks);
}
-/* Remove BUF from the narrowing_locks alist. Do nothing if BUF is
- not present in narrowing_locks. */
+/* Remove BUF and its locks from the narrowing_locks alist. Do
+ nothing if BUF is not present in narrowing_locks. */
static void
narrowing_locks_remove (Lisp_Object buf)
{
@@ -2803,16 +2803,8 @@ narrowing_locks_restore (Lisp_Object buf_and_saved_locks)
if (NILP (buf_and_saved_locks))
return;
Lisp_Object buf = XCAR (buf_and_saved_locks);
- /* This cannot fail when buf_and_saved_locks was returned by
- narrowing_locks_save. */
- eassert (BUFFERP (buf));
Lisp_Object saved_locks = XCDR (buf_and_saved_locks);
- /* This cannot fail when buf_and_saved_locks was returned by
- narrowing_locks_save. */
- eassert (! NILP (saved_locks));
- Lisp_Object current_locks = assq_no_quit (buf, narrowing_locks);
- if (! NILP (current_locks))
- narrowing_locks_remove (buf);
+ narrowing_locks_remove (buf);
narrowing_locks_add (buf, saved_locks);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- feature/improved-locked-narrowing bf4373f90a: Simplify narrowing_locks_restore,
Gregory Heytings <=