[Top][All Lists]
[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 01:54:18 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) |
> I have other things to do, so I haven't participated in this thread,
> but FWIW, I think that search-whitespace-regexp is not something that
> should be used by default.
Ignoring whitespace in isearch is a very useful feature.
But I agree that its current implementation is far from optimal.
It would be better to reimplement it in isearch exactly the same way
as `isearch-word' is implemented because these two are similar features.
A new `isearch-whitespace' toggled by `M-s SPC' could construct a regexp
like in `word-search-regexp' and search it with `re-search-forward' in
`isearch-search-fun-default'. This will provide flexibility to solve
related problems.
To make this feature less "magic" and surprising to users,
it could reveal a constructed regexp after switching from ordinary
isearch mode to regexp mode. As well as after switching from word mode
to regexp mode could also reveal the regexp used to search words
ignoring punctuation.
Another variant to implement `isearch-toggle-whitespace' is like
`isearch-toggle-case-fold' that changes the value of the internal
variable `case-fold-search' effective to both regexp and non-regexp
searches. But I don't know how difficult is to modify the
search engine to ignore whitespace the same way as it ignores case
using translation tables.
Regarding the need to quote literal spaces in non-regexp search,
one example of possible solution is HTML that uses "nobr"
for essential whitespace that should not be ignored.
Doing the same in isearch for `C-q SPC' would insert "no-break space"
to the search string. Then repeating a non-regexp search
from the search ring will correctly interpret it as a literal space
(as opposed to the normal space character interpreted as whitespace pattern).
- Re: Interpretation of a space in regexp isearch?, (continued)
- Re: Interpretation of a space in regexp isearch?, Chong Yidong, 2012/08/26
- Re: Interpretation of a space in regexp isearch?, Bastien, 2012/08/26
- Re: Interpretation of a space in regexp isearch?, Dani Moncayo, 2012/08/26
- Re: Interpretation of a space in regexp isearch?, Dani Moncayo, 2012/08/26
- Re: Interpretation of a space in regexp isearch?, Juri Linkov, 2012/08/28
- Re: Interpretation of a space in regexp isearch?, Dani Moncayo, 2012/08/28
- Re: Interpretation of a space in regexp isearch?, Juri Linkov, 2012/08/28
- Re: Interpretation of a space in regexp isearch?, Johan Bockgård, 2012/08/27
- Re: Interpretation of a space in regexp isearch?, Juri Linkov, 2012/08/28
- Re: Interpretation of a space in regexp isearch?, Stefan Monnier, 2012/08/28
- Re: Interpretation of a space in regexp isearch?,
Juri Linkov <=
- RE: Interpretation of a space in regexp isearch?, Drew Adams, 2012/08/28
- Re: Interpretation of a space in regexp isearch?, Juri Linkov, 2012/08/29
- RE: Interpretation of a space in regexp isearch?, Drew Adams, 2012/08/29
- Re: Interpretation of a space in regexp isearch?, Juri Linkov, 2012/08/29
- Re: Interpretation of a space in regexp isearch?, Chong Yidong, 2012/08/30
- Re: Interpretation of a space in regexp isearch?, Chong Yidong, 2012/08/30
- Re: Interpretation of a space in regexp isearch?, Juri Linkov, 2012/08/30
- Re: Interpretation of a space in regexp isearch?, Stefan Monnier, 2012/08/30
- Re: Interpretation of a space in regexp isearch?, Juri Linkov, 2012/08/30
- Re: Interpretation of a space in regexp isearch?, Juri Linkov, 2012/08/30