delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/10/07/11:03:21

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
From: Michael Albinus <michael DOT albinus AT gmx DOT de>
To: cygwin AT cygwin DOT com
Subject: Re: emacs-23.2-3 and DBus
References: <844od1b8rx DOT fsf AT aol DOT com> <4CAB2230 DOT 4090500 AT cornell DOT edu> <877hhwiih3 DOT fsf AT gmx DOT de> <4CAB84CF DOT 2010604 AT cornell DOT edu> <8739skhs26 DOT fsf AT gmx DOT de> <4CAC73AF DOT 1020209 AT cornell DOT edu> <87ocb7mlhq DOT fsf AT gmx DOT de> <4CACB32F DOT 2070501 AT cornell DOT edu> <87y6abgqg3 DOT fsf AT gmx DOT de> <4CACBBFA DOT 9040509 AT cornell DOT edu> <4CACC49B DOT 1000008 AT cornell DOT edu>
Date: Thu, 07 Oct 2010 17:03:01 +0200
Message-ID: <8739si3v16.fsf@gmx.de>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.50 (gnu/linux)
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Ken Brown <kbrown AT cornell DOT edu> writes:

>>> I haven't the cygwin notebook with me, next access for me is tomorrow.
>>> I'll check then.

I couldn't do it today, unfortunately.

>> Yes, that's it.  Emacs does freeze if I load dbus.el and the system bus
>> isn't running.  But the problem doesn't occur in a build of Emacs from
>> the trunk.  I vaguely recall that someone reported this problem last
>> summer, and you fixed it.  But maybe you only fixed it in the trunk, and
>> not in the emacs-23 branch.  Do I remember that correctly?

In the trunk, we have rewritten D-Bus integration into the main
loop. xd_pending_messages, which I believe is the source of our pain,
does not exist any longer in the trunk.

> Here's what I was thinking of:
>
>   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6579

Yep. Reading the code, I have the feeling, that the following patch
should help:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs-23/src/dbusbind.c.~100084~	2010-10-07 16:44:04.632300629 +0200
--- /home/albinus/src/emacs-23/src/dbusbind.c	2010-10-07 16:41:25.000000000 +0200
***************
*** 1571,1577 ****

  /* 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
  xd_get_dispatch_status (bus)
       Lisp_Object bus;
  {
--- 1571,1577 ----

  /* Check, whether there is pending input in the message queue of the
     D-Bus BUS.  BUS is a Lisp symbol, either :system or :session.  */
! static Lisp_Object
  xd_get_dispatch_status (bus)
       Lisp_Object bus;
  {
***************
*** 1587,1609 ****
    return
      (dbus_connection_get_dispatch_status (connection)
       == DBUS_DISPATCH_DATA_REMAINS)
!     ? TRUE : FALSE;
  }

  /* Check for queued incoming messages from the system and session buses.  */
  int
  xd_pending_messages ()
  {

    /* 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);
  }

  /* Read queued incoming message of the D-Bus BUS.  BUS is a Lisp
--- 1587,1617 ----
    return
      (dbus_connection_get_dispatch_status (connection)
       == DBUS_DISPATCH_DATA_REMAINS)
!     ? Qt : Qnil;
  }

  /* Check for queued incoming messages from the system and session buses.  */
  int
  xd_pending_messages ()
  {
+   int ret;
+   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.  */
!   ret = (HASH_TABLE_P (Vdbus_registered_objects_table)
! 	 ? (!NILP (internal_catch (Qdbus_error, xd_get_dispatch_status,
! 				    QCdbus_system_bus))
! 	    || ((getenv ("DBUS_SESSION_BUS_ADDRESS") != NULL)
! 		? (!NILP (internal_catch (Qdbus_error, xd_get_dispatch_status,
! 					  QCdbus_session_bus)))
! 		: FALSE))
! 	 : FALSE);
!
!   /* Return.  */
!   xd_in_read_queued_messages = 0;
!   return ret;
  }

  /* Read queued incoming message of the D-Bus BUS.  BUS is a Lisp
--8<---------------cut here---------------end--------------->8---

At least it doesn't hurt under GNU/Linux :-)

> Ken

Best regards, Michael.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019