On 8/9/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
> I'm going to fix the <f-args> bug mentioned in the todo
> (because I got bitten by it). I made a testcase (it's below), here is the
> table:
>
> Testcase                 Current          Expected
> --------------------------------------------------------------
> XX a\\ b    bug:   1 arg('a\ b')       Expected 2 args('a\','b') ?
> XX a\\  b   bug:   2 args('a\ ','b')   Expected 2 args('a\','b') ?
>
> Do you agree with the 'Expected' part that I propose ?
> It is tricky when to translate \\ into \\, and when to translate \\
> into \. If we do not translate '\\ ' into '\'+arg-break, then we cannot
> represent the argument which ends with single backslash.  Do you agree
> with translating '\\ ' into '\'+arg break ?

Looks OK with me.  Basic idea is that "\\" is handled like a backslash,
and "\ " is a space that doesn't separate arguments, right?  Trying to
write the docs that explains this may help deciding what the simple rule
is.  But we should also try to keep it mostly backwards compatible.

> " the testcase
> " XX \\         works, 2 args ('\\')

It would be a lot simpler if the result could be '\'.  But that's not
backwards compatible.  Perhaps you can ask on the Vim maillist if
someone would have a problem with this change.

> " XX a b        works, 2 args ('a','b')
> " XX a\ b       works, 1 arg ('a b')
> " XX a\\b              1 arg ('a\\b')       Shall it be 1 arg('a\b') ?

Making this 'a\b' is more straightforward, but again not backwards
compatible.

> " XX a\\ b      bug:   1 arg('a\ b')         Expected 2 args('a\','b')
> " XX a\\  b     bug:   2 args ('a\ ','b').   Expected 2 args('a\','b')

Right.  This also shows that '\\' can be passed on as '\', thus the
backwards compatibility problem isn't that big.


It would be a lot simpler if the result could be '\'.  But that's not
backwards compatible.  Perhaps you can ask on the Vim maillist if
someone would have a problem with this change.

I have problem with this change; and that's not because of
backward-compatibility, but
because in my plugin (helpwords), arguments are regular expressions.
It feels very
awkward to duplicate every \ in regexp, because \ are very common in regexps.
To type \\(foo\\|bar\\) ? Oh my god. That breaks my intuitition for
typing and seeing regexps.

What do you think about adding another, new form <ff-args> (?) that changes
every  \\ to \, whereas <f-args> leaves \ as \ and \\ as \\ (except
before whitespace) ?

On mailing list (http://marc.theaimsgroup.com/?l=vim-dev&m=115524231924245&w=2),
two people voted for always relpacing \\ with \.

But I don't like it.

What do you say about having two forms <f-args> and <ff-args> (spelling?),
one of which is backward-compatible (\\->\\) and new form is \\->\ ?
If you agree,
is <ff-args> spelling ok ?

Yakov

Reply via email to