[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/undo-fu 1d60424680 50/82: Raise error when using undo-fu c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/undo-fu 1d60424680 50/82: Raise error when using undo-fu commands when undo has been disabled |
Date: |
Thu, 7 Jul 2022 12:04:53 -0400 (EDT) |
branch: elpa/undo-fu
commit 1d60424680a2eff6a20f0d462057b2fc1bc7f5f6
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Raise error when using undo-fu commands when undo has been disabled
While in this case nothing useful can be done,
raise an error since this was failing to set the checkpoint
with an unhelpful error.
---
changelog.rst | 5 +++++
undo-fu.el | 9 +++++++++
2 files changed, 14 insertions(+)
diff --git a/changelog.rst b/changelog.rst
index 08913245fe..0bd9d09ece 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -3,6 +3,11 @@
Change Log
##########
+- In development
+
+ - Raise an error when using undo commands when undo has been disabled for
the buffer.
+ *(was failing to set the checkpoint in this case).*
+
- Version 0.3 (2020-03-03)
- Support non-destructive commands between undo/redo actions without
breaking the chain.
diff --git a/undo-fu.el b/undo-fu.el
index 283f529bfb..eba23d64ed 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -111,6 +111,11 @@ Optional argument BODY runs with the message suffix."
(apply ,message-orig (append (list (concat arg "%s")) args (list
,suffix))))))
,@body)))
+(defun undo-fu--undo-enabled-or-error ()
+ "Raise a user error when undo is disabled."
+ (when (eq t buffer-undo-list)
+ (user-error "Undo has been disabled!")))
+
(defun undo-fu--next-step (list)
"Get the next undo step in the list.
@@ -196,6 +201,8 @@ wraps the `undo' function.
Optional argument ARG The number of steps to redo."
(interactive "*p")
+ ;; Raise error since we can't do anything useful in this case.
+ (undo-fu--undo-enabled-or-error)
(let*
( ;; Assign for convenience.
@@ -329,6 +336,8 @@ wraps the `undo-only' function.
Optional argument ARG the number of steps to undo."
(interactive "*p")
+ ;; Raise error since we can't do anything useful in this case.
+ (undo-fu--undo-enabled-or-error)
(let*
( ;; Assign for convenience.
- [nongnu] elpa/undo-fu 3c366ef52a 33/82: Add '.elisp-autofmt' to enable auto-formatting, (continued)
- [nongnu] elpa/undo-fu 3c366ef52a 33/82: Add '.elisp-autofmt' to enable auto-formatting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 4d635722a3 34/82: readme: minor improvements to wording, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 88c4086e12 43/82: Add 'undo-fu-ignore-keyboard-quit' & 'undo-fu-disable-checkpoint', ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 2b1e53285a 55/82: Fix checkpoint initialization with undo data from undo-fu-session, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu a651bb3035 57/82: Complete docstring, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 46de023b5f 58/82: Use logic back-ported from emacs-28 'undo-redo', ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 8b00b16fa8 46/82: Non-destructive commands no longer break the undo-chain, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 6c31b8e565 59/82: Protect undo-fu from aggressive-indent, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 7cbc3f852b 63/82: readme: move details into own top-level heading, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu e0ad06b5ef 64/82: Cleanup: formatting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 1d60424680 50/82: Raise error when using undo-fu commands when undo has been disabled,
ELPA Syncer <=
- [nongnu] elpa/undo-fu 06b52a11d9 69/82: Cleanup: replace 'if' with 'cond', ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 3ae95e60f6 65/82: Update readme example, remove call to disable undo-tree, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 3957d8d188 79/82: Cleanup: replace member with memq, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu fdd806d95c 13/82: Cleanup: make a function to disable the checkpoint, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu ed5af4d0ff 18/82: Merge branch 'add-autoload-cookie' into 'master', ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 61d6cda0a0 35/82: Cleanup: add checkpoint set/clear functions, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu e3e6750c95 37/82: readme: update to reference other packages, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu afa5685743 39/82: Cleanup: minor improvements to comments and error strings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu d5dd79c454 40/82: readme: add link to melpa, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu ea41b40601 54/82: Use 'undo' instead of 'undo-only' when unconstrained mode is in use, ELPA Syncer, 2022/07/07