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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/tmr d8071f7476 7/7: Use let bound variable in tmr--read


From: ELPA Syncer
Subject: [elpa] externals/tmr d8071f7476 7/7: Use let bound variable in tmr--read-timer
Date: Wed, 11 May 2022 04:57:56 -0400 (EDT)

branch: externals/tmr
commit d8071f74761c6b9b30f55f5598b89a4b2f4ec47d
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Use let bound variable in tmr--read-timer
---
 tmr.el | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/tmr.el b/tmr.el
index 1296d08290..39b8705af2 100644
--- a/tmr.el
+++ b/tmr.el
@@ -277,17 +277,18 @@ completion."
     (setq tmr--timers (cl-delete timer tmr--timers))))
 
 (defun tmr--read-timer ()
-  "Let the user choose a timer among all timers. Return the selected timer.
-If there is a single timer, use that.  If there are multiple
-timers, prompt for one with completion. If there are no timers,
-return nil."
-  (cond
-   ((= (length tmr--timers) 1)
-    (car timers))
-   ((> (length tmr--timers) 1)
-    (let* ((timer-descriptions (mapcar #'tmr--long-description tmr--timers))
-           (selection (completing-read "Timer: " timer-descriptions nil t)))
-      (cl-find selection tmr--timers :test #'string= :key 
#'tmr--long-description)))))
+  "Let the user choose a timer among all timers.
+Return the selected timer.  If there is a single timer, use that.
+If there are multiple timers, prompt for one with completion.  If
+there are no timers, return nil."
+  (let ((timers tmr--timers))
+    (cond
+     ((= (length timers) 1)
+      (car timers))
+     ((> (length timers) 1)
+      (let* ((timer-descriptions (mapcar #'tmr--long-description timers))
+             (selection (completing-read "Timer: " timer-descriptions nil t)))
+        (cl-find selection timers :test #'string= :key 
#'tmr--long-description))))))
 
 (defun tmr--echo-area (time &optional description)
   "Produce `message' for current `tmr' TIME.



reply via email to

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