Typo in the regex doc (can mislead users)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Typo in the regex doc (can mislead users)

Sitaktif
Dear team,

There is a typo in the doc about the regex patterns. Can be quite
misleading since the operator is not easy to understand for beginners.

Location : runtime/doc/patterns.txt
Where :

:help \@!
It is in second paragraph, second example : "a", "ap", "aap" should be
"a", "ap", "app". (The same example in the first paragraph is right)

I included a patch, but this is my first one, so tell me if I need to
modify it to be conform to Vim devel standards.

Best,

--
Romain Chossart

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

doc_pattern_patch_sitaktif.patch (856 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Typo in the regex doc (can mislead users)

Lech Lorens
On 04-Mar-2010 Romain Chossart <[hidden email]> wrote:

> Dear team,
>
> There is a typo in the doc about the regex patterns. Can be quite
> misleading since the operator is not easy to understand for beginners.
>
> Location : runtime/doc/patterns.txt
> Where :
>
> :help \@!
> It is in second paragraph, second example : "a", "ap", "aap" should be
> "a", "ap", "app". (The same example in the first paragraph is right)
>
> I included a patch, but this is my first one, so tell me if I need to
> modify it to be conform to Vim devel standards.


Both the versions are correct. Maybe the sentence might be more
descriptive instead of providing an example, e.g.:

"a.\{-}p\@!" will match any string beginning with an "a" (NOTE: also
one ending with a "p") that isn't followed by a "p", because the "."
can match any single character (including a "p") and "p\@!" doesn't
match after that.

--
Cheers,
Lech

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Typo in the regex doc (can mislead users)

Tony Mechelynck
In reply to this post by Sitaktif
On 04/03/10 14:21, Romain Chossart wrote:

> Dear team,
>
> There is a typo in the doc about the regex patterns. Can be quite
> misleading since the operator is not easy to understand for beginners.
>
> Location : runtime/doc/patterns.txt
> Where :
>
> :help \@!
> It is in second paragraph, second example : "a", "ap", "aap" should be
> "a", "ap", "app". (The same example in the first paragraph is right)
>
> I included a patch, but this is my first one, so tell me if I need to
> modify it to be conform to Vim devel standards.
>
> Best,
>
> --
> Romain Chossart
>

The patch (a unified diff) is OK: IIUC, Bram prefers context diffs but
accepts unified diffs. Other kind of diffs (e.g. an ed-style diff) are
not OK.

However, as Lech said, in this case the current help text is maybe
unclear but not wrong.


Best regards,
Tony.
--
Wiker's Law:
        Government expands to absorb revenue and then some.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Typo in the regex doc (can mislead users)

Sitaktif
Sorry, my bad, I made too quick conclusions from the fact that the two
different examples for the same pattern ("a", "ap", "aap" and "a",
"ap", "app").

We could make the sentence more descriptive, as Lench said, but I
would also explain :
``With that example, the only possibility to match more than one
character is with "ap", "app", ...``. It would help understanding the
operator imho, because when we test the example ourselves, "aa" is
highlited in "aap" (when hlsearch is on)... but it is in fact two
matches !


@Tony: Ok, thanks for the patching convention

Best,
Romain
--
Romain Chossart



On Fri, Mar 5, 2010 at 3:22 AM, Tony Mechelynck
<[hidden email]> wrote:

> On 04/03/10 14:21, Romain Chossart wrote:
>>
>> Dear team,
>>
>> There is a typo in the doc about the regex patterns. Can be quite
>> misleading since the operator is not easy to understand for beginners.
>>
>> Location : runtime/doc/patterns.txt
>> Where :
>>
>> :help \@!
>> It is in second paragraph, second example : "a", "ap", "aap" should be
>> "a", "ap", "app". (The same example in the first paragraph is right)
>>
>> I included a patch, but this is my first one, so tell me if I need to
>> modify it to be conform to Vim devel standards.
>>
>> Best,
>>
>> --
>> Romain Chossart
>>
>
> The patch (a unified diff) is OK: IIUC, Bram prefers context diffs but
> accepts unified diffs. Other kind of diffs (e.g. an ed-style diff) are not
> OK.
>
> However, as Lech said, in this case the current help text is maybe unclear
> but not wrong.
>
>
> Best regards,
> Tony.
> --
> Wiker's Law:
>        Government expands to absorb revenue and then some.
>

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