In my search to find a simpler solution that the one found "1 of n" result for Emacs search I've come up with the following package
https://github.com/nordlow/elisp/blob/master/mine/indexed-isearch.el
But the information displayed is delayed one key-stroke. How do fix this? My guess is that I either should call some function that updates the minibuffer at the end of isearch-cound-message
or inject the update to isearch-message-suffix sooner the isearch logic that displays information in the minibuffer.
Does anybody know?
The initial message is provided by isearch-string, which before typing is that one you used last time. This is why before re-typing you see a wrong number. This can be corrected quite easy.
The initial bad message can be corrected by resetting the value of
isearch-message-suffix-add
in the hook namedisearch-exit-mode
.UPDATE:
This code is the best one can write. I looked at it today. The edit string is not the same as
isearch-string
, but it's delayed by 1 character. In order to have a correct display, one needs to type C-s or C-r 2 times, for the edit-string to be the same as isearch-string. Isearch does not export in the external environment a variable to have the value of edit-string.And in
isearch-mode-end-hook
I inserted so:This works nice for me -- and it displays the isearch-string, to know what to expect at, at each moment.