From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Peter_M=C3=BCnster?= Newsgroups: gmane.emacs.help Subject: Re: notifications-notify resets idle-time Date: Sun, 04 Mar 2012 22:24:14 +0100 Message-ID: <87fwdogiv5.fsf@micropit.couberia.bzh> References: <874nuy5okw.fsf@micropit.couberia.bzh> <87wr7tr8um.fsf@gmx.de> <87obt5siph.fsf@micropit.couberia.bzh> <87wr7t5ys8.fsf@gmx.de> <87hayxsfbo.fsf@micropit.couberia.bzh> <87sjih2wdo.fsf@gmx.de> <87mx8p5nqa.fsf@micropit.couberia.bzh> <87obt5mgc8.fsf@gmx.de> <87fweh5gw4.fsf@micropit.couberia.bzh> <87fwegv2c1.fsf@gmx.de> <877gzs5mw1.fsf@micropit.couberia.bzh> <87bop4uut0.fsf@gmx.de> <87lio7okjw.fsf@micropit.couberia.bzh> <87sjif21m2.fsf@gmx.de> <874nuvi1bl.fsf@micropit.couberia.bzh> <87lio7j6g3.fsf@gmx.de> <87ehtyhh8d.fsf@micropit.couberia.bzh> <87hayuk7jn.fsf@gmx.de> <87pqdie396.fsf@micropit.couberia.bzh> <87k43pycii.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1330896279 10548 80.91.229.3 (4 Mar 2012 21:24:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 4 Mar 2012 21:24:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 04 22:24:38 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S4Iv0-0006ch-CD for geh-help-gnu-emacs@m.gmane.org; Sun, 04 Mar 2012 22:24:38 +0100 Original-Received: from localhost ([::1]:48101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4Iuz-0003KY-MX for geh-help-gnu-emacs@m.gmane.org; Sun, 04 Mar 2012 16:24:37 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4Iut-0003KH-Nb for help-gnu-emacs@gnu.org; Sun, 04 Mar 2012 16:24:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4Iur-000677-FL for help-gnu-emacs@gnu.org; Sun, 04 Mar 2012 16:24:31 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:60449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4Iur-000670-4U for help-gnu-emacs@gnu.org; Sun, 04 Mar 2012 16:24:29 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S4Iul-0006Wz-IV for help-gnu-emacs@gnu.org; Sun, 04 Mar 2012 22:24:23 +0100 Original-Received: from arennes-359-1-186-119.w2-2.abo.wanadoo.fr ([2.2.49.119]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 04 Mar 2012 22:24:23 +0100 Original-Received: from pmlists by arennes-359-1-186-119.w2-2.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 04 Mar 2012 22:24:23 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 93 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: arennes-359-1-186-119.w2-2.abo.wanadoo.fr User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:3tLQ8qsE5SYrVUXbnrNvyP+Ako4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83934 Archived-At: On Tue, Feb 14 2012, Michael Albinus wrote: >>> Wouldn't it suffice just to deregister signal "NotificationClosed"? >> >> How? With dbus-unregister-service? > > Yes. It seems, that I rather need dbus-unregister-object, because I only want to unregister the closed-signal, not the action-signal. So I patched notifications.el: --8<---------------cut here---------------start------------->8--- --- notifications.el~ 2012-03-04 22:00:27.851590759 +0100 +++ notifications.el 2012-03-04 22:00:43.625016422 +0100 @@ -96,6 +96,12 @@ This must be kept, because the notification daemon could be restarted, and the registered signals cannot be identified anymore.") +(defvar notifications-action-signal-object nil + "Object of the registration of the action signal.") + +(defvar notifications-closed-signal-object nil + "Object of the registration of the closed signal.") + (defun notifications-on-action-signal (id action) "Dispatch signals to callback functions from `notifications-on-action-map'." (let ((entry (assoc id notifications-on-action-map))) @@ -106,13 +112,14 @@ (remove entry 'notifications-on-action-map)))) (when (fboundp 'dbus-register-signal) - (dbus-register-signal - :session - nil - notifications-path - notifications-interface - notifications-action-signal - 'notifications-on-action-signal)) + (setq notifications-action-signal-object + (dbus-register-signal + :session + nil + notifications-path + notifications-interface + notifications-action-signal + 'notifications-on-action-signal))) (defun notifications-on-closed-signal (id &optional reason) "Dispatch signals to callback functions from `notifications-on-closed-map'." @@ -128,13 +135,14 @@ (remove entry 'notifications-on-close-map)))) (when (fboundp 'dbus-register-signal) - (dbus-register-signal - :session - nil - notifications-path - notifications-interface - notifications-closed-signal - 'notifications-on-closed-signal)) + (setq notifications-closed-signal-object + (dbus-register-signal + :session + nil + notifications-path + notifications-interface + notifications-closed-signal + 'notifications-on-closed-signal))) (defun notifications-notify (&rest params) "Send notification via D-Bus using the Freedesktop notification protocol. --8<---------------cut here---------------end--------------->8--- And in my init.el I do now: --8<---------------cut here---------------start------------->8--- (require 'notifications) (dbus-unregister-object notifications-closed-signal-object) --8<---------------cut here---------------end--------------->8--- > I have played with the other woraround option, reusing the notification > window. The following code snippet, based on your initial example, shall > give you an idea: I understand: instead of closing the window, you replace it by another and no event is sent to emacs. But it does not really fit my needs: Now I use https://github.com/p-m/org-notify with a personal setup that opens notification pop-ups once per minute with a timeout of 10 seconds for example. -- Peter