Gnus development mailing list
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bmork@dod.no>
Subject: Re: Server variables in ~/News/agent/lib/servers
Date: Fri, 14 Jun 2002 18:43:54 +0200	[thread overview]
Message-ID: <hvlm9hkdyt.fsf@rasputin.ws.nextra.no> (raw)
In-Reply-To: <ilulm9ld1xc.fsf@latte.josefsson.org>

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

Simon Josefsson <jas@extundo.com> writes:
> Bjørn Mork <bmork@dod.no> 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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: agent-servers.diff --]
[-- Type: text/x-patch, Size: 1445 bytes --]

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

  reply	other threads:[~2002-06-14 16:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-06 10:49 Bjørn Mork
2002-06-11 19:56 ` Simon Josefsson
2002-06-14 16:43   ` Bjørn Mork [this message]
2002-06-15 17:34     ` Kai Großjohann
2002-06-16 19:43       ` Bjørn Mork
2002-06-16 19:48         ` Bjørn Mork
2002-06-16 20:47           ` Kai Großjohann
2002-06-16 20:56             ` Simon Josefsson
2002-06-16 21:14               ` Bjørn Mork
2002-06-17  7:27                 ` Simon Josefsson
2002-06-17  9:09                   ` Bjørn Mork
2002-06-17  9:55                     ` Simon Josefsson
2002-06-24 11:50       ` Steinar Bang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=hvlm9hkdyt.fsf@rasputin.ws.nextra.no \
    --to=bmork@dod.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).