emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/net dbus.el


From: Michael Albinus
Subject: [Emacs-diffs] emacs/lisp/net dbus.el
Date: Wed, 19 Aug 2009 07:08:57 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       09/08/19 07:08:57

Modified files:
        lisp/net       : dbus.el 

Log message:
        * net/dbus.el (top): Apply `dbus-init-bus' for the :session bus
        only if it is running already.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/dbus.el?cvsroot=emacs&r1=1.30&r2=1.31

Patches:
Index: dbus.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/dbus.el,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- dbus.el     18 Aug 2009 15:12:01 -0000      1.30
+++ dbus.el     19 Aug 2009 07:08:57 -0000      1.31
@@ -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 @@
         (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
+  (dbus-init-bus :system)
+  (when (getenv "DBUS_SESSION_BUS_ADDRESS")
+    (dbus-init-bus :session)))
+
 (provide 'dbus)
 
 ;; arch-tag: a47caf84-9162-4811-90cc-5d388e37b9bd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]