[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tmr bdd99767bb 03/14: Add tmr-tabulated--refresh
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tmr bdd99767bb 03/14: Add tmr-tabulated--refresh |
Date: |
Mon, 27 Jun 2022 12:58:04 -0400 (EDT) |
branch: externals/tmr
commit bdd99767bbe04ae684b4dfbceb75ea68e48bfad5
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add tmr-tabulated--refresh
Refresh tabulated view when timers finished, are created, cancelled or
modified.
---
tmr-tabulated.el | 25 +++++++++++++------------
tmr.el | 1 +
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/tmr-tabulated.el b/tmr-tabulated.el
index b734a1a5ba..2c07298a03 100644
--- a/tmr-tabulated.el
+++ b/tmr-tabulated.el
@@ -64,7 +64,7 @@
(defvar tmr-tabulated-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "k" #'tmr-tabulated-cancel)
- (define-key map "K" #'tmr-tabulated-remove-finished)
+ (define-key map "K" #'tmr-remove-finished)
(define-key map "+" #'tmr)
(define-key map "c" #'tmr-tabulated-clone)
(define-key map "w" #'tmr-tabulated-rewrite-description)
@@ -88,23 +88,14 @@ Interactively, use the timer at point.
Optional NO-HOOKS has the same meaning as in `tmr-cancel'."
(interactive (list (tmr-tabulated--get-timer-at-point) current-prefix-arg))
- (tmr-cancel timer no-hooks)
- ;; avoid point moving back to the beginning of the buffer:
(tmr-tabulated--move-point-to-closest-entry)
- (revert-buffer))
-
-(defun tmr-tabulated-remove-finished ()
- "Remove all finished timers."
- (interactive)
- (tmr-remove-finished)
- (revert-buffer))
+ (tmr-cancel timer no-hooks))
(defun tmr-tabulated-clone (timer)
"Create a new timer by cloning TIMER.
Interactively, use the timer at point."
(interactive (list (tmr-tabulated--get-timer-at-point)))
- (tmr-clone timer)
- (revert-buffer))
+ (tmr-clone timer))
(defun tmr-tabulated-reschedule (timer)
"Reschedule TIMER.
@@ -154,5 +145,15 @@ Point isn't moved if point is on the only entry."
"Return the timer on the current line or nil."
(tmr--get-timer-by-creation-date (tabulated-list-get-id)))
+(defun tmr-tabulated--refresh (_timer)
+ "Refresh *tmr-tabulated-view* buffer if it exists."
+ (when-let (buf (get-buffer "*tmr-tabulated-view*"))
+ (with-current-buffer buf
+ (revert-buffer))))
+
+(add-hook 'tmr-timer-completed-functions #'tmr-tabulated--refresh)
+(add-hook 'tmr-timer-created-functions #'tmr-tabulated--refresh)
+(add-hook 'tmr-timer-cancelled-functions #'tmr-tabulated--refresh)
+
(provide 'tmr-tabulated)
;;; tmr-tabulated.el ends here
diff --git a/tmr.el b/tmr.el
index 6e821ab4d7..8f5bbb4cf5 100644
--- a/tmr.el
+++ b/tmr.el
@@ -218,6 +218,7 @@ With optional NO-HOOKS refrain from calling
(defun tmr-remove-finished ()
"Remove all finished timers."
(interactive)
+ ;; TODO call tabulated refresh
(setq tmr--timers (cl-delete-if #'tmr--timer-donep tmr--timers)))
(defun tmr--read-timer (&optional active description)
- [elpa] externals/tmr updated (704242b6ba -> 907756ce8d), ELPA Syncer, 2022/06/27
- [elpa] externals/tmr bdd99767bb 03/14: Add tmr-tabulated--refresh,
ELPA Syncer <=
- [elpa] externals/tmr 38c9089597 08/14: tmr-remove-finished: Add autoload, ELPA Syncer, 2022/06/27
- [elpa] externals/tmr 9f0dee563b 06/14: Move tmr-sound.el back into tmr.el, ELPA Syncer, 2022/06/27
- [elpa] externals/tmr cfd798b066 11/14: Add tmr-reschedule and tmr-edit-description, ELPA Syncer, 2022/06/27
- [elpa] externals/tmr 907756ce8d 14/14: Acknowledge Daniel Mendler for the latest patches, ELPA Syncer, 2022/06/27
- [elpa] externals/tmr 448be30775 09/14: Improve tmr-clone: Only prompt for description if pressing C-u C-u, ELPA Syncer, 2022/06/27
- [elpa] externals/tmr 6f3b096f2c 13/14: Greatly simplify tmr-tabulated, reuse tmr--read-timer, ELPA Syncer, 2022/06/27
- [elpa] externals/tmr 58d30c4896 12/14: Remove single line functions which were used only once, ELPA Syncer, 2022/06/27
- [elpa] externals/tmr 58224191d0 01/14: Rename struct tmr-timer to tmr--timer, ELPA Syncer, 2022/06/27
- [elpa] externals/tmr e18496d187 07/14: Add tmr--update-hook, ELPA Syncer, 2022/06/27
- [elpa] externals/tmr e9c6c8861f 02/14: Get rid of tmr-descriptions-list, ELPA Syncer, 2022/06/27