[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/undo-fu 2cba1903f3 45/82: Cleanup: improve 'undo-fu-disabl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/undo-fu 2cba1903f3 45/82: Cleanup: improve 'undo-fu-disable-checkpoint' messages |
Date: |
Thu, 7 Jul 2022 12:04:52 -0400 (EDT) |
branch: elpa/undo-fu
commit 2cba1903f34a2aa5fccc69678564c59f5c70537b
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Cleanup: improve 'undo-fu-disable-checkpoint' messages
Also use functions for assigning was-undo/was-redo.
---
undo-fu.el | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/undo-fu.el b/undo-fu.el
index 47081d6ef2..037f451aa0 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -147,6 +147,14 @@ Returns the number of steps to reach this list or
COUNT-LIMIT."
pending-undo-list)
list-to-find count-limit))
+(defun undo-fu--was-undo ()
+ "Return t when the last command was undo."
+ (not (null (member last-command '(undo undo-fu-only-undo)))))
+
+(defun undo-fu--was-redo ()
+ "Return t when the last command was redo."
+ (not (null (member last-command '(undo-fu-only-redo)))))
+
;; ---------------------------------------------------------------------------
;; Public Functions
@@ -158,15 +166,15 @@ This command is needed when
`undo-fu-ignore-keyboard-quit' is t,
since in this case `keyboard-quit' cannot be used
to perform unconstrained undo/redo actions."
(interactive)
- (message "Undo checkpoint cleared!")
- (undo-fu--checkpoint-disable)
+ (let ((was-undo-or-redo (or (undo-fu--was-undo) (undo-fu--was-redo))))
+ ;; Display an appropriate message.
+ (if was-undo-or-redo
+ (if (and undo-fu--respect undo-fu--checkpoint)
+ (message "Undo checkpoint cleared!")
+ (message "Undo checkpoint already cleared!"))
+ (message "Undo checkpoint disabled for next undo action!"))
- ;; Needed not to interfere with undo/redo stepping behavior.
- (let*
- ( ;; Assign for convenience.
- (was-undo (not (null (member last-command '(undo undo-fu-only-undo)))))
- (was-redo (not (null (member last-command '(undo-fu-only-redo)))))
- (was-undo-or-redo (or was-undo was-redo)))
+ (undo-fu--checkpoint-disable)
(when was-undo-or-redo
(setq this-command last-command)
@@ -194,8 +202,8 @@ Optional argument ARG The number of steps to redo."
(let*
( ;; Assign for convenience.
- (was-undo (not (null (member last-command '(undo undo-fu-only-undo)))))
- (was-redo (not (null (member last-command '(undo-fu-only-redo)))))
+ (was-undo (undo-fu--was-undo))
+ (was-redo (undo-fu--was-redo))
(was-undo-or-redo (or was-undo was-redo))
(undo-fu-quit-command
(if undo-fu-ignore-keyboard-quit
@@ -313,8 +321,8 @@ Optional argument ARG the number of steps to undo."
(let*
( ;; Assign for convenience.
- (was-undo (not (null (member last-command '(undo undo-fu-only-undo)))))
- (was-redo (not (null (member last-command '(undo-fu-only-redo)))))
+ (was-undo (undo-fu--was-undo))
+ (was-redo (undo-fu--was-redo))
(was-undo-or-redo (or was-undo was-redo))
(undo-fu-quit-command
(if undo-fu-ignore-keyboard-quit
- [nongnu] elpa/undo-fu d26b64530a 02/82: Support undo/redo multiple times, (continued)
- [nongnu] elpa/undo-fu d26b64530a 02/82: Support undo/redo multiple times, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 374a62cba0 08/82: Disable undo-in-region support, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu be82f88630 07/82: Add installation section, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 9cc8c64f16 12/82: Merge branch 'patch-1' into 'master', ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 6f876014dc 14/82: Cleanup: complete doc string for message override macro, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 769789d742 17/82: Add autoload cookie, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu c5bb7b0402 22/82: Evil Mode: mark undo commands not to repeat, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu fd2e9952f9 31/82: Merge branch 'compiler-warnings' into 'master', ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu c2be4ae43e 41/82: Cleanup: blank lines, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu d03de12298 44/82: Cleanup: use the term 'checkpoint' instead of 'end-point', ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 2cba1903f3 45/82: Cleanup: improve 'undo-fu-disable-checkpoint' messages,
ELPA Syncer <=
- [nongnu] elpa/undo-fu 32674fc7b0 47/82: Release 0.3, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu c0806c1903 60/82: Update changelog, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu aae7ec9784 49/82: Cleanup: use mapc for multiple calls to evil-declare-not-repeat, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu f9c39c248c 81/82: readme: update to use evil-modes undo-fu support, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 97e7f4f6e0 82/82: Change URL to codeberg, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu fa245fd3d0 01/82: Initial functionality., ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 8daa0b5c46 05/82: Correct docstrings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 792d27b8a1 16/82: Lower version requirement to 24.3, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 1ecbe826ae 20/82: Fix undo-fu-only-redo-all counting incorrectly, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 0c34b6747e 52/82: Cleanup: replace cl-letf with macro that temporarily sets advice, ELPA Syncer, 2022/07/07