emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interpretation of a space in regexp isearch?


From: Juri Linkov
Subject: Re: Interpretation of a space in regexp isearch?
Date: Wed, 29 Aug 2012 11:28:51 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu)

>>> The magic of `C-q SPC' is missing for non-regexp searches though.
>>
>> `C-q SPC' inserts "[ ]" in regexp search.  The problem for non-regexp
>> search is how to avoid quoting "[ ]" in `regexp-quote'.
>
> Good point.  Here's how to handle this: when isearch-regexp is nil, make
> isearch-process-search-string call regexp-quote for each addition to the
> search string; then have isearch-quote-char suppress quoting by passing
> an optional arg to isearch-process-search-string.
>
> Then in isearch-search-fun-default, we can use re-search-forward for
> plain isearch as well, since the search string will have been
> appropriately quoted when processed.  See attached patch.

Unfortunately, this will expose the regexp used in non-regexp search
in such cases as editing the search string with M-e or repeating
the previous search from the search ring.  All special regexp characters
will be displayed as quoted with \.  This will mean that there is no more
plain non-regexp search from the user's point of view.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]