public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Emacs and DBUS
@ 2010-08-13  2:37 nyc4bos
  2010-08-14 10:32 ` Ken Brown
  0 siblings, 1 reply; 25+ messages in thread
From: nyc4bos @ 2010-08-13  2:37 UTC (permalink / raw)
  To: cygwin

Hi,

Can the Cygwin Emacs maintainer compile an
Emacs binary (emacs-X11, emacs-nox, etc) with D-BUS?

It appears that the cygdbus-1-3.dll should be able
to be available for Cygwin Emacs support.

Thanks.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-13  2:37 Emacs and DBUS nyc4bos
@ 2010-08-14 10:32 ` Ken Brown
  2010-08-18 18:44   ` Michael Albinus
  2010-08-20 18:24   ` Reini Urban
  0 siblings, 2 replies; 25+ messages in thread
From: Ken Brown @ 2010-08-14 10:32 UTC (permalink / raw)
  To: cygwin

On 8/12/2010 10:36 PM, nyc4bos@aol.com wrote:
> Hi,
>
> Can the Cygwin Emacs maintainer compile an
> Emacs binary (emacs-X11, emacs-nox, etc) with D-BUS?
>
> It appears that the cygdbus-1-3.dll should be able
> to be available for Cygwin Emacs support.
>
> Thanks.

Yes, I've just checked that it builds with D-Bus.  I'll upload a test 
release in a few days.  BTW, the configure script gives the following 
warning:

   D-Bus integration has been tested for GNU/Linux only.

So I don't know if it will work.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-14 10:32 ` Ken Brown
@ 2010-08-18 18:44   ` Michael Albinus
  2010-08-18 18:57     ` Ken Brown
  2010-08-20 18:24   ` Reini Urban
  1 sibling, 1 reply; 25+ messages in thread
From: Michael Albinus @ 2010-08-18 18:44 UTC (permalink / raw)
  To: cygwin

Ken Brown <kbrown@cornell.edu> writes:

> Yes, I've just checked that it builds with D-Bus.  I'll upload a test
> release in a few days.  BTW, the configure script gives the following
> warning:
>
>   D-Bus integration has been tested for GNU/Linux only.
>
> So I don't know if it will work.

This message is from me (I wrote the D-Bus integration for Emacs). It
works for other Unices as well; if your test build runs also
successfully, it might be time to remove the warning.

Don't hesitate to contact me if you run into trouble.

> 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-18 18:44   ` Michael Albinus
@ 2010-08-18 18:57     ` Ken Brown
  2010-08-18 19:19       ` Michael Albinus
  0 siblings, 1 reply; 25+ messages in thread
From: Ken Brown @ 2010-08-18 18:57 UTC (permalink / raw)
  To: cygwin

On 8/18/2010 2:43 PM, Michael Albinus wrote:
> Ken Brown writes:
>
>> Yes, I've just checked that it builds with D-Bus.  I'll upload a test
>> release in a few days.  BTW, the configure script gives the following
>> warning:
>>
>>    D-Bus integration has been tested for GNU/Linux only.
>>
>> So I don't know if it will work.
>
> This message is from me (I wrote the D-Bus integration for Emacs). It
> works for other Unices as well; if your test build runs also
> successfully, it might be time to remove the warning.
>
> Don't hesitate to contact me if you run into trouble.

Thanks, Michael.  I don't use D-BUS myself, but I hope the OP will test 
it and report back.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-18 18:57     ` Ken Brown
@ 2010-08-18 19:19       ` Michael Albinus
  2010-08-18 21:08         ` Ken Brown
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Albinus @ 2010-08-18 19:19 UTC (permalink / raw)
  To: cygwin

Ken Brown <kbrown@cornell.edu> writes:

> Thanks, Michael.  I don't use D-BUS myself, but I hope the OP will
> test it and report back.

It's some years ago I have used Cygwin. But if you have uploaded the
build already, I could check, whether I have problems running Emacs +
D-Bus under Cygwin.

> 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-18 19:19       ` Michael Albinus
@ 2010-08-18 21:08         ` Ken Brown
  2010-08-24 19:45           ` Michael Albinus
  0 siblings, 1 reply; 25+ messages in thread
From: Ken Brown @ 2010-08-18 21:08 UTC (permalink / raw)
  To: cygwin

On 8/18/2010 3:19 PM, Michael Albinus wrote:
> Ken Brown<kbrown@cornell.edu>  writes:
>
>> Thanks, Michael.  I don't use D-BUS myself, but I hope the OP will
>> test it and report back.
>
> It's some years ago I have used Cygwin. But if you have uploaded the
> build already, I could check, whether I have problems running Emacs +
> D-Bus under Cygwin.

Yes, it's uploaded.  See

   http://cygwin.com/ml/cygwin-announce/2010-08/msg00020.html

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-14 10:32 ` Ken Brown
  2010-08-18 18:44   ` Michael Albinus
@ 2010-08-20 18:24   ` Reini Urban
  2010-08-20 19:10     ` Ken Brown
  1 sibling, 1 reply; 25+ messages in thread
From: Reini Urban @ 2010-08-20 18:24 UTC (permalink / raw)
  To: cygwin

2010/8/14 Ken Brown <kbrown@cornell.edu>:
> On 8/12/2010 10:36 PM, nyc4bos@aol.com wrote:
>> Can the Cygwin Emacs maintainer compile an
>> Emacs binary (emacs-X11, emacs-nox, etc) with D-BUS?
>>
>> It appears that the cygdbus-1-3.dll should be able
>> to be available for Cygwin Emacs support.
>
> Yes, I've just checked that it builds with D-Bus.  I'll upload a test
> release in a few days.  BTW, the configure script gives the following
> warning:
>
>  D-Bus integration has been tested for GNU/Linux only.
> So I don't know if it will work.

I added dbus support to clisp, tested it and it works fine. Yaakov also uses it.
So dbus on cygwin works fine.
It would be nice to have it in emacs also.
-- 
Reini Urban

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-20 18:24   ` Reini Urban
@ 2010-08-20 19:10     ` Ken Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Ken Brown @ 2010-08-20 19:10 UTC (permalink / raw)
  To: cygwin

On 8/20/2010 2:14 PM, Reini Urban wrote:
> 2010/8/14 Ken Brown<kbrown@cornell.edu>:
>> On 8/12/2010 10:36 PM, nyc4bos@aol.com wrote:
>>> Can the Cygwin Emacs maintainer compile an
>>> Emacs binary (emacs-X11, emacs-nox, etc) with D-BUS?
>>>
>>> It appears that the cygdbus-1-3.dll should be able
>>> to be available for Cygwin Emacs support.
>>
>> Yes, I've just checked that it builds with D-Bus.  I'll upload a test
>> release in a few days.  BTW, the configure script gives the following
>> warning:
>>
>>   D-Bus integration has been tested for GNU/Linux only.
>> So I don't know if it will work.
>
> I added dbus support to clisp, tested it and it works fine. Yaakov also uses it.
> So dbus on cygwin works fine.
> It would be nice to have it in emacs also.

