Subject: Re: bug#13480: 24.3.50; `C-w' from Isearch should translate newlines to spaces

From: Dani Moncayo <[email-masked]>
Date: Sat, 19 Jan 2013 11:40:14 +0100

>> Well, OTOH it makes a lot of sense to think of the text displayed in
>> the echo area (during Isearch) not necessarily as the raw search
>> string, but as its "canonical form", according to the current matching
>> behavior (which the user should be able to alter on-the-fly).
>>
>> Definitely that would be a nice behavior, and not only for the laxity
>> in whitespace matching, but also in other ones discussed recently like
>> those related to accented letters.
>
> `isearch-yank-string' already downcases the yanked upper case string
> to lower case, so it's possible to do the same with lax spaces and
> accented letters.

Yes, but I see that currently the conversion to lowercase is
destructive, i.e., the original text supplied by the user is lost.
For example, if I have "Hello" in the kill ring and do `C-s C-y M-s
c', obviously I'd like to be searching for "Hello" case-sensitively,
but currently I end up searching (case-sensitively) for "hello".
That's wrong, IMO.

I propose to:
1. Store in one variable the "raw" (untouched) search string, as
supplied by the user.
2. Store in another variable (or define a function to get) the
"canonical" search string, based on the raw search string and the
"laxities" enabled at that moment for the search algorithm (related to
whitespace, case-sensitivity, accents, etc).
3. Display the canonical search string in the echo area and use it
also in the search algorithm.

-- 
Dani Moncayo