Re: Patch 7.0.111

2006-10-05 Thread Fan Decheng

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.

  

Oh, right. Calling the shell requires escaping, and using execv()
requires a portability layer and dealing with $PATH. Calling the shell
is relatively simpler.





Re: Patch 7.0.111

2006-10-04 Thread Bram Moolenaar

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.

-- 
For society, it's probably a good thing that engineers value function over
appearance.  For example, you wouldn't want engineers to build nuclear power
plants that only _look_ like they would keep all the radiation inside.
(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Patch 7.0.111

2006-10-04 Thread Hari Krishna Dara

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