emacs-devel
[Top][All Lists]
Advanced

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

lazy-count-update-hook run with inconsistent point (Was: Overlay count f


From: Jai Flack
Subject: lazy-count-update-hook run with inconsistent point (Was: Overlay count for isearch)
Date: Fri, 25 Mar 2022 11:04:18 +1000

Juri Linkov <juri@linkov.net> writes:
> Feel free to submit requests for changes in the core
> that would allow you to hook into the core functionality.
> For example, now we added a new hook 'lazy-count-update-hook'
> that you can use in your package to display the count overlay
> anywhere you want.

What do you think about lazy-count-update-hook being run with
inconsistent point? It's called from three points in isearch.el and from
best I can tell, for two of those (in isearch-lazy-highlight-new-loop)
it is always called with point at the current match (start or end
depending on forward or reverse search); however the last call (in
isearch-lazy-highlight-buffer-update) is inside the save-excursion and
so the point is wherever the last overlay has been created.

I can't see any reason for this inconsistency in the UI updating code
(starting line 4338 on 392d66f6f5) so should this be moved outside the
save-excursion or rather documented as unreliable?

Note: my package can use isearch-match-data so this is just a minor
implementation detail.

-- 
Thanks,
Jai



reply via email to

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