From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/45264 Path: main.gmane.org!not-for-mail From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai =?iso-8859-15?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.gnus.general Subject: Re: Server variables in ~/News/agent/lib/servers Date: Sat, 15 Jun 2002 19:34:41 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1024162617 648 127.0.0.1 (15 Jun 2002 17:36:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 15 Jun 2002 17:36:57 +0000 (UTC) Cc: ding@gnus.org Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17JHTs-0000AK-00 for ; Sat, 15 Jun 2002 19:36:56 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17JHSZ-0005Cx-00; Sat, 15 Jun 2002 12:35:35 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 15 Jun 2002 12:35:54 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id MAA01939 for ; Sat, 15 Jun 2002 12:35:40 -0500 (CDT) Original-Received: (qmail 2430 invoked by alias); 15 Jun 2002 17:35:15 -0000 Original-Received: (qmail 2425 invoked from network); 15 Jun 2002 17:35:15 -0000 Original-Received: from waldorf.cs.uni-dortmund.de (129.217.4.42) by gnus.org with SMTP; 15 Jun 2002 17:35:15 -0000 Original-Received: from lothlorien.cs.uni-dortmund.de (lothlorien [129.217.19.67]) by waldorf.cs.uni-dortmund.de with ESMTP id g5FHYlb06877; Sat, 15 Jun 2002 19:34:47 +0200 (MES) Original-Received: from lucy.cs.uni-dortmund.de (lucy [129.217.19.80]) by lothlorien.cs.uni-dortmund.de id TAA25564; Sat, 15 Jun 2002 19:34:42 +0200 (MET DST) Original-Received: by lucy.cs.uni-dortmund.de (Postfix, from userid 6104) id CF6923B5DF; Sat, 15 Jun 2002 19:34:41 +0200 (CEST) Original-To: =?iso-8859-1?q?Bj=F8rn?= Mork Mail-Followup-To: =?iso-8859-1?q?Bj=F8rn?= Mork , ding@gnus.org In-Reply-To: =?iso-8859-1?q?(Bj=F8rn?= Mork's message of "Fri, 14 Jun 2002 18:43:54 +0200") Original-Lines: 67 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:45264 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:45264 Bj=F8rn Mork writes: > Index: lisp/gnus-agent.el > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v > retrieving revision 6.72 > diff -u -r6.72 gnus-agent.el > --- lisp/gnus-agent.el 2002/05/29 13:25:56 6.72 > +++ lisp/gnus-agent.el 2002/06/14 16:56:15 > @@ -627,17 +627,23 @@ >=20=20 > (defun gnus-agent-read-servers () > "Read the alist of covered servers." > - (setq gnus-agent-covered-methods > - (gnus-agent-read-file > - (nnheader-concat gnus-agent-directory "lib/servers")))) > + (dolist (method (gnus-agent-read-file=20 > + (nnheader-concat gnus-agent-directory "lib/servers")) > + gnus-agent-covered-methods) > + (unless method (setq method "native")) > + (add-to-list 'gnus-agent-covered-methods=20 > + (gnus-server-get-method nil method)))) I don't grok dolist (never used it), so I'm not 100% sure of what's happening. One thing I notice is that the old code always sets the variable to a one-element list. With the new code, the list could grow more and more if gnus-agent-read-servers is called multiple times. I would write something like the following: (setq gnus-agent-covered-methods (mapcar (lambda (m) (gnus-server-get-method nil (or m "native"))) (gnus-agent-read-file (nnheader-concat gnus-agent-directory "lib/servers")))) But maybe it does something else entirely. Or it is incomprehensible. > (defun gnus-agent-write-servers () > "Write the alist of covered servers." > (gnus-make-directory (nnheader-concat gnus-agent-directory "lib")) > (let ((coding-system-for-write nnheader-file-coding-system) > - (file-name-coding-system nnmail-pathname-coding-system)) > + (file-name-coding-system nnmail-pathname-coding-system) > + (methods)) > (with-temp-file (nnheader-concat gnus-agent-directory "lib/servers") > - (prin1 gnus-agent-covered-methods (current-buffer))))) > + (prin1 (dolist (method gnus-agent-covered-methods methods) > + (add-to-list 'methods (gnus-method-simplify method))) > + (current-buffer))))) Again, here I would use mapcar: (prin1 (mapcar 'gnus-method-simplify gnus-agent-covered-methods) (current-buffer)) If this is what's happening, mapcar seems to be the winner :-) > ;;; > ;;; Summary commands kai "a mapcar a day keeps the doctor away" --=20 ~/.signature is: umop 3p!sdn (Frank Nobis)