From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: Re: lazy-count-update-hook run with inconsistent point Date: Fri, 25 Mar 2022 10:48:08 +0100 Message-ID: <87r16qqs6f.fsf@gmail.com> 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> <87k0cietbh.fsf_-_@disroot.org> <87bkxuqxgk.fsf@gmail.com> <86wngimnbm.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22374"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.92 (gnu/linux) Cc: Jai Flack , Philip Kaludercic , 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 10:48:53 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 1nXgYt-0005Zu-Ok for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Mar 2022 10:48:51 +0100 Original-Received: from localhost ([::1]:57736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXgYs-0001UW-8v for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Mar 2022 05:48:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXgYH-0000oU-Ah for emacs-devel@gnu.org; Fri, 25 Mar 2022 05:48:13 -0400 Original-Received: from [2a00:1450:4864:20::630] (port=46639 helo=mail-ej1-x630.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXgYF-0007kS-Pw for emacs-devel@gnu.org; Fri, 25 Mar 2022 05:48:12 -0400 Original-Received: by mail-ej1-x630.google.com with SMTP id qx21so14187924ejb.13 for ; Fri, 25 Mar 2022 02:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=mXjA+SJSwkx7x3yanTuSJOMhomD3A2pVR09jXkTVyHk=; b=BGeyyJ8bvEGAEX+cxwtZYXfdBLe1WeW/xctgloarGWZEubHTpGOKGKkVD1tUeHo8kW OU/wq28DAMg2haHe9R8BrtxYERV6YizcIuniBhPKVUeATIftCnwrDKEm6vZ6JOfQ2Z0h fhO6ar4Ov8PIpg58A1kSnqLcdGorMm+TttpG5ndi7LLf1JdSjiX4+toxDcBTsUrXmS6X jJbx0mmz3D28ouHavAcaB6bBaGSgq0M1sKBj9VP4xv9dI04ewbg0QBKnrLwKikY10cP0 72BUK87SxPNJVFtNVb+HLmQuNY3n/oT9tk7Z+/y98xXZHAzdX0/gY93vdDSHPOd+JuXl bY+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=mXjA+SJSwkx7x3yanTuSJOMhomD3A2pVR09jXkTVyHk=; b=wkq1T82zMEnN+jLd1y/8TEmnhQMtNGe9AD/FT7Md+hfmzf0HKcM1a7TapuBe0E+35C AatO4BtF01bmAcbZtvzM1mi0LQj5ExinIpEuh4orFSdztkpr57SWFJWe1cT5Ht2CKgPC bP4KPoZ1Jgq3p0WO3Ad/Mz3V4frSsB49bHs982c72TCu/zoVKQbrEyPat3xj/PZxn/Ju mDb04JodloAgp+OS/M1TrMDTV9ZWycfXDScOgWA+VG4eu2os22cQH/1EbU0M5tfqW0bA ZEpT5a2zTpyUqT7TpUvJOpN6XqaK+kPUYaY5vIvKSAHQYPiOwjKkmaAjtdx+tbrN+HsI Edhg== X-Gm-Message-State: AOAM531WlXoCU4zyiJwcjUmxa+v3/DHSBNkHkqpL+X+Rjmjs5DeFy1rY TQkvg3XoAczr3vg4B595LiHEleJNIn4L/A== X-Google-Smtp-Source: ABdhPJwyPc0lwprDcTTgblrYdTEIvfjqS9C1WwJFVA+I9P3wVM0uN4ZTYXM7QpiG5ylTPDyTLbqDUw== X-Received: by 2002:a17:906:d555:b0:6da:ac8c:f66b with SMTP id cr21-20020a170906d55500b006daac8cf66bmr10540117ejc.107.1648201690042; Fri, 25 Mar 2022 02:48:10 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::7039]) by smtp.gmail.com with ESMTPSA id s7-20020a170906778700b006df7e0e140bsm2144888ejm.140.2022.03.25.02.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 02:48:09 -0700 (PDT) In-Reply-To: <86wngimnbm.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 25 Mar 2022 10:36:37 +0200") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::630 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=arstoffel@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:287441 Archived-At: --=-=-= Content-Type: text/plain On Fri, 25 Mar 2022 at 10:36, Juri Linkov wrote: > Running the hook was also under another condition: > `(when isearch-lazy-count ...)'. Shouldn't it be added > to `(when nomore ...)' too? Ah, of course. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Always-run-isearch-lazy-count-update-hook-with-point.patch >From 368a29d8357cbd0f36b320d9df12fe534307581a Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Fri, 25 Mar 2022 08:46:57 +0100 Subject: [PATCH] Always run 'isearch-lazy-count-update-hook' with point at match * lisp/isearch.el (isearch-lazy-highlight-buffer-update): Run 'isearch-lazy-count-update-hook' outside of save-excursion, so point is at the current match. --- lisp/isearch.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 9b311cb49e..05a73edead 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -4342,11 +4342,12 @@ isearch-lazy-highlight-buffer-update (setq isearch-lazy-count-current (gethash opoint isearch-lazy-count-hash 0)) (when (and isearch-mode (null isearch-message-function)) - (isearch-message)) - (run-hooks 'lazy-count-update-hook)) + (isearch-message))) (setq isearch-lazy-highlight-timer (run-at-time lazy-highlight-interval nil - 'isearch-lazy-highlight-buffer-update))))))))) + 'isearch-lazy-highlight-buffer-update))))) + (when (and nomore isearch-lazy-count) + (run-hooks 'lazy-count-update-hook)))))) ;; Reading from minibuffer with lazy highlight and match count -- 2.35.1 --=-=-=--