[gnus git] branch master updated: n0-17-490-g9831826 =1= Fix the HH:MM case for the Gnus daemon
Lars Ingebrigtsen <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via 98318263d7034ab22eb329f1238f0730f9514bd1 (commit)
from 3364f2ba4a2e156d63de014cc6d196dc92cddd7e (commit)
- Log -----------------------------------------------------------------
commit 98318263d7034ab22eb329f1238f0730f9514bd1
Author: Vida Gábor <[email protected]>
Date: Fri Jan 27 18:43:29 2012 +0100
Fix the HH:MM case for the Gnus daemon
* gnus-demon.el (gnus-demon-run-callback, gnus-demon-init): Convert to
seconds, and make the repeat clause with HH:MM specs work as
documented.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5051a6f..0186935 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-27 Vida Gábor <[email protected]> (tiny change)
+
+ * gnus-demon.el (gnus-demon-run-callback, gnus-demon-init): Convert to
+ seconds, and make the repeat clause with HH:MM specs work as
+ documented.
+
2012-01-27 Lars Ingebrigtsen <[email protected]>
* proto-stream.el (proto-stream-capability-open): Fall back on
diff --git a/lisp/gnus-demon.el b/lisp/gnus-demon.el
index 2f99522..c91c725 100644
--- a/lisp/gnus-demon.el
+++ b/lisp/gnus-demon.el
@@ -102,6 +102,7 @@ Emacs has been idle for IDLE `gnus-demon-timestep's."
"Run FUNC if Emacs has been idle for longer than IDLE seconds."
(unless gnus-inhibit-demon
(when (or (not idle)
+ (and (eq idle t) (> (gnus-demon-idle-since) 0))
(<= idle (gnus-demon-idle-since)))
(with-local-quit
(ignore-errors
@@ -115,6 +116,7 @@ Emacs has been idle for IDLE `gnus-demon-timestep's."
;; Set up the timer.
(let* ((func (nth 0 handler))
(time (nth 1 handler))
+ (time-type (type-of time))
(idle (nth 2 handler))
;; Compute time according with timestep.
;; If t, replace by 1
@@ -123,33 +125,32 @@ Emacs has been idle for IDLE `gnus-demon-timestep's."
((null time)
nil)
((stringp time)
- (gnus-demon-time-to-step time))
+ (* (gnus-demon-time-to-step time) gnus-demon-timestep))
(t
(* time gnus-demon-timestep))))
+ (idle (if (numberp idle)
+ (* idle gnus-demon-timestep)
+ idle))
+
(timer
(cond
- ;; (func number t)
- ;; Call when Emacs has been idle for `time'
- ((and (numberp time) (eq idle t))
- (run-with-timer time time 'gnus-demon-run-callback func time))
- ;; (func number number)
- ;; Call every `time' when Emacs has been idle for `idle'
- ((and (numberp time) (numberp idle))
- (run-with-timer time time 'gnus-demon-run-callback func idle))
;; (func nil number)
;; Only call when Emacs has been idle for `idle'
((and (null time) (numberp idle))
(run-with-idle-timer (* idle gnus-demon-timestep) t
'gnus-demon-run-callback func))
- ;; (func number nil)
+ ;; (func number any)
;; Call every `time'
- ((and (numberp time) (null idle))
- (run-with-timer time time 'gnus-demon-run-callback func)))))
+ ((eq time-type 'integer)
+ (run-with-timer time time 'gnus-demon-run-callback func idle))
+ ;; (func string any)
+ ((eq time-type 'string)
+ (run-with-timer time (* 24 60 60) 'gnus-demon-run-callback func idle)))))
(when timer
(add-to-list 'gnus-demon-timers timer)))))
(defun gnus-demon-time-to-step (time)
- "Find out how many seconds to TIME, which is on the form \"17:43\"."
+ "Find out how many steps to TIME, which is on the form \"17:43\"."
(let* ((now (current-time))
;; obtain NOW as discrete components -- make a vector for speed
(nowParts (decode-time now))
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 6 ++++++
lisp/gnus-demon.el | 27 ++++++++++++++-------------
2 files changed, 20 insertions(+), 13 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project