branch: externals/tmr
commit d8071f74761c6b9b30f55f5598b89a4b2f4ec47d
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
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.