[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/undo-fu 9159f46b70 78/82: Cleanup: prefer `cond` to `if`
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/undo-fu 9159f46b70 78/82: Cleanup: prefer `cond` to `if` |
Date: |
Thu, 7 Jul 2022 12:04:56 -0400 (EDT) |
branch: elpa/undo-fu
commit 9159f46b7069275418766d2fa0e2584512c5bc0f
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Cleanup: prefer `cond` to `if`
---
undo-fu.el | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/undo-fu.el b/undo-fu.el
index e06d241dfb..8862d6672a 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -220,9 +220,11 @@ Optional argument ARG The number of steps to redo."
(was-redo (and was-undo-or-redo undo-fu--was-redo))
(was-undo (and was-undo-or-redo (null was-redo)))
(undo-fu-quit-command
- (if undo-fu-ignore-keyboard-quit
- 'undo-fu-disable-checkpoint
- 'keyboard-quit)))
+ (cond
+ (undo-fu-ignore-keyboard-quit
+ 'undo-fu-disable-checkpoint)
+ (t
+ 'keyboard-quit))))
;; Reset the option to not respect the checkpoint
;; after running non-undo related commands.
@@ -261,9 +263,11 @@ Optional argument ARG The number of steps to redo."
;; It's important to clamp the number of steps before assigning
;; 'last-command' since it's used when checking the available steps.
(steps
- (if (numberp arg)
- arg
- 1))
+ (cond
+ ((numberp arg)
+ arg)
+ (t
+ 1)))
(last-command
(cond
(was-undo
@@ -318,9 +322,11 @@ Optional argument ARG the number of steps to undo."
(was-undo-or-redo (undo-fu--was-undo-or-redo))
(was-redo (and was-undo-or-redo undo-fu--was-redo))
(undo-fu-quit-command
- (if undo-fu-ignore-keyboard-quit
- 'undo-fu-disable-checkpoint
- 'keyboard-quit)))
+ (cond
+ (undo-fu-ignore-keyboard-quit
+ 'undo-fu-disable-checkpoint)
+ (t
+ 'keyboard-quit))))
;; Reset the option to not respect the checkpoint
;; after running non-undo related commands.
- [nongnu] elpa/undo-fu 792d27b8a1 16/82: Lower version requirement to 24.3, (continued)
- [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
- [nongnu] elpa/undo-fu 49cca61343 56/82: Fix unconstrained redo trapping the user at the end of the chain, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 25e25ec4df 48/82: Cleanup: typos, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu f4db4c9b98 62/82: Update readme, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu e81c8da441 73/82: Cleanup: use brief SPDX license, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu d3d50ad00d 67/82: Cleanup: quiet docstring width warning, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu ab8bc10e42 72/82: Cleanup: minor wording changes, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 7430fa58f1 75/82: Fix unconstrained undo when the user has undo-no-redo enabled, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 9159f46b70 78/82: Cleanup: prefer `cond` to `if`,
ELPA Syncer <=
- [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, 2022/07/07