From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/45271 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?q?Bj=F8rn?= Mork Newsgroups: gmane.emacs.gnus.general Subject: Re: Server variables in ~/News/agent/lib/servers Date: Sun, 16 Jun 2002 21:43:09 +0200 Organization: Detonation oozy Decked Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1024256666 5817 127.0.0.1 (16 Jun 2002 19:44:26 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 16 Jun 2002 19:44:26 +0000 (UTC) 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 17Jfwo-0001Vi-00 for ; Sun, 16 Jun 2002 21:44:26 +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 17Jfvt-0000tj-00; Sun, 16 Jun 2002 14:43:29 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 16 Jun 2002 14:43:47 -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 OAA03621 for ; Sun, 16 Jun 2002 14:43:34 -0500 (CDT) Original-Received: (qmail 27646 invoked by alias); 16 Jun 2002 19:43:11 -0000 Original-Received: (qmail 27641 invoked from network); 16 Jun 2002 19:43:10 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by gnus.org with SMTP; 16 Jun 2002 19:43:10 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 17JgLQ-0002ns-00 for ; Sun, 16 Jun 2002 22:09:52 +0200 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 71 Original-NNTP-Posting-Host: 148.122.252.5 Original-X-Trace: quimby.gnus.org 1024258192 10779 148.122.252.5 (16 Jun 2002 20:09:52 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 16 Jun 2002 20:09:52 GMT User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386-debian-linux-gnu) Cancel-Lock: sha1:Q+/PzlvNC2cGH3/A//k0ppDnp6A= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:45271 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:45271 --=-=-= Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes: > I don't grok dolist (never used it), Nor had I before. It was just something I found near the lines I changed :-) > 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. No it wouldn't. add-to-list will take care of that. But my approach was of course very inefficient and inelegant. > If this is what's happening, mapcar seems to be the winner :-) Yup, beautiful. This is what I wanted to do. I just didn't know how. Thanks. I've attached a new version of the patch using your code. Bjørn -- Your bad grammar reminds me of a Jewish grandmother. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=agent-servers.diff Index: lisp/gnus-agent.el =================================================================== 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/16 19:59:24 @@ -628,8 +628,12 @@ (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")))) + (mapcar (lambda (m) + (gnus-server-get-method + nil + (or m "native"))) + (gnus-agent-read-file + (nnheader-concat gnus-agent-directory "lib/servers")))) (defun gnus-agent-write-servers () "Write the alist of covered servers." @@ -637,7 +641,8 @@ (let ((coding-system-for-write nnheader-file-coding-system) (file-name-coding-system nnmail-pathname-coding-system)) (with-temp-file (nnheader-concat gnus-agent-directory "lib/servers") - (prin1 gnus-agent-covered-methods (current-buffer))))) + (prin1 (mapcar 'gnus-method-simplify gnus-agent-covered-methods) + (current-buffer))))) ;;; ;;; Summary commands --=-=-=--