From 2712187032d73d6a8b6f8d6a501467a7dc1d0778 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 27 Sep 2019 02:17:14 +0200 Subject: [PATCH] Fix problem with changing to correct NNTP server * lisp/gnus/nntp.el (nntp-close-server): * lisp/gnus/nnimap.el (nnimap-close-server): * lisp/gnus/gnus-int.el (gnus-close-server): Take an optional DEFS parameter to enable switching to the correct nnoo server (bug#20319) when there's two servers with the same address. --- lisp/gnus/gnus-int.el | 3 ++- lisp/gnus/nnbabyl.el | 2 +- lisp/gnus/nnimap.el | 4 ++-- lisp/gnus/nnmbox.el | 2 +- lisp/gnus/nnregistry.el | 2 +- lisp/gnus/nntp.el | 3 ++- lisp/gnus/nnweb.el | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index b27a8a18ebf..0abbfe6720b 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -352,7 +352,8 @@ If it is down, start it up (again)." (when (stringp gnus-command-method) (setq gnus-command-method (gnus-server-to-method gnus-command-method))) (funcall (gnus-get-function gnus-command-method 'close-server) - (nth 1 gnus-command-method))) + (nth 1 gnus-command-method) + (nthcdr 2 gnus-command-method))) (defun gnus-request-list (gnus-command-method) "Request the active file from GNUS-COMMAND-METHOD." diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el index 0f4f4303cd8..46d52446075 100644 --- a/lisp/gnus/nnbabyl.el +++ b/lisp/gnus/nnbabyl.el @@ -130,7 +130,7 @@ nnbabyl-mbox-file) t))) -(deffoo nnbabyl-close-server (&optional server) +(deffoo nnbabyl-close-server (&optional server _defs) ;; Restore buffer mode. (when (and (nnbabyl-server-opened) nnbabyl-previous-buffer-mode) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 345667b927b..2c91ba0bf5e 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -627,8 +627,8 @@ textual parts.") (setq result (cdr (cadr elem)))))) result)) -(deffoo nnimap-close-server (&optional server) - (when (nnoo-change-server 'nnimap server nil) +(deffoo nnimap-close-server (&optional server defs) + (when (nnoo-change-server 'nnimap server defs) (ignore-errors (delete-process (get-buffer-process (nnimap-buffer)))) (nnoo-close-server 'nnimap server) diff --git a/lisp/gnus/nnmbox.el b/lisp/gnus/nnmbox.el index 110f39a867f..3b704961f01 100644 --- a/lisp/gnus/nnmbox.el +++ b/lisp/gnus/nnmbox.el @@ -130,7 +130,7 @@ nnmbox-mbox-file) t))) -(deffoo nnmbox-close-server (&optional server) +(deffoo nnmbox-close-server (&optional server _defs) (when (buffer-live-p nnmbox-mbox-buffer) (kill-buffer nnmbox-mbox-buffer)) (nnoo-close-server 'nnmbox server) diff --git a/lisp/gnus/nnregistry.el b/lisp/gnus/nnregistry.el index 6dcdac54623..ab9a8a97f8c 100644 --- a/lisp/gnus/nnregistry.el +++ b/lisp/gnus/nnregistry.el @@ -39,7 +39,7 @@ (deffoo nnregistry-server-opened (server) gnus-registry-enabled) -(deffoo nnregistry-close-server (server) +(deffoo nnregistry-close-server (server &optional defs) t) (deffoo nnregistry-status-message (server) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 49aa6ab1446..24084a3fe0b 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1062,7 +1062,8 @@ command whose response triggered the error." (or (nntp-find-connection nntp-server-buffer) (nntp-open-connection nntp-server-buffer))))) -(deffoo nntp-close-server (&optional server) +(deffoo nntp-close-server (&optional server defs) + (nnoo-change-server 'nntp server defs) (nntp-possibly-change-group nil server t) (let ((process (nntp-find-connection nntp-server-buffer))) (while process diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index b08b27dd1eb..e25f373bdf3 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el @@ -170,7 +170,7 @@ Valid types include `google', `dejanews', and `gmane'.") (nnheader-report 'nnweb "Fetched article %s" article) (cons group (and (numberp article) article)))))) -(deffoo nnweb-close-server (&optional server) +(deffoo nnweb-close-server (&optional server _defs) (when (and (nnweb-server-opened server) (gnus-buffer-live-p nnweb-buffer)) (with-current-buffer nnweb-buffer -- 2.39.2