Hi,

[...]

> The D-Bus connection is an Unix socket. When vim fires a signal from the
> plug-in, some data is sent through the socket to the dbus-daemon
> process. But to receive D-Bus signal, the socket file descriptor must
> be added somehow in the vim main loop in order to call a function to
> read on the socket and I have no idea how to do that from a vim plug-in
> in Python. It may not be possible to do it from a Python plug-in without
> modifying the vim code.

I also want to do something similar to what you want. I would like to
write once (if no-one will be faster than me :) ) shell support to vim
(no flame please, it just would be useful for me in some specific cases).

My plan is to use empty (http://empty.sourceforge.net) as a layer above
platform specific pty details. And just make vim listen on file
descriptor and fill vim internal buffer structure with the received
information. On the way out, I would execute external command (empty)
for every line written in the shell buffer.


> It seems that this "mainloop" problem is not specific to D-Bus but other
> projects has the same problem:

For console vim, I think that the proper place might be function
RealWaitForChar, look for SNIFF code. I don't care about gui too much,
at least not at the moment. Hopefully others will be able to help more.


> Can you explain me the place in the vim code where the main loop is
> implemented? Should I look at some of the above projects or other ones?

I know vim code very little, I'm just sharing my thoughts. Hopefully it
will be useful to you.

-- 
        Vlad

Attachment: pgpJQ0U4cbxYX.pgp
Description: PGP signature

Raspunde prin e-mail lui