+2003-11-24 Kevin Greiner <kgreiner@xpediantsolutions.com>
+ * 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 <kgreiner@xpediantsolutions.com>
* gnus.el (gnus-agent-covered-methods): Documented use of
;;; 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)
(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."
(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*")