Re: autochdir feature not seen by has() and :version
> If Vim is built with the 'autochdir' feature defined, it is not > reported as such by the ":version" command and has('autochdir') > returns zero. > > The following diffs show my proposed patches: Thanks, I'll include it. -- I have to exercise early in the morning before my brain figures out what I'm doing. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- 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.
Re: autochdir feature not seen by has() and :version
Christian wrote: > On Do, 26 Jul 2018, mssr...@gmail.com wrote: > > > If Vim is built with the 'autochdir' feature defined, it is not reported as > > such by the ":version" command and has('autochdir') returns zero. > > > > The following diffs show my proposed patches: > > Why do we need this? Scripts currently test for the autochdir feature by > using `exists('+autochdir')` Yeah, you can check for the option to exist. But it's not very consistent. And you cannot find out without the +eval feature. -- What the word 'politics' means: 'Poli' in Latin meaning 'many' and 'tics' meaning 'bloodsucking creatures'. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- 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.
Re: autochdir feature not seen by has() and :version
On Fri, Jul 27, 2018 at 5:40 PM, wrote: > On Friday, July 27, 2018 at 12:50:44 AM UTC-4, Tony Mechelynck wrote: >> On Fri, Jul 27, 2018 at 3:41 AM, wrote: >> > If Vim is built with the 'autochdir' feature defined, it is not reported >> > as such by the ":version" command and has('autochdir') returns zero. >> >> Maybe this is only a documentation error under :help 'autochdir' ? >> Such a feature is also not mentioned under :h feature-list and :h >> +feature-list. > > However, AUTOCHDIR is listed as a "feature" in feature.h so I would think it > should included in feature-list and therefore should be recognized by has() > and :version. Why should some "features" be recognized and not others? > >> >> AFAICT, Huge, Big and Normal builds return 1 as the value of >> exists('+autochdir'), and neither exists() nor has() can be tested in >> Small and Tiny builds, which lack expression evaluation. > > My experience is different. Here's the full disclosure. > > I always build Vim under Windows using mingw and specify FEATURES=NORMAL. I > wanted to have the 'autochdir' feature but did not want to build with BIG > features because I have no use for 'rightleft', 'farsi', and others. So I > added -DFEAT_AUTOCHDIR to the make variable DEFINES in Make_cyg_ming.mak. I > was able to build without error and all tests passed. To make sure that the > 'autochdir' feature was included, I tried has() and :version and saw that it > was not listed. An investigation into why then lead to my proposed patches. > > -mike Well, I build all 5 featuresets of Vim on Linux64; here are the environment variables defining my configure settings for the Normal build: export CONF_OPT_GUI='--enable-gui=gtk2' export CONF_OPT_MULTIBYTE='--enable-multibyte' export CONF_OPT_AUTOSERVE='--enable-autoservername' export CONF_OPT_FEAT='--with-features=normal' export CONF_ARGS='--with-vim-name=vim-normal' export CONF_OPT_COMPBY='"--with-compiledby=antoine.mechely...@gmail.com"' As you can see, the 'autochdir' feature (which I personally don't use) is defaulted; but when I invoke the "vim-normal" executable in konsole and ask it :echo exists('+autochdir') it answers 1, meaning (according to ":help exists()") that the 'autochdir' option not only is known, but works in this executable. Note also that neither :help 'autochdir', :help feature-list nor :help +feature-list mention any +autochdir feature; what is said under :help 'autochdir' about it is {only available when compiled with it, use exists("+autochdir") to check} IOW, IMHO trying to use has('autochdir'), and expecting it to return 1 if the option works, is unsupported behaviour. Best regards, Tony. -- -- 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.
Re: autochdir feature not seen by has() and :version
On Friday, July 27, 2018 at 1:40:58 AM UTC-4, Christian Brabandt wrote: > On Do, 26 Jul 2018, mssr...@gmail.com wrote: > > > If Vim is built with the 'autochdir' feature defined, it is not reported as > > such by the ":version" command and has('autochdir') returns zero. > > > > The following diffs show my proposed patches: > > Why do we need this? Scripts currently test for the autochdir feature by > using `exists('+autochdir')` 1. 'autochdir' is a feature, has() can take a feature argument, and :version lists features. 2. has('autochdir') returns zero even if that feature has been built-in. 3. :version does not list that feature whether or not it's built-in. What am I missing? -mike > > > Best, > Christian > -- > Milch bleibt wesentlich länger frisch, wenn man sie in der Kuh beläßt. -- -- 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.
Re: autochdir feature not seen by has() and :version
On Friday, July 27, 2018 at 12:50:44 AM UTC-4, Tony Mechelynck wrote: > On Fri, Jul 27, 2018 at 3:41 AM, wrote: > > If Vim is built with the 'autochdir' feature defined, it is not reported as > > such by the ":version" command and has('autochdir') returns zero. > > Maybe this is only a documentation error under :help 'autochdir' ? > Such a feature is also not mentioned under :h feature-list and :h > +feature-list. However, AUTOCHDIR is listed as a "feature" in feature.h so I would think it should included in feature-list and therefore should be recognized by has() and :version. Why should some "features" be recognized and not others? > > AFAICT, Huge, Big and Normal builds return 1 as the value of > exists('+autochdir'), and neither exists() nor has() can be tested in > Small and Tiny builds, which lack expression evaluation. My experience is different. Here's the full disclosure. I always build Vim under Windows using mingw and specify FEATURES=NORMAL. I wanted to have the 'autochdir' feature but did not want to build with BIG features because I have no use for 'rightleft', 'farsi', and others. So I added -DFEAT_AUTOCHDIR to the make variable DEFINES in Make_cyg_ming.mak. I was able to build without error and all tests passed. To make sure that the 'autochdir' feature was included, I tried has() and :version and saw that it was not listed. An investigation into why then lead to my proposed patches. -mike > > > Best regards, > Tony. > > > > > > > The following diffs show my proposed patches: > > > > $ git diff evalfunc.c > > diff --git a/src/evalfunc.c b/src/evalfunc.c > > index a9f6c5b8a..ae849be2f 100644 > > --- a/src/evalfunc.c > > +++ b/src/evalfunc.c > > @@ -6045,6 +6045,9 @@ f_has(typval_T *argvars, typval_T *rettv) > > "arabic", > > #endif > > "autocmd", > > +#ifdef FEAT_AUTOCHDIR > > + "autochdir", > > +#endif > > #ifdef FEAT_AUTOSERVERNAME > > "autoservername", > > #endif > > $ > > $ git diff version.c > > diff --git a/src/version.c b/src/version.c > > index 830de26fc..abc7bf8df 100644 > > --- a/src/version.c > > +++ b/src/version.c > > @@ -101,6 +101,11 @@ static char *(features[]) = > > "-arabic", > > #endif > > "+autocmd", > > +#ifdef FEAT_AUTOCHDIR > > + "+autochdir", > > +#else > > + "-autochdir", > > +#endif > > #ifdef FEAT_AUTOSERVERNAME > > "+autoservername", > > #else > > > > -- > > -- > > 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. -- -- 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.
Re: autochdir feature not seen by has() and :version
On Do, 26 Jul 2018, mssr...@gmail.com wrote: > If Vim is built with the 'autochdir' feature defined, it is not reported as > such by the ":version" command and has('autochdir') returns zero. > > The following diffs show my proposed patches: Why do we need this? Scripts currently test for the autochdir feature by using `exists('+autochdir')` Best, Christian -- Milch bleibt wesentlich länger frisch, wenn man sie in der Kuh beläßt. -- -- 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.
Re: autochdir feature not seen by has() and :version
On Fri, Jul 27, 2018 at 3:41 AM, wrote: > If Vim is built with the 'autochdir' feature defined, it is not reported as > such by the ":version" command and has('autochdir') returns zero. Maybe this is only a documentation error under :help 'autochdir' ? Such a feature is also not mentioned under :h feature-list and :h +feature-list. AFAICT, Huge, Big and Normal builds return 1 as the value of exists('+autochdir'), and neither exists() nor has() can be tested in Small and Tiny builds, which lack expression evaluation. Best regards, Tony. > > The following diffs show my proposed patches: > > $ git diff evalfunc.c > diff --git a/src/evalfunc.c b/src/evalfunc.c > index a9f6c5b8a..ae849be2f 100644 > --- a/src/evalfunc.c > +++ b/src/evalfunc.c > @@ -6045,6 +6045,9 @@ f_has(typval_T *argvars, typval_T *rettv) > "arabic", > #endif > "autocmd", > +#ifdef FEAT_AUTOCHDIR > + "autochdir", > +#endif > #ifdef FEAT_AUTOSERVERNAME > "autoservername", > #endif > $ > $ git diff version.c > diff --git a/src/version.c b/src/version.c > index 830de26fc..abc7bf8df 100644 > --- a/src/version.c > +++ b/src/version.c > @@ -101,6 +101,11 @@ static char *(features[]) = > "-arabic", > #endif > "+autocmd", > +#ifdef FEAT_AUTOCHDIR > + "+autochdir", > +#else > + "-autochdir", > +#endif > #ifdef FEAT_AUTOSERVERNAME > "+autoservername", > #else > > -- > -- > 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. -- -- 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.