GNU bug report logs - #42977
28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration

Previous Next

Package: emacs;

Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Date: Fri, 21 Aug 2020 20:44:02 UTC

Severity: normal

Found in version 28.0.50

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42977 in the body.
You can then email your comments to 42977 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Fri, 21 Aug 2020 20:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 21 Aug 2020 20:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus
 integration
Date: Fri, 21 Aug 2020 13:43:07 -0700
[Message part 1 (text/plain, inline)]
The attached patch provides a new gnus-dbus.el library, allowing systems
with dbus support to register a signal that closes all Gnus servers when
the system is going down for sleep. This is kind of a stop-gap solution
for the larger problems discussed in #40748.

It only does anything if Emacs has been compiled with dbus support, and
if the user sets the `gnus-dbus-close-on-sleep' to non-nil (it defaults
to nil).

Right now I've done this by checking the value of that option in
`gnus-1', but I could just as easily have the library add a startup
hook.

I assume this would require a mention in the manual. Is it something
we'd add to NEWS, as well?

Thanks,
Eric

[0001-Add-basic-D-Bus-integration-to-Gnus.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Sat, 22 Aug 2020 06:34:01 GMT) Full text and rfc822 format available.

Message #8 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50;
 New gnus-dbus library providing (optional) D-Bus->Gnus integration
Date: Sat, 22 Aug 2020 09:33:11 +0300
> From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
> Date: Fri, 21 Aug 2020 13:43:07 -0700
> 
> I assume this would require a mention in the manual. Is it something
> we'd add to NEWS, as well?

Yes, IMO.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Sat, 22 Aug 2020 13:55:01 GMT) Full text and rfc822 format available.

Message #11 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Sat, 22 Aug 2020 15:53:53 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> The attached patch provides a new gnus-dbus.el library, allowing systems
> with dbus support to register a signal that closes all Gnus servers when
> the system is going down for sleep.

Great!  I've just skimmed the patch, but it looks good to me.

> I assume this would require a mention in the manual. Is it something
> we'd add to NEWS, as well?

Yup and yup.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Sat, 22 Aug 2020 18:02:02 GMT) Full text and rfc822 format available.

Message #14 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Sat, 22 Aug 2020 11:00:57 -0700
[Message part 1 (text/plain, inline)]
On 08/22/20 15:53 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> The attached patch provides a new gnus-dbus.el library, allowing systems
>> with dbus support to register a signal that closes all Gnus servers when
>> the system is going down for sleep.
>
> Great!  I've just skimmed the patch, but it looks good to me.
>
>> I assume this would require a mention in the manual. Is it something
>> we'd add to NEWS, as well?
>
> Yup and yup.

Okay, good. Here's a new version of the patch, with docs. I also
switched the signal type from :system to :session, since :session is
apparently appropriate for user-level stuff. Anyway, I'll run this for a
few days before pushing.

Eric

[0001-Add-basic-D-Bus-integration-to-Gnus.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Sun, 23 Aug 2020 12:28:01 GMT) Full text and rfc822 format available.

Message #17 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Sun, 23 Aug 2020 14:27:17 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> Okay, good. Here's a new version of the patch, with docs. I also
> switched the signal type from :system to :session, since :session is
> apparently appropriate for user-level stuff. Anyway, I'll run this for a
> few days before pushing.

Sounds good.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Tue, 25 Aug 2020 17:44:02 GMT) Full text and rfc822 format available.

Message #20 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Tue, 25 Aug 2020 10:43:32 -0700
On 08/23/20 14:27 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> Okay, good. Here's a new version of the patch, with docs. I also
>> switched the signal type from :system to :session, since :session is
>> apparently appropriate for user-level stuff. Anyway, I'll run this for a
>> few days before pushing.
>
> Sounds good.  :-)

Okay, there it goes. This was made a tiny bit more difficult to test by
the fact that the 'closed status (in `gnus-opened-servers') is set at
various calling sites, and not centrally in `gnus-close-server'.
`gnus-open-server' sets the 'open status, it seems like
`gnus-close-server' should do the equivalent. I could take it out of
`gnus-group-suspend', and look at whether `gnus-server-set-status' was
really necessary.

