www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/08/26/22:37:16

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4C77233A.1090504@cornell.edu>
Date: Thu, 26 Aug 2010 22:30:18 -0400
From: Ken Brown <kbrown AT cornell DOT 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 AT cygwin DOT com>
Subject: Re: Emacs and DBUS
References: <847hjvdyr9 DOT fsf AT aol DOT com> <4C667099 DOT 2020103 AT cornell DOT edu> <87mxsj69st DOT fsf AT gmx DOT de> <4C6C2D11 DOT 8020003 AT cornell DOT edu> <87d3tf685q DOT fsf AT gmx DOT de> <4C6C4BC8 DOT 9010400 AT cornell DOT edu> <87lj7vokyt DOT fsf AT gmx DOT de> <4C74648F DOT 2030203 AT cornell DOT edu> <87d3t7nzez DOT fsf AT gmx DOT de> <4C75226F DOT 9030005 AT cornell DOT edu> <4C752AAB DOT 9000304 AT cornell DOT edu> <4C752F4F DOT 60203 AT cornell DOT edu> <8762yyovon DOT fsf AT gmx DOT de> <4C76C254 DOT 4040802 AT cornell DOT edu> <87occpyvsl DOT fsf AT gmx DOT de>
In-Reply-To: <87occpyvsl.fsf@gmx.de>
X-IsSubscribed: yes
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

On 8/26/2010 4:16 PM, Michael Albinus wrote:
> Ken Brown writes:
>
>>> I'm confused: do you mean, the problem is happening when the system bus
>>> is running, or when it is *not* running? I suspect the latter case.
>>
>> I really meant it the way I said it: The problem occurs if the system
>> bus *is* running.  I've done some further testing, and here are the
>> results, all with a build of emacs from the trunk, starting in the
>> emacs src directory.
>
> Oops.
>
>> 1. With the system bus not running, I start Emacs via 'dbus-launch
>> ./emacs.exe -Q&' and load dbus.el.  In the *scratch* buffer I evaluate
>> some of the expressions that you suggested in your earlier email:
>>
>> (dbus-get-unique-name :session)
>> ":1.0"
>> (defun my-dbus-signal-handler (&rest args)
>>      (message "Signal from bus %s received: %s"
>>               (dbus-event-bus-name last-input-event) args))
>> my-dbus-signal-handler
>> (dbus-register-signal
>>     :session dbus-service-dbus dbus-path-dbus dbus-interface-dbus
>>     "NameOwnerChanged" 'my-dbus-signal-handler)
>> ((:session "org.freedesktop.DBus" "NameOwnerChanged")
>> ("org.freedesktop.DBus" "/org/freedesktop/DBus"
>> my-dbus-signal-handler))
>>
>> Now I try 'dbus-monitor --session' in the xterm window from which I
>> started emacs.  This produces output in the xterm window, but I don't
>> see anything in Emacs.
>
> No surprise. You have started an own session bus for Emacs, which is not
> known to dbus-monitor. You shall do
>
> # eval `dbus-launch --auto-syntax`
>
> dbus-launch returns some environment variables to be set, which is done
> by the eval command. The most interesting one is $DBUS_SESSION_BUS_ADDRESS
>
> # emacs&
>
> Emacs will find the session bus via $DBUS_SESSION_BUS_ADDRESS. Load
> dbus.el, and eval the expressions as suggested.
>
> # dbus-monitor --session
>
> 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?

>> 2. With the system bus running, I start Emacs as above and load
>> dbus.el. The cursor stops blinking, and Emacs becomes unresponsive.  I
>> can type C-g and hear a bell, and I can type C-x C-c to exit, but I
>> can't get a response to any other key presses.
>
> That I need to debug. Hmm, no system available next days.
>
> 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?

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

- Raw text -


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