On 5/6/2006, at 20:40, Ethan Gutmann wrote:
[...] I wonder if it is possible to keep a persistent process open in the background and send commands to it. I'm not sure how IDLWAVE http://www.idlwave.org does this for emacs, I'm afraid that emacs runs a complete shell of its own... I suppose this could be done with a separate program that just passes information back and forth, but that seems inelegant (and more difficult than it needs to be). All I need to do is start a process, pass strings to it as standard in, and read standard out and error from it.
Conceptually this is possible using named pipes, e.g. we start by doing:
% mkfifo in && mkfifo out % bash -s <in &>out &
Now we have bash running in the background with stdin/out/err connected to named pipes.
So from somewhere else we can send ‘date’ to bash by doing:
% echo date >in
And then:
% read res <out && echo "$res" Tue Jun 6 13:06:25 CEST 2006
This reads a line from the output of the background bash process and prints it.
Though the above will close the named pipes after writing/reading to/ from them. I am not skilled in file descriptor joggling from shell, but at least I know that POSIX does provide the necessary API for reading/writing w/o closing and waiting for output etc.
[...] I would also like to inquire about the status of a plugin API. The web page says more is likely to be done here, has anything been done?
No, and it’s unlikely something I will find time for anytime soon. If you have small requests then I am however willing to listen.
Eventually I might want to write a simple plugin that talks to the IDL process and highlights associated lines in the editor window (and possibly add a GUI for querying and displaying variables)
You should be able to pull that off with the existing capabilities. Either using the ODB Editor Interface to highlight the lines, or the txmt URL scheme -- as for GUI, you can inject anything into the TM program space using the current plug-in loading capabilities, which includes full-blown interactive GUIs.