From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/79146 Path: news.gmane.org!not-for-mail From: Philipp Haselwarter Newsgroups: gmane.emacs.gnus.general Subject: Re: scanning for new mail with demon-handler Date: Sun, 19 Jun 2011 18:49:58 +0200 Message-ID: <87oc1tlqa1.fsf@nzebook.haselwarter.org> References: <874o3o760s.fsf@yun.yagibdah.de> <87d3icxuce.fsf@topper.koldfront.dk> <87r56ss2hp.fsf@yun.yagibdah.de> <877h8k9sg9.fsf@topper.koldfront.dk> <87aadgkxi3.fsf@yun.yagibdah.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EuroFed/Waco-Texas/counter-terrorism/warfare/J6yvtEh1qg" X-Trace: dough.gmane.org 1308502295 21037 80.91.229.12 (19 Jun 2011 16:51:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Jun 2011 16:51:35 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M27445@lists.math.uh.edu Sun Jun 19 18:51:31 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QYLDf-0006VU-37 for ding-account@gmane.org; Sun, 19 Jun 2011 18:51:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1QYLCb-0007UC-Li; Sun, 19 Jun 2011 11:50:25 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1QYLCY-0007Tz-RO for ding@lists.math.uh.edu; Sun, 19 Jun 2011 11:50:22 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1QYLCU-0002W7-LW for ding@lists.math.uh.edu; Sun, 19 Jun 2011 11:50:20 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1QYLCR-0003Yn-OA for ding@gnus.org; Sun, 19 Jun 2011 18:50:15 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QYLCR-0005ul-3z for ding@gnus.org; Sun, 19 Jun 2011 18:50:15 +0200 Original-Received: from 55.93.114.78.rev.sfr.net ([78.114.93.55]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jun 2011 18:50:15 +0200 Original-Received: from philipp.haselwarter by 55.93.114.78.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jun 2011 18:50:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 98 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 55.93.114.78.rev.sfr.net X-NSA-Fodder: Leitrim Defcon kilo class advisors White Water Watergate Microsoft: With our software, there's no limit to what you can't do! User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:86WIGVyN7VtW0mAEGjnSZUXkS0s= X-Spam-Score: -4.9 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:79146 Archived-At: --EuroFed/Waco-Texas/counter-terrorism/warfare/J6yvtEh1qg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 2011-06-17 20:34 UT, lee wrote: l> asjo@koldfront.dk (Adam Sjøgren) writes: >> On Fri, 17 Jun 2011 21:05:06 +0200, lee wrote: >> >>> Yes, it does more, that´s why I like gnus-demon-scan-mail :) >>> Gnus-demon-scan-news also scans for new news, creating unneccessary >>> network traffic and load on the news servers. >> >> If you put your mail groups on a different level than your >> newsgroups, maybe you can use a customized version of >> gnus-demon-scan-news to do what you want. l> Hm, I´ve read a post saying that you could set newsgroups to a higher l> level for them not to be included when checking for new messages.I l> tried that, found that it didn´t work and learned that the levels are l> also used to distinguish between unsubscribed and zomie groups.So I l> decided to better not play with group levels until I know better what l> I´m doing. l> Unfortunately, I don´t know yet how to make a customized function l> like that ...There´s so much to learn when you start using gnus that l> it´ll take a while. I'd suggest something like --EuroFed/Waco-Texas/counter-terrorism/warfare/J6yvtEh1qg Content-Type: text/x-patch Content-Disposition: inline Modified lisp/gnus-demon.el diff --git a/lisp/gnus-demon.el b/lisp/gnus-demon.el index 419346b..6146b53 100644 --- a/lisp/gnus-demon.el +++ b/lisp/gnus-demon.el @@ -191,15 +191,34 @@ minutes, the connection is closed." "Add daemonic scanning of new articles from all backends." (gnus-demon-add-handler 'gnus-demon-scan-news 120 60)) -(defun gnus-demon-scan-news () +(defun gnus-demon-scan-news (&optional arg) (let ((win (current-window-configuration))) (unwind-protect (save-window-excursion (when (gnus-alive-p) (with-current-buffer gnus-group-buffer - (gnus-group-get-new-news)))) + (gnus-group-get-new-news arg)))) (set-window-configuration win)))) +(fset 'gnus-demon-scan-news-1 + (apply-partially 'gnus-demon-scan-news 1)) +(fset 'gnus-demon-scan-news-2 + (apply-partially 'gnus-demon-scan-news 2)) +(fset 'gnus-demon-scan-news-3 + (apply-partially 'gnus-demon-scan-news 3)) +(fset 'gnus-demon-scan-news-4 + (apply-partially 'gnus-demon-scan-news 4)) +(fset 'gnus-demon-scan-news-5 + (apply-partially 'gnus-demon-scan-news 5)) +(fset 'gnus-demon-scan-news-6 + (apply-partially 'gnus-demon-scan-news 6)) +(fset 'gnus-demon-scan-news-7 + (apply-partially 'gnus-demon-scan-news 7)) +(fset 'gnus-demon-scan-news-8 + (apply-partially 'gnus-demon-scan-news 8)) +(fset 'gnus-demon-scan-news-9 + (apply-partially 'gnus-demon-scan-news 9)) + (defun gnus-demon-add-scan-timestamps () "Add daemonic updating of timestamps in empty newgroups." (gnus-demon-add-handler 'gnus-demon-scan-timestamps nil 30)) --EuroFed/Waco-Texas/counter-terrorism/warfare/J6yvtEh1qg Content-Type: text/plain For example, I keep local mail on level 1, external mail on 3, nntp on 4 and nnrss on level 5 and fetch them accordingly: #+begin_src emacs-lisp (gnus-demon-add-handler 'gnus-demon-scan-news-1 121 10) (gnus-demon-add-handler 'gnus-demon-scan-news-3 240 10) (gnus-demon-add-handler 'gnus-demon-scan-news-4 601 10) (gnus-demon-add-handler 'gnus-demon-scan-news-5 7201 10) #+end_src -- Philipp Haselwarter --EuroFed/Waco-Texas/counter-terrorism/warfare/J6yvtEh1qg--