It's in the latest (experimental) release.  Can you test it and see if 
it works?

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-18 21:08         ` Ken Brown
@ 2010-08-24 19:45           ` Michael Albinus
  2010-08-25  1:01             ` Ken Brown
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Albinus @ 2010-08-24 19:45 UTC (permalink / raw)
  To: cygwin

Ken Brown <kbrown@cornell.edu> writes:

Hi Ken,

>> It's some years ago I have used Cygwin. But if you have uploaded the
>> build already, I could check, whether I have problems running Emacs +
>> D-Bus under Cygwin.
>
> Yes, it's uploaded.  See
>
>   http://cygwin.com/ml/cygwin-announce/2010-08/msg00020.html

Unfortunately, it does not run. First, there is a minor issue: when I've
started emacs after downloading, I've got

/usr/bin/emacs-nox.exe: error while loading shared libraries: cygdbus-1-3.dll: cannot open shared object file: No such file or directory

I guess, a dependency to libdbus1_3 must be added when Emacs is
compiled with D-Bus support.

After installing that library, Emacs did start. How ever, it blocks
when loading dbus.el.

I've tried to debug it with gdb, but it told me

(gdb) file /usr/bin/emacs-nox.exe
Reading symbols from /usr/bin/emacs-nox.exe...(no debugging symbols found)...done.

I'm sorry; I'm not familiar with cygwin, so I don't know how to continue.

> 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-24 19:45           ` Michael Albinus
@ 2010-08-25  1:01             ` Ken Brown
  2010-08-25  1:10               ` René Berber
  2010-08-25  4:15               ` Michael Albinus
  0 siblings, 2 replies; 25+ messages in thread
From: Ken Brown @ 2010-08-25  1:01 UTC (permalink / raw)
  To: cygwin

On 8/24/2010 3:43 PM, Michael Albinus wrote:
> Ken Brown writes:
>
> Hi Ken,
>
>>> It's some years ago I have used Cygwin. But if you have uploaded the
>>> build already, I could check, whether I have problems running Emacs +
>>> D-Bus under Cygwin.
>>
>> Yes, it's uploaded.  See
>>
>>    http://cygwin.com/ml/cygwin-announce/2010-08/msg00020.html
>
> Unfortunately, it does not run. First, there is a minor issue: when I've
> started emacs after downloading, I've got
>
> /usr/bin/emacs-nox.exe: error while loading shared libraries: cygdbus-1-3.dll: cannot open shared object file: No such file or directory
>
> I guess, a dependency to libdbus1_3 must be added when Emacs is
> compiled with D-Bus support.

Yes, I mentioned this in the announcement of the test release.  I will 
add libdbus1_3 as a dependency when the test release gets promoted to 
"current".

> After installing that library, Emacs did start. How ever, it blocks
> when loading dbus.el.

Don't you normally have to start a D-BUS session before loading dbus.el? 
  Maybe one of the Cygwin people who uses D-BUS can tell us how to do that.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-25  1:01             ` Ken Brown
@ 2010-08-25  1:10               ` René Berber
  2010-08-25  4:15               ` Michael Albinus
  1 sibling, 0 replies; 25+ messages in thread
From: René Berber @ 2010-08-25  1:10 UTC (permalink / raw)
  To: cygwin

Ken Brown wrote:

[snip]
> Don't you normally have to start a D-BUS session before loading dbus.el?
>  Maybe one of the Cygwin people who uses D-BUS can tell us how to do that.

libdbus starts "dbus-daemon --session" if its not already started
(global or session) and if it can find it (in the PATH and probably some
hard coded locations, similar for the configuration).
-- 
René Berber


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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-25  1:01             ` Ken Brown
  2010-08-25  1:10               ` René Berber
@ 2010-08-25  4:15               ` Michael Albinus
  2010-08-25  6:55                 ` Yaakov (Cygwin/X)
  2010-08-25 14:20                 ` Ken Brown
  1 sibling, 2 replies; 25+ messages in thread
From: Michael Albinus @ 2010-08-25  4:15 UTC (permalink / raw)
  To: cygwin

Ken Brown <kbrown@cornell.edu> writes:

>> After installing that library, Emacs did start. How ever, it blocks
>> when loading dbus.el.
>
> Don't you normally have to start a D-BUS session before loading
> dbus.el? Maybe one of the Cygwin people who uses D-BUS can tell us how
> to do that.

I've started the session bus via dbus-launch in advance, of course. I
have no idea, how to start the system bus in cygwin, 'though.

Emacs' D-Bus code shall be resistent in case of absence of a bus, but
who knows ... how could I debug it via gdb? Or, alternatively, how could
I start the system bus?

> 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-25  4:15               ` Michael Albinus
@ 2010-08-25  6:55                 ` Yaakov (Cygwin/X)
  2010-08-25 14:20                 ` Ken Brown
  1 sibling, 0 replies; 25+ messages in thread
