all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jai Flack <jflack@disroot.org>
To: Juri Linkov <juri@linkov.net>
Cc: Philip Kaludercic <philipk@posteo.net>,
	 Augusto Stoffel <arstoffel@gmail.com>,
	 Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: lazy-count-update-hook run with inconsistent point (Was: Overlay count for isearch)
Date: Fri, 25 Mar 2022 11:04:18 +1000	[thread overview]
Message-ID: <87k0cietbh.fsf_-_@disroot.org> (raw)
In-Reply-To: <86ee2reopn.fsf@mail.linkov.net> (Juri Linkov's message of "Thu,  24 Mar 2022 10:31:32 +0200")

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	other threads:[~2022-03-25  1:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 11:56 [NonGNU] New package: ctrlf and Questions jflack
2022-02-23 18:33 ` Augusto Stoffel
2022-02-23 19:40   ` Philip Kaludercic
2022-02-23 20:59     ` Augusto Stoffel
2022-02-24 10:36       ` Jai Flack
2022-02-26 11:02         ` Augusto Stoffel
2022-02-27  4:02           ` Stefan Monnier
2022-03-16 11:37             ` Overlay count for isearch (Was: [NonGNU] New package: ctrlf and Questions) Jai Flack
2022-03-16 12:00               ` Overlay count for isearch Augusto Stoffel
2022-03-18  2:45                 ` Jai Flack
2022-03-18  8:21                   ` Philip Kaludercic
2022-03-24  1:22                     ` Jai Flack
2022-03-24  8:31                       ` Juri Linkov
2022-03-25  1:04                         ` Jai Flack [this message]
2022-03-25  7:54                           ` lazy-count-update-hook run with inconsistent point Augusto Stoffel
2022-03-25  8:36                             ` Juri Linkov
2022-03-25  9:48                               ` Augusto Stoffel
2022-03-27  5:24                                 ` Jai Flack
2022-03-27  7:48                                 ` Juri Linkov
2022-03-26  3:28                       ` Overlay count for isearch Richard Stallman
2022-03-27  5:03                         ` Jai Flack
2022-03-05  4:39           ` [NonGNU] New package: ctrlf and Questions Jai Flack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0cietbh.fsf_-_@disroot.org \
    --to=jflack@disroot.org \
    --cc=arstoffel@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.