WDYT?

Eric




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Tue, 25 Aug 2020 19:22:01 GMT) Full text and rfc822 format available.

Message #23 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Tue, 25 Aug 2020 21:21:42 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> Okay, there it goes. This was made a tiny bit more difficult to test by
> the fact that the 'closed status (in `gnus-opened-servers') is set at
> various calling sites, and not centrally in `gnus-close-server'.
> `gnus-open-server' sets the 'open status, it seems like
> `gnus-close-server' should do the equivalent. I could take it out of
> `gnus-group-suspend', and look at whether `gnus-server-set-status' was
> really necessary.

I think the use case is stuff like this:

(defun gnus-agent-toggle-group-plugged (group)
  "Toggle the status of the server of the current group."
  (interactive (list (gnus-group-group-name)))
  (let* ((method (gnus-find-method-for-group group))
	 (status (cadr (assoc method gnus-opened-servers))))
    (if (eq status 'offline)
	(gnus-server-set-status method 'closed)
      (gnus-close-server method)
      (gnus-server-set-status method 'offline))

Where we close the server (i.e., the backends close the network
connections), but don't set the status to 'closed, because it's still
open on the Gnus side.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Tue, 25 Aug 2020 19:34:01 GMT) Full text and rfc822 format available.

Message #26 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Tue, 25 Aug 2020 12:33:26 -0700
On 08/25/20 21:21 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> Okay, there it goes. This was made a tiny bit more difficult to test by
>> the fact that the 'closed status (in `gnus-opened-servers') is set at
>> various calling sites, and not centrally in `gnus-close-server'.
>> `gnus-open-server' sets the 'open status, it seems like
>> `gnus-close-server' should do the equivalent. I could take it out of
>> `gnus-group-suspend', and look at whether `gnus-server-set-status' was
>> really necessary.
>
> I think the use case is stuff like this:
>
> (defun gnus-agent-toggle-group-plugged (group)
>   "Toggle the status of the server of the current group."
>   (interactive (list (gnus-group-group-name)))
>   (let* ((method (gnus-find-method-for-group group))
> 	 (status (cadr (assoc method gnus-opened-servers))))
>     (if (eq status 'offline)
> 	(gnus-server-set-status method 'closed)
>       (gnus-close-server method)
>       (gnus-server-set-status method 'offline))
>
> Where we close the server (i.e., the backends close the network
> connections), but don't set the status to 'closed, because it's still
> open on the Gnus side.

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.

Alternately, we could just have `gnus-close-all-servers' set the status,
too.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Tue, 25 Aug 2020 19:38:02 GMT) Full text and rfc822 format available.

Message #29 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Tue, 25 Aug 2020 21:37:16 +0200
Eric Abrahamsen <eric <at> 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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Thu, 27 Aug 2020 01:20:02 GMT) Full text and rfc822 format available.

Message #32 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Wed, 26 Aug 2020 18:19:32 -0700
[Message part 1 (text/plain, inline)]
On 08/25/20 21:37 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> 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.

[close-gnus-servers.diff (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Thu, 27 Aug 2020 13:38:01 GMT) Full text and rfc822 format available.

Message #35 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 42977 <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Thu, 27 Aug 2020 15:37:14 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> 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.

Looks good to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42977; Package emacs. (Thu, 27 Aug 2020 21:21:02 GMT) Full text and rfc822 format available.

Message #38 received at 42977 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 42977 <at> debbugs.gnu.org, 42977-done <at> debbugs.gnu.org
Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional)
 D-Bus->Gnus integration
Date: Thu, 27 Aug 2020 14:20:26 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> 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.
>
> Looks good to me.

Cool, in it goes. It turns out the signal needed to be :system after
all, not :session, so I made that change as well, and am closing this
report.

Thanks,
Eric




Reply sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
You have taken responsibility. (Thu, 27 Aug 2020 21:21:02 GMT) Full text and rfc822 format available.

Notification sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
bug acknowledged by developer. (Thu, 27 Aug 2020 21:21:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Sep 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.