From: Yaakov (Cygwin/X) @ 2010-08-25  6:55 UTC (permalink / raw)
  To: cygwin

On Wed, 2010-08-25 at 05:28 +0200, Michael Albinus wrote:
> Ken Brown writes:
> > Don't you normally have to start a D-BUS session before loading
> > dbus.el? Maybe one of the Cygwin people who uses D-BUS can tell us how
> > to do that.
> 
> I've started the session bus via dbus-launch in advance, of course.

See dbus-launch(1) for how this should be done.

> I have no idea, how to start the system bus in cygwin, 'though.

The Cygwin README tells you how to do that.


Yaakov



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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-25  4:15               ` Michael Albinus
  2010-08-25  6:55                 ` Yaakov (Cygwin/X)
@ 2010-08-25 14:20                 ` Ken Brown
  2010-08-25 14:57                   ` Ken Brown
  1 sibling, 1 reply; 25+ messages in thread
From: Ken Brown @ 2010-08-25 14:20 UTC (permalink / raw)
  To: cygwin



On 8/24/2010 11:28 PM, Michael Albinus wrote:
> Ken Brown  writes:
>
>>> After installing that library, Emacs did start. How ever, it blocks
>>> when loading dbus.el.
>>
>> Don't you normally have to start a D-BUS session before loading
>> dbus.el? Maybe one of the Cygwin people who uses D-BUS can tell us how
>> to do that.
>
> I've started the session bus via dbus-launch in advance, of course. I
> have no idea, how to start the system bus in cygwin, 'though.

Run /usr/bin/messagebus-config and follow the instructions for 
installing messagebus as a service.  You will need to be logged in as a 
user with administrator privileges for this.

> Emacs' D-Bus code shall be resistent in case of absence of a bus, but
> who knows ... how could I debug it via gdb?

The executable /usr/bin/emacs-nox.exe is stripped; that's why you 
couldn't debug it.  Here's a link to the unstripped version, with debug 
symbols:

   http://www.math.cornell.edu/~kbrown/emacs-nox.exe.bz2

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-25 14:20                 ` Ken Brown
@ 2010-08-25 14:57                   ` Ken Brown
  2010-08-25 16:32                     ` Ken Brown
  2010-08-26  4:16                     ` Michael Albinus
  0 siblings, 2 replies; 25+ messages in thread
From: Ken Brown @ 2010-08-25 14:57 UTC (permalink / raw)
  To: cygwin

On 8/25/2010 10:02 AM, Ken Brown wrote:
>
>
> On 8/24/2010 11:28 PM, Michael Albinus wrote:
>> Ken Brown  writes:
>>
>>>> After installing that library, Emacs did start. How ever, it blocks
>>>> when loading dbus.el.
>>>
>>> Don't you normally have to start a D-BUS session before loading
>>> dbus.el? Maybe one of the Cygwin people who uses D-BUS can tell us how
>>> to do that.
>>
>> I've started the session bus via dbus-launch in advance, of course. I
>> have no idea, how to start the system bus in cygwin, 'though.
>
> Run /usr/bin/messagebus-config and follow the instructions for
> installing messagebus as a service.  You will need to be logged in as a
> user with administrator privileges for this.
>
>> Emacs' D-Bus code shall be resistent in case of absence of a bus, but
>> who knows ... how could I debug it via gdb?
>
> The executable /usr/bin/emacs-nox.exe is stripped; that's why you
> couldn't debug it.  Here's a link to the unstripped version, with debug
> symbols:
>
>     http://www.math.cornell.edu/~kbrown/emacs-nox.exe.bz2

Hi Michael,

