[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: spaces in isearch
From: |
Juri Linkov |
Subject: |
Re: spaces in isearch |
Date: |
Sun, 21 Nov 2004 19:09:48 +0200 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
Alex Schroeder <address@hidden> writes:
> Juri Linkov <address@hidden> writes:
>> Since C-q in isearch mode is processed by isearch-quote-char,
>> it could intercept SPC and insert [ ] into the search string.
>
> I'm not sure I like that. C-q <something> should insert <something>,
No, C-q <something> should be used to insert <something_different>.
There is no sense to use C-q <something> to insert the same <something>.
> I didn't know about the special behaviour of <space> in
> isearch-forward-regexp.
The old behavior: SPC inserts \\(?:\\s-+\\), C-q SPC inserts SPC.
The new behavior: SPC inserts SPC (which now internally means \\(?:\\s-+\\)).
So C-q SPC inserting SPC has no sense anymore since SPC now is
inserted by SPC itself.
Moreover, to achieve backward compatibility for users using C-q SPC
to match just a space, C-q SPC should do something to preserve the
literal meaning of a space. Adding [ ] to the search string in regexp
isearch mode is the most natural thing to do.
>From implementation point of view this means moving the old code from
`isearch-whitespace-chars' to `isearch-quote-char' and replacing
(isearch-process-search-string search-whitespace-regexp " ")
with
(isearch-process-search-string "[ ]" " ")
--
Juri Linkov
http://www.jurta.org/emacs/