From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add notifications.el Date: Mon, 07 Jun 2010 14:12:07 +0200 Message-ID: <87ljar3uug.fsf@gmx.de> References: <1275757657-15244-1-git-send-email-julien@danjou.info> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1275912754 5591 80.91.229.12 (7 Jun 2010 12:12:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Jun 2010 12:12:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Julien Danjou Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 07 14:12:32 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 1OLbBv-0006lu-6k for ged-emacs-devel@m.gmane.org; Mon, 07 Jun 2010 14:12:31 +0200 Original-Received: from localhost ([127.0.0.1]:48499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLbBu-0000TD-69 for ged-emacs-devel@m.gmane.org; Mon, 07 Jun 2010 08:12:30 -0400 Original-Received: from [140.186.70.92] (port=43696 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLbBj-0000QJ-HG for emacs-devel@gnu.org; Mon, 07 Jun 2010 08:12:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLbBe-0000A5-M6 for emacs-devel@gnu.org; Mon, 07 Jun 2010 08:12:19 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:41397) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OLbBe-00009c-BM for emacs-devel@gnu.org; Mon, 07 Jun 2010 08:12:14 -0400 Original-Received: (qmail invoked by alias); 07 Jun 2010 12:12:09 -0000 Original-Received: from p4FC18D0A.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [79.193.141.10] by mail.gmx.net (mp013) with SMTP; 07 Jun 2010 14:12:09 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX19f5GtrjF9fyMOzr9YSuilBszz12dBRXUGFzu3sIL bqJGE/2IMUcYgI User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:125573 Archived-At: Julien Danjou writes: Hi, > FYI I've signed the copyright assignment papers. Looks nice. I have some comments, 'tho. You should require 'cl when byte-compiling, due to the `case' macro. > +(defun notifications-notify (&rest params) > + "Send notification via D-Bus using the Freedesktop notification protocol. > +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") > + :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-directory) > + :action A list of actions. 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" "")) > + :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. > + :urgency The urgency level. > + Either `low', `normal' or `critical'. > + :category The type of notification this is. > + :desktop-entry This specifies the name of the desktop filename representing > + the calling program. > + :image-data This is a raw data image format which describes the width, > + height, rowstride, has alpha, bits per sample, channels and > + image data respectively. > + :sound-file The path to a sound file to play when the notification pops up. > + :suppress-sound Causes the server to suppress playing any sounds, if it has > + that ability. > + :x Specifies the X location on the screen that the notification > + should point to. The \"y\" hint must also be specified. > + :y Specifies the Y location on the screen that the notification > + should point to. The \"x\" hint must also be specified. All of them are hints. If none of them is given, you get a D-Bus error, try (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 also propose to add the handling of the "NotificationClosed" and "ActionInvoked" signals. This could be done by adding a callback function to `notifications-notify'. Best regards, Michael.