From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jai Flack Newsgroups: gmane.emacs.devel Subject: lazy-count-update-hook run with inconsistent point (Was: Overlay count for isearch) Date: Fri, 25 Mar 2022 11:04:18 +1000 Message-ID: <87k0cietbh.fsf_-_@disroot.org> References: <9631587bddf2ab3b07b60bd4195cc3e1@disroot.org> <87r17tmnzc.fsf@gmail.com> <8735k9jrr2.fsf@posteo.net> <87mtihmh8t.fsf@gmail.com> <87tucoblfh.fsf@disroot.org> <878rtxdh6a.fsf@gmail.com> <87czim3z8g.fsf_-_@disroot.org> <87zglqf6pp.fsf@gmail.com> <87r170t1vm.fsf@disroot.org> <871qyzpt6u.fsf@posteo.net> <87ee2s87qp.fsf@disroot.org> <86ee2reopn.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7776"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , Augusto Stoffel , Stefan Monnier , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 25 07:23:44 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXdMN-0001kG-SU for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Mar 2022 07:23:43 +0100 Original-Received: from localhost ([::1]:40582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXdMM-00081L-Ek for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Mar 2022 02:23:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXYNU-0002OG-2m for emacs-devel@gnu.org; Thu, 24 Mar 2022 21:04:32 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:57190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXYNP-0000Mb-FN for emacs-devel@gnu.org; Thu, 24 Mar 2022 21:04:29 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 884954024A; Fri, 25 Mar 2022 02:04:25 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cHH5KerHknF5; Fri, 25 Mar 2022 02:04:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1648170263; bh=R+OHJgiarf542JImA/FBYvTgg4hBJRmRm2cmXw8i3uA=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=eRj0wNgSB6eFXVVvpyubItHIjgPLqIbBsvsrccWgfzTLpwKhlxtqReTR0GLsz1j97 fwksKl4JFHdJzeS3rbqQMhzAFrC2cADyyS2UbL/7GuolyCIEJZq0A7ZI3i6s9jDNzn blp6LBBcQAE3fRVXYGQJQez0jhimPIBb4jJVByNhSUIOfzcJSANYJCX6HKhxBuhTdm P9Bwovwsyld9JLNE01cUt4XMACyBr0gOMkR2Iop/SGa/34wE2tHs7oo7cEY1yBYx7w WAfcdG7jh469oRK7g21u0Jri9Cy5RTAsD5QiQvv1UrIAux5BXgXMzli4A7QzlqsEuV Etvyl30wiZDcg== In-Reply-To: <86ee2reopn.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 24 Mar 2022 10:31:32 +0200") Received-SPF: pass client-ip=178.21.23.139; envelope-from=jflack@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 25 Mar 2022 02:19:51 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:287433 Archived-At: Juri Linkov 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