Subject: bug#29321: Isearch hit count

From: Juri Linkov <[email-masked]>
Date: Thu, 15 Nov 2018 23:16:39 +0200

>> But this implementation causes flicker because it updates
>> isearch highlighting on every search hit while traversing
>> all found matches COUNT times until it reaches COUNT-th match.
>>
>> Attached is a better approach that adds the COUNT arg to
>> isearch functions down to the lowest-level isearch function,
>> thus making it compatible with the COUNT arg of re-search-forward:
>
>   Unfortunately, this patch (below) had errrs for me:
>
>    ...and in the echo area I see:
>
>              0/0 I-search: -c [(void-variable +)]

It seems this `+' comes from the diff indicator from the
beginning of the diff line from failed patching.

So I attached a whole new file isearch-repeat.3.el
for your convenience.

But please note that it contains a new implementation
because I found problems in the previous implementation:
when COUNT is added to low-level isearch functions then
they don't skip filtered-out matches.

So a better place is in isearch-search after
`funcall isearch-filter-predicate'.  But the problem
is that when (= (match-beginning 0) (match-end 0))
then it doesn't move point one character forward like
isearch-repeat does.  So the right place to use COUNT is in
isearch-repeat.

Please try a new implementation: