branch: elpa/undo-fu
commit fdd806d95c145e2a47aadaf447f2d8a81a7d8a42
Author: Campbell Barton <[email protected]>
Commit: Campbell Barton <[email protected]>
Cleanup: make a function to disable the checkpoint
---
undo-fu.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/undo-fu.el b/undo-fu.el
index b9a90fc085..8e93ac9288 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -56,6 +56,13 @@
;; Internal functions/macros.
+(defun undo-fu--checkpoint-disable ()
+ "Disable check to prevent crossing the initial boundary when redoing."
+ (setq undo-fu--respect nil)
+ (setq undo-fu--checkpoint-is-blocking nil)
+ (setq undo-fu--checkpoint nil))
+
+
(defmacro undo-fu--with-message-suffix (suffix &rest body)
"Add text after the message output."
(declare (indent 1))
@@ -149,8 +156,7 @@ Optional argument ARG The number of steps to redo."
;; This allows explicitly over-stepping the boundary, in cases where it's
needed.
(when undo-fu--respect
(when (string-equal last-command 'keyboard-quit)
- (setq undo-fu--respect nil)
- (setq undo-fu--checkpoint-is-blocking nil)
+ (undo-fu--checkpoint-disable)
(message "Redo end-point stepped over!")))
(when undo-fu--respect
@@ -234,9 +240,7 @@ Optional argument ARG the number of steps to undo."
;; This allows explicitly over-stepping the boundary, in cases where it's
needed.
(when undo-fu--respect
(when (string-equal last-command 'keyboard-quit)
- (setq undo-fu--respect nil)
- (setq undo-fu--checkpoint-is-blocking nil)
- (setq undo-fu--checkpoint nil)
+ (undo-fu--checkpoint-disable)
(message "Undo end-point ignored!")))
(let*