GNU bug report logs - #13480
24.3.50; `C-w' from Isearch should translate newlines to spaces

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 17 Jan 2013 20:41:02 UTC

Severity: normal

Tags: moreinfo

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 13480 <at> debbugs.gnu.org
Subject: bug#13480: 24.3.50; `C-w' from Isearch should translate newlines to spaces
Date: Fri, 18 Jan 2013 00:54:35 +0100
>>> So I propose that the command `isearch-yank-word-or-char' (C-w in
>>> Isearch) DTRT in this case, i.e., when `search-whitespace-regexp' is
>>> non-nil, translate the <newline> into a simple space when pulling text
>>> from the buffer into the search string.
>>
>> It makes sense to translate the <newline> into a simple space
>> only when `search-whitespace-regexp' contains <newline>
>> such as e.g. (setq search-whitespace-regexp "\\(\\s-\\|\n\\)+")
>> Otherwise, the translated space won't match <newline>.
>> It is possible to do this with the patch below.
>
> Indeed.  Any character that matches the current value of
> `search-whitespace-regexp' should be translated to a single space.

Wait a moment.  On second thought, I think that no translation should
be necessary at all when adding text from somewhere to the search string.

As I see it, the problem (bug) is that when `isearch-lax-whitespace'
is non-nil, a search string like "foo<X>bar" should match every
string like "foo<Y>bar" in the buffer, where X and Y are arbitrary
strings that match `search-whitespace-regexp'.

But the current behavior is different: only plain spaces in the search
string are matched against `search-whitespace-regexp', i.e., "<X>" is
fixed to a plain space.

-- 
Dani Moncayo




This bug report was last modified 3 years and 86 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.