[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/undo-fu 1baca3da6b 03/82: Lookup key for keyboard-quit ins
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/undo-fu 1baca3da6b 03/82: Lookup key for keyboard-quit instead of hard coding in message |
Date: |
Thu, 7 Jul 2022 12:04:46 -0400 (EDT) |
branch: elpa/undo-fu
commit 1baca3da6b2810ad5e05abd3a0d2a179006e3780
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Lookup key for keyboard-quit instead of hard coding in message
---
undo-fu.el | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/undo-fu.el b/undo-fu.el
index c5b4c74942..167a0371c0 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -29,7 +29,7 @@
;; and stops redoing once the initial undo action is reached.
;;
;; If you want to cross the initial undo step to access
-;; the full history, pressing C-g (keyboard-quit)
+;; the full history, running (keyboard-quit) typically C-g.
;; lets you continue redoing for functionality not typically
;; accessible with regular undo/redo.
;;
@@ -54,6 +54,9 @@
(defvar-local undo-fu--respect t)
+;; Internal functions.
+
+
(defun undo-fu--next-step (list)
"Get the next undo step in the list.
@@ -79,6 +82,7 @@ Returns the number of steps to reach this list."
(setq count (1+ count)))
count))
+
(defun undo-fu--count-redo-available (list-to-find count-limit)
"Count the number of redo steps until a previously stored undo step.
@@ -92,6 +96,9 @@ Returns the number of steps to reach this list."
pending-undo-list)
list-to-find count-limit))
+
+;; Public functions.
+
(defun undo-fu-only-redo-all ()
"Redo all actions until the initial undo step.
@@ -101,6 +108,7 @@ wraps the `undo' function."
(user-error "Redo end-point not found!"))
(undo-fu-only-redo (undo-fu--count-redo-available undo-fu--checkpoint
most-positive-fixnum)))
+
(defun undo-fu-only-redo (&optional arg)
"Redo an action until the initial undo action.
@@ -121,7 +129,7 @@ Optional argument ARG The number of steps to redo."
(unless was-undo-or-redo
(setq undo-fu--respect t)))
- ;; Allow crossing the boundary, if we press G-g
+ ;; Allow crossing the boundary, if we press keyboard-quit.
;; to allow explicitly over-stepping the boundary, in cases where it's
needed.
(when undo-fu--respect
(when (string-equal last-command 'keyboard-quit)
@@ -134,17 +142,21 @@ Optional argument ARG The number of steps to redo."
;; Ensure the next steps is a redo action.
(let ((list (undo-fu--next-step buffer-undo-list)))
(and list (gethash list undo-equiv-table)))
- (user-error "Redo step not found (C-g to ignore)")))
+ (user-error
+ "Redo step not found (%s to ignore)"
+ (substitute-command-keys "\\[keyboard-quit]"))))
(when undo-fu--checkpoint-is-blocking
- (user-error "Redo end-point hit (C-g to step over it)"))
+ (user-error
+ "Redo end-point hit (%s to step over it)"
+ (substitute-command-keys "\\[keyboard-quit]")))
(let*
(
(last-command
(cond
(was-undo
- ;; Break undo chain, avoid having to press C-g.
+ ;; Break undo chain, avoid having to press keyboard-quit.
'ignore)
(was-redo
;; Checked by the undo function.
- [nongnu] elpa/undo-fu 9159f46b70 78/82: Cleanup: prefer `cond` to `if`, (continued)
- [nongnu] elpa/undo-fu 9159f46b70 78/82: Cleanup: prefer `cond` to `if`, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 756a4846b3 06/82: Remove redundant error handling case, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu e49ee5bdc3 10/82: Show unconstrained suffix for unconstrained undo/redo, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 9bf729c727 09/82: Support pressing C-g before undo, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu ad8a60f979 28/82: Lazy initialize checkpoint length (minor speedup for linear redo), ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu f883424345 36/82: readme: disable undo-tree in the evil-example, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu f938ee2d94 38/82: Cleanup: pass in 'was-redo' as an argument, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 06772aef15 70/82: Use "undo" group, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu e07fd219a0 74/82: Sync backported functions from Emacs, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu c92261a3b7 80/82: Cleanup: use with-eval-after-load, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 1baca3da6b 03/82: Lookup key for keyboard-quit instead of hard coding in message,
ELPA Syncer <=
- [nongnu] elpa/undo-fu cad12914a4 15/82: Add 'undo-fu-allow-undo-in-region' option, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu a0e111b955 21/82: Add .elisp-autofmt to enable auto-formatting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu d561fa8e0c 23/82: Fix #2 Support linear redo, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 459c90479d 24/82: Release 0.2, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 29a8c3d5a8 32/82: Use more prominent comment sections, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu d81063c96d 42/82: Cleanup: remove unnecessary checkpoint-is-blocking variable, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 0ce9ac3614 53/82: Cleanup: use updated auto-formatting results, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 20c9d6170a 77/82: Cleanup: simplify checks for clearing the checkpoint, ELPA Syncer, 2022/07/07