From unknown Wed Jun 18 23:06:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#33838 <33838@debbugs.gnu.org> To: bug#33838 <33838@debbugs.gnu.org> Subject: Status: 27.0.50; lazy-highlight fails with a quick key sequence Reply-To: bug#33838 <33838@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:06:49 +0000 retitle 33838 27.0.50; lazy-highlight fails with a quick key sequence reassign 33838 emacs submitter 33838 Juri Linkov severity 33838 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 22 19:07:20 2018 Received: (at submit) by debbugs.gnu.org; 23 Dec 2018 00:07:20 +0000 Received: from localhost ([127.0.0.1]:60330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1garId-0008K1-U5 for submit@debbugs.gnu.org; Sat, 22 Dec 2018 19:07:20 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1garId-0008Jp-3m for submit@debbugs.gnu.org; Sat, 22 Dec 2018 19:07:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1garIX-0007e9-1w for submit@debbugs.gnu.org; Sat, 22 Dec 2018 19:07:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59160) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1garIW-0007e2-VU for submit@debbugs.gnu.org; Sat, 22 Dec 2018 19:07:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1garIW-0007ay-0E for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 19:07:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1garIS-0007bN-2f for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 19:07:12 -0500 Received: from catfish.maple.relay.mailchannels.net ([23.83.214.32]:15976) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1garIR-0007ZU-PE for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 19:07:08 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 3D0931246C5 for ; Sun, 23 Dec 2018 00:07:05 +0000 (UTC) Received: from pdx1-sub0-mail-a66.g.dreamhost.com (unknown [100.96.36.160]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id ED2141246DC for ; Sun, 23 Dec 2018 00:07:04 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a66.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sun, 23 Dec 2018 00:07:05 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Turn-Fumbling: 00e80dff7335c88d_1545523625040_254688950 X-MC-Loop-Signature: 1545523625040:2470884522 X-MC-Ingress-Time: 1545523625040 Received: from pdx1-sub0-mail-a66.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a66.g.dreamhost.com (Postfix) with ESMTP id B15358070A for ; Sat, 22 Dec 2018 16:07:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type; s= linkov.net; bh=7sNP8e8rKdbCRcHC/L47Vw8dceI=; b=zZI1WxKgWmBA+IGT4 0M/lLzYb/aIKkQmo15ZG5qxIzTjKe528raQzUcJKeVnF2iggd7U1cteiEaOWr/0Q yNmQi0CNQyqhv0unZR4RuwrEv+zp74qMEz5YQA/RRxu/5wjqYUkcBlkEG7TfSpw/ ytZK8TyVubaDhvk7yP7bB/3mHs= Received: from mail.jurta.org (m91-129-106-79.cust.tele2.ee [91.129.106.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a66.g.dreamhost.com (Postfix) with ESMTPSA id A76968070D for ; Sat, 22 Dec 2018 16:07:02 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a66 From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: 27.0.50; lazy-highlight fails with a quick key sequence Organization: LINKOV.NET Date: Sun, 23 Dec 2018 02:05:19 +0200 Message-ID: <87muox3y68.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudejjedgudekvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdeirdejleenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdeirdejledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Quickly typing `C-s C-s' to repeat the last search in a file with long wrapped lines sometimes fails to lazy-highlight other matches. This is because the condition in isearch-lazy-highlight-new-loop relies on the return value of `(sit-for 0)' and when there is input pending like the second `C-s' keystroke unprocessed due to the large file size with long lines, it doesn't start a new lazy-highlight loop. I noticed this problem only after starting to use lazy-count that fails to count matches. Before that, there was no clear indication that lazy-highlight failed in such cases. I doubt that relying on its return value was intentional, so I propose the following fix: diff --git a/lisp/isearch.el b/lisp/isearch.el index dd0973d4ea..5876e70305 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3661,7 +3661,7 @@ isearch-lazy-highlight-new-loop search string to change or the window to scroll). It is also used by other Emacs features." (when (and (null executing-kbd-macro) - (sit-for 0) ;make sure (window-start) is credible + (progn (sit-for 0) t) ;make sure (window-start) is credible (or (not (equal isearch-string isearch-lazy-highlight-last-string)) (not (memq (selected-window) From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 23 18:29:08 2018 Received: (at 33838) by debbugs.gnu.org; 23 Dec 2018 23:29:08 +0000 Received: from localhost ([127.0.0.1]:34126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gbDBD-0007LL-RO for submit@debbugs.gnu.org; Sun, 23 Dec 2018 18:29:08 -0500 Received: from lavender.maple.relay.mailchannels.net ([23.83.214.99]:44962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gbDBB-0007L9-9g for 33838@debbugs.gnu.org; Sun, 23 Dec 2018 18:29:06 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 4BED26830D2 for <33838@debbugs.gnu.org>; Sun, 23 Dec 2018 23:29:03 +0000 (UTC) Received: from pdx1-sub0-mail-a62.g.dreamhost.com (unknown [100.96.19.78]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 16FF368251D for <33838@debbugs.gnu.org>; Sun, 23 Dec 2018 23:29:03 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a62.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sun, 23 Dec 2018 23:29:03 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Interest-Bitter: 5c58cfb54ee3d83d_1545607743166_329126264 X-MC-Loop-Signature: 1545607743166:920101028 X-MC-Ingress-Time: 1545607743166 Received: from pdx1-sub0-mail-a62.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTP id D17CC808ED for <33838@debbugs.gnu.org>; Sun, 23 Dec 2018 15:29:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=VnsBq4izWSZ/guHPqE+831boB0c=; b= dpM6Etsx+NxQ4Ej3nfHa+iliLvadjj/JCEMk6VGWD5v4/xFol6J81KMnRzWMEZ2t c5412LZxErU62WzsOLdADeSIapYQY41LlaT3crNZ7XwO0zHNsPnqBI/r5ToF7Lp4 85Ea9XWyklkErjuK4F5SVZAYSNYbyu388A/BcGw8uPs= Received: from mail.jurta.org (m91-129-106-79.cust.tele2.ee [91.129.106.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTPSA id 0AF4C80918 for <33838@debbugs.gnu.org>; Sun, 23 Dec 2018 15:29:01 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a62 From: Juri Linkov To: 33838@debbugs.gnu.org Subject: Re: bug#33838: 27.0.50; lazy-highlight fails with a quick key sequence Organization: LINKOV.NET References: <87muox3y68.fsf@mail.linkov.net> Date: Mon, 24 Dec 2018 01:27:22 +0200 In-Reply-To: <87muox3y68.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 23 Dec 2018 02:05:19 +0200") Message-ID: <875zvjn7s5.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudektddguddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtiedrjeelnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtiedrjeelpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepfeefkeefkeesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33838 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Quickly typing `C-s C-s' to repeat the last search in a file with long > wrapped lines sometimes fails to lazy-highlight other matches. > > This is because the condition in isearch-lazy-highlight-new-loop relies on > the return value of `(sit-for 0)' and when there is input pending like the > second `C-s' keystroke unprocessed due to the large file size with long > lines, it doesn't start a new lazy-highlight loop. I realized that sit-for here is for a reason to not try running isearch-lazy-highlight-new-loop on every keypress. The problem is that when the first `C-s' is ignored (in this case isearch-string is an empty string and isearch-lazy-highlight-last-string is the last search string), for the second `C-s', isearch-string is equal to isearch-lazy-highlight-last-string from the last search, so a new loop is not initiated. A proper fix would be to reset isearch-lazy-highlight-last-string on exiting Isearch, so it won't affect the next search: diff --git a/lisp/isearch.el b/lisp/isearch.el index dd0973d4ea..d2c1c150b5 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1357,6 +1357,7 @@ isearch-done (setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout) (isearch-dehighlight) (lazy-highlight-cleanup lazy-highlight-cleanup) + (setq isearch-lazy-highlight-last-string nil) (let ((found-start (window-group-start)) (found-point (point))) (when isearch-window-configuration From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 25 16:55:31 2018 Received: (at 33838-done) by debbugs.gnu.org; 25 Dec 2018 21:55:31 +0000 Received: from localhost ([127.0.0.1]:36487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gbufj-0004NI-4T for submit@debbugs.gnu.org; Tue, 25 Dec 2018 16:55:31 -0500 Received: from ostrich.birch.relay.mailchannels.net ([23.83.209.138]:42450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gbufh-0004NA-Bi for 33838-done@debbugs.gnu.org; Tue, 25 Dec 2018 16:55:29 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id F3D2B502BF0 for <33838-done@debbugs.gnu.org>; Tue, 25 Dec 2018 21:55:27 +0000 (UTC) Received: from pdx1-sub0-mail-a16.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id BFA9C502C10 for <33838-done@debbugs.gnu.org>; Tue, 25 Dec 2018 21:55:27 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a16.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Tue, 25 Dec 2018 21:55:27 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Blushing-Spill: 30d698036f0739b6_1545774927864_3218196498 X-MC-Loop-Signature: 1545774927864:3668813265 X-MC-Ingress-Time: 1545774927864 Received: from pdx1-sub0-mail-a16.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a16.g.dreamhost.com (Postfix) with ESMTP id 6ACF97F93F for <33838-done@debbugs.gnu.org>; Tue, 25 Dec 2018 13:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=4iTx5o+pBDh6Po7/RBiTG1VaeLA=; b= Kc2fK0mvMViACkY694yG5NGyLR3GCq2ByiSgsBiertO0W561Qjwju591GAGIp3G7 +0wUK9X1xwJ7UZsGbE/KtrEwqv/4SuCVdHxC/i4d9uA567QYrhTKyzKETaDGhblT rrtvp/D1cMrYrLeVvHpZsCalI6h94c6H7ZVWtSZh+fo= Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a16.g.dreamhost.com (Postfix) with ESMTPSA id 8BD3A7F941 for <33838-done@debbugs.gnu.org>; Tue, 25 Dec 2018 13:55:26 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a16 From: Juri Linkov To: 33838-done@debbugs.gnu.org Subject: Re: bug#33838: 27.0.50; lazy-highlight fails with a quick key sequence Organization: LINKOV.NET References: <87muox3y68.fsf@mail.linkov.net> <875zvjn7s5.fsf@mail.linkov.net> Date: Tue, 25 Dec 2018 23:54:42 +0200 In-Reply-To: <875zvjn7s5.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 24 Dec 2018 01:27:22 +0200") Message-ID: <8736qlmfvh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudekfedgudehlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdekrdduleefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtkedrudelfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopeeffeekfeekqdguohhnvgesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33838-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > A proper fix would be to reset isearch-lazy-highlight-last-string > on exiting Isearch, so it won't affect the next search: Pushed to master and closed. From unknown Wed Jun 18 23:06:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 23 Jan 2019 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator