2012/7/7 Bram Moolenaar <[email protected]>:

> This does not appear to be the right solution.  It also affects a
> command like  ":n foo*"  even though that should obey 'wildignore'.

Backtick can avoid any special characters, including wildcard.
Thus, there is no reason for applying 'wildignore'.
":n foo*" does not relate on this discussion.  This is not escaped by backtick.


> Your example is about passing a literal string.  But it might as well be
> an expression that returns a list of file names.  Again, 'wildignore'
> should apply then.

A list of file names is not a wildcard.

  :args `=['a.txt', 'b.bak', 'c.txt']`

This should be equal to:

  :args a.txt b.bak c.txt

Not the following.

  :args a.txt c.txt


> Why would the user want to use backticks instead?

For example, I want to open a new file "file[a].txt".

  :e file[a].txt

This is often successful.  But, if file "filea.txt" exists, Vim opens it.
I try to avoid it by escape.

  :e file\[a].txt

However, this doesn't work well on MS Windows.  "\" is treated as a
directory separator.
Like this, the escape by "\" does not work.  fnameescape() is useless.
I try escape according to advice of ":help wildcard".

  :e file\[[]a].txt

But, this also doesn't work.  I don't know the reason.
Additionally, this way is too complex.
So, I use backtick to avoid this problem.

  :e `='file[a].txt'`

This works well.


Thanks.

--
thinca <[email protected]>

-- 
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

Raspunde prin e-mail lui