Hi,

I would like to have a support for D-Bus [1] in vim, and then be able
to write vim plug-ins that use the vim D-Bus connection to communicate
with external applications. My goal [2] is to be able to control the vim
buffer from other applications to enable collaboration features (as
Gobby does) between different editors (vim, emacs) using the same
D-Bus protocol.

I don't know the vim code, but with help from the #vim IRC channel, I
wrote a vim plug-in in python [3] that fires a D-Bus signal each time
the vim buffer is changed. It seems possible to inform external
applications of each change of the vim buffer.

I want also my plug-in to receive to D-Bus methods, so that external
applications can change the content of the vim buffer. However, I am
unable to do that with my plug-in because of the way the D-Bus
connection is implemented in my plug-in. 

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.

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

- Clewn [4]: GDB support in vim. Clewn is an external program but need
a patch in vim to work.
- Slim-Vim [5]: Vim interface to SLIME, the project is abandoned. It
needed a way to add a socket connection.
- Eclim [6]: Eclipse integration in Vim: Vim instances communicate with
Eclipse through the Eclim interface.
- Vim client-server communication [7]

The problem is, there is a lot of different projects, I don't know where
to start looking :)

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?

Thanks for your help,

Alban

[1] http://www.freedesktop.org/wiki/Software/dbus
[2] http://alban.apinc.org/blog/2008/05/11/c
[3] http://people.collabora.co.uk/~alban/d/2008/05/remotecontrol.vim
[4] http://clewn.sourceforge.net/
[5] http://wiki.alu.org/Slim-Vim
[6] http://eclim.sourceforge.net/
[7] http://vimdoc.sourceforge.net/htmldoc/remote.html

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui