From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Aug 2020 20:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 42977@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159804260423923 (code B ref -1); Fri, 21 Aug 2020 20:44:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Aug 2020 20:43:24 +0000 Received: from localhost ([127.0.0.1]:48357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9Dsi-0006Dm-8t for submit@debbugs.gnu.org; Fri, 21 Aug 2020 16:43:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:39948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9Dsf-0006Dd-81 for submit@debbugs.gnu.org; Fri, 21 Aug 2020 16:43:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9Dse-0008Ap-Tj for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2020 16:43:21 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:33750 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9Dsc-00005n-OP for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2020 16:43:20 -0400 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id ED7F1FA30C for ; Fri, 21 Aug 2020 20:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1598042590; bh=EPiPQ5sZSlA29+mgpPwuMXnDN1n9wmgAQcZ3N4+tfNA=; h=From:To:Subject:Date:From; b=Pbu3xGCb5EW8YtOf3ryAY+MRRpzgchfuX8or4mENPBqmayUsQmOtHJG81L5koF3WG ssss4oNWl7svN1hXd0lDzeKTSJ/EftVESZ4+aP+Rd+yzZ2vzAA5hueKn+gKMc3Z68C SYGR72YFEHT9nsrZEj8z7rr+yeoxZpNBoxjKM6/M= From: Eric Abrahamsen Date: Fri, 21 Aug 2020 13:43:07 -0700 Message-ID: <87imdb6884.fsf@ericabrahamsen.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/21 16:43:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-basic-D-Bus-integration-to-Gnus.patch >From 414051f4fb7d60a6674b7267dc7f73025ddb1a3b Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Fri, 21 Aug 2020 13:36:58 -0700 Subject: [PATCH] Add basic D-Bus integration to Gnus * lisp/gnus/gnus-dbus.el: New library, registering a signal that closes all Gnus servers when the system is going to sleep. * lisp/gnus/gnus-start.el: Check new option `gnus-dbus-close-on-sleep', and register the appropriate D-Bus signal if it is non-nil. * lisp/gnus/gnus.el: New gnus-dbus customization group. --- lisp/gnus/gnus-dbus.el | 66 +++++++++++++++++++++++++++++++++++++++++ lisp/gnus/gnus-start.el | 3 ++ lisp/gnus/gnus.el | 4 +++ 3 files changed, 73 insertions(+) create mode 100644 lisp/gnus/gnus-dbus.el diff --git a/lisp/gnus/gnus-dbus.el b/lisp/gnus/gnus-dbus.el new file mode 100644 index 0000000000..14f0abb6be --- /dev/null +++ b/lisp/gnus/gnus-dbus.el @@ -0,0 +1,66 @@ +;;; gnus-dbus.el --- DBUS integration for Gnus -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Eric Abrahamsen + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This library contains some Gnus integration for systems using DBUS. +;; At present it registers a signal to close all Gnus servers before +;; system sleep or hibernation. + +;;; Code: + +(require 'dbus) + +(defcustom gnus-dbus-close-on-sleep nil + "When non-nil, close Gnus servers on system sleep." + :group 'gnus-dbus + :type 'boolean) + +(defvar gnus-dbus-sleep-registration-object nil + "Object returned from `dbus-register-signal'. +Used to unregistering the signal.") + +(defun gnus-dbus-register-sleep-signal () + "Use `dbus-register-signal' to close servers on sleep." + (when (featurep 'dbusbind) + (setq gnus-dbus-sleep-registration-object + (dbus-register-signal :system + "org.freedesktop.login1" + "/org/freedesktop/login1" + "org.freedesktop.login1.Manager" + "PrepareForSleep" + #'gnus-dbus-sleep-handler)) + (gnus-add-shutdown #'gnus-dbus-unregister-sleep-signal 'gnus))) + +(defun gnus-dbus-sleep-handler (sleep-start) + ;; Sleep-start is t before sleeping. + (when (and sleep-start + (gnus-alive-p)) + (condition-case nil + (gnus-close-all-servers) + (error nil)))) + +(defun gnus-dbus-unregister-sleep-signal () + (condition-case nil + (dbus-unregister-object + gnus-dbus-sleep-registration-object) + (wrong-type-argument nil))) + +(provide 'gnus-dbus) +;;; gnus-dbus.el ends here diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index ba8b91be5c..fe600f107c 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -31,6 +31,7 @@ (require 'gnus-range) (require 'gnus-util) (require 'gnus-cloud) +(require 'gnus-dbus) (autoload 'message-make-date "message") (autoload 'gnus-agent-read-servers-validate "gnus-agent") (autoload 'gnus-agent-save-local "gnus-agent") @@ -798,6 +799,8 @@ gnus-1 (gnus-run-hooks 'gnus-setup-news-hook) (when gnus-agent (gnus-request-create-group "queue" '(nndraft ""))) + (when gnus-dbus-close-on-sleep + (gnus-dbus-register-sleep-signal)) (gnus-start-draft-setup) ;; Generate the group buffer. (gnus-group-list-groups level) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index cecf4d4fb4..f615d49d27 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -292,6 +292,10 @@ gnus-fun :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) +(defgroup gnus-dbus nil + "D-Bus integration for Gnus." + :group 'gnus) + (defconst gnus-version-number "5.13" "Version number for this version of Gnus.") -- 2.28.0 --=-=-=-- From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Aug 2020 06:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.159807800413984 (code B ref 42977); Sat, 22 Aug 2020 06:34:01 +0000 Received: (at 42977) by debbugs.gnu.org; 22 Aug 2020 06:33:24 +0000 Received: from localhost ([127.0.0.1]:48662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9N5g-0003dT-DD for submit@debbugs.gnu.org; Sat, 22 Aug 2020 02:33:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9N5c-0003dD-Bj for 42977@debbugs.gnu.org; Sat, 22 Aug 2020 02:33:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34748) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k9N5W-0004Yy-OU; Sat, 22 Aug 2020 02:33:14 -0400 Received: from [176.228.60.248] (port=1883 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k9N5V-0000B3-Hn; Sat, 22 Aug 2020 02:33:14 -0400 Date: Sat, 22 Aug 2020 09:33:11 +0300 Message-Id: <83y2m79om0.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87imdb6884.fsf@ericabrahamsen.net> (message from Eric Abrahamsen on Fri, 21 Aug 2020 13:43:07 -0700) References: <87imdb6884.fsf@ericabrahamsen.net> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Eric Abrahamsen > 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. From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Aug 2020 13:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.159810444617122 (code B ref 42977); Sat, 22 Aug 2020 13:55:01 +0000 Received: (at 42977) by debbugs.gnu.org; 22 Aug 2020 13:54:06 +0000 Received: from localhost ([127.0.0.1]:49146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9Ty9-0004S6-Li for submit@debbugs.gnu.org; Sat, 22 Aug 2020 09:54:06 -0400 Received: from quimby.gnus.org ([95.216.78.240]:36066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9Ty7-0004Rb-HT for 42977@debbugs.gnu.org; Sat, 22 Aug 2020 09:54:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ijFnCR3+PK8BoQ0y4UKhceWDs4ely0CPyk023q36SLo=; b=h5giJzACDMkdR77ehW7S25S/zr /hUZcabQLIaTiFjwqmQ9StU2lCZGBQX45VXshcJ/sukGuh+MoHKdUitwAmv4zfbRRvO4slmkAEwLJ g0U3tfjOwnZut0bGkUi2GaJDWxUVs9tm+mEC2RZKfypkmE869VLh4vZnOLnLpuHdvy1U=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k9Txy-0008Cg-Nb; Sat, 22 Aug 2020 15:53:57 +0200 From: Lars Ingebrigtsen References: <87imdb6884.fsf@ericabrahamsen.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEW6lGvVvpOJTTv/ //8WfddaAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+QIFg0cFh54y+kAAAFySURBVCjPTdDBatwwEAbg 3wKHrU9pQHc71ODVU4glAScnx0h72FN7CJQ8hSirHnx3z17IgjJP2RnZpdFFfGik+UcoPS9HdOEN WnAk3XqUG5JvjrQAZfmgb5J/HYlgPuK385/UmxOj6WP7+46InhldE5v7UZt9L2WX2Pw8zi+vfUXY 97F5Gq++tSqjZbhoIa918el0dbNFxX0G/cJl2kLBKgCztt7y/sYtKPqDzkjmFy1+rAvGV845FI9D 3aDIqe0Xh7baRniAQ6ECMhxkbRgKeWpZoaK1XegynOIs3bJiqGZ7a5ZqRT0fBhOqAP432+qTpTCt iNqAAn8Vw8yUHAWTMvQb8cxVQuGd8c80MUiw97aaFijBsPelpR2Q8cEj1zuoBPjh4r+Ds6hFcPU/ wFUyUDkmX2PXgeMABzqHe+rkDwXLZCjBrMhL3gB3Jg5AuPyDnLwL1IrD+RPodiszAvvpTr6/Iqnp P4IiSYN8ARvkJGX8BePRrLauUHjHAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA4LTIyVDEzOjI4 OjIxKzAwOjAw2Y22lwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wOC0yMlQxMzoyODoyMSswMDow MKjQDisAAAAASUVORK5CYII= X-Now-Playing: The Contortions's _Buy_: "Bedroom Athlete" Date: Sat, 22 Aug 2020 15:53:53 +0200 In-Reply-To: <87imdb6884.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 21 Aug 2020 13:43:07 -0700") Message-ID: <87a6ymn5vy.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eric Abrahamsen 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. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen 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 From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Aug 2020 18:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.159811927922013 (code B ref 42977); Sat, 22 Aug 2020 18:02:02 +0000 Received: (at 42977) by debbugs.gnu.org; 22 Aug 2020 18:01:19 +0000 Received: from localhost ([127.0.0.1]:51372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9XpO-0005iy-Dc for submit@debbugs.gnu.org; Sat, 22 Aug 2020 14:01:18 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:45058 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9XpI-0005ih-Ie for 42977@debbugs.gnu.org; Sat, 22 Aug 2020 14:01:16 -0400 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 826B2FA30C; Sat, 22 Aug 2020 18:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1598119265; bh=CUkMdiJDHUFbTbUnvPL4JK9+mFAV+jyWQ1+pLiXRbKc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=iheGj35VZ3m0CL66Orb06TFX4WvKJ2SD9FWVFmdT1MblS7dc+UL7GgR65bheyYE2y x4MAGrCcSO/YVDK0qzeneZ9+WukXhTbEvoekXyW6FBqNd8C/UPNq/sAlM6dk4FAf+h Bw90kcPTEk+iwgeEvkLLCmFYXm6TxQqapqEoFrkk= From: Eric Abrahamsen References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> Date: Sat, 22 Aug 2020 11:00:57 -0700 In-Reply-To: <87a6ymn5vy.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 22 Aug 2020 15:53:53 +0200") Message-ID: <87y2m64l2e.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain On 08/22/20 15:53 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-basic-D-Bus-integration-to-Gnus.patch >From 702961d4e8a1654cec7c3af26855899f65d62f10 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Fri, 21 Aug 2020 13:36:58 -0700 Subject: [PATCH 1/2] Add basic D-Bus integration to Gnus * lisp/gnus/gnus-dbus.el: New library, registering a signal that closes all Gnus servers when the system is going to sleep. * lisp/gnus/gnus-start.el: Check new option `gnus-dbus-close-on-sleep', and register the appropriate D-Bus signal if it is non-nil. * lisp/gnus/gnus.el: New gnus-dbus customization group. * doc/misc/gnus.texi: Document. --- doc/misc/gnus.texi | 22 +++++++++++++ etc/NEWS | 5 +++ lisp/gnus/gnus-dbus.el | 68 +++++++++++++++++++++++++++++++++++++++++ lisp/gnus/gnus-start.el | 3 ++ lisp/gnus/gnus.el | 4 +++ 5 files changed, 102 insertions(+) create mode 100644 lisp/gnus/gnus-dbus.el diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 332926a685..0bdc2fa297 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -828,6 +828,7 @@ Top * Spam Package:: A package for filtering and processing spam. * The Gnus Registry:: A package for tracking messages by Message-ID. * The Gnus Cloud:: A package for synchronizing Gnus marks. +* D-Bus Integration:: Closing Gnus servers on system sleep. * Other modes:: Interaction with other modes. * Various Various:: Things that are really various. @@ -22333,6 +22334,7 @@ Various * Spam Package:: A package for filtering and processing spam. * The Gnus Registry:: A package for tracking messages by Message-ID. * The Gnus Cloud:: A package for synchronizing Gnus marks. +* D-Bus Integration:: Closing Gnus servers on system sleep. * Other modes:: Interaction with other modes. * Various Various:: Things that are really various. @end menu @@ -26404,6 +26406,26 @@ Gnus Cloud Usage Server buffer (@pxref{Gnus Cloud Setup}). @end defvar +@node D-Bus Integration +@section D-Bus Integration +@cindex dbus +@cindex D-Bus +@cindex gnus-dbus +@cindex system sleep +@cindex closing servers automatically +@cindex hung connections + +When using laptops or other systems that have a sleep or hibernate +functionality, it's possible for long-running server connections to +become ``hung'', requiring the user to manually close and re-open the +connections after the system resumes. On systems compiled with D-Bus +support (check the value of @code{(featurep 'dbusbind)}), Gnus can +register a D-Bus signal to automatically close all server connections +before the system goes to sleep. To enable this, set +@code{gnus-dbus-close-on-sleep} to a non-nil value. + +For more information about D-Bus and Emacs, @pxref{Top,,, dbus, D-Bus integration in Emacs}. + @node Other modes @section Interaction with other modes diff --git a/etc/NEWS b/etc/NEWS index 0a6a7dec5c..5e7ad0073c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -267,6 +267,11 @@ tags to be considered as well. ** Gnus ++++ +*** New option 'gnus-dbus-close-on-sleep' +On systems with D-Bus support, it is now possible to register a signal +to close all Gnus servers before the system sleeps. + +++ *** The key binding of 'gnus-summary-search-article-forward' has changed. This command was previously on 'M-s' and shadowed the global 'M-s' diff --git a/lisp/gnus/gnus-dbus.el b/lisp/gnus/gnus-dbus.el new file mode 100644 index 0000000000..b6e8bb9c8b --- /dev/null +++ b/lisp/gnus/gnus-dbus.el @@ -0,0 +1,68 @@ +;;; gnus-dbus.el --- DBUS integration for Gnus -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Eric Abrahamsen + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This library contains some Gnus integration for systems using DBUS. +;; At present it registers a signal to close all Gnus servers before +;; system sleep or hibernation. + +;;; Code: + +(require 'gnus) +(require 'dbus) +(declare-function gnus-close-all-servers "gnus-start") + +(defcustom gnus-dbus-close-on-sleep nil + "When non-nil, close Gnus servers on system sleep." + :group 'gnus-dbus + :type 'boolean) + +(defvar gnus-dbus-sleep-registration-object nil + "Object returned from `dbus-register-signal'. +Used to unregister the signal.") + +(defun gnus-dbus-register-sleep-signal () + "Use `dbus-register-signal' to close servers on sleep." + (when (featurep 'dbusbind) + (setq gnus-dbus-sleep-registration-object + (dbus-register-signal :session + "org.freedesktop.login1" + "/org/freedesktop/login1" + "org.freedesktop.login1.Manager" + "PrepareForSleep" + #'gnus-dbus-sleep-handler)) + (gnus-add-shutdown #'gnus-dbus-unregister-sleep-signal 'gnus))) + +(defun gnus-dbus-sleep-handler (sleep-start) + ;; Sleep-start is t before sleeping. + (when (and sleep-start + (gnus-alive-p)) + (condition-case nil + (gnus-close-all-servers) + (error nil)))) + +(defun gnus-dbus-unregister-sleep-signal () + (condition-case nil + (dbus-unregister-object + gnus-dbus-sleep-registration-object) + (wrong-type-argument nil))) + +(provide 'gnus-dbus) +;;; gnus-dbus.el ends here diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index ba8b91be5c..fe600f107c 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -31,6 +31,7 @@ (require 'gnus-range) (require 'gnus-util) (require 'gnus-cloud) +(require 'gnus-dbus) (autoload 'message-make-date "message") (autoload 'gnus-agent-read-servers-validate "gnus-agent") (autoload 'gnus-agent-save-local "gnus-agent") @@ -798,6 +799,8 @@ gnus-1 (gnus-run-hooks 'gnus-setup-news-hook) (when gnus-agent (gnus-request-create-group "queue" '(nndraft ""))) + (when gnus-dbus-close-on-sleep + (gnus-dbus-register-sleep-signal)) (gnus-start-draft-setup) ;; Generate the group buffer. (gnus-group-list-groups level) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index cecf4d4fb4..f615d49d27 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -292,6 +292,10 @@ gnus-fun :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) +(defgroup gnus-dbus nil + "D-Bus integration for Gnus." + :group 'gnus) + (defconst gnus-version-number "5.13" "Version number for this version of Gnus.") -- 2.28.0 --=-=-=-- From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Aug 2020 12:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.159818564923916 (code B ref 42977); Sun, 23 Aug 2020 12:28:01 +0000 Received: (at 42977) by debbugs.gnu.org; 23 Aug 2020 12:27:29 +0000 Received: from localhost ([127.0.0.1]:52244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9p5t-0006Dg-0s for submit@debbugs.gnu.org; Sun, 23 Aug 2020 08:27:29 -0400 Received: from quimby.gnus.org ([95.216.78.240]:46080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9p5q-0006DS-Vt for 42977@debbugs.gnu.org; Sun, 23 Aug 2020 08:27:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=K/BQ05Kfgw4zTry2NEK0H8NJngHt13f9iDOPtnMsQWc=; b=MnPP+moHya5F8VDvT9pD5LNV+5 rLWDN3bxyMqqjwRj+ePRMODm3A4m3E2Y9uEprK/wwakUTrjKKL1Wymigg8h095PV0AS5F64NERtai DPHnP7z6R69yTc6GBlpAwP4LBjS6Khz0s4GrvTqcZlMgqgmRijr1fIp7p1B3u2eGuldY=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k9p5i-0006Os-Ml; Sun, 23 Aug 2020 14:27:21 +0200 From: Lars Ingebrigtsen References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> <87y2m64l2e.fsf@ericabrahamsen.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEUeFBRcMCGqWTDZ lGD////llHMYAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+QIFwwVKcCiUM8AAAG9SURBVDjLbVSLscQg CBQrAGwgYAMv0n9vb1GT3I/J3CSufHaBK6UUSeOSRkIi5YfhhvovgIjryT+R0sZvQJp8ATOrd/vM 3iI9PManQwQn0M/1We/oEccEbOVwETwqSuuk953Cuw+HGTVKoJ2vXN2FKTQBeimWplI1uuHjm121 dizuHzzq8LxtGe3NrfoE8jrTm0puD/DmEkeWIDhUsec+r5xgytTd7mPZlYJW0b7quIvnSak4BFbb bXvhCqIRG0jiKwc06JAoVnZywRCQYBSQwlBAXYC6WGrJmaGGx7GKQTY1zZ4wYjakGDbLoWFueZp+ ANImUF0XkH6I6yOCVmuaWvZEJzs008cWS3XOcs42Wh19/E0Aoi3aQPE+XOOQBWzHCXT0v69qmejY AgCoYTrK5MfaeVeR4veRBCeAaa3rDQcg28saeIkTI3IBdYq/Qocz5OJL5rsJFH6qzzHMn2c5CUXU VGN2PpW/PY78tCSCp54PMITUJyCD6AGgGtqZ4cGCwff2sCJrPgs143uoyUzQ9r0uh5V2DagfJNeE UbtkgGFhKJm3XGQd90izWsqaa5ux3O6t2jdq5F7S/vf5B1KKMiP0fugcAAAAJXRFWHRkYXRlOmNy ZWF0ZQAyMDIwLTA4LTIzVDEyOjIxOjQxKzAwOjAwkAnczgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAy MC0wOC0yM1QxMjoyMTo0MSswMDowMOFUZHIAAAAASUVORK5CYII= X-Now-Playing: The Stooges's _The Stooges_: "We Will Fall" Date: Sun, 23 Aug 2020 14:27:17 +0200 In-Reply-To: <87y2m64l2e.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 22 Aug 2020 11:00:57 -0700") Message-ID: <87k0xpfsyi.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eric Abrahamsen 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 ru [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen 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 From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 17:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.159837742310971 (code B ref 42977); Tue, 25 Aug 2020 17:44:02 +0000 Received: (at 42977) by debbugs.gnu.org; 25 Aug 2020 17:43:43 +0000 Received: from localhost ([127.0.0.1]:35941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAcz0-0002qs-IL for submit@debbugs.gnu.org; Tue, 25 Aug 2020 13:43:42 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:53296 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAcyy-0002qd-2V for 42977@debbugs.gnu.org; Tue, 25 Aug 2020 13:43:41 -0400 Received: from localhost (75-172-112-137.tukw.qwest.net [75.172.112.137]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 211A1FA30C; Tue, 25 Aug 2020 17:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1598377414; bh=0XhyqW5E2bK9MqUHhitOrfhtxbDPTeNZnuKqZF8NDsk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=n/eQ1d3vPXL7Glg52R3vrT4SeBAxLroaTtmKKKbNa8a9fRy0k6FTz6OBbAi8Lo/yC DkJdCCnZCWOvpDdPIyGJItvr7kx19+ew27Ycq3Uw2lulCf95H19r296tJMsiX5DhaK 2gXUsZFm5e35OLuF2d0+DalawUhSKqRz/0UD+UzA= From: Eric Abrahamsen References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> <87y2m64l2e.fsf@ericabrahamsen.net> <87k0xpfsyi.fsf@gnus.org> Date: Tue, 25 Aug 2020 10:43:32 -0700 In-Reply-To: <87k0xpfsyi.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 23 Aug 2020 14:27:17 +0200") Message-ID: <87bliy4o57.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 08/23/20 14:27 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen 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 From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 19:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.15983833145078 (code B ref 42977); Tue, 25 Aug 2020 19:22:01 +0000 Received: (at 42977) by debbugs.gnu.org; 25 Aug 2020 19:21:54 +0000 Received: from localhost ([127.0.0.1]:36165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAeW2-0001Jq-4G for submit@debbugs.gnu.org; Tue, 25 Aug 2020 15:21:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:44938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAeVz-0001Jc-JX for 42977@debbugs.gnu.org; Tue, 25 Aug 2020 15:21:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gBs7YLJl+Xosz90o4D3IgFxQwz5ChZANr7NeLqD6Isk=; b=bOhVrzbump2J0w46hpiWctzAYq hTVmFS9SzEed7Z2kme/dO+vWQRkuuF88jaaittQ9pVwpeKXCDAd8JvT1hkGSyJNZZZP4uOOsYL1Im HK2QGbEaXSP6QGgrMM6sLAIFkhQEb2Y4gQB+lN/LqoYdWLwwdZc3F2abMhCG1Cn+Q29M=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAeVr-00010g-D9; Tue, 25 Aug 2020 21:21:46 +0200 From: Lars Ingebrigtsen References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> <87y2m64l2e.fsf@ericabrahamsen.net> <87k0xpfsyi.fsf@gnus.org> <87bliy4o57.fsf@ericabrahamsen.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEUBAgEnMS1UYls4 SkKcp514hnz///9NkLG6AAAAAWJLR0QGYWa4fQAAAAd0SU1FB+QIGRMLBz+Q8aEAAAF8SURBVDjL vZNBcoMwDEVJMt1jfAGQ0D6WcoBOxuxbat//Kv0Q7ISZtJNu+pmxwc/Slww0zX+p3T8etvloPb2P iT4uzWDHvqO3suHc9722PZ1a0nPnaNhA13+6i7qhG9qRqBtUNuADnTyRtNx47s50OlaztvlVBwet wzPgnoPg/PNUP3mEF0+qevp1MLMNECQxxplW5TxXkDPW43QDJAWoDC4thEpIieCDlyw53fZTmmoq 55W17JdYQSIODsVIXhXj1lfOREqmSJ6nRxABxjiniAqmKcodoM6J1rriiipYlGNR2gN6Bq4JNhLv 2sC0gjBeDW3w0ssG5EpsyhIzfNNEJaLxRgOAjnJFETtwYTKciZnuTtf57kvVNH55ZyrVAxHIg5gE L1xKcwU3KSnPLDKXCLu96IUwAmBWwCaCe6AlcQVwYGMKhqlDk3ewlMlmeFsBm+jBHJmNB7eyChZr LKN/3AFw+eBKUUscgFZQlmG1B4fyn59C69oXP/g/6Bv0wWzDJd3VcAAAABBlWElmSUkqAAgAAAAA AAAAAAAAAJw8uSgAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDgtMjVUMTk6MTE6MDcrMDA6MDBa KVdIAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTA4LTI1VDE5OjExOjA3KzAwOjAwK3Tv9AAAAABJ RU5ErkJggg== X-Now-Playing: Tuxedomoon's _Live in San Francisco (1979)_: "Volo Vivace" Date: Tue, 25 Aug 2020 21:21:42 +0200 In-Reply-To: <87bliy4o57.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 25 Aug 2020 10:43:32 -0700") Message-ID: <87o8my4jll.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eric Abrahamsen 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-cl [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen 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 From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 19:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.15983840176156 (code B ref 42977); Tue, 25 Aug 2020 19:34:01 +0000 Received: (at 42977) by debbugs.gnu.org; 25 Aug 2020 19:33:37 +0000 Received: from localhost ([127.0.0.1]:36170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAehN-0001bD-89 for submit@debbugs.gnu.org; Tue, 25 Aug 2020 15:33:37 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:56978 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAehL-0001az-0M for 42977@debbugs.gnu.org; Tue, 25 Aug 2020 15:33:36 -0400 Received: from localhost (75-172-112-137.tukw.qwest.net [75.172.112.137]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id EF423FA30C; Tue, 25 Aug 2020 19:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1598384008; bh=GnhjoXiDZ+forzaufQkk/5K3Le187Ws1ToOhrQiW8Mo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=NY7EwGMiJpztZ5dFIFXUMVzq27inNnY3LwDLmEhhV9LZC173JHLje+8wd5SE6YNEa l0HHiQntpntmkOLWUmTxYZhzVvMTbHp/gRI8ATUn4+uhcUxP1SYRgn35TKrhunZSRR 70R0FLfmPPY7btSm2OGrw++d/wX00RDWn2y/SS8A= From: Eric Abrahamsen References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> <87y2m64l2e.fsf@ericabrahamsen.net> <87k0xpfsyi.fsf@gnus.org> <87bliy4o57.fsf@ericabrahamsen.net> <87o8my4jll.fsf@gnus.org> Date: Tue, 25 Aug 2020 12:33:26 -0700 In-Reply-To: <87o8my4jll.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 25 Aug 2020 21:21:42 +0200") Message-ID: <87mu2i34hl.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 08/25/20 21:21 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen 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. From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 19:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.15983842516493 (code B ref 42977); Tue, 25 Aug 2020 19:38:02 +0000 Received: (at 42977) by debbugs.gnu.org; 25 Aug 2020 19:37:31 +0000 Received: from localhost ([127.0.0.1]:36174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAel8-0001gf-Ow for submit@debbugs.gnu.org; Tue, 25 Aug 2020 15:37:30 -0400 Received: from quimby.gnus.org ([95.216.78.240]:45480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAel7-0001gS-57 for 42977@debbugs.gnu.org; Tue, 25 Aug 2020 15:37:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ROVpQa9l0FSepGGq+V7gTgdylB4VQ6J2t4y2ddaMd2E=; b=q2l1K5ytoVHxdtASNoDOWD9SWx Bd6etBJ0DcQWPRrsfFvmNTaHRyzDU64LediTqAljq+vTq/XnQu0OT+Vj9zXK3eGJ1lNUdkBB0l2lU N6GWeJpc4z+aUMw3zleLiSyZlMvfCr2BIXNxMlha4tjyycJXRmfLXG91u+TH1lDTSz/c=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAekw-0001Ce-H2; Tue, 25 Aug 2020 21:37:22 +0200 From: Lars Ingebrigtsen References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> <87y2m64l2e.fsf@ericabrahamsen.net> <87k0xpfsyi.fsf@gnus.org> <87bliy4o57.fsf@ericabrahamsen.net> <87o8my4jll.fsf@gnus.org> <87mu2i34hl.fsf@ericabrahamsen.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEUBAgEnMS1UYls4 SkKcp514hnz///9NkLG6AAAAAWJLR0QGYWa4fQAAAAd0SU1FB+QIGRMLBz+Q8aEAAAF8SURBVDjL vZNBcoMwDEVJMt1jfAGQ0D6WcoBOxuxbat//Kv0Q7ISZtJNu+pmxwc/Slww0zX+p3T8etvloPb2P iT4uzWDHvqO3suHc9722PZ1a0nPnaNhA13+6i7qhG9qRqBtUNuADnTyRtNx47s50OlaztvlVBwet wzPgnoPg/PNUP3mEF0+qevp1MLMNECQxxplW5TxXkDPW43QDJAWoDC4thEpIieCDlyw53fZTmmoq 55W17JdYQSIODsVIXhXj1lfOREqmSJ6nRxABxjiniAqmKcodoM6J1rriiipYlGNR2gN6Bq4JNhLv 2sC0gjBeDW3w0ssG5EpsyhIzfNNEJaLxRgOAjnJFETtwYTKciZnuTtf57kvVNH55ZyrVAxHIg5gE L1xKcwU3KSnPLDKXCLu96IUwAmBWwCaCe6AlcQVwYGMKhqlDk3ewlMlmeFsBm+jBHJmNB7eyChZr LKN/3AFw+eBKUUscgFZQlmG1B4fyn59C69oXP/g/6Bv0wWzDJd3VcAAAABBlWElmSUkqAAgAAAAA AAAAAAAAAJw8uSgAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDgtMjVUMTk6MTE6MDcrMDA6MDBa KVdIAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTA4LTI1VDE5OjExOjA3KzAwOjAwK3Tv9AAAAABJ RU5ErkJggg== X-Now-Playing: Tuxedomoon's _Live in San Francisco (1979)_: "(Special Treatment For The) Family Man" Date: Tue, 25 Aug 2020 21:37:16 +0200 In-Reply-To: <87mu2i34hl.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 25 Aug 2020 12:33:26 -0700") Message-ID: <87k0xm4ivn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eric Abrahamsen 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. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen 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 From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Aug 2020 01:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.159849119022753 (code B ref 42977); Thu, 27 Aug 2020 01:20:02 +0000 Received: (at 42977) by debbugs.gnu.org; 27 Aug 2020 01:19:50 +0000 Received: from localhost ([127.0.0.1]:41174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kB6Zx-0005uv-RJ for submit@debbugs.gnu.org; Wed, 26 Aug 2020 21:19:50 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:47604 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kB6Zs-0005ue-NY for 42977@debbugs.gnu.org; Wed, 26 Aug 2020 21:19:48 -0400 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 308B7FA30C; Thu, 27 Aug 2020 01:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1598491178; bh=lEQX7MTmnEdW3bY2a8DfHcbiFbKYJ/OJuieclM9EqGM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=cMVVqT4M+e5ekYVbu4g+ZD0twZ3dXyrZl5rwZ21q+AkN64puE7xGsDjlSGWdd2NFs Encbz6PwjUj0hvvVfBL2SAVQvEkNBvWelGwROHl8+pW4/R3KRzeG9MampoAY9BD6in gduNhkQ9VxkU/dxFKTU81HrxUdPVkpGQddXcEhnE= From: Eric Abrahamsen References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> <87y2m64l2e.fsf@ericabrahamsen.net> <87k0xpfsyi.fsf@gnus.org> <87bliy4o57.fsf@ericabrahamsen.net> <87o8my4jll.fsf@gnus.org> <87mu2i34hl.fsf@ericabrahamsen.net> <87k0xm4ivn.fsf@gnus.org> Date: Wed, 26 Aug 2020 18:19:32 -0700 In-Reply-To: <87k0xm4ivn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 25 Aug 2020 21:37:16 +0200") Message-ID: <877dtkzxzv.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain On 08/25/20 21:37 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=close-gnus-servers.diff 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." --=-=-=-- From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Aug 2020 13:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eric Abrahamsen Cc: 42977@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.15985354459844 (code B ref 42977); Thu, 27 Aug 2020 13:38:01 +0000 Received: (at 42977) by debbugs.gnu.org; 27 Aug 2020 13:37:25 +0000 Received: from localhost ([127.0.0.1]:42149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBI5l-0002Yi-J5 for submit@debbugs.gnu.org; Thu, 27 Aug 2020 09:37:25 -0400 Received: from quimby.gnus.org ([95.216.78.240]:37960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBI5j-0002YV-RW for 42977@debbugs.gnu.org; Thu, 27 Aug 2020 09:37:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/IdWPGZbz4T+WFU3qnnz+T6cw0SPBT9rBIhzEgwOlVE=; b=iILZBZA3J7X5yTwn6N+BlM5TiB QqWBUYuzl6g/NRKKPv24u9LLJFRj6uoiTpkAWFFx34flU2OdQArgJo3wqlmszG64GMzHN7rFHsQmV /AgvvtaAFW8pOx2RxIne4UWwPQgNuAhZ6HkPHRslogEQUMF1HwtxbjdzPQxMICEPxtwU=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBI5b-0003DG-D9; Thu, 27 Aug 2020 15:37:18 +0200 From: Lars Ingebrigtsen References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> <87y2m64l2e.fsf@ericabrahamsen.net> <87k0xpfsyi.fsf@gnus.org> <87bliy4o57.fsf@ericabrahamsen.net> <87o8my4jll.fsf@gnus.org> <87mu2i34hl.fsf@ericabrahamsen.net> <87k0xm4ivn.fsf@gnus.org> <877dtkzxzv.fsf@ericabrahamsen.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXFuZpoXF3Am2OU cEH///9sZGuXAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+QIGww7AMPBfjcAAAFxSURBVDjLtZPrkcMw CISxKgimAT0aCNB/b7cgJbY8dz9Pk5kkfGYXEKaD6EV/nL/AQf8GClEt/cLv78/eS+/fko7XJzrP F+g5dcoDFBWqCSoloz59DpePM9RqAHzhnyrXeLjQ0krg5upq8XBZFVQy7y4qrgxQIhlyEziAM/O5 HBIQufhgWWCdmsChkkdmrEQCACMu+CwwW69oCQGHkMhYcyvZRQBPIesT1NUlgKZSH9ekaQIPqTOU HyCMlbUZn+22GBl39sbtre11AQ0iYk1aP5QvEFFkKI5xO25SLuHAOk54lJuUex+CEecK3EpGsYaK zWuAegcGBza3viWEFIpVeReiDXjMHXPMi733jpjHOEZe3gOU9eQTWLdI6mUDUW74WI0l2TPG8Gm0 AYQGmiixa+Uh5dFd3OkOJIXM1hJfAIMaUqf8BrC2yGJ+1hsN5jaqPIYoc1gyJ3P3iPlmnm0AFy6/ AiQgqtPpAdaN4G17X+4/4FBLfdXAE18AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDgtMjdUMTI6 NTg6NTkrMDA6MDBuU+D5AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTA4LTI3VDEyOjU4OjU5KzAw OjAwHw5YRQAAAABJRU5ErkJggg== X-Now-Playing: Jim Black Trio's _Reckon_: "What You Are Made From" Date: Thu, 27 Aug 2020 15:37:14 +0200 In-Reply-To: <877dtkzxzv.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 26 Aug 2020 18:19:32 -0700") Message-ID: <87d03cw6ph.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eric Abrahamsen 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 p [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen 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 From unknown Sun Jun 22 22:46:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration In-Reply-To: <87imdb6884.fsf@ericabrahamsen.net> Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Aug 2020 21:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 42977@debbugs.gnu.org, 42977-done@debbugs.gnu.org Received: via spool by 42977-submit@debbugs.gnu.org id=B42977.15985632429706 (code B ref 42977); Thu, 27 Aug 2020 21:21:02 +0000 Received: (at 42977) by debbugs.gnu.org; 27 Aug 2020 21:20:42 +0000 Received: from localhost ([127.0.0.1]:44315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBPK5-0002WU-Vt for submit@debbugs.gnu.org; Thu, 27 Aug 2020 17:20:42 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:43358 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBPJz-0002W2-69; Thu, 27 Aug 2020 17:20:36 -0400 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 58FBDFA07E; Thu, 27 Aug 2020 21:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1598563228; bh=MZ09bAkhdijkdcf7uYkK8tQSIu8pH8v4snfITu4p6TY=; h=From:To:Cc:Subject:References:Date:From; b=gBPGoyqAERhqdd76/2VmJDmMydjeLWiePTCEDK2Ws3VVLcseqUi8X86Z42BzQwVlo hkWtEBveZ3N2mI93GC6HSIHLFyKjJl5Qz+uq3liW2vFNb1zfY2UEbVO1yqHF41Yz2T d0QgWa0e2lGCfaC3ExNRGyIC0/IcTjbURIk/qfsw= From: Eric Abrahamsen References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> <87y2m64l2e.fsf@ericabrahamsen.net> <87k0xpfsyi.fsf@gnus.org> <87bliy4o57.fsf@ericabrahamsen.net> <87o8my4jll.fsf@gnus.org> <87mu2i34hl.fsf@ericabrahamsen.net> <87k0xm4ivn.fsf@gnus.org> <877dtkzxzv.fsf@ericabrahamsen.net> <87d03cw6ph.fsf@gnus.org> Date: Thu, 27 Aug 2020 14:20:26 -0700 Message-ID: <87y2lzg50l.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > Eric Abrahamsen 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 From unknown Sun Jun 22 22:46:57 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Eric Abrahamsen Subject: bug#42977: closed (Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration) Message-ID: References: <87y2lzg50l.fsf@ericabrahamsen.net> <87imdb6884.fsf@ericabrahamsen.net> X-Gnu-PR-Message: they-closed 42977 X-Gnu-PR-Package: emacs Reply-To: 42977@debbugs.gnu.org Date: Thu, 27 Aug 2020 21:21:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1598563262-9769-1" This is a multi-part message in MIME format... ------------=_1598563262-9769-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus int= egration which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 42977@debbugs.gnu.org. --=20 42977: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D42977 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1598563262-9769-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 42977-done) by debbugs.gnu.org; 27 Aug 2020 21:20:37 +0000 Received: from localhost ([127.0.0.1]:44313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBPK0-0002WI-Pb for submit@debbugs.gnu.org; Thu, 27 Aug 2020 17:20:36 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:43358 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBPJz-0002W2-69; Thu, 27 Aug 2020 17:20:36 -0400 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 58FBDFA07E; Thu, 27 Aug 2020 21:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1598563228; bh=MZ09bAkhdijkdcf7uYkK8tQSIu8pH8v4snfITu4p6TY=; h=From:To:Cc:Subject:References:Date:From; b=gBPGoyqAERhqdd76/2VmJDmMydjeLWiePTCEDK2Ws3VVLcseqUi8X86Z42BzQwVlo hkWtEBveZ3N2mI93GC6HSIHLFyKjJl5Qz+uq3liW2vFNb1zfY2UEbVO1yqHF41Yz2T d0QgWa0e2lGCfaC3ExNRGyIC0/IcTjbURIk/qfsw= From: Eric Abrahamsen To: Lars Ingebrigtsen Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration References: <87imdb6884.fsf@ericabrahamsen.net> <87a6ymn5vy.fsf@gnus.org> <87y2m64l2e.fsf@ericabrahamsen.net> <87k0xpfsyi.fsf@gnus.org> <87bliy4o57.fsf@ericabrahamsen.net> <87o8my4jll.fsf@gnus.org> <87mu2i34hl.fsf@ericabrahamsen.net> <87k0xm4ivn.fsf@gnus.org> <877dtkzxzv.fsf@ericabrahamsen.net> <87d03cw6ph.fsf@gnus.org> Date: Thu, 27 Aug 2020 14:20:26 -0700 Message-ID: <87y2lzg50l.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 42977-done Cc: 42977@debbugs.gnu.org, 42977-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > Eric Abrahamsen 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 ------------=_1598563262-9769-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Aug 2020 20:43:24 +0000 Received: from localhost ([127.0.0.1]:48357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9Dsi-0006Dm-8t for submit@debbugs.gnu.org; Fri, 21 Aug 2020 16:43:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:39948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9Dsf-0006Dd-81 for submit@debbugs.gnu.org; Fri, 21 Aug 2020 16:43:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9Dse-0008Ap-Tj for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2020 16:43:21 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:33750 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9Dsc-00005n-OP for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2020 16:43:20 -0400 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id ED7F1FA30C for ; Fri, 21 Aug 2020 20:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1598042590; bh=EPiPQ5sZSlA29+mgpPwuMXnDN1n9wmgAQcZ3N4+tfNA=; h=From:To:Subject:Date:From; b=Pbu3xGCb5EW8YtOf3ryAY+MRRpzgchfuX8or4mENPBqmayUsQmOtHJG81L5koF3WG ssss4oNWl7svN1hXd0lDzeKTSJ/EftVESZ4+aP+Rd+yzZ2vzAA5hueKn+gKMc3Z68C SYGR72YFEHT9nsrZEj8z7rr+yeoxZpNBoxjKM6/M= From: Eric Abrahamsen To: bug-gnu-emacs@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-ID: <87imdb6884.fsf@ericabrahamsen.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/21 16:43:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-basic-D-Bus-integration-to-Gnus.patch >From 414051f4fb7d60a6674b7267dc7f73025ddb1a3b Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Fri, 21 Aug 2020 13:36:58 -0700 Subject: [PATCH] Add basic D-Bus integration to Gnus * lisp/gnus/gnus-dbus.el: New library, registering a signal that closes all Gnus servers when the system is going to sleep. * lisp/gnus/gnus-start.el: Check new option `gnus-dbus-close-on-sleep', and register the appropriate D-Bus signal if it is non-nil. * lisp/gnus/gnus.el: New gnus-dbus customization group. --- lisp/gnus/gnus-dbus.el | 66 +++++++++++++++++++++++++++++++++++++++++ lisp/gnus/gnus-start.el | 3 ++ lisp/gnus/gnus.el | 4 +++ 3 files changed, 73 insertions(+) create mode 100644 lisp/gnus/gnus-dbus.el diff --git a/lisp/gnus/gnus-dbus.el b/lisp/gnus/gnus-dbus.el new file mode 100644 index 0000000000..14f0abb6be --- /dev/null +++ b/lisp/gnus/gnus-dbus.el @@ -0,0 +1,66 @@ +;;; gnus-dbus.el --- DBUS integration for Gnus -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Eric Abrahamsen + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This library contains some Gnus integration for systems using DBUS. +;; At present it registers a signal to close all Gnus servers before +;; system sleep or hibernation. + +;;; Code: + +(require 'dbus) + +(defcustom gnus-dbus-close-on-sleep nil + "When non-nil, close Gnus servers on system sleep." + :group 'gnus-dbus + :type 'boolean) + +(defvar gnus-dbus-sleep-registration-object nil + "Object returned from `dbus-register-signal'. +Used to unregistering the signal.") + +(defun gnus-dbus-register-sleep-signal () + "Use `dbus-register-signal' to close servers on sleep." + (when (featurep 'dbusbind) + (setq gnus-dbus-sleep-registration-object + (dbus-register-signal :system + "org.freedesktop.login1" + "/org/freedesktop/login1" + "org.freedesktop.login1.Manager" + "PrepareForSleep" + #'gnus-dbus-sleep-handler)) + (gnus-add-shutdown #'gnus-dbus-unregister-sleep-signal 'gnus))) + +(defun gnus-dbus-sleep-handler (sleep-start) + ;; Sleep-start is t before sleeping. + (when (and sleep-start + (gnus-alive-p)) + (condition-case nil + (gnus-close-all-servers) + (error nil)))) + +(defun gnus-dbus-unregister-sleep-signal () + (condition-case nil + (dbus-unregister-object + gnus-dbus-sleep-registration-object) + (wrong-type-argument nil))) + +(provide 'gnus-dbus) +;;; gnus-dbus.el ends here diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index ba8b91be5c..fe600f107c 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -31,6 +31,7 @@ (require 'gnus-range) (require 'gnus-util) (require 'gnus-cloud) +(require 'gnus-dbus) (autoload 'message-make-date "message") (autoload 'gnus-agent-read-servers-validate "gnus-agent") (autoload 'gnus-agent-save-local "gnus-agent") @@ -798,6 +799,8 @@ gnus-1 (gnus-run-hooks 'gnus-setup-news-hook) (when gnus-agent (gnus-request-create-group "queue" '(nndraft ""))) + (when gnus-dbus-close-on-sleep + (gnus-dbus-register-sleep-signal)) (gnus-start-draft-setup) ;; Generate the group buffer. (gnus-group-list-groups level) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index cecf4d4fb4..f615d49d27 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -292,6 +292,10 @@ gnus-fun :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) +(defgroup gnus-dbus nil + "D-Bus integration for Gnus." + :group 'gnus) + (defconst gnus-version-number "5.13" "Version number for this version of Gnus.") -- 2.28.0 --=-=-=-- ------------=_1598563262-9769-1--