On 14 Dec 2015 12:23 am, "Juri Linkov" wrote: > > > > 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. Right. I always get confused about that variable. > (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, 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.