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

From: Juri Linkov <[email-masked]>
Date: Tue, 15 Dec 2015 01:58:11 +0200

>> (maybe simpler
>> would be to normalize the search string by turning all whitespace
>> into space characters),
>
> Yes, I think this should give you the behaviour you're looking for.
> Try setting search-default-regexp-function to #'my-lax-with-char-fold,

search-default-regexp-mode definitely needs to be renamed to
search-default-regexp-function ;-)

> where
>
> (defun my-lax-with-char-fold (s &optional l)
>   (character-fold-to-regexp (replace-regexp-in-string "\t\n\r\s+" " " s)
> l))
>
> And then also set search-whitespace-regexp like above.

Thanks for the suggestion.  Since it works, then maybe better
generalize it to allow a mode that supports normalization of
the search string, that also will do symmetric char-folding,
where e.g. searching for “ä” will match “a”, etc.