[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tmr 88a16c9ac5 2/7: Add tmr-remove for uniformity with
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tmr 88a16c9ac5 2/7: Add tmr-remove for uniformity with other commands |
Date: |
Wed, 29 Jun 2022 07:58:00 -0400 (EDT) |
branch: externals/tmr
commit 88a16c9ac51093b18fd90fc71b57ee8b86123908
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add tmr-remove for uniformity with other commands
---
README.org | 3 ++-
tmr-tabulated.el | 5 +++--
tmr.el | 21 ++++++++++++++-------
3 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/README.org b/README.org
index 213ae654ac..27f4d9496b 100644
--- a/README.org
+++ b/README.org
@@ -324,7 +324,8 @@ Everything is in place to set up the package.
(define-key map (kbd "C-c t k") #'tmr-cancel)
(define-key map (kbd "C-c t s") #'tmr-reschedule)
(define-key map (kbd "C-c t e") #'tmr-edit-description)
- (define-key map (kbd "C-c t K") #'tmr-remove-finished))
+ (define-key map (kbd "C-c t r") #'tmr-remove)
+ (define-key map (kbd "C-c t R") #'tmr-remove-finished))
#+end_src
* Acknowledgements
diff --git a/tmr-tabulated.el b/tmr-tabulated.el
index 741788af32..2c7ac1e375 100644
--- a/tmr-tabulated.el
+++ b/tmr-tabulated.el
@@ -62,8 +62,9 @@
(defvar tmr-tabulated-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "k" #'tmr-cancel)
- (define-key map "K" #'tmr-remove-finished)
+ (define-key map "k" #'tmr-remove)
+ (define-key map "r" #'tmr-remove)
+ (define-key map "R" #'tmr-remove-finished)
(define-key map "+" #'tmr)
(define-key map "t" #'tmr)
(define-key map "*" #'tmr-with-description)
diff --git a/tmr.el b/tmr.el
index c70c0ea025..8b3167c26b 100644
--- a/tmr.el
+++ b/tmr.el
@@ -211,18 +211,25 @@ Populated by `tmr' and then operated on by `tmr-cancel'.")
(defvar tmr--update-hook nil
"Hooks to execute when timers are changed.")
+;;;###autoload
+(defun tmr-remove (timer)
+ "Cancel and remove TIMER object set with `tmr' command.
+Interactively, let the user choose which timer to cancel with
+completion."
+ (interactive (list (tmr--read-timer)))
+ (cancel-timer (tmr--timer-timer-object timer))
+ (setq tmr--timers (delete timer tmr--timers))
+ (run-hooks 'tmr--update-hook)
+ (run-hook-with-args 'tmr-timer-cancelled-functions timer))
+
;;;###autoload
(defun tmr-cancel (timer)
"Cancel TIMER object set with `tmr' command.
Interactively, let the user choose which timer to cancel with
-completion."
+completion. This command is the same as `tmr-remove' but
+chooses only among active timers."
(interactive (list (tmr--read-timer :active)))
- (if (not timer)
- (user-error "No `tmr' to cancel")
- (cancel-timer (tmr--timer-timer-object timer))
- (setq tmr--timers (delete timer tmr--timers))
- (run-hooks 'tmr--update-hook)
- (run-hook-with-args 'tmr-timer-cancelled-functions timer)))
+ (tmr-remove timer))
;;;###autoload
(defun tmr-reschedule (timer)
- [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 <=
- [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, 2022/06/29
- [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