emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/undo-fu 61d6cda0a0 35/82: Cleanup: add checkpoint set/clea


From: ELPA Syncer
Subject: [nongnu] elpa/undo-fu 61d6cda0a0 35/82: Cleanup: add checkpoint set/clear functions
Date: Thu, 7 Jul 2022 12:04:51 -0400 (EDT)

branch: elpa/undo-fu
commit 61d6cda0a09e017e52693c66a2a5c8bb82a553b4
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Cleanup: add checkpoint set/clear functions
---
 undo-fu.el | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/undo-fu.el b/undo-fu.el
index 07746b6cfd..73bffe9efc 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -72,13 +72,22 @@ causing undo-fu to work with reduced functionality when a 
selection exists."
 ;; ---------------------------------------------------------------------------
 ;; Internal Functions/Macros
 
+(defun undo-fu--checkpoint-set ()
+  "Set the checkpoint."
+  (setq undo-fu--checkpoint (cdr buffer-undo-list))
+  (setq undo-fu--checkpoint-length nil))
+
+(defun undo-fu--checkpoint-unset ()
+  "Unset the checkpoint."
+  (setq undo-fu--checkpoint nil)
+  (setq undo-fu--checkpoint-length nil))
+
 (defun undo-fu--checkpoint-disable ()
-  "Disable check to prevent crossing the initial boundary when redoing."
+  "Disable using the checkpoint, allowing the initial boundary to be crossed 
when redoing."
   (setq undo-fu--respect nil)
   (setq undo-fu--in-region nil)
   (setq undo-fu--checkpoint-is-blocking nil)
-  (setq undo-fu--checkpoint nil)
-  (setq undo-fu--checkpoint-length nil))
+  (undo-fu--checkpoint-unset))
 
 
 (defmacro undo-fu--with-message-suffix (suffix &rest body)
@@ -302,8 +311,7 @@ Optional argument ARG the number of steps to undo."
         (setq undo-fu--respect t)))
 
     (when (or undo-fu--checkpoint-is-blocking (not was-undo-or-redo))
-      (setq undo-fu--checkpoint (cdr buffer-undo-list))
-      (setq undo-fu--checkpoint-length nil))
+      (undo-fu--checkpoint-set))
 
     (when (region-active-p)
       (if undo-fu-allow-undo-in-region



reply via email to

[Prev in Thread] Current Thread [Next in Thread]