Subject: Re: bug#29321: Isearch hit count

From: Live System User <[email-masked]>
Date: Fri, 02 Nov 2018 08:51:34 -0400

Juri Linkov <[email-masked]> writes:

Hi,

>>> > I tried it, but I still see the problem.  If I repeat
>>> > quickly there won't be a count in the prompt, and not
>>> > just at the beginning.  Or there might be one, but
>>> > then when I switch direction it disappears (rightly
>>> > so, as you pointed out), but if I continue repeating
>>> > in that new direction the count never appears.
>>> 
>>> When you type too quickly, lazy-highlighting (that also counts
>>> the number of matches) has no chance to run its timer function.
>>> It runs with (run-with-idle-timer lazy-highlight-initial-delay ...)
>>> This means that it runs only after lazy-highlight-initial-delay
>>> (by default, 0.25 secs) of inactivity.
>>
>> Sure, but why does the count not get displayed after you
>> slow down or even stop (while remaining in Isearch).
>> That's my question.
>>
>> That it doesn't get shown as long as you just keep C-M-s
>> pressed, without letting up, is understandable.  But why
>> isn't the count shown when you let up?
>
> I now see that you are testing in the *info* buffer.
> Yes, I see the same - the number of matches and overlays
> are not updated when going to another Info node.
> I fixed this to check the previous and current values
> of (point-min) and (point-max) - they are different in
> different Info nodes.
>
> Another problem when the number was not displayed is
> when you start searching forward at the end of the buffer,
> and there are matches above.  I fixed it to display e.g.
> "0/123", meaning there are 123 matches total, but there is
> no current match yet.
>
> Also in a new version attached I added a new function
> isearch-lazy-count-format that is easy to redefine
> to display current/total in another format either
> in the message prefix or suffix.

  Thank you for adding this!

  Now that you have the count, would it be posible to add a
  command to specify which occurane of a match to go to and/or
  highlight?

  Lets say there are 100 matches.  I search through them and wind
  up at 42/100.  I stop seaching and do something else.  I decide
  I want to go back to my previous search.  It would be very handy
  to have a command to do "goto match 42" or "goto match 67" or
  "goto match last-match" .e.g. go directly to 100/100 (since 100
  is the last found numbered match reported by isearch) and I would
  then see the 100th match highlighted and the indicator displaying
  "100/100".

  Let me know if this should be a separate enhancement request.

  Thanks.