bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54230: 29.0.50; Unhelpful regexp hint in search-whitespace-regexp


From: Andreas Schwab
Subject: bug#54230: 29.0.50; Unhelpful regexp hint in search-whitespace-regexp
Date: Thu, 03 Mar 2022 10:53:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

On Mär 03 2022, Rudolf Adamkovič via "Bug reports for GNU Emacs, the Swiss army 
knife of text editors" wrote:

> In the documentation for the 'search-whitespace-regex':
>
> Actual:
>
>> You might want to use something like "[ \\t\\r\\n]+" instead.
>
> Expected:
>
>> You might want to use something like "[ \t\r\n]+" instead.

You need to look at the actual doc string, not its source:

    If non-nil, regular expression to match a sequence of whitespace chars.
    When you enter a space or spaces in the incremental search, it
    will match any sequence matched by this regexp.  As an exception,
    spaces are treated normally in regexp incremental search if they
    occur in a regexp construct like [...] or *, + or ?.

    If the value is a string, it applies to both ordinary and
    regexp incremental search.  If the value is nil, or
    ‘isearch-lax-whitespace’ is nil for ordinary incremental search, or
    ‘isearch-regexp-lax-whitespace’ is nil for regexp incremental search,
    then each space you type matches literally, against one space.

    You might want to use something like "[ \t\r\n]+" instead.
    In the Customization buffer, that is ‘[’ followed by a space, a
    tab, a carriage return (control-M), a newline, and ‘]+’.  Don’t
    add any capturing groups into this value; that can change the
    numbering of existing capture groups in unexpected ways.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]