branch: elpa/undo-fu
commit 9bf729c7275c8a5b3a6c4a2209cab437bb7dfab6
Author: Campbell Barton <[email protected]>
Commit: Campbell Barton <[email protected]>
Support pressing C-g before undo
Allows to enter unconstrained mode before undo.
---
undo-fu.el | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/undo-fu.el b/undo-fu.el
index 6320638896..2918069fde 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -210,6 +210,15 @@ Optional argument ARG the number of steps to undo."
(when (or undo-fu--checkpoint-is-blocking (not was-undo-or-redo))
(setq undo-fu--checkpoint (cdr buffer-undo-list)))
+ ;; Allow crossing the boundary, if we press [keyboard-quit].
+ ;; 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)
+ (message "Undo end-point ignored!")))
+
(let*
;; Swap in 'undo' for our own function name.
;; Without this undo won't stop once the first undo step is reached.