The blocking you observed when dbus.el is loaded doesn't occur with a 
build from the Emacs trunk (r101187).  But I don't know how to test the 
dbus functionality after loading dbus.el.  If we find it works there, 
maybe the problem is just a matter of backporting some patch to Emacs 
23.2.  Can you tell me how to test dbus in emacs?  Or do you want me to 
send you the executable and let you test it?

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-25 14:57                   ` Ken Brown
@ 2010-08-25 16:32                     ` Ken Brown
  2010-08-26  4:50                       ` Michael Albinus
  2010-08-26  4:16                     ` Michael Albinus
  1 sibling, 1 reply; 25+ messages in thread
From: Ken Brown @ 2010-08-25 16:32 UTC (permalink / raw)
  To: cygwin

On 8/25/2010 10:37 AM, Ken Brown wrote:
> On 8/25/2010 10:02 AM, Ken Brown wrote:
>>
>>
>> On 8/24/2010 11:28 PM, Michael Albinus wrote:
>>> Ken Brown  writes:
>>>
>>>>> After installing that library, Emacs did start. How ever, it blocks
>>>>> when loading dbus.el.
>>>>
>>>> Don't you normally have to start a D-BUS session before loading
>>>> dbus.el? Maybe one of the Cygwin people who uses D-BUS can tell us how
>>>> to do that.
>>>
>>> I've started the session bus via dbus-launch in advance, of course. I
>>> have no idea, how to start the system bus in cygwin, 'though.
>>
>> Run /usr/bin/messagebus-config and follow the instructions for
>> installing messagebus as a service.  You will need to be logged in as a
>> user with administrator privileges for this.
>>
>>> Emacs' D-Bus code shall be resistent in case of absence of a bus, but
>>> who knows ... how could I debug it via gdb?
>>
>> The executable /usr/bin/emacs-nox.exe is stripped; that's why you
>> couldn't debug it.  Here's a link to the unstripped version, with debug
>> symbols:
>>
>>      http://www.math.cornell.edu/~kbrown/emacs-nox.exe.bz2
>
> Hi Michael,
>
> The blocking you observed when dbus.el is loaded doesn't occur with a
> build from the Emacs trunk (r101187).

Correction: It occurs if and only if the system messagebus service is 
running.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-25 14:57                   ` Ken Brown
  2010-08-25 16:32                     ` Ken Brown
@ 2010-08-26  4:16                     ` Michael Albinus
  1 sibling, 0 replies; 25+ messages in thread
From: Michael Albinus @ 2010-08-26  4:16 UTC (permalink / raw)
  To: cygwin

Ken Brown <kbrown@cornell.edu> writes:

> Hi Michael,

Hi Ken,

> The blocking you observed when dbus.el is loaded doesn't occur with a
> build from the Emacs trunk (r101187).  But I don't know how to test
> the dbus functionality after loading dbus.el.

There is a manual, open it with (info "(dbus)")

You could check your own D-Bus name:

  (dbus-get-unique-name :system)
  (dbus-get-unique-name :session)

You could register for signals sent by the D-Bus:

  (defun my-dbus-signal-handler (&rest args)
    (message "Signal from bus %s received: %s"
             (dbus-event-bus-name last-input-event) args))

  (dbus-register-signal
   :system dbus-service-dbus dbus-path-dbus dbus-interface-dbus
   "NameOwnerChanged" 'my-dbus-signal-handler)
  (dbus-register-signal
   :session dbus-service-dbus dbus-path-dbus dbus-interface-dbus
   "NameOwnerChanged" 'my-dbus-signal-handler)

Now you could open any other D-Bus application, and you shall be
notified in Emacs. Let's use dbus-monitor, started in a shell:

  # dbus-monitor --session
  # dbus-monitor --system

> If we find it works there, maybe the problem is just a matter of
> backporting some patch to Emacs 23.2.

In Emacs' trunk, there are changes how D-Bus buses are initialized for
polling of pending messages. The intention was to access non-default
buses as well, but it seems to help also for the system and session
buses on cygwin. Backporting would include both dbusbind.c and dbus.el,
because there are dependent changes. I havent't planned it yet for the
Emacs 23 branch, but why not.

> Can you tell me how to test dbus in emacs?  Or do you want me to send
> you the executable and let you test it?

Unfortunately, the next 10 days or so I won't have access to a machine
running Windows+Cygwin (I'll be on the road); accessing my email shall
be possible. I'ld like to test it when I'm back.

Thinking about, I prefer an unstripped version of emacs-x11 instead of
emacs-nox for testing.

> 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-25 16:32                     ` Ken Brown
@ 2010-08-26  4:50                       ` Michael Albinus
  2010-08-26 19:41                         ` Ken Brown
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Albinus @ 2010-08-26  4:50 UTC (permalink / raw)
  To: cygwin

