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

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

[nongnu] elpa/undo-fu 5c9aadad4b 27/82: Support using undo-fu-only-redo


From: ELPA Syncer
Subject: [nongnu] elpa/undo-fu 5c9aadad4b 27/82: Support using undo-fu-only-redo after regular undo/undo-only
Date: Thu, 7 Jul 2022 12:04:51 -0400 (EDT)

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

    Support using undo-fu-only-redo after regular undo/undo-only
    
    While this wont support linear undo functionality,
    it at least wont error.
---
 undo-fu.el | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/undo-fu.el b/undo-fu.el
index 44c143d142..9f3de862ef 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -185,6 +185,12 @@ Optional argument ARG The number of steps to redo."
         (undo-fu--checkpoint-disable)
         (message "Redo end-point stepped over!")))
 
+    ;; Ensure the undo checkpoint is usable.
+    (when undo-fu--respect
+      (when (eq last-command 'undo)
+        (undo-fu--checkpoint-disable)
+        (message "Redo 'undo' called, not 'undo-fu-only-undo', checkpoint 
disabled!")))
+
     (when undo-fu--respect
       (unless
         ;; Ensure the next steps is a redo action.
@@ -207,7 +213,14 @@ Optional argument ARG The number of steps to redo."
       ;; the redo action will undo, which isn't so useful.
       ;; This makes redo-only the reverse of undo-only.
 
-      (when (not (eq t pending-undo-list))
+      (when
+        (and
+          ;; Not the first redo action.
+          (not (eq t pending-undo-list))
+          ;; Sanity check, since it's not just being used as a marker
+          ;; any (unlikely) issues here would error.
+          (not (null undo-fu--checkpoint)))
+
         ;; Skip to the last matching redo step before the checkpoint.
         (let
           (



reply via email to

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