[IPython-dev] Close to giving up (was: Re: Synchronization with Editor)
Vivian De Smedt
vivian at vdesmedt.com
Mon Jun 16 09:50:20 EDT 2008
Hi Heinz,
Thanks for your technical feedback.
Here are my answer to the three points I have isolated in your mails.
Tell me if I have missed one.
> * IMO hooks.synchronize_with_editor should be merged with
> hooks.fix_error_editor.
>
I suspect IPython to assume that when fix_error_editor hook will return
the error will be fixed.
So that hook should be synchronous. It should give back the hand to the
editor and wait that the user validate the changes by closing the editor
or sending a signal (e.g. emacs).
The synchronize_with_editor hook don't have to be synchronous. It has to
synchronize the editor with IPython, opening the script file at the
right line, and return (no user input needed).
So if we merge both hooks I think we should at least add a parameter to
tell what should be the action of the hook:
- synchronize and wait for validation before returning or
- synchronize only and return.
With the multi tab editor or multi buffer editor the first kind of hooks
are not so easy to write. You don't want to quit the editor at the end
of the edition and you have no built in way to signal that you have
finish with the edition of a particular file opened in the editor (emacs
is the exception).
> * I think the win32 imports should be wrapped in a conditional block
> for *nix users to benefit from this.
>
About the unix version I'll be glad to improve the code to support them
what I think should be improved is the following:
- The .exe extention should be removed (I just remove them)
- The name of the executables should be checked (scite, emacsclient,
gvim, ...)
- We should provide alternative for runCommand, sleep and
restoreConsoleFocus
Unfortunately I have no access to a linux box to test possible
alternatives. If someone could propose something I'll be glad to
incorporate it into the ip_synchronize_width.py propositions of hooks.
> * Nearly the same code can be used for XEmacs/gnuserv (using gnuclient instead
> of gvim as command).
>
In the emacs version of the hook I have implemented something based on
emacsclient that seems to works well for emacs at least on the win32
platform.
Tell me what you think.
Did you had a chance to test the hooks for some editor. Did you find it
useful or handy?
Kindest regards,
Vivian.
More information about the IPython-dev
mailing list