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: Mon, 07 Jun 2010 17:17:34 +0200 Message-ID: References: <1275757657-15244-1-git-send-email-julien@danjou.info> <87ljar3uug.fsf@gmx.de> 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 1275944987 9682 80.91.229.12 (7 Jun 2010 21:09:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Jun 2010 21:09:47 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 07 23:09:45 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 1OLjZo-0004mi-K8 for ged-emacs-devel@m.gmane.org; Mon, 07 Jun 2010 23:09:44 +0200 Original-Received: from localhost ([127.0.0.1]:49176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLjZn-0003xG-TT for ged-emacs-devel@m.gmane.org; Mon, 07 Jun 2010 17:09:44 -0400 Original-Received: from [140.186.70.92] (port=33071 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLe5A-0003e9-1C for emacs-devel@gnu.org; Mon, 07 Jun 2010 11:17:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLe58-00032Z-3I for emacs-devel@gnu.org; Mon, 07 Jun 2010 11:17:43 -0400 Original-Received: from coquelicot-s.easter-eggs.com ([213.215.37.94]:57984) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLe57-00031o-UQ for emacs-devel@gnu.org; Mon, 07 Jun 2010 11:17:42 -0400 Original-Received: from cigue.easter-eggs.fr (cigue.easter-eggs.fr [10.0.0.33]) by rose.easter-eggs.fr (Postfix) with ESMTPS id 1ABB31402D; Mon, 7 Jun 2010 17:17:34 +0200 (CEST) Original-Received: from jdanjou by cigue.easter-eggs.fr with local (Exim 4.72) (envelope-from ) id 1OLe55-0005Yz-JV; Mon, 07 Jun 2010 17:17:39 +0200 In-Reply-To: <87ljar3uug.fsf@gmx.de> (Michael Albinus's message of "Mon, 07 Jun 2010 14:12:07 +0200") 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, 2) X-Mailman-Approved-At: Mon, 07 Jun 2010 17:09:07 -0400 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:125612 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Jun 07 2010, Michael Albinus wrote: > You should require 'cl when byte-compiling, due to the `case' macro. Thanks, added. >> +(defun notifications-notify (&rest params) >> + "Send notification via D-Bus using the Freedesktop notification proto= col. >> +Various PARAMS can be set: >> + >> + :title The notification title. >> + :body The notification body text. > > You might mention, that these are mandatory parameters. Check the effect = of > > (notifications-notify :urgency "low") They are not mandatory, even if it's weird. It works fine here, even if the text is blank. >> + :app-icon The notification icon. > > If not given, you could apply a default value. A good value might be > > (expand-file-name "images/icons/hicolor/scalable/apps/emacs.svg" data-dir= ectory) Good idea, thanks. Added. > I would call this parameter :actions, because you allow several actions > in that list. Or you allow multiple :action parameters, and concat them. > > I would also be more descriptive, with examples. > > And I would explain, that the action identifier "default" has a special > meaning. Try for effect > > (notifications-notify :title "title" :body "body" :urgency "low" > :action '("default" "")) Enhanced in that way. >> + :timeout The timeout time in milliseconds since the display >> + of the notification at which the notification should >> + automatically close. >> + If -1, the notification's expiration time is dependent >> + on the notification server's settings, and may vary for >> + the type of notification (default). >> + If 0, the notification never expires. > > You might mention, that -1 is the default value. Well, it is mentionned but since you did not saw that, I modified the help. > All of them are hints. If none of them is given, you get a D-Bus error, t= ry > > (notifications-notify) > > This is because you initialize your `hints' variable as '(:array). If no > hint is given, you cannot pass it to `dbus-call-method' as such. You > must pass '(:array :signature "{sv}") as empty hint. I did not have any error, but well, I fixed it anyway. > I also propose to add the handling of the "NotificationClosed" and > "ActionInvoked" signals. This could be done by adding a callback > function to `notifications-notify'. That's clearly bonus, but added. :-) Feel free to comment, I'm still new at this. =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) iEYEARECAAYFAkwNDY4ACgkQpGK1HsL+5c3jCgCeIAwuBlwBY0FXPPjLC881nyTB BbwAoNWDcWoxDFOrJ8BWGa5QKYiltUem =HI3T -----END PGP SIGNATURE----- --=-=-=--