[Top][All Lists]

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

Re: Calling occur from within isearch

From: Johan Bockgård
Subject: Re: Calling occur from within isearch
Date: Wed, 05 Dec 2007 00:59:12 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux)

Juri Linkov <address@hidden> writes:

>>> saying that the distinction between `yes' and `t' is valid for some
>>> searching interactive commands.
>> I can't see how this distinction is at all useful for the user.
>> `search-uppercase' already provides a (the) way to decide whether "mixed
>> case in the search string [should be] ignored":
>>     (if (and case-fold-search search-upper-case)
>>         (isearch-no-upper-case-p regexp t)
>>       case-fold-search)
> I can't comment why isearch functions use `(eq case-fold-search t)',
> but I think other interactive search-related commands like occur
> should use the same condition, whatever it is.

Note that the preceding line is

    (let ((case-fold-search isearch-case-fold-search))

and that there are two other places in isearch that use

    (and (eq isearch-case-fold-search t) search-upper-case)

Isearch needs the third value `yes' to handle the M-c feature (see

    C-s ABC M-c   => search is now case-insensitive, despite uppercase input

This is the only situation where `yes' is used; case-fold-search never
has this value outside isearch.

Other search functions have no use for this.

>> In the case of occur from within isearch, the current value of
>> isearch-case-fold-search will make searching find the right matches--if
>> occur does *not* look at the case of the input again
>>     (let ((case-fold-search isearch-case-fold-search)
>>           (search-upper-case nil))
>>       (occur regexp nlines))
> What code in occur for this case do you have in mind?

isearch-occur should do this.  Isearch has already decided if the search
should be case-sensitive or not, so occur should not consider input

Johan Bockgård

reply via email to

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