emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100093: * dbusbind.c (xd_get_disp


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100093: * dbusbind.c (xd_get_dispatch_status): Return a Lisp_Object.
Date: Fri, 08 Oct 2010 13:40:23 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100093
committer: Michael Albinus <address@hidden>
branch nick: emacs-23
timestamp: Fri 2010-10-08 13:40:23 +0200
message:
  * dbusbind.c (xd_get_dispatch_status): Return a Lisp_Object.
  (xd_pending_messages): Catch xd_get_dispatch_status calls.
modified:
  src/ChangeLog
  src/dbusbind.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-10-08 03:19:47 +0000
+++ b/src/ChangeLog     2010-10-08 11:40:23 +0000
@@ -1,3 +1,8 @@
+2010-10-08  Michael Albinus  <address@hidden>
+
+       * dbusbind.c (xd_get_dispatch_status): Return a Lisp_Object.
+       (xd_pending_messages): Catch xd_get_dispatch_status calls.
+
 2010-10-08  Kenichi Handa  <address@hidden>
 
        * coding.c (complement_process_encoding_system): Fix previous change.

=== modified file 'src/dbusbind.c'
--- a/src/dbusbind.c    2010-10-03 09:23:07 +0000
+++ b/src/dbusbind.c    2010-10-08 11:40:23 +0000
@@ -1571,7 +1571,7 @@
 
 /* Check, whether there is pending input in the message queue of the
    D-Bus BUS.  BUS is a Lisp symbol, either :system or :session.  */
-int
+static Lisp_Object
 xd_get_dispatch_status (bus)
      Lisp_Object bus;
 {
@@ -1587,23 +1587,34 @@
   return
     (dbus_connection_get_dispatch_status (connection)
      == DBUS_DISPATCH_DATA_REMAINS)
-    ? TRUE : FALSE;
+    ? Qt : Qnil;
 }
 
 /* Check for queued incoming messages from the system and session buses.  */
 int
 xd_pending_messages ()
 {
+  int ret = FALSE;
+  xd_in_read_queued_messages = 1;
 
   /* Vdbus_registered_objects_table will be initialized as hash table
      in dbus.el.  When this package isn't loaded yet, it doesn't make
      sense to handle D-Bus messages.  */
-  return (HASH_TABLE_P (Vdbus_registered_objects_table)
-         ? (xd_get_dispatch_status (QCdbus_system_bus)
-            || ((getenv ("DBUS_SESSION_BUS_ADDRESS") != NULL)
-                ? xd_get_dispatch_status (QCdbus_session_bus)
-                : FALSE))
-         : FALSE);
+  if (HASH_TABLE_P (Vdbus_registered_objects_table))
+    {
+      ret = (!NILP (internal_catch (Qdbus_error, xd_get_dispatch_status,
+                                   QCdbus_system_bus)));
+      if (ret) goto theend;
+
+      ret = ((getenv ("DBUS_SESSION_BUS_ADDRESS") != NULL) &&
+            (!NILP (internal_catch (Qdbus_error, xd_get_dispatch_status,
+                                    QCdbus_session_bus))));
+    }
+
+  /* Return.  */
+ theend:
+  xd_in_read_queued_messages = 0;
+  return ret;
 }
 
 /* Read queued incoming message of the D-Bus BUS.  BUS is a Lisp


reply via email to

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