On Friday, July 5, 2013 8:01:49 PM UTC+2, Bram Moolenaar wrote:
> Nikolay Pavlov wrote:
> 
> 
> > >
> 
> > > Nikolay Pavlov wrote:
> 
> > >
> 
> > > > > It's the other way around: On MS-Windows you can do:
> 
> > > > >
> 
> > > > >         :e foo\$bar
> 
> > > > >
> 
> > > > > That is editing the file "$bar" in directory "foo".  On Unix this has
> 
> > a
> 
> > > > > different meaning, editing file "foo$bar", thus not using $bar as an
> 
> > > > > environment variable. That's why test 97 won't work on MS-Windows.
> 
> > > >
> 
> > > > I had a problem with expand(fnameescape('$HOME')): here '$HOME' is
> 
> > assumed
> 
> > > > to be ./$HOME and fnameescape() does not cope with this. Same for
> 
> > ./a$HOME:
> 
> > > > it tries to edit either ./aC:... (which is impossible due to requirement
> 
> > > > not to have colon in the filename) or ./a/$HOME. There is a bug here.
> 
> > >
> 
> > > It's a problem, since:
> 
> > >
> 
> > >         :e $HOME
> 
> > >
> 
> > > Means to expand the environment variable $HOME, while
> 
> > >
> 
> > >         :e \$HOME
> 
> > >
> 
> > > Might mean editing the file "$HOME" in the current drive.
> 
> > >
> 
> > > Backslash escaping just doesn't work here.  Perhaps we should require
> 
> > > Windows style environment variables:
> 
> > >
> 
> > >         :e %HOME%
> 
> > >
> 
> > > That's not backwards compatible though.
> 
> > 
> 
> > I would suggest different kind of escaping: $$ will mean a single $. Not
> 
> > the best as it adds different meaning to $, but since backslash was
> 
> > partially released from its regular meaning (escape character) it is the
> 
> > best I can deduce.
> 
> 
> 
> Yeah, using $$HOME where $HOME is meant literally would probably work
> 
> best.  But it's very difficult to make all pieces of the code, with
> 
> environment variable expansion and wildcard handling work properly.
> 
> I'll make it a todo item.
> 
> 
> 
> -- 
> 
> I wonder, do vegetarians eat fruit bats?
> 
> 

Hello,

May be, an idea is not to change $HOME, or $bar at all, but in windows to 
expand $A_WORD to %A_WORD%, but not to expand \$A_WORD and :e \$A_WORD mean to 
edit the file "$A_WORD" in the current folder.
On windows to escape a char is more complicated, see the link:
http://www.robvanderwoude.com/escapechars.php

Best regards !

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui