From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22301 invoked by alias); 7 Oct 2010 15:03:14 -0000 Received: (qmail 22279 invoked by uid 22791); 7 Oct 2010 15:03:12 -0000 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 Received: from mailout-de.gmx.net (HELO mail.gmx.net) (213.165.64.22) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 07 Oct 2010 15:03:07 +0000 Received: (qmail invoked by alias); 07 Oct 2010 15:03:03 -0000 Received: from p4FC1803B.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [79.193.128.59] by mail.gmx.net (mp070) with SMTP; 07 Oct 2010 17:03:03 +0200 From: Michael Albinus To: cygwin@cygwin.com Subject: Re: emacs-23.2-3 and DBus References: <844od1b8rx.fsf@aol.com> <4CAB2230.4090500@cornell.edu> <877hhwiih3.fsf@gmx.de> <4CAB84CF.2010604@cornell.edu> <8739skhs26.fsf@gmx.de> <4CAC73AF.1020209@cornell.edu> <87ocb7mlhq.fsf@gmx.de> <4CACB32F.2070501@cornell.edu> <87y6abgqg3.fsf@gmx.de> <4CACBBFA.9040509@cornell.edu> <4CACC49B.1000008@cornell.edu> Date: Thu, 07 Oct 2010 15:03:00 -0000 Message-ID: <8739si3v16.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2010-10/txt/msg00181.txt.bz2 Ken Brown 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