From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/45250 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: Fri, 14 Jun 2002 18:43:54 +0200 Organization: Deprived ourselves Demand 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 1024073152 16081 127.0.0.1 (14 Jun 2002 16:45:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 14 Jun 2002 16:45:52 +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 17IuCt-0004BG-00 for ; Fri, 14 Jun 2002 18:45:51 +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 17IuBO-0002eZ-00; Fri, 14 Jun 2002 11:44:18 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 14 Jun 2002 11:44:37 -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 LAA28956 for ; Fri, 14 Jun 2002 11:44:24 -0500 (CDT) Original-Received: (qmail 5612 invoked by alias); 14 Jun 2002 16:43:57 -0000 Original-Received: (qmail 5607 invoked from network); 14 Jun 2002 16:43:57 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by gnus.org with SMTP; 14 Jun 2002 16:43:57 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 17IuZu-0000LS-00 for ; Fri, 14 Jun 2002 19:09:38 +0200 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 77 Original-NNTP-Posting-Host: 148.122.193.44.dhcp.nextra.no Original-X-Trace: quimby.gnus.org 1024074578 1329 148.122.193.44 (14 Jun 2002 17:09:38 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 14 Jun 2002 17:09:38 GMT User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386-debian-linux-gnu) Cancel-Lock: sha1:+L5uPPJRABM81hTXCpQNualXo8c= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:45250 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:45250 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Simon Josefsson writes: > Bjørn Mork writes: > >> Having them there means that agent forgets the server every time you >> change its select-method by adding, removing or changing a variable. >> I can't really see any reason why that's necessary, but maybe I'm >> missing something? Why not use a reference to the select-method like >> its done in ~/newsrc.eld? > > I think this should be done too. Does anyone have a specific idea > (read: patch) on how to do it? :-) The attached patch seems to fix it, but should be reviewed by someone with a little lisp knowledge. I am pretty clueless in this area (too) and have most likely done some very basic errors here. Note that I've only changed the file format. It would probably have been better to change the content of gnus-agent-covered-methods instead of changing gnus-agent-{read,write}-servers, but that would require more changes than I feel comfortable doing... Although the file format changes, I still believe this change is backwards compatible since Gnus always has been able to read the new format. Bjørn -- So, trees are crass? --=-=-= 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/14 16:56:15 @@ -627,17 +627,23 @@ (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 + (nnheader-concat gnus-agent-directory "lib/servers")) + gnus-agent-covered-methods) + (unless method (setq method "native")) + (add-to-list 'gnus-agent-covered-methods + (gnus-server-get-method nil method)))) (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))))) ;;; ;;; Summary commands --=-=-=--