From 1e4a36620ae5949ea839a7234380d64fbf6f4287 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 25 Nov 2003 02:30:26 +0000 Subject: [PATCH] Synch to Gnus 200311250226. --- lisp/ChangeLog | 12 ++++++++++++ lisp/gnus-agent.el | 35 ++++++++++++++++++++++------------- lisp/gnus-srvr.el | 9 ++++++++- 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 25d9780..8716d80 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2003-11-24 Kevin Greiner + * gnus-srvr.el (gnus-server-insert-server-line): The server names + used in gnus-agent are different (for example, the native server + uses the alias "native") from the names in gnus-srvr. + Compensating by adding a second text property storing the name + expected by gnus-agent. + (gnus-server-named-server): New function. + * gnus-agent.el (gnus-agent-remove-server, gnus-agent-add-server): + No longer expect an argument as it was ignored anyway. Uses the + new gnus-server-named-server function to get gnus-agent compatible + names from the server buffer. + 2003-11-20 Kevin Greiner * gnus.el (gnus-agent-covered-methods): Documented use of diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index c477f04..f6c4ba3 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -801,30 +801,39 @@ be a select method." ;;; Server mode commands ;;; -(defun gnus-agent-add-server (server) +(defun gnus-agent-add-server () "Enroll SERVER in the agent program." - (interactive (list (gnus-server-server-name))) - (unless server - (error "No server on the current line")) - (let ((method (gnus-server-get-method nil (gnus-server-server-name)))) + (interactive) + (let* ((server (gnus-server-server-name)) + (named-server (gnus-server-named-server)) + (method (and server + (gnus-server-get-method nil server)))) + (unless server + (error "No server on the current line")) + (when (gnus-agent-method-p method) (error "Server already in the agent program")) - (push (gnus-method-to-server method) gnus-agent-covered-methods) + + (push named-server gnus-agent-covered-methods) + (setq gnus-agent-method-p-cache nil) (gnus-server-update-server server) (gnus-agent-write-servers) (gnus-message 1 "Entered %s into the Agent" server))) -(defun gnus-agent-remove-server (server) +(defun gnus-agent-remove-server () "Remove SERVER from the agent program." - (interactive (list (gnus-server-server-name))) - (unless server - (error "No server on the current line")) - (let* ((server (gnus-server-server-name))) - (unless (member server gnus-agent-covered-methods) + (interactive) + (let* ((server (gnus-server-server-name)) + (named-server (gnus-server-named-server))) + (unless server + (error "No server on the current line")) + + (unless (member named-server gnus-agent-covered-methods) (error "Server not in the agent program")) + (setq gnus-agent-covered-methods - (delete server gnus-agent-covered-methods) + (delete named-server gnus-agent-covered-methods) gnus-agent-method-p-cache nil) (gnus-server-update-server server) diff --git a/lisp/gnus-srvr.el b/lisp/gnus-srvr.el index 4fd1d48..bfc3d08 100644 --- a/lisp/gnus-srvr.el +++ b/lisp/gnus-srvr.el @@ -290,7 +290,8 @@ The following commands are available: (prog1 (1+ (point)) ;; Insert the text. (eval gnus-server-line-format-spec)) - (list 'gnus-server (intern gnus-tmp-name))))) + (list 'gnus-server (intern gnus-tmp-name) + 'gnus-named-server (intern (gnus-method-to-server method)))))) (defun gnus-enter-server-buffer () "Set up the server buffer." @@ -344,6 +345,12 @@ The following commands are available: (let ((server (get-text-property (gnus-point-at-bol) 'gnus-server))) (and server (symbol-name server)))) +(defun gnus-server-named-server () + "Returns a server name that matches one of the names returned by +gnus-method-to-server." + (let ((server (get-text-property (gnus-point-at-bol) 'gnus-named-server))) + (and server (symbol-name server)))) + (defalias 'gnus-server-position-point 'gnus-goto-colon) (defconst gnus-server-edit-buffer "*Gnus edit server*") -- 1.7.10.4