X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.0 required=5.0	tests=AWL,BAYES_00,SPF_NEUTRAL,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4C77CA9C.1090207@cornell.edu>
Date: Fri, 27 Aug 2010 10:24:28 -0400
From: Ken Brown <kbrown@cornell.edu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2
MIME-Version: 1.0
To: cygwin <cygwin@cygwin.com>
Subject: Re: Emacs and DBUS
References: <847hjvdyr9.fsf@aol.com> <4C667099.2020103@cornell.edu>	<87mxsj69st.fsf@gmx.de> <4C6C2D11.8020003@cornell.edu>	<87d3tf685q.fsf@gmx.de> <4C6C4BC8.9010400@cornell.edu>	<87lj7vokyt.fsf@gmx.de> <4C74648F.2030203@cornell.edu>	<87d3t7nzez.fsf@gmx.de> <4C75226F.9030005@cornell.edu>	<4C752AAB.9000304@cornell.edu> <4C752F4F.60203@cornell.edu>	<8762yyovon.fsf@gmx.de> <4C76C254.4040802@cornell.edu>	<87occpyvsl.fsf@gmx.de> <4C77233A.1090504@cornell.edu> <871v9kbj02.fsf@gmx.de>
In-Reply-To: <871v9kbj02.fsf@gmx.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 8/27/2010 3:41 AM, Michael Albinus wrote:
> Ken Brown<kbrown@cornell.edu>  writes:
>
>>> This is also a D-Bus client, which connects to the *same* session bus as
>>> Emacs did due to $DBUS_SESSION_BUS_ADDRESS. Now you should see the
>>> signal sent by dbus-monitor in Emacs.
>>
>> OK, I started the session bus the right way this time, but I still
>> didn't see any signal from dbus-monitor in Emacs.  I assume I should
>> have seen something in the echo area?
>
> Yes. You could test whether both Emacs and dbus-monitor use the same bus
> by reordering the calls:
>
> - apply dbus-launch as described
> - echo $DBUS_SESSION_BUS_ADDRESS
> - in *another* shell, set $DBUS_SESSION_BUS_ADDRESS to this value, and
>    start dbus-monitor
> - start Emacs in the first shell, and load dbus.el. You shall see in
>    the other shell output from  dbus-monitor, telling that an application
>    has started. It will also tell you the name of that application, like
>    ":1.2".

This doesn't happen.  Is it possible that dbus.el doesn't complete its 
initialization because the system bus isn't running?  (Keep in mind that 
I can't do *anything* with dbus in Emacs unless I load dbus.el before 
starting the system bus.)  I note that when I use the version of Emacs 
built with MYCPPFLAGS='-DDBUS_DEBUG', loading dbus.el results in the 
following error message in the echo area:

D-Bus error: "Failed to connect to socket 
/var/run/dbus/system_bus_socket: Interrupted system call"

> - apply (dbus-get-unique-name :session) in Emacs. The result shall be
>    the same name.
> - start dbus-monitor in the same shell as Emacs. In the other
>    dbus-monitor, you should be notified, that an application has been started.
>
>>> Maybe you can compile dbusbind.c with the compiler flag DBUS_DEBUG,
>>> something like this in the Emacs source tree:
>>>
>>> # MYCPPFLAGS='-DDBUS_DEBUG' make
>>>
>>> This enables test traces sent to Emacs' stdout (the shell where you have
>>> started it). I've introduced this flag while testing dbusbind.c, when it
>>> has blocked Emacs, and I didn't want to start gdb ...
>>>
>>> Maybe I can see something suspicious in the traces.
>>
>> There's very little there.  It prints the two lines
>>
>>    xd_add_watch: fd 8
>>    xd_add_watch: fd 9
>>
>> and no more.  Does this tell you anything?
>
> It's the initialization phase. Two watch functions are installed on file
> descriptors 8 and 9 (connected to the system and session buses), polling
> for incoming messages in Emacs' mainloop.
>
> When you call dbus-get-unique-name, there shall be more output. But this
> works, as you have confirmed, so this is not the interesting case.
>
> I've hoped to see more :-( Did you play with the running/non-running
> system bus?

Yes, the traces above were produced when starting Emacs with the system 
bus running.  I'm stuck at that point and can't do anything to produce 
more traces.

Ken

--
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

