GNU bug report logs - #22147
Obsolete search-forward-lax-whitespace

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Fri, 11 Dec 2015 23:54:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 22147 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Artur Malabarba <bruce.connor.am <at> gmail.com>
Cc: 22147 <at> debbugs.gnu.org
Subject: Re: bug#22147: Obsolete search-forward-lax-whitespace
Date: Mon, 14 Dec 2015 02:23:34 +0200
>> 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?




This bug report was last modified 4 years and 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.