info-gnus-english
[Top][All Lists]
Advanced

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

Re: batch email reading?


From: Karl Kleinpaste
Subject: Re: batch email reading?
Date: Tue, 16 May 2006 09:43:19 -0400
User-agent: Gnus/5.110005 (No Gnus v0.5) XEmacs/21.5-b27 (linux)

"jacques.wainer@gmail.com" <jacques.wainer@gmail.com> writes:
> Anyone has a batch email reading function for gnus?

Assuming your Gnus is left running overnight, then the gnus-daemon
functions will do what you want.

;; automatic group re-scan without manual effort.
;; assumes: mail groups, level <= 2; nntp groups, level >= 3.
;; look up arg interpretation for gnus-demon-add-handler.
;; overall meaning: check mail every 5 regardless, and
;; check nntp every 20 iff idle for 20.
;;
;; level-specified group scanner.
(defun gnus-demon-scan-mail-or-news-and-update (level)
"Scan for new mail, updating the *Group* buffer."
  (let ((win (current-window-configuration)))
    (unwind-protect
        (save-window-excursion
          (save-excursion
            (when (gnus-alive-p)
              (save-excursion
                (set-buffer gnus-group-buffer)
                (gnus-group-get-new-news level)))))
      (set-window-configuration win))))
;;
;; level 2: only mail groups are scanned.
(defun gnus-demon-scan-mail-and-update ()
"Scan for new mail, updating the *Group* buffer."
  (gnus-demon-scan-mail-or-news-and-update 2))
(gnus-demon-add-handler 'gnus-demon-scan-mail-and-update 5 nil)
;;
;; level 3: mail and local news groups are scanned.
(defun gnus-demon-scan-news-and-update ()
"Scan for new mail, updating the *Group* buffer."
  (gnus-demon-scan-mail-or-news-and-update 3))
(gnus-demon-add-handler 'gnus-demon-scan-news-and-update 20 20)


reply via email to

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