[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tmr a9d4ca04a6 1/7: Simplify tmr--read-timer
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tmr a9d4ca04a6 1/7: Simplify tmr--read-timer |
Date: |
Tue, 28 Jun 2022 03:57:59 -0400 (EDT) |
branch: externals/tmr
commit a9d4ca04a6fb76329b70b6552d69aa6f6b749c98
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Simplify tmr--read-timer
---
tmr.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tmr.el b/tmr.el
index 1fec868e94..f4de620ac3 100644
--- a/tmr.el
+++ b/tmr.el
@@ -269,7 +269,7 @@ there are no timers, return nil.
If optional ACTIVE is non-nil, limit the list of timers to those
that are still running.
-If optional DESCRIPTION is provided use it to format the
+If optional DESCRIPTION function is provided use it to format the
completion candidates."
(or
(run-hook-with-args-until-success 'tmr--read-timer-hook)
@@ -281,9 +281,11 @@ completion candidates."
(`(,timer) timer)
(timers
(let* ((formatter (or description #'tmr--long-description))
- (timer-descriptions (mapcar formatter timers))
- (selection (completing-read "Timer: " timer-descriptions nil t)))
- (cl-find selection timers :test #'string= :key formatter))))))
+ (timer-alist (mapcar
+ (lambda (x)
+ (cons (funcall formatter x) x))
+ timers)))
+ (cdr (assoc (completing-read "Timer: " timer-alist nil t)
timer-alist)))))))
;; NOTE 2022-04-21: Emacs has a `play-sound' function but it only
;; supports .wav and .au formats. Also, it does not work on all
- [elpa] externals/tmr updated (1751526fb6 -> 61144ea82e), ELPA Syncer, 2022/06/28
- [elpa] externals/tmr a9d4ca04a6 1/7: Simplify tmr--read-timer,
ELPA Syncer <=
- [elpa] externals/tmr 17b084f96a 2/7: tmr--long-description: Show remaining time, ELPA Syncer, 2022/06/28
- [elpa] externals/tmr c511fe5587 4/7: Update manual's entry about grid view, ELPA Syncer, 2022/06/28
- [elpa] externals/tmr 114c4fd306 5/7: Mark obsolete what was changed in e46df43, ELPA Syncer, 2022/06/28
- [elpa] externals/tmr 61144ea82e 7/7: Define obsolete alias for 'tmr-descriptions-list', ELPA Syncer, 2022/06/28
- [elpa] externals/tmr 6c2af5d8be 6/7: Update tmr-clone docs to reflect current state, ELPA Syncer, 2022/06/28
- [elpa] externals/tmr e46df436e2 3/7: Rename done and completed to finished for consistency, ELPA Syncer, 2022/06/28