aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaúl Benencia <id@rbenencia.name>2025-12-31 17:44:27 -0300
committerRaúl Benencia <id@rbenencia.name>2025-12-31 17:44:27 -0300
commit3fec9613ccffaa1f2d8fd3e325038583b4a9a32a (patch)
tree8a7e3801003bc0c80df35b30c5e39b2af32aabe4
parent246d25c6d57667b5d254262e0bf7188dfa6dbb6b (diff)
fix: reset notification streak when resetting session
-rw-r--r--org-tempus.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/org-tempus.el b/org-tempus.el
index bcbf3f6..9b041b0 100644
--- a/org-tempus.el
+++ b/org-tempus.el
@@ -90,7 +90,7 @@
(defvar org-tempus--idle-timer nil
"Timer used to check session idle activity.")
-(defcustom org-tempus-idle-check-interval 10
+(defcustom org-tempus-idle-check-interval 60
"Seconds between idle checks for out-of-clock activity."
:type 'integer
:set (lambda (symbol value)
@@ -104,7 +104,7 @@
(run-at-time value value #'org-tempus--handle-idle)))))
:group 'org-tempus)
-(defcustom org-tempus-idle-active-threshold-seconds 30
+(defcustom org-tempus-idle-active-threshold-seconds 60
"Maximum idle seconds to consider the user active."
:type 'integer
:group 'org-tempus)
@@ -257,7 +257,8 @@ Known providers are `emacs' (activity inside Emacs),
(defun org-tempus--reset-notification-state ()
"Reset notification state."
- (setq org-tempus--notification-state nil))
+ (setq org-tempus--notification-state nil)
+ (setq org-tempus--idle-active-streak 0))
(defun org-tempus--notification-allowed-p ()
"Return non-nil when a notification can be sent."
@@ -466,6 +467,7 @@ A session does not reset when switching tasks within
:global t
(if org-tempus-mode
(progn
+ (org-tempus--reset-notification-state)
(when (timerp org-tempus--timer)
(cancel-timer org-tempus--timer))
(setq org-tempus--timer
nihil fit ex nihilo