diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 97e10a37a2..d613bc86ad 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -4300,8 +4300,7 @@ gnus-group-suspend ;; Closing all the backends is useful (for instance) when when the ;; IP addresses have changed and you need to reconnect. (dolist (elem gnus-opened-servers) - (gnus-close-server (car elem)) - (setcar (cdr elem) 'closed)) + (gnus-close-server (car elem))) (when group-buf (bury-buffer group-buf) (delete-windows-on group-buf t)))) diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 60ebc07c34..da385a1802 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -351,9 +351,12 @@ gnus-close-server "Close the connection to GNUS-COMMAND-METHOD." (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) - (nthcdr 2 gnus-command-method))) + (prog1 + (funcall (gnus-get-function gnus-command-method 'close-server) + (nth 1 gnus-command-method) + (nthcdr 2 gnus-command-method)) + (when-let ((elem (assoc gnus-command-method gnus-opened-servers))) + (setf (nth 1 elem) 'closed)))) (defun gnus-request-list (gnus-command-method) "Request the active file from GNUS-COMMAND-METHOD."