On Wed, 4 Oct 2006 at 10:30pm, Bram Moolenaar wrote:

>
> Fan Decheng wrote:
>
> > Bram Moolenaar wrote:
> > > Patch 7.0.111
> > > Problem:    The gzip plugin can't handle filenames with single quotes.
> > > Solution:   Add and use the shellescape() function. (partly by Alexey
Froloff)
> > > Files:      runtime/autoload/gzip.vim, runtime/doc/eval.txt, src/eval.c,
> > >             src/mbyte.c, src/misc2.c, src/proto/misc2.pro
> [...]
> > I wonder whether it is possible to use execv() instead of escaping the
> > command and then sending it to the shell. How do you think?
>
> Vim doesn't have an execv() function.  Implementing this properly for
> all systems isn't that simple.  At least you would need to take care of
> $PATH.

How about using the underlying execv() where it is supported, and when
it is not support just behave like system() does? This approach will
probably cover more than 95% of the vim users. The problems that exist
with using system() and different shells and environments is a huge
usability issue (this will also avoid the minimized window on windows
that most people feel bothered), and it might even make big difference
in the performance when external commands are executed often (like
using external commands to find matches for popup completion, everytime
a character is typed).

One caceat is that currently, if the external command execution takes a
lot of time, you want to terminate it, you can un-minimize the window
and kill it. If this window is avoided, Vim should still provide a means
to kill it (like doing an explicit kill() when user presses ^C while
waiting for the process).

-- 
Thanks,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to