From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add notifications.el Date: Wed, 09 Jun 2010 22:58:06 +0200 Message-ID: <87631rzzxd.fsf@keller.adm.naquadah.org> References: <1275757657-15244-1-git-send-email-julien@danjou.info> <201006092018.10163.tassilo@member.fsf.org> <87ocfkkpgg.fsf@keller.adm.naquadah.org> <201006092116.46374.tassilo@member.fsf.org> <87ljaoyom4.fsf@keller.adm.naquadah.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1276117109 2510 80.91.229.12 (9 Jun 2010 20:58:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Jun 2010 20:58:29 +0000 (UTC) Cc: Tassilo Horn , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 09 22:58:27 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OMSLy-0005j9-JI for ged-emacs-devel@m.gmane.org; Wed, 09 Jun 2010 22:58:26 +0200 Original-Received: from localhost ([127.0.0.1]:42633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMSLy-0002LP-2h for ged-emacs-devel@m.gmane.org; Wed, 09 Jun 2010 16:58:26 -0400 Original-Received: from [140.186.70.92] (port=36722 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMSLl-0002IG-JL for emacs-devel@gnu.org; Wed, 09 Jun 2010 16:58:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMSLk-000221-7T for emacs-devel@gnu.org; Wed, 09 Jun 2010 16:58:13 -0400 Original-Received: from prometheus.naquadah.org ([212.85.154.174]:33640 helo=mx1.naquadah.org) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMSLj-00021r-T4 for emacs-devel@gnu.org; Wed, 09 Jun 2010 16:58:12 -0400 Original-Received: by mx1.naquadah.org (Postfix, from userid 8) id 464745C130; Wed, 9 Jun 2010 22:58:09 +0200 (CEST) Original-Received: from keller.adm.naquadah.org (chapai.naquadah.org [82.227.158.144]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.naquadah.org (Postfix) with ESMTPSA id CC9855C123; Wed, 9 Jun 2010 22:58:06 +0200 (CEST) Original-Received: from jd by keller.adm.naquadah.org with local (Exim 4.72) (envelope-from ) id 1OMSLe-00040i-An; Wed, 09 Jun 2010 22:58:06 +0200 In-Reply-To: (Stefan Monnier's message of "Wed, 09 Jun 2010 16:39:33 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125688 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= On Wed, Jun 09 2010, Stefan Monnier wrote: > Just so I understand better the trade-off: what would it take to pass > `id' to the on-close function? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Passes-notification-id-as-argument-of-on-action-and-.patch Content-Transfer-Encoding: quoted-printable From=2056b9ff8b24c5d762190701e7bf2bb6cc0e4937a8 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 9 Jun 2010 22:57:18 +0200 Subject: [PATCH] Passes notification id as argument of on-action and on-clo= se functions Signed-off-by: Julien Danjou =2D-- lisp/net/notifications.el | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/net/notifications.el b/lisp/net/notifications.el index a2147ed..8d897eb 100644 =2D-- a/lisp/net/notifications.el +++ b/lisp/net/notifications.el @@ -87,7 +87,7 @@ (defun notifications-on-action-signal (id action) (let ((entry (assoc id notifications-on-action-map))) (when entry =2D (funcall (cadr entry) action) + (funcall (cadr entry) id action) (remove entry 'notifications-on-action-map)))) =20 (dbus-register-signal @@ -101,7 +101,7 @@ (defun notifications-on-closed-signal (id reason) (let ((entry (assoc id notifications-on-close-map))) (when entry =2D (funcall (cadr entry) (cadr (assoc reason notifications-closed-rea= son))) + (funcall (cadr entry) id (cadr (assoc reason notifications-closed-re= ason))) (remove entry 'notifications-on-close-map)))) =20 (dbus-register-signal @@ -153,11 +153,13 @@ Various PARAMS can be set: should point to. The \"y\" hint must also be specified. :y Specifies the Y location on the screen that the notificat= ion should point to. The \"x\" hint must also be specified. =2D :on-action Function to call when an action is invoked. The key of = the =2D action is passed as argument to the function. + :on-action Function to call when an action is invoked. + The notification id and the key of the action are passed + as arguments to the function. :on-close Function to call when the notification has been closed by timeout or by the user. =2D The function receive the closing reason as argument: + The function receive the notification id and the closing + reason as arguments: - `expired' if the notification has expired - `dismissed' if the notification was dismissed by the = user - `close-notification' if the notification was closed =2D-=20 1.7.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =2D-=20 Julien Danjou // =E1=90=B0 http://julien.danjou.info --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkwQAF4ACgkQpGK1HsL+5c23fQCfW1ikANKO+MZoGWG4rimoDiOe 39MAoMJDpUZadOv1W/DvftsJ/7gmdE3f =yDCn -----END PGP SIGNATURE----- --==-=-=--