[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tmr c1e7580eec 05/10: tmr: print message for cancelled
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tmr c1e7580eec 05/10: tmr: print message for cancelled timer |
Date: |
Sun, 15 May 2022 02:58:18 -0400 (EDT) |
branch: externals/tmr
commit c1e7580eec570648975d9b7c3a279252c50ed08d
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
tmr: print message for cancelled timer
---
tmr.el | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tmr.el b/tmr.el
index 7eee5c9460..ef613f3fb6 100644
--- a/tmr.el
+++ b/tmr.el
@@ -146,7 +146,8 @@ Each function must accept a timer as argument."
#'tmr-sound-play
#'tmr-notification-notify))
-(defcustom tmr-timer-cancelled-functions nil
+(defcustom tmr-timer-cancelled-functions
+ (list #'tmr-print-message-for-cancelled-timer)
"Functions to execute when a timer is created.
Each function must accept a timer as argument."
:type 'hook)
@@ -180,7 +181,12 @@ Each function must accept a timer as argument."
(let ((start (tmr--format-creation-date timer))
(end (tmr--format-end-date timer))
(description (tmr--timer-description timer)))
- (format "Started at %s and will end at %s%s"
+ ;; We prefix it with TMR just so it is easier to find in
+ ;; `view-echo-area-messages'. The concise wording makes it flexible
+ ;; enough to be used when starting a timer but also when cancelling
+ ;; one: check `tmr-print-message-for-created-timer' and
+ ;; `tmr-print-message-for-cancelled-timer'.
+ (format "TMR start at %s; end at %s%s"
(propertize start 'face 'success)
(propertize end 'face 'error)
(if description
@@ -280,6 +286,10 @@ there are no timers, return nil."
"Show a `message' informing the user that TIMER has completed."
(message "%s" (tmr--long-description-for-completed-timer timer)))
+(defun tmr-print-message-for-cancelled-timer (timer)
+ "Show a `message' informing the user that TIMER is cancelled."
+ (message "Cancelled: <<%s>>" (tmr--long-description timer)))
+
(defvar tmr--duration-hist '()
"Minibuffer history of `tmr' durations.")
- [elpa] externals/tmr updated (3d9242be83 -> 407da662a2), ELPA Syncer, 2022/05/15
- [elpa] externals/tmr b2b322a00f 03/10: tmr: placate the compiler about cl-lib and related, ELPA Syncer, 2022/05/15
- [elpa] externals/tmr 6602891c8f 02/10: Decompose tmr.el into several files, ELPA Syncer, 2022/05/15
- [elpa] externals/tmr 32f6f93aba 04/10: tmr-notification: remove needless quotes, ELPA Syncer, 2022/05/15
- [elpa] externals/tmr 0ceb744885 01/10: tmr: Improve tmr--long-description, ELPA Syncer, 2022/05/15
- [elpa] externals/tmr f5dcca3588 07/10: tmr: use only active timers for tmr-cancel, ELPA Syncer, 2022/05/15
- [elpa] externals/tmr 3f8674546b 09/10: tmr: accept optional default in description prompt, ELPA Syncer, 2022/05/15
- [elpa] externals/tmr 407da662a2 10/10: tmr: make tmr-clone prompt optionally, ELPA Syncer, 2022/05/15
- [elpa] externals/tmr c7e0f6f118 06/10: tmr: tweak message for completed tmr, ELPA Syncer, 2022/05/15
- [elpa] externals/tmr b2903077f5 08/10: tmr: store the original input of a timer, ELPA Syncer, 2022/05/15
- [elpa] externals/tmr c1e7580eec 05/10: tmr: print message for cancelled timer,
ELPA Syncer <=