bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#49534: 26.3; Isearch should support using filter predicates with emp


From: Juri Linkov
Subject: bug#49534: 26.3; Isearch should support using filter predicates with empty search hits
Date: Tue, 13 Jul 2021 22:25:36 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

tags 49534 fixed
close 49534 28.0.50
quit

>> That won't work.  Isearch is unnecessarily restrictive because of this
>> test in `isearch-search', which if non-nil prevents invoking
>> `isearch-filter-predicate'.
>>
>>  (= (match-beginning 0) (match-end 0))
>
> And, indeed, the default predicate doesn't match on invisible text...
> but I'm not sure why it's also testing the length of the match.  (The
> default predicate also checks this, so removing the test seems to
> produce identical results by default.)

I've tried to remove (= (match-beginning 0) (match-end 0))
and then tried the test case provided by Drew,
but it goes into an infinite loop.

So it requires advancing by 1 char - the same trick as it's used
in query-replace, etc.

Also I noticed that Drew's test case matches at 'eob'
that is wrong.  So I moved checks for bobp/eobp outside.

The third problem I noticed thanks to Drew's test case
is that lazy-highlighting incorrectly highlights empty matches.
Fixed as well.





reply via email to

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