On 2014-03-13, Viktor Kojouharov wrote: > On Thursday, March 13, 2014 11:25:35 PM UTC+2, Gary Johnson wrote: > > On 2014-03-13, Viktor Kojouharov wrote: > > > Hi Bram, > > > > > > I made a patch which adds a new variable, 'v:progpath'. Quite > > > similar to 'v:progname', but including the full invocation path of > > > the current vim instance. The full path itself is quite useful > > > when you want to do tricks with vim servers and --remote-expr, and > > > you don't have to care whether vim is in the $PATH. > > > > > diff -r a42040fed96c src/main.c > > > --- a/src/main.c Tue Jan 14 21:31:34 2014 +0100 > > > +++ b/src/main.c Thu Mar 13 23:02:21 2014 +0200 > > > @@ -1611,6 +1611,7 @@ > > > > > > #ifdef FEAT_EVAL > > > set_vim_var_string(VV_PROGNAME, initstr, -1); > > > + set_vim_var_string(VV_PROGPATH, (char_u *)parmp->argv[0], -1); > > > #endif > > > > > > if (TOLOWER_ASC(initstr[0]) == 'r') > > > > If I'm reading your patch correctly, it assumes that argv[0] > > contains the full path to the executable. That's not true in > > general.
> It contains the full path which was used to start vim. It could > very well be a relative path, or be the same as progname, if vim > was run started from the $PATH, but wouldn't the value be enough > to start another instance of vim? If all you need is a way to start another instance of the executable you're running, then that might be enough. However, you might need to remember the working directory in which vim was started in case argv[0] is a relative path and the user changes working directories before querying the value of v:progpath. Regards, Gary -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.