[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/undo-fu 2b1e53285a 55/82: Fix checkpoint initialization wi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/undo-fu 2b1e53285a 55/82: Fix checkpoint initialization with undo data from undo-fu-session |
Date: |
Thu, 7 Jul 2022 12:04:53 -0400 (EDT) |
branch: elpa/undo-fu
commit 2b1e53285a55ce50ca6fd60b050f2171e235d8f9
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Fix checkpoint initialization with undo data from undo-fu-session
---
changelog.rst | 2 ++
undo-fu.el | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/changelog.rst b/changelog.rst
index bf33687479..57787c5684 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -5,6 +5,8 @@ Change Log
- In development
+ - Fix undo checkpoint initialization when running for the first with
existing undo data.
+ This could happen when running undo immediately upon loading a file with
undo data from ``undo-fu-session``.
- Undo in *unconstrained* mode no longer uses ``undo-only``,
matching redo behavior.
- Raise an error when using undo commands when undo has been disabled for
the buffer.
diff --git a/undo-fu.el b/undo-fu.el
index a9ded87138..ac70a1ef67 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -358,6 +358,12 @@ Optional argument ARG the number of steps to undo."
'undo-fu-disable-checkpoint
'keyboard-quit)))
+ ;; Special case, for first execution, `was-undo-or-redo' may be true
+ ;; based on saved undo history, yet the `undo-fu--checkpoint' can be nil.
+ ;; In this case it's simplest to behave as if the last command was not
undo.
+ (when (and was-undo-or-redo undo-fu--respect (null undo-fu--checkpoint))
+ (setq was-undo-or-redo nil))
+
;; Reset the option to not respect the checkpoint
;; after running non-undo related commands.
(unless undo-fu--respect
- [nongnu] elpa/undo-fu c20637ffe3 11/82: Fix typo, (continued)
- [nongnu] elpa/undo-fu c20637ffe3 11/82: Fix typo, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 9cfc95948a 19/82: Cleanup: remove unnecessary calculation, auto-load redo-all, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu f8f416c0d4 25/82: readme: capitalize 'Emacs', ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu f53b3e3963 26/82: Use eval-after-load instead of with-eval-after-load for Emacs 24.3, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 5c9aadad4b 27/82: Support using undo-fu-only-redo after regular undo/undo-only, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 6e8095c449 29/82: Suppress compiler warnings about evil functions, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 7d600ab8f2 30/82: Fix 'success' assignment (internal variable), ELPA Syncer, 2022/07/07
- [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 <=
- [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, 2022/07/07
- [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