emacs-elpa-diffs
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]