emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/tmr 92d6163dd0 10/14: Remove no-hooks argument


From: ELPA Syncer
Subject: [elpa] externals/tmr 92d6163dd0 10/14: Remove no-hooks argument
Date: Mon, 27 Jun 2022 12:58:04 -0400 (EDT)

branch: externals/tmr
commit 92d6163dd0fd66649636f315176213189d1b86da
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Remove no-hooks argument
    
    It is better to instead let bind the dynamic hook variables.
---
 tmr-tabulated.el | 14 ++++++--------
 tmr.el           | 14 +++++---------
 2 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/tmr-tabulated.el b/tmr-tabulated.el
index 35d9254ab0..10d0d5d844 100644
--- a/tmr-tabulated.el
+++ b/tmr-tabulated.el
@@ -82,14 +82,12 @@
   (add-hook 'tabulated-list-revert-hook #'tmr-tabulated--set-entries nil t)
   (tabulated-list-init-header))
 
-(defun tmr-tabulated-cancel (timer &optional no-hooks)
+(defun tmr-tabulated-cancel (timer)
   "Stop TIMER and remove it from the list.
-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))
+Interactively, use the timer at point."
+  (interactive (list (tmr-tabulated--get-timer-at-point)))
   (tmr-tabulated--move-point-to-closest-entry)
-  (tmr-cancel timer no-hooks))
+  (tmr-cancel timer))
 
 (defun tmr-tabulated-clone (timer)
   "Create a new timer by cloning TIMER.
@@ -105,8 +103,8 @@ If TIMER has a description, prompt for one.  Otherwise only
 prompt for a duration."
   (interactive (list (tmr-tabulated--get-timer-at-point)))
   (tmr-clone timer :prompt)
-  ;; Cancel the old timer
-  (tmr-tabulated-cancel timer :no-hooks))
+  (let (tmr-timer-cancelled-functions)
+    (tmr-tabulated-cancel timer)))
 
 (defun tmr-tabulated-rewrite-description (timer description)
   "Change TIMER description with that of DESCRIPTION."
diff --git a/tmr.el b/tmr.el
index e43a6a38fa..2aaa412113 100644
--- a/tmr.el
+++ b/tmr.el
@@ -205,21 +205,17 @@ Populated by `tmr' and then operated on by `tmr-cancel'.")
   (cl-find creation-date tmr--timers :key #'tmr--timer-creation-date))
 
 ;;;###autoload
-(defun tmr-cancel (timer &optional no-hooks)
+(defun tmr-cancel (timer)
   "Cancel TIMER object set with `tmr' command.
 Interactively, let the user choose which timer to cancel with
-completion.
-
-With optional NO-HOOKS refrain from calling
-`tmr-timer-cancelled-functions'."
-  (interactive (list (tmr--read-timer :active) current-prefix-arg))
+completion."
+  (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))
-    (unless no-hooks
-      (run-hooks 'tmr--update-hook)
-      (run-hook-with-args 'tmr-timer-cancelled-functions timer))))
+    (run-hooks 'tmr--update-hook)
+    (run-hook-with-args 'tmr-timer-cancelled-functions timer)))
 
 ;;;###autoload
 (defun tmr-remove-finished ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]