[Top][All Lists]

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

bug#22147: Obsolete search-forward-lax-whitespace

From: Juri Linkov
Subject: bug#22147: Obsolete search-forward-lax-whitespace
Date: Mon, 14 Dec 2015 02:23:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu)

>> Thanks, setting search-default-regexp-mode to #'search-whitespace-regexp
>> gives the same effect.
>> One drawback is that then it removes char-fold search.
> True. I think it might also be possible to get what you want by just
> setting the search-whitespace-regexp variable to "[ \t\r\n]+". That would
> have the advantage of not removing char folding (and would reduce
> everything to one line).

This still doesn't allow ^J in the search string to match a newline.
I often paste multi-line texts into the search string and need to
ignore differences in newlines usually caused by text re-filling.

What the mentioned regexp function does is replacing all whitespace
in the search string with the regexp that matches whitespace (also
it's possible to replace whitespace with a space character and then
use search-spaces-regexp to match this space character using the regexp
in search-whitespace-regexp).

By analogy with char-folding, this means symmetric whitespace folding.
When char-fold-symmetric causes all members of a folding equivalence
class to be treated equivalently, lax-whitespace-symmetric could
treat only whitespace character equivalently.

>> Do you have a plan to combine lax-whitespace search with char-fold search?
> Char-folding is perfectly compatible with the regular lax-whitespace.

Could char-folding already do the described above (maybe simpler
would be to normalize the search string by turning all whitespace
into space characters), or better first implement char-fold-symmetric
and then use it for whitespace characters?

reply via email to

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