From: Michael Albinus Date: Wed, 19 Aug 2009 07:15:28 +0000 (+0000) Subject: * net/dbus.el (top): Apply `dbus-init-bus' for the :session bus X-Git-Tag: emacs-pretest-23.1.90~1789 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=720c7cd6a93566a5758f76e6b4dc80aef97cb275;p=emacs.git * net/dbus.el (top): Apply `dbus-init-bus' for the :session bus only if it is running already. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 08c56531d96..f511078e522 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-08-19 Michael Albinus + + * net/dbus.el (top): Apply `dbus-init-bus' only if the session bus + is running already. + 2009-08-19 Stefan Monnier * subr.el (listify-key-sequence-1): Use normal syntax since those diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index c1222a66f66..273d531ed35 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -41,15 +41,6 @@ (defvar dbus-debug) (defvar dbus-registered-functions-table) -;; Initialize :system and :session buses. This adds their file -;; descriptors to input_wait_mask, in order to detect incoming -;; messages immediately. -;; We must avoid to call the function twice for a bus, because the -;; DBusWatch will be removed then. -(when (and (featurep 'dbusbind) (not (featurep 'dbus))) - (dbus-init-bus :system) - (dbus-init-bus :session)) - ;; Pacify byte compiler. (eval-when-compile (require 'cl)) @@ -841,6 +832,14 @@ name of the property, and its value. If there are no properties, (cons property (dbus-get-property bus service path interface property)) 'append))))) +;; Initialize :system and :session buses. This adds their file +;; descriptors to input_wait_mask, in order to detect incoming +;; messages immediately. +(dbus-ignore-errors + (when (getenv "DBUS_SESSION_BUS_ADDRESS") + (dbus-init-bus :system) + (dbus-init-bus :session))) + (provide 'dbus) ;; arch-tag: a47caf84-9162-4811-90cc-5d388e37b9bd