From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.help Subject: Re: notifications-notify resets idle-time Date: Tue, 14 Feb 2012 10:45:09 +0100 Message-ID: <87k43pycii.fsf@gmx.de> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1329212739 32138 80.91.229.3 (14 Feb 2012 09:45:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2012 09:45:39 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Peter =?utf-8?Q?M=C3=BCnster?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 14 10:45:38 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RxEx7-0004UP-IZ for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Feb 2012 10:45:37 +0100 Original-Received: from localhost ([::1]:34240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxEx5-0002Ti-D8 for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Feb 2012 04:45:35 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxEwz-0002Rr-7v for help-gnu-emacs@gnu.org; Tue, 14 Feb 2012 04:45:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxEwt-0006xS-9Q for help-gnu-emacs@gnu.org; Tue, 14 Feb 2012 04:45:29 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:56930) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RxEws-0006xC-Tv for help-gnu-emacs@gnu.org; Tue, 14 Feb 2012 04:45:23 -0500 Original-Received: (qmail invoked by alias); 14 Feb 2012 09:45:20 -0000 Original-Received: from p57BB9624.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.150.36] by mail.gmx.net (mp004) with SMTP; 14 Feb 2012 10:45:20 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1/FHKkKz1rFdL1nrDuhcx6YAMnnu+oAzMLmC7Whz5 wEnTaX1DEd15XK In-Reply-To: <87pqdie396.fsf@micropit.couberia.bzh> ("Peter \=\?utf-8\?Q\?M\?\= \=\?utf-8\?Q\?\=C3\=BCnster\=22's\?\= message of "Tue, 14 Feb 2012 00:13:09 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 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:83745 Archived-At: Peter M=C3=BCnster writes: >> One idea would be to add a property `dont-reset-idle-time' to an >> incoming event. Per default it is nil, and the timer is reset. But if >> this property exists non-nil, the timer isn't reset. > > It should depend on the reason (second argument of signal), because when > the user presses the mouse button, he is not idle. Expiration can happen > without user action. It is not possible to check arguments of an incoming D-Bus signal. The signal is just put into the event queue. Arguments are inspected when the event is handled by the respective handler, which is much too late for the idle-time reset. >> Wouldn't it suffice just to deregister signal "NotificationClosed"? > > How? With dbus-unregister-service? Yes. 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: --8<---------------cut here---------------start------------->8--- (require 'notifications) (defvar msg-id nil) (defvar counter 0) (defun my-test () (setq counter (1+ counter) msg-id (apply 'notifications-notify :title (format "%d" (or msg-id 0)) :body (format "%d" counter) :timeout 0 (if msg-id `(:replaces-id ,msg-id) '(:on-close (lambda (&rest ignore) (setq msg-id nil)))))) (message (format "idle: %d" (if (current-idle-time) (cadr (current-idle-time)) 0)))) (run-with-timer 5 5 'my-test) --8<---------------cut here---------------end--------------->8--- > Thanks for your efforts, Best regards, Michael.