Ken Brown <kbrown@cornell.edu> writes:

>> The blocking you observed when dbus.el is loaded doesn't occur with a
>> build from the Emacs trunk (r101187).
>
> Correction: It occurs if and only if the system messagebus service is
> running.

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.

> 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-26  4:50                       ` Michael Albinus
@ 2010-08-26 19:41                         ` Ken Brown
  2010-08-26 21:39                           ` Michael Albinus
  0 siblings, 1 reply; 25+ messages in thread
From: Ken Brown @ 2010-08-26 19:41 UTC (permalink / raw)
  To: cygwin

On 8/26/2010 12:16 AM, Michael Albinus wrote:
> Ken Brown  writes:
>
>>> The blocking you observed when dbus.el is loaded doesn't occur with a
>>> build from the Emacs trunk (r101187).
>>
>> Correction: It occurs if and only if the system messagebus service is
>> running.
>
> 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.

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.

Back to *scratch*:

(dbus-get-unique-name :system)

This throws me into the lisp debugger with the error (dbus-error "Failed 
to connect to socket /var/run/dbus/system_bus_socket: Connection 
refused").  I guess this is to be expected, since the system bus is not 
running.  I now start the system bus via 'net start messagebus' in a 
shell, and I try again:

(dbus-get-unique-name :system)
":1.0"

Is this to be expected, that I get the same name for :system that I got 
for :session?

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.

I'm willing to try anything else you suggest.  Otherwise, I hope you're 
able to debug this when you return from your travels.  The unstripped 
emacs-X11.exe binary (Emacs 23.2) is at

   http://www.math.cornell.edu/~kbrown/emacs-X11.exe.bz2

and the binary for my build from the trunk is at

   http://www.math.cornell.edu/~kbrown/emacs.exe.bz2

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-26 19:41                         ` Ken Brown
@ 2010-08-26 21:39                           ` Michael Albinus
  2010-08-27  6:09                             ` Ken Brown
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Albinus @ 2010-08-26 21:39 UTC (permalink / raw)
  To: cygwin

Ken Brown <kbrown@cornell.edu> 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.

> Back to *scratch*:
>
> (dbus-get-unique-name :system)
>
> This throws me into the lisp debugger with the error (dbus-error
> "Failed to connect to socket /var/run/dbus/system_bus_socket:
> Connection refused").  I guess this is to be expected, since the
> system bus is not running.  I now start the system bus via 'net start
> messagebus' in a shell, and I try again:
>
> (dbus-get-unique-name :system)
> ":1.0"
>
> Is this to be expected, that I get the same name for :system that I
> got for :session?

It is not "the same name", it simply looks like :-) Any D-bus daemon
counts the registered clients. In both cases, Emacs has been the first
one, so you've got the same identity name.

The good message is that dbusbind.c is able to speak to both buses under
Cygwin!

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

> I'm willing to try anything else you suggest.  Otherwise, I hope
> you're able to debug this when you return from your travels.  The
> unstripped emacs-X11.exe binary (Emacs 23.2) is at
>
>   http://www.math.cornell.edu/~kbrown/emacs-X11.exe.bz2
>
> and the binary for my build from the trunk is at
>
>   http://www.math.cornell.edu/~kbrown/emacs.exe.bz2
>
> Ken

Thanks, and 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-26 21:39                           ` Michael Albinus
@ 2010-08-27  6:09                             ` Ken Brown
  2010-08-27  7:49                               ` Michael Albinus
  0 siblings, 1 reply; 25+ messages in thread
From: Ken Brown @ 2010-08-27  6:09 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-27  6:09                             ` Ken Brown
@ 2010-08-27  7:49                               ` Michael Albinus
  2010-08-27 15:02                                 ` Ken Brown
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Albinus @ 2010-08-27  7:49 UTC (permalink / raw)
  To: cygwin

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".
- 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?

Anyway, I need to debug when I'm back.

> 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-27  7:49                               ` Michael Albinus
@ 2010-08-27 15:02                                 ` Ken Brown
  2010-08-27 15:19                                   ` Ken Brown
  0 siblings, 1 reply; 25+ messages in thread
From: Ken Brown @ 2010-08-27 15:02 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-27 15:02                                 ` Ken Brown
@ 2010-08-27 15:19                                   ` Ken Brown
  2010-08-27 16:11                                     ` Michael Albinus
  0 siblings, 1 reply; 25+ messages in thread
From: Ken Brown @ 2010-08-27 15:19 UTC (permalink / raw)
  To: cygwin

On 8/27/2010 10:24 AM, Ken Brown wrote:
> On 8/27/2010 3:41 AM, Michael Albinus wrote:
>> Ken Brown 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?

To partially answer my own question, I tried removing the line

   (dbus-init-bus :system)

from dbus.el.  The good news is that when I then load dbus.el, I do get 
the expected output from dbus-monitor.  The bad news is that Emacs then 
behaves exactly as in the scenario where I start Emacs with the system 
bus running.  Namely, it prints the trace 'xd_add_watch: fd 9' and then 
becomes unresponsive.  All I can do is press C-g if I want to hear bells 
or C-x C-c to exit.

I suspect we can't go any further with this until you return from your 
trip and start debugging.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Emacs and DBUS
  2010-08-27 15:19                                   ` Ken Brown
@ 2010-08-27 16:11                                     ` Michael Albinus
  0 siblings, 0 replies; 25+ messages in thread
From: Michael Albinus @ 2010-08-27 16:11 UTC (permalink / raw)
  To: cygwin

Ken Brown <kbrown@cornell.edu> writes:

> I suspect we can't go any further with this until you return from your
> trip and start debugging.

Yes, I'm sorry. Let's continue in September.

> 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

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2010-08-27 15:30 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-13  2:37 Emacs and DBUS nyc4bos
2010-08-14 10:32 ` Ken Brown
2010-08-18 18:44   ` Michael Albinus
2010-08-18 18:57     ` Ken Brown
2010-08-18 19:19       ` Michael Albinus
2010-08-18 21:08         ` Ken Brown
2010-08-24 19:45           ` Michael Albinus
2010-08-25  1:01             ` Ken Brown
2010-08-25  1:10               ` René Berber
2010-08-25  4:15               ` Michael Albinus
2010-08-25  6:55                 ` Yaakov (Cygwin/X)
2010-08-25 14:20                 ` Ken Brown
2010-08-25 14:57                   ` Ken Brown
2010-08-25 16:32                     ` Ken Brown
2010-08-26  4:50                       ` Michael Albinus
2010-08-26 19:41                         ` Ken Brown
2010-08-26 21:39                           ` Michael Albinus
2010-08-27  6:09                             ` Ken Brown
2010-08-27  7:49                               ` Michael Albinus
2010-08-27 15:02                                 ` Ken Brown
2010-08-27 15:19                                   ` Ken Brown
2010-08-27 16:11                                     ` Michael Albinus
2010-08-26  4:16                     ` Michael Albinus
2010-08-20 18:24   ` Reini Urban
2010-08-20 19:10     ` Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).