From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/27730 Path: main.gmane.org!not-for-mail From: Shenghuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-group-get-new-news broken again Date: 05 Dec 1999 11:24:17 -0500 Organization: U of Rochester Sender: owner-ding@hpc.uh.edu Message-ID: <2n1z911hla.fsf@tiger.jia.vnet> References: <87d7smpywj.fsf@cenderis.demon.co.uk> <87g0xilkcj.fsf@mharnois.workgroup.net> <2niu2evx0j.fsf@tiger.jia.vnet> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035164703 26065 80.91.224.250 (21 Oct 2002 01:45:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:45:03 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id LAA26305 for ; Sun, 5 Dec 1999 11:27:09 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id KAB13290; Sun, 5 Dec 1999 10:26:29 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 05 Dec 1999 10:26:35 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id KAA24600 for ; Sun, 5 Dec 1999 10:26:21 -0600 (CST) Original-Received: from mailhop1.nyroc.rr.com (mailhop1-1.nyroc.rr.com [24.92.226.166]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id LAA26300 for ; Sun, 5 Dec 1999 11:25:57 -0500 (EST) Original-Received: from mailout2.nyroc.rr.com ([10.92.226.121]) by mailhop1.nyroc.rr.com (Post.Office MTA v3.5.3 release 223 ID# 0-59787U250000L250000S0V35) with ESMTP id com for ; Sun, 5 Dec 1999 11:24:05 -0500 Original-Received: from heart.cs.rochester.edu ([24.24.58.252]) by mailout2.nyroc.rr.com (Post.Office MTA v3.5.3 release 223 ID# 0-59787U250000L250000S0V35) with ESMTP id com for ; Sun, 5 Dec 1999 11:17:44 -0500 Original-Received: (from zsh@localhost) by heart.cs.rochester.edu (8.9.3/8.9.3) id LAA30012; Sun, 5 Dec 1999 11:24:17 -0500 X-Authentication-Warning: tiger.jia.vnet: zsh set sender to zsh@cs.rochester.edu using -f Original-To: ding@gnus.org X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q Original-Lines: 40 User-Agent: Gnus/5.0803 (Gnus v5.8.3) XEmacs/21.2 (Shinjuku) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:27730 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:27730 --=-=-= >>>>> "Simon" == Simon Josefsson writes: Simon> Shenghuo ZHU writes: >> I think the patch speed up most mail sources correctly except >> directory, since there is a hack code in nnmail-get-new-mail >> (nnmail.el:1426), which only fetch the contents of a single group's >> spool file. With the patch, `2 g' fetching for the first group >> inhibits fetching from other spool files. For those users who do not >> use directory as a mail source, this patch would not be a problem. Simon> Ouch. This patch add the hack to the scanning part too, but Simon> this is getting quite messy. It wouldn't work if `mail-sources' Simon> can be a group parameter (or non-global in any way), but I'm Simon> not sure if it can be, so... Whatdoyouthink, should I apply Simon> this or remove my earlier speed-up patch? [...] Speed up patch is good for most cases, at least people like the speed. Actually, Lars had put some codes to avoid multiply fetching a mail source, see `nnmail-fetched-sources'. So, the message "%s: Reading incoming mail (no new mail)...done" does not mean that Gnus fetches those mail sources again, while "%s: Reading incoming mail from %s..." means it fetches. But the overhead, such as nnmail-active and nnmail-cache-open, may cost some. So, I am thinking to speed up nnmail-get-new-mail by checking sources before actually doing something, so that Gnus still scan backend without fetch mail for most cases (except directory). See the attached patch. What do you think? Now, let's return to the beginning of this thread. I am not sure whether Bruce and Michael use directory. If not, Simon's speed up patch wouldn't cause trouble generally. -- Shenghuo --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=nnmail-5.43zsh.diff jIndex: nnmail.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v retrieving revision 5.43 diff -u -r5.43 nnmail.el --- nnmail.el 1999/12/04 01:11:10 5.43 +++ nnmail.el 1999/12/05 16:25:29 @@ -1393,6 +1393,7 @@ (let* ((sources (or mail-sources (if (listp nnmail-spool-file) nnmail-spool-file (list nnmail-spool-file)))) + fetching-sources (group-in group) (i 0) (new 0) @@ -1400,14 +1401,6 @@ incoming incomings source) (when (and (nnmail-get-value "%s-get-new-mail" method) nnmail-spool-file) - ;; We first activate all the groups. - (nnmail-activate method) - ;; Allow the user to hook. - (run-hooks 'nnmail-pre-get-new-mail-hook) - ;; Open the message-id cache. - (nnmail-cache-open) - ;; The we go through all the existing mail source specification - ;; and fetch the mail from each. (while (setq source (pop sources)) ;; Be compatible with old values. (cond @@ -1439,21 +1432,31 @@ (when nnmail-fetched-sources (if (member source nnmail-fetched-sources) (setq source nil) - (push source nnmail-fetched-sources))) - (when source - (nnheader-message 4 "%s: Reading incoming mail from %s..." - method (car source)) - (when (setq new - (mail-source-fetch - source - `(lambda (file orig-file) - (nnmail-split-incoming - file ',(intern (format "%s-save-mail" method)) - ',spool-func - (nnmail-get-split-group orig-file source) - ',(intern (format "%s-active-number" method)))))) - (incf total new) - (incf i)))) + (push source nnmail-fetched-sources) + (push source fetching-sources))))) + (when fetching-sources + ;; We first activate all the groups. + (nnmail-activate method) + ;; Allow the user to hook. + (run-hooks 'nnmail-pre-get-new-mail-hook) + ;; Open the message-id cache. + (nnmail-cache-open) + ;; The we go through all the existing mail source specification + ;; and fetch the mail from each. + (while (setq source (pop fetching-sources)) + (nnheader-message 4 "%s: Reading incoming mail from %s..." + method (car source)) + (when (setq new + (mail-source-fetch + source + `(lambda (file orig-file) + (nnmail-split-incoming + file ',(intern (format "%s-save-mail" method)) + ',spool-func + (nnmail-get-split-group orig-file source) + ',(intern (format "%s-active-number" method)))))) + (incf total new) + (incf i))) ;; If we did indeed read any incoming spools, we save all info. (if (zerop total) (nnheader-message 4 "%s: Reading incoming mail (no new mail)...done" --=-=-=--