[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tmr b1aa243d90 1/7: Fix completion table, handle null c
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tmr b1aa243d90 1/7: Fix completion table, handle null completion |
Date: |
Wed, 29 Jun 2022 07:58:00 -0400 (EDT) |
branch: externals/tmr
commit b1aa243d907090b2ea028a4fb50f0aed43ab2df5
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Fix completion table, handle null completion
---
tmr.el | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/tmr.el b/tmr.el
index 0626c9acd9..c70c0ea025 100644
--- a/tmr.el
+++ b/tmr.el
@@ -291,7 +291,8 @@ that are still running."
timer-list 'tmr-timer #'tmr--timer-annotation)
nil t)
timer-list))))
- (and selected (get-text-property 0 'tmr-timer selected)))))))
+ (or (and selected (get-text-property 0 'tmr-timer selected))
+ (user-error "No timer selected")))))))
;; 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
@@ -431,14 +432,17 @@ Without a PROMPT, clone TIMER outright."
(tmr--description-prompt (tmr--timer-description timer))
(tmr--timer-description timer))))
-(defun tmr--completion-table (candidates &optional category)
- "Return completion table for CANDIDATES of CATEGORY with sorting disabled."
- (lambda (str pred action)
- (if (eq action 'metadata)
- `(metadata (display-sort-function . identity)
- (cycle-sort-function . identity)
- (category . ,category))
- (complete-with-action action candidates str pred))))
+(defun tmr--completion-table (candidates &optional category annotation)
+ "Make completion table for CANDIDATES with sorting disabled.
+CATEGORY is the completion category.
+ANNOTATION is an annotation function."
+ (lambda (str pred action)
+ (if (eq action 'metadata)
+ `(metadata (display-sort-function . identity)
+ (cycle-sort-function . identity)
+ (annotation-function . ,annotation)
+ (category . ,category))
+ (complete-with-action action candidates str pred))))
(provide 'tmr)
;;; tmr.el ends here
- [elpa] externals/tmr updated (aa521d5ce6 -> 7fae717b1b), ELPA Syncer, 2022/06/29
- [elpa] externals/tmr 88a16c9ac5 2/7: Add tmr-remove for uniformity with other commands, ELPA Syncer, 2022/06/29
- [elpa] externals/tmr fb57e9163f 3/7: Add tmr-confirm configuration option, ELPA Syncer, 2022/06/29
- [elpa] externals/tmr b1aa243d90 1/7: Fix completion table, handle null completion,
ELPA Syncer <=
- [elpa] externals/tmr 71f34405cb 4/7: tmr--read-timer: Add PROMPT argument, ELPA Syncer, 2022/06/29
- [elpa] externals/tmr 7fae717b1b 7/7: Remove unused macros from README.org, ELPA Syncer, 2022/06/29
- [elpa] externals/tmr 4ea7d30ef4 5/7: Update documentation to reflect current state, ELPA Syncer, 2022/06/29
- [elpa] externals/tmr 323da8d075 6/7: Make the README.org metadata easier to read, ELPA Syncer, 2022/06/29