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 17:36:04 +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: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1275927153 30875 80.91.229.12 (7 Jun 2010 16:12:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Jun 2010 16:12:33 +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 18: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 1OLewB-00068X-Jx for ged-emacs-devel@m.gmane.org; Mon, 07 Jun 2010 18:12:31 +0200 Original-Received: from localhost ([127.0.0.1]:32984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLewA-00035H-Ou for ged-emacs-devel@m.gmane.org; Mon, 07 Jun 2010 12:12:30 -0400 Original-Received: from [140.186.70.92] (port=53372 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLeNF-0000aM-Pr for emacs-devel@gnu.org; Mon, 07 Jun 2010 11:36:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLeND-0006bm-VO for emacs-devel@gnu.org; Mon, 07 Jun 2010 11:36:25 -0400 Original-Received: from mailrelay2.alcatel.de ([194.113.59.96]:49230) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLeND-0006bP-NS for emacs-devel@gnu.org; Mon, 07 Jun 2010 11:36:23 -0400 Original-Received: from destgsu0048.de.alcatel-lucent.com (destgsu0048.de.alcatel-lucent.com [149.204.242.4]) by mailrelay2.alcatel.de (8.14.3/8.14.3/ICT) with ESMTP id o57Fa4oY030509; Mon, 7 Jun 2010 17:36:04 +0200 Original-Received: from slbhn1.alcatel.de (slbhn1.de.alcatel-lucent.com [149.204.90.35]) by destgsu0048.de.alcatel-lucent.com (8.12.3/8.12.3) with ESMTP id o57Fa4RZ000099; Mon, 7 Jun 2010 17:36:04 +0200 (MEST) In-Reply-To: (Julien Danjou's message of "Mon, 7 Jun 2010 17:17:34 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Alcanet-virus-scanned: o57Fa4RZ000099 at destgsu0048.de.alcatel-lucent.com X-Scanned-By: MIMEDefang 2.64 on 149.204.45.73 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 2) 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:125591 Archived-At: Julien Danjou writes: >>> +(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") > > They are not mandatory, even if it's weird. It works fine here, even if > the text is blank. They are not mandatory functionally (there is no D-Bus error), but as you say, the result is weird. I like Stefan's idea to make them mandatory parameters; if somebody really wants to left them empty, she could pass "". >>> + :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. Grrr. I need new glasses! >> 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 did not have any error, but well, I fixed it anyway. Maybe you have disabled D-Bus error in one way or the other, I've got an error. Did you run dbus-monitor in parallel, during tests? >> 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. :-) It is more than just bonus. Otherwise, :actions could not be handled properly. Thanks for adding. Best regards, Michael.