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

From: Artur Malabarba <[email-masked]>
Date: Tue, 15 Dec 2015 10:15:56 +0000

2015-12-14 23:58 GMT+00:00 Juri Linkov <[email-masked]>:
>>> (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 ;-)

Like I said on the devel thread, not sure about this. The only reason
I got this wrong on all the above messages is that I wrote every
single one of them from my phone. :-)

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

I don't know what you mean. IIUC, the current framework already
supports a "normalizing mode", which is what we just did here, isn't
it?