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: Dani Moncayo
Subject: Re: Interpretation of a space in regexp isearch?
Date: Tue, 28 Aug 2012 11:07:00 +0200

On Tue, Aug 28, 2012 at 10:28 AM, Juri Linkov <address@hidden> wrote:
>> 1. Info mode has its own variable `Info-search-whitespace-regexp'.
>> Why is it necessary?  I guess there's a reason (which I don't know by
>> now)
>
> `Info-search-whitespace-regexp' is used in the regexp-based `Info-search'.

OK but why do we need it?  I.e, why can't use
`search-whitespace-regexp' also in Info mode?

> Its default value is the same as for `search-whitespace-regexp'
> (actually it could inherit the default value directly from the value of
> `search-whitespace-regexp').
>
>> so it seems that your change should also affect to this variable.
>
> Yes, these changes affect this variable.  The condition that checks for
> `isearch-regexp' should be removed from `Info-search' like in the patch
> below (could be installed after resolving other problems).

Does your patch makes `Info-search-whitespace-regexp' in Info mode
behave like `search-whitespace-regexp' in other modes?

>> 2. Why don't you include \n and \r by default in the regexp?  IMO
>> that'd be TRT for most users.
>
> The default value of `search-whitespace-regexp' is "\\s-+"
> that means it matches whitespace including \n and \r by default.
> However, some modes override this default whitespace syntax
> where newlines are not whitespace.  For example, in Lisp
> a newline ends a comment.  But currently you can't search
> in comments without regard to line breaks anyway.
> To implement this, `search-whitespace-regexp' should also
> ignore the semicolon that starts a comment.

Ok I see it now.

>> 3.  Why should this feature be limited to _incremental_ searches?  I
>> don't think it should.  The documentation states this limitation (see
>> [1][2][3]) but according to the tests I've done, non-incremental
>> searches also take `search-whitespace-regexp' into account.
>
> By the term "non-incremental searches" do you mean
> `M-x nonincremental-search-forward RET' or `C-s RET'?

I mean `C-s RET' or `C-M-s RET'.


-- 
Dani Moncayo



reply via email to

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