On Jul 6, 2013 12:34 AM, "Charles Campbell" <[email protected]> wrote: > > Bram Moolenaar wrote: >> >> Nikolay Pavlov wrote: >> >>> On Jul 4, 2013 10:25 PM, "Bram Moolenaar" <[email protected]> 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. >> > May I point out that, under both Korn shell and Bash, $$ expands to the process pid; currently it appears to do nothing under vim, though.
It was taken specifically for this reason: if it did expand to PID I would not suggest it. If you have better suggestion for an alternate escape variant please post it here. > Regards, > Chip Campbell > > -- > -- > 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. > > -- -- 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.
