Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* how to check for new news every a few minutes?
@ 2006-04-26 17:46 Qing Xiu
  2006-04-26 18:16 ` Karl Kleinpaste
  0 siblings, 1 reply; 2+ messages in thread
From: Qing Xiu @ 2006-04-26 17:46 UTC (permalink / raw)


hi, guys, I use Emacs and guns a long time every day. Each time I had
to press 'g' to check for new news and new emails. How can I set up
Emacs to make itself check for new news every, say, 5 minutes? Thanks a
lot!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to check for new news every a few minutes?
  2006-04-26 17:46 how to check for new news every a few minutes? Qing Xiu
@ 2006-04-26 18:16 ` Karl Kleinpaste
  0 siblings, 0 replies; 2+ messages in thread
From: Karl Kleinpaste @ 2006-04-26 18:16 UTC (permalink / raw)


"Qing Xiu" <qing.xiu@163.com> writes:
> How can I set up Emacs to make itself check for new news every, say,
> 5 minutes?

;; 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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-26 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26 17:46 how to check for new news every a few minutes? Qing Xiu
2006-04-26 18:16 ` Karl Kleinpaste

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).