From 709a5173cd98d1e67724d1d02c437fa63681c3b6 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 23 Nov 2014 10:00:28 +0100 Subject: [PATCH] * erc-desktop-notifications.el (erc-notifications-bus): New customer option. Supports cases when Emacs hasn't been invoked in the same environment where the notifications shall go to. (erc-notifications-notify): Use it. --- lisp/erc/ChangeLog | 7 +++++++ lisp/erc/erc-desktop-notifications.el | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 9b8ec66ff55..2004de41d0b 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,10 @@ +2014-11-23 Michael Albinus + + * erc-desktop-notifications.el (erc-notifications-bus): + New customer option. Supports cases when Emacs hasn't been + invoked in the same environment where the notifications shall go to. + (erc-notifications-notify): Use it. + 2014-11-10 Kelvin White * erc-stamp.el (erc-timestamp-intangible): Change version tag to 24.5. diff --git a/lisp/erc/erc-desktop-notifications.el b/lisp/erc/erc-desktop-notifications.el index c0362b773dd..c8945cf9319 100644 --- a/lisp/erc/erc-desktop-notifications.el +++ b/lisp/erc/erc-desktop-notifications.el @@ -46,6 +46,12 @@ :group 'erc-notifications :type '(choice (const :tag "No icon" nil) file)) +(defcustom erc-notifications-bus :session + "D-Bus bus to use for notification." + :version "24.5" + :group 'erc-notifications + :type '(choice (const :tag "Session bus" :session) string)) + (defvar dbus-debug) ; used in the macroexpansion of dbus-ignore-errors (defun erc-notifications-notify (nick msg) @@ -53,7 +59,8 @@ This will replace the last notification sent with this function." (dbus-ignore-errors (setq erc-notifications-last-notification - (notifications-notify :title (xml-escape-string nick) + (notifications-notify :bus erc-notifications-bus + :title (xml-escape-string nick) :body (xml-escape-string msg) :replaces-id erc-notifications-last-notification :app-icon erc-notifications-icon)))) -- 2.39.5