Tuesday, October 6, 2015

Re: file patterns for argument list

On Thursday, October 1, 2015 at 2:44:46 PM UTC-5, Tim Chase wrote:
> On 2015-10-01 13:58, Benjamin Fritz wrote:
> > Today I discovered that this works to add both file.h and file.cpp
> > to the arg list:
> >
> > :args file.*{cpp,h}
> >
> > But this doesn't work:
> >
> > :args file.{cpp,h}
> >
> > The second variant just adds the (non-existent) "file.{cpp,h}" file
> > name (with a literal "{h,cpp}" in the name) to the arg list.
>
> Do you experience it when you start vim with "-u NONE"?
>

Yes, I get the strange literal file name with "gvim -N -u NONE -i NONE"
as well, unless I throw a '*' in there, exactly as before.

> I just tried your example and it worked fine (the stock 7.4.1-488,576
> on Debian Linux), putting those two file-names in my argument list, as
> reported back with ":args".
>
> I don't know if it's an OS-specific globbing, so if you're running it
> on Windows, you might see a different behavior (I just tested it on
> an XP VM that I have at hand where I do see the behavior you
> describe).
>

I'm running on Windows 7 with 64-bit Vim 7.4.872. HUGE features.

On Thursday, October 1, 2015 at 11:30:49 PM UTC-5, Tony Mechelynck wrote:
> On Thu, Oct 1, 2015 at 8:58 PM, Benjamin Fritz <fritzophrenic@gmail.com> wrote:
>
> It might be related to what I read in $VIMRUNTIME/doc/cmdline.txt
> lines 940 sqq. (some lines below the helptag *extension-removal*), as
> follows:
>
> Note: Where a file name is expected wildcards expansion is done. On Unix the
> shell is used for this, unless it can be done internally (for speed).
> Unless in |restricted-mode|, backticks work also, like in >
> :n `echo *.c`
> But expansion is only done if there are any wildcards before expanding the
> '%', '#', etc.. This avoids expanding wildcards inside a file name.
>

This is part of the help for filename-modifiers, I don't expect it to
apply to normal file names/wildcards. Even if it does apply, I'm not
using %, #, etc. in my file name, so the "expansion is only done..."
text shouldn't apply.

I'm on Windows, so the "On Unix the shell is used for this" shouldn't
apply either.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: