[slimpl] Hello list, and an idea about asynchronous events
Larry Clapp
larry at theclapp.org
Tue Feb 14 07:18:07 CST 2006
In a different parent, on Mon, Feb 13, 2006 at 04:04:24PM +0500,
Dmitry Petukhov wrote:
> Hello list, i'm Dmitry Petukhov, progammer from Russia, Ekaterinburg
> (Urals)
Welcome, Dmitry!
> About async event to vim: have you considered using --server and
> --remote-send and --remote-expr ? it seems to me somewhat fitting
> to this purpose.
I took a look at the Vim server implementation (several months back),
and it might work for us, but probably not for the primary Vim <->
Swank communication channel. The Vim server uses X properties to
store the data; I don't know X very well, but as near as I could tell,
sending something to a Vim server appends data to an X property. Vim
reads the data, but doesn't delete it from the property (again, as
near as I could tell; I may've missed it). So sending large amounts
of data over the Vim server channel would gradually bloat either the
Vim or the X memory footprint.
> When you have some event to alert vim instance, which must started
> with --server "server-name", just send a keystroke to which
> appropriate action mapped, or invoke a function with remote-expr.
Yes, this might work. Send data over a socket and then send a
"ReadData()" command over the server channel.
For the moment, the issue does not come up, though. You only need
asynchronous events if you have asynchronous data, and I've used only
synchronous calls to Swank so far (that is, send a request and do a
blocking wait for a response).
On Tue, Feb 14, 2006 at 08:21:26AM +0500, Dmitry Petukhov wrote:
> On 2/14/06, Larry Clapp <larry at theclapp.org> wrote:
> > Chad Daelhousen wrote:
> > > Personally (I hold no actual sway in the project), I would want
> > > something that works on a VT as well as under X. AFAIK, Vim's
> > > client-server feature relies on X11 communication (or equivalent
> > > on win32) to work.
>
> how many people do day-to-day development on VT ?
I do, for work. I telecommute, so I do most of my coding (no Lisp,
lots of shell and Perl) in a tty. Sometimes I develop locally -- in a
tabbed tty (gnome-terminal), with Vim in some tabs and shells in
others. Even when I worked "on site", I did a lot of my development
ssh'ed into a remote server. Anyone that develops on a remote server
might want to do development on a tty.
> swank is separate process, talkinkg through socket, and can reside
> on another host, while you using gvim on your desktop. and at least,
> this works _now_.
Well, that is a good point. :)
What does the list think? I think we have 4 (or maybe 5) choices:
- Do blocking waits for all calls to Swank
- Implement an event framework that basically intercepts many Vim
commands (typed text, cursor movement) and does event processing
before or after them
- Fork a separate process that prods Vim (say) 4x/sec via the Vim
server channel
- See what Brad does with the NetBeans interface
- I'd also like to investigate Perl threading, which could make the
whole problem go away. (This is the "or maybe 5th" option.)
Of course we have many more options than that, if we allow anything
involving modifying Vim. As always, if someone else wants to attempt
it, go for it, but I don't have time. :)
-- L
More information about the slimpl
mailing list