gnus-art.el (gnus-mime-buttonize-attachments-in-header): Improve criterion that finds...
[gnus] / lisp / gnus-demon.el
index 81529b7..9d2cf19 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-demon.el --- daemonic Gnus behavior
 
-;; Copyright (C) 1995-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2014 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -77,7 +77,6 @@ Emacs has been idle for IDLE `gnus-demon-timestep's."
 
 ;;; Functions.
 
-;;;###autoload
 (defun gnus-demon-add-handler (function time idle)
   "Add the handler FUNCTION to be run at TIME and IDLE."
   ;; First remove any old handlers that use this function.
@@ -86,7 +85,6 @@ Emacs has been idle for IDLE `gnus-demon-timestep's."
   (push (list function time idle) gnus-demon-handlers)
   (gnus-demon-init))
 
-;;;###autoload
 (defun gnus-demon-remove-handler (function &optional no-init)
   "Remove the handler FUNCTION from the list of handlers."
   (gnus-alist-pull function gnus-demon-handlers)
@@ -146,9 +144,12 @@ marked with SPECIAL."
                        (* (gnus-demon-time-to-step time) gnus-demon-timestep))
                        (t
                        (* time gnus-demon-timestep))))
-           (idle (if (numberp idle)
-                     (* idle gnus-demon-timestep)
-                   idle))
+          (idle (cond ((numberp idle)
+                       (* idle gnus-demon-timestep))
+                      ((and (eq idle t) (numberp time))
+                       time)
+                      (t
+                       idle)))
 
            (timer
             (cond