From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 42977@debbugs.gnu.org
Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration
Date: Wed, 26 Aug 2020 18:19:32 -0700 [thread overview]
Message-ID: <877dtkzxzv.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87k0xm4ivn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 25 Aug 2020 21:37:16 +0200")
[-- Attachment #1: Type: text/plain, Size: 597 bytes --]
On 08/25/20 21:37 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Okay, I see. But even given that, leaving `gnus-server-set-status'
>> alone, it might be fine to have `gnus-close-server' set a 'closed status
>> -- the server will just re-set it afterwards.
>
> Sure. I haven't looked at all the callers, though, but I guess it's a
> simplification.
I think it's more a matter of reducing confusion for hackers. If I do
`gnus-close-server' followed by `gnus-server-status', it tells me the
server is open -- not very helpful.
The patch is pretty simple.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: close-gnus-servers.diff --]
[-- Type: text/x-patch, Size: 1446 bytes --]
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."
next prev parent reply other threads:[~2020-08-27 1:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 20:43 bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Eric Abrahamsen
2020-08-22 6:33 ` Eli Zaretskii
2020-08-22 13:53 ` Lars Ingebrigtsen
2020-08-22 18:00 ` Eric Abrahamsen
2020-08-23 12:27 ` Lars Ingebrigtsen
2020-08-25 17:43 ` Eric Abrahamsen
2020-08-25 19:21 ` Lars Ingebrigtsen
2020-08-25 19:33 ` Eric Abrahamsen
2020-08-25 19:37 ` Lars Ingebrigtsen
2020-08-27 1:19 ` Eric Abrahamsen [this message]
2020-08-27 13:37 ` Lars Ingebrigtsen
2020-08-27 21:20 ` Eric Abrahamsen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877dtkzxzv.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=42977@debbugs.gnu.org \
--cc=larsi@gnus.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).