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

Re: nnimap and demons?



>>>>> On 31 Aug 1999 13:41:09 -0700,
>>>>> Jody Klymak <jklymak@apl.washington.edu> (jmk) writes:

jmk> I am curious how (if?) people are using the demon functionality of
jmk> gnus with nnimap.  Can it be done?  What do I need to put in my .gnus?
jmk> What I am trying to do is poll the server every 5 minutes or so to see
jmk> if I have any mail. 

This is what I'm doing.  My inbox is set at level 1.  Other
important folders that directly receive mail are set at level 2.
(This code began from an example someone sent to me.)

;;; set a group level.  This one is run every 5 minutes.
(defun gnus-demon-scan-mail-groups1 ()
  (save-window-excursion
    (when (gnus-alive-p)
      (save-excursion
        (set-buffer gnus-group-buffer)
        (gnus-group-get-new-news 1)))))

;;; I have this one run every 17min.
(defun gnus-demon-scan-mail-groups2 ()
  (save-window-excursion
    (when (gnus-alive-p)
      (save-excursion
        (set-buffer gnus-group-buffer)
        (gnus-group-get-new-news 2)))))

...

;; Check for new mail every 5 minutes after being idle for 5 minute.
(gnus-demon-add-handler 'gnus-demon-scan-mail-groups1 5 5)

;; This check is for "favorite" folders that aren't quite as important.
(gnus-demon-add-handler 'gnus-demon-scan-mail-groups2 17 17)