GNU bug report logs - #56815
29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Eli Zaretskii <eliz@HIDDEN>; dated Thu, 28 Jul 2022 17:30:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 8 Aug 2022 17:23:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 08 13:23:52 2022
Received: from localhost ([127.0.0.1]:41855 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oL6Tn-00009X-Vz
	for submit <at> debbugs.gnu.org; Mon, 08 Aug 2022 13:23:52 -0400
Received: from relay11.mail.gandi.net ([217.70.178.231]:36195)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1oL6Tg-00008f-Fx
 for 56815 <at> debbugs.gnu.org; Mon, 08 Aug 2022 13:23:47 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id DF07B100009;
 Mon,  8 Aug 2022 17:23:37 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <83mtct87ti.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 28 Jul
 2022 20:29:13 +0300")
Organization: LINKOV.NET
References: <83mtct87ti.fsf@HIDDEN>
Date: Mon, 08 Aug 2022 20:20:41 +0300
Message-ID: <86k07i4pp2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

While waiting when buffer-local current_buffer->long_line_optimizations_p
will be exposed to Lisp, I noticed another need for lazy-highlight optimization:
in large buffers (but without long lines) some customization makes replacement
too slow when lazy-highlight tries to rehighlight the whole buffer
after every replacement.  For query-replace it should be enough to
highlight matches only on the displayed screen, therefore this patch
fixes the problem:

```
diff --git a/lisp/replace.el b/lisp/replace.el
index cac0edf43a..9a1f6f22e0 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2744,7 +2750,9 @@ replace-highlight
 	    (isearch-case-fold-search case-fold)
 	    (isearch-forward (not backward))
 	    (isearch-other-end match-beg)
-	    (isearch-error nil))
+	    (isearch-error nil)
+	    (isearch-lazy-count nil)
+	    (lazy-highlight-buffer nil))
 	(isearch-lazy-highlight-new-loop range-beg range-end))))
```




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 2 Aug 2022 11:10:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 02 07:10:48 2022
Received: from localhost ([127.0.0.1]:42557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oIpnU-00028x-3M
	for submit <at> debbugs.gnu.org; Tue, 02 Aug 2022 07:10:48 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oIpnP-00028g-Mb
 for 56815 <at> debbugs.gnu.org; Tue, 02 Aug 2022 07:10:46 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42820)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oIpnJ-00022I-U7; Tue, 02 Aug 2022 07:10:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=V2txCNbKue3j+bu/I1WM+w6y8Kp2REliaFH9GivIv2Y=; b=T+XhUleYhgWc
 IlhtCHT8Pe1PrKhMQScQ2FlRRpVskrAZ9l3EreJxcZyqVhgi69Ti6WoglLllhwWkFwGLrkzR1kVmM
 Z31lggvuuX9uiBdtiiAbXZjjyUr9qkUFFtwMAMt3fcqap1nKwMSZsfw1gVADeUtgf8ASXGkGVJvZh
 WEgZKpYI5SWZCubFTaGQLsb0/+YaLXCtQhdOniGH0k3ky7AOfiubN8dhHKg7M4EzSkY9IJ/qs98/v
 z2xj5Oxy3nwCM4bKpyLlyqLcqffv7C9CkP5GeKG/vxSDXRT+GJ1poU816wxj+CxkRJrLPtCqZoZEw
 7tX898qutJ49WvlxtCruGg==;
Received: from [87.69.77.57] (port=3554 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oIpnC-0004iv-4T; Tue, 02 Aug 2022 07:10:33 -0400
Date: Tue, 02 Aug 2022 14:10:21 +0300
Message-Id: <83k07q295u.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <74ddc877f180e5ccb48f@HIDDEN> (message from Gregory
 Heytings on Tue, 02 Aug 2022 07:31:16 +0000)
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN>
 <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN>
 <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN>
 <86y1w7bzum.fsf@HIDDEN> <74ddc877f180e5ccb48f@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org, larsi@HIDDEN, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 02 Aug 2022 07:31:16 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: Eli Zaretskii <eliz@HIDDEN>, 56815 <at> debbugs.gnu.org, larsi@HIDDEN
> 
> 
> >> So if no good ideas arise that are simple enough to implement, I'm okay 
> >> with simply disabling isearch-lazy-highlight in such buffers, as I 
> >> wrote in the original bug report.  (Doing that will probably require 
> >> exposing the "long-lines" flag to Lisp, but that's fine by me.)
> >
> > Exposing the "long-lines" flag to Lisp is exactly what is needed.
> >
> 
> My current plan is to run a hook when long lines are detected, in which 
> modes such as isearch will be free to add any function they like.

I'm not sure I agree that a hook is a better interface.  A hook is
only useful to features that are already turned on when the hook is
called; features that are turned on later will miss it.

By contrast, an accessor function can be called at any time, and for
an attribute that, once set remains set, I think it's a more
convenient way of adapting features and packages to this condition.

Or am I missing something?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 2 Aug 2022 07:31:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 02 03:31:21 2022
Received: from localhost ([127.0.0.1]:42158 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oImN7-00029O-5Z
	for submit <at> debbugs.gnu.org; Tue, 02 Aug 2022 03:31:21 -0400
Received: from heytings.org ([95.142.160.155]:35040)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1oImN3-00029A-S3
 for 56815 <at> debbugs.gnu.org; Tue, 02 Aug 2022 03:31:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1659425476;
 bh=ZwjY6hWIFLru1qmjjdn2VIN2PiG8cq5UUefJ4aPEDdg=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=xziDLU4H9yYfxY9BFlhU61K7azdaUpksiEEWTIRjl1YVlMLqIwV0b/NL0bGiCDf3D
 yGWb6CbYvy0LoNFely/7qtjI86p+THVZPcdEjgfuV10JMts0S9KEJVavj7hkt8FIsC
 IfHVKpw9FSqKFU/W1fHxKY65tBsukdLIcUo/ssWfq/MNqX1B9zuObPfzgs5Fc8fwWI
 2OsdmVK9xCaL7I/Fk81AM0+p4R0HyUuRcNpyRnl+iIuy9lu7z10JlX1HRJ6qZtrkpj
 5mhSwMDydOnN6YkR0WmzJQ+z4jkcUizR5UNyK/XnGv1ViMAMSPvTGV9+ktTJMEd6Xv
 D29tjYw7ED3UA==
Date: Tue, 02 Aug 2022 07:31:16 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <86y1w7bzum.fsf@HIDDEN>
Message-ID: <74ddc877f180e5ccb48f@HIDDEN>
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN>
 <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN>
 <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN>
 <86y1w7bzum.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56815
Cc: larsi@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 56815 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>> So if no good ideas arise that are simple enough to implement, I'm okay 
>> with simply disabling isearch-lazy-highlight in such buffers, as I 
>> wrote in the original bug report.  (Doing that will probably require 
>> exposing the "long-lines" flag to Lisp, but that's fine by me.)
>
> Exposing the "long-lines" flag to Lisp is exactly what is needed.
>

My current plan is to run a hook when long lines are detected, in which 
modes such as isearch will be free to add any function they like.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 1 Aug 2022 18:17:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 01 14:17:32 2022
Received: from localhost ([127.0.0.1]:41605 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oIZyu-00025Z-A9
	for submit <at> debbugs.gnu.org; Mon, 01 Aug 2022 14:17:32 -0400
Received: from relay11.mail.gandi.net ([217.70.178.231]:58479)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1oIZys-000257-TT
 for 56815 <at> debbugs.gnu.org; Mon, 01 Aug 2022 14:17:31 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 15029100006;
 Mon,  1 Aug 2022 18:17:20 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <83wnbs2nc3.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 01 Aug
 2022 14:51:56 +0300")
Organization: LINKOV.NET
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN>
 <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN>
 <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN>
Date: Mon, 01 Aug 2022 21:09:05 +0300
Message-ID: <86y1w7bzum.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> So if no good ideas arise that are simple enough to implement, I'm
> okay with simply disabling isearch-lazy-highlight in such buffers, as
> I wrote in the original bug report.  (Doing that will probably require
> exposing the "long-lines" flag to Lisp, but that's fine by me.)

Exposing the "long-lines" flag to Lisp is exactly what is needed.
So when lazy-highlight will detect a special value of a new
buffer-local variable when narrowing is in effect due to long lines,
then lazy-highlight can switch to a different algorithm
like you described earlier.  Currently isearch-lazy-highlight-new-loop
checks for window-group-start and window-group-end.  But when
the "long-lines" flag is set, it should also check for window-hscroll
because narrowed lazy-highlighting should be updated on hscrolling.

This "long-lines" flag will be also useful for pre-command-hook
and post-command-hook to convey the information about narrowing
to hooks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 1 Aug 2022 11:52:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 01 07:52:21 2022
Received: from localhost ([127.0.0.1]:39505 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oITy9-0000gi-FD
	for submit <at> debbugs.gnu.org; Mon, 01 Aug 2022 07:52:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53090)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oITy7-0000gV-QY
 for 56815 <at> debbugs.gnu.org; Mon, 01 Aug 2022 07:52:20 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47306)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oITy2-0000z9-0q; Mon, 01 Aug 2022 07:52:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=QgQAkI9P6JKFcafyqj3B0ERgZncd1g0hmaaW2ininPs=; b=gEyq3GK4lAB7
 fWugBNrV3RNsKnYDdAuLakoysgUkjAf4xonRVxtialBFA2nm/iyRFkR0cthPXO6VZka/JvBxigqat
 yC6FK4KCQKo2rPekYmWoD6dgmELwrPSPenfNFpUGGGXE7e5WMMghOmLYjTWxIty/eohAWgo0AXFwQ
 phb2ZyLF5XNdtNsSPxHoBw6VaE8sO1YwvkiW6ixNcgpxeojyHA/0TcCJVbJCknIMY9IhZEoAXAnkA
 MaSTL2sLZsIwD+/2+D0jECEkiPzywDjo58tRa8dr7211eVIg3pfdwy7XmDx1ExlhVAEkEgeQopb7f
 +ds5Rx/xRIZKZh9rN/dDuA==;
Received: from [87.69.77.57] (port=1281 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oITxu-0003jp-Rw; Mon, 01 Aug 2022 07:52:13 -0400
Date: Mon, 01 Aug 2022 14:51:56 +0300
Message-Id: <83wnbs2nc3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <86fsih5bch.fsf@HIDDEN> (message from Juri Linkov on
 Sun, 31 Jul 2022 22:40:22 +0300)
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN>
 <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> 
 <86fsih5bch.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Juri Linkov <juri@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  larsi@HIDDEN,  56815 <at> debbugs.gnu.org
> Date: Sun, 31 Jul 2022 22:40:22 +0300
> 
> >> And yes, if we want truncate-lines to work reasonably well, we need to
> >> fix any features which behave silly in that display mode.
> >>
> >
> > If we want truncate-lines to work reasonably well without fixing all such
> > features one-by-one, we need to fix the root cause of that dysfunction,
> > which is not inside these individual features, but is the fact that (-
> > (window-end) (window-start)) is huge.
> 
> Do you think introducing the rectangular narrowing could be a more general fix?
> We already have rectangular regions generalized as non-contiguous regions.
> Could non-contiguous narrowing help to restrict the accessible buffer area
> to the visible screen rectangle?

I don't understand how such a restriction will work on the level of
buffer text.  E.g., what happens when you insert a single character
before the beginning of one of the narrowed regions? does the region
move with the text or does it stay on the same buffer positions?

Basically, as long as Emacs represents buffer text as a single long C
string (aside of the gap), with no additional structure, I don't see
how implement this with any reasonable complexity.

And I agree with Gregory that the gains in this case will be too low,
relative to the complexity.

Let's keep this in its correct proportions: we "just" want isearch to
behave reasonably well in long-and-truncated lines, because IMO
isearch is one of the few features that we cannot break or disable in
such buffers -- the ability to search is too fundamental to editing,
even if that editing means just viewing the text.

So if no good ideas arise that are simple enough to implement, I'm
okay with simply disabling isearch-lazy-highlight in such buffers, as
I wrote in the original bug report.  (Doing that will probably require
exposing the "long-lines" flag to Lisp, but that's fine by me.)

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 31 Jul 2022 21:21:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 31 17:21:09 2022
Received: from localhost ([127.0.0.1]:38701 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oIGN3-0005kW-GV
	for submit <at> debbugs.gnu.org; Sun, 31 Jul 2022 17:21:09 -0400
Received: from heytings.org ([95.142.160.155]:60964)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1oIGN1-0005kO-HD
 for 56815 <at> debbugs.gnu.org; Sun, 31 Jul 2022 17:21:08 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1659302466;
 bh=5Mbfwclovb1QNgYe4VUbobj9lANhtIVmx8NiyY2qXTc=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=mYKwG89mbUG38udjpxe5f0UIccr039WEvg3g3zaNyMgKQl2FZkHRsc5L426eQtosS
 t3WxNfhvzS5ESMyKk8iQUrrvwmZY9OopWiS9bJBIGB4X/6nqvtmmd3rl9QDt6+HFUI
 kDZAoyHmPZp6lY8Tr0z7o22Zha6kNarZVU9Z3p5rBHl1hCK2MEZjRu0f4UaVekL06b
 j6BJ6JKP8z7AoRSaV2gcxPn5IwhX96UAN2b3nC6iXR/bnTmPXnpj/FCwEsnYtGOQ2H
 K1UA4oTREWcTj1ZKeZUW5m3KFJnWMU/XDWNjak5y8/q/F8Qu/zgq6zrUXN8n97829/
 MaRCWh21AzzXw==
Date: Sun, 31 Jul 2022 21:21:05 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <86fsih5bch.fsf@HIDDEN>
Message-ID: <8c7321f2f39cf55a895b@HIDDEN>
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN>
 <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN>
 <86fsih5bch.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, larsi@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>>> And yes, if we want truncate-lines to work reasonably well, we need to 
>>> fix any features which behave silly in that display mode.
>>
>> If we want truncate-lines to work reasonably well without fixing all 
>> such features one-by-one, we need to fix the root cause of that 
>> dysfunction, which is not inside these individual features, but is the 
>> fact that (- (window-end) (window-start)) is huge.
>
> Do you think introducing the rectangular narrowing could be a more 
> general fix? We already have rectangular regions generalized as 
> non-contiguous regions. Could non-contiguous narrowing help to restrict 
> the accessible buffer area to the visible screen rectangle?
>

Yes, I think so.  But I also think it would be wrong to do that.  That 
would be an enormous change to the code (wherever we use BEGV and ZV we 
would have to use instead two arrays BEGV[] and ZV[]) for a microscopic 
use case, and it wouldn't even solve the problem completely, because the 
largest possible line width is limited to about 200 MB anyway (because its 
width in pixels is stored in an int).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 31 Jul 2022 20:11:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 31 16:11:52 2022
Received: from localhost ([127.0.0.1]:38656 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oIFI0-000403-AT
	for submit <at> debbugs.gnu.org; Sun, 31 Jul 2022 16:11:52 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:41159)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1oIFHv-0003zl-M2
 for 56815 <at> debbugs.gnu.org; Sun, 31 Jul 2022 16:11:51 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 8EC3C60005;
 Sun, 31 Jul 2022 20:11:39 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Gregory Heytings <gregory@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <bf6b6a6fd35ae2bb3303@HIDDEN> (Gregory Heytings's message
 of "Fri, 29 Jul 2022 20:26:00 +0000")
Organization: LINKOV.NET
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN>
 <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN>
Date: Sun, 31 Jul 2022 22:40:22 +0300
Message-ID: <86fsih5bch.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, larsi@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> And yes, if we want truncate-lines to work reasonably well, we need to
>> fix any features which behave silly in that display mode.
>>
>
> If we want truncate-lines to work reasonably well without fixing all such
> features one-by-one, we need to fix the root cause of that dysfunction,
> which is not inside these individual features, but is the fact that (-
> (window-end) (window-start)) is huge.

Do you think introducing the rectangular narrowing could be a more general fix?
We already have rectangular regions generalized as non-contiguous regions.
Could non-contiguous narrowing help to restrict the accessible buffer area
to the visible screen rectangle?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 30 Jul 2022 05:35:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 30 01:35:56 2022
Received: from localhost ([127.0.0.1]:33766 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHf8l-0000vg-Ku
	for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 01:35:55 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41172)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oHf8i-0000vT-15
 for 56815 <at> debbugs.gnu.org; Sat, 30 Jul 2022 01:35:53 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:58170)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHf8b-0005wV-IJ; Sat, 30 Jul 2022 01:35:45 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=+La4uXt5AtJYZCKSa1v0+QyGEgC4fhbND+nNpqXl/qo=; b=FOatl5enBZKc
 yko5RqWH1P2GY0Q8cNHqAWl46+lskt3oOAf4zCzU0RjzWcgN0uPJdgXMLhJ1PK07aR7aVpIflF8Ni
 VApvlczws8TxrNJryoTiBWmMvXqxspGqW9xTGfQbzWdiiK+2/HRSDCf/hSthqXtUOW3w/YlL6GcYG
 Ivm95ZHm5nEgoof9l/6sIvW1rIjPgj2sZFhKEpRpof6ndQ9XiBDFVvS+H2VfnQrAInMsenrKAz5Lr
 h5Bb2cqKNWXzGADGjmZuaLBsC0fnk+9ATJd57JJR31yuj30wJrf9hirAPCl1zT7p9AzGGunf42QRU
 c9yWMBWwSnWpcGrAj510cQ==;
Received: from [87.69.77.57] (port=3884 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHf8b-0000kI-0B; Sat, 30 Jul 2022 01:35:45 -0400
Date: Sat, 30 Jul 2022 08:35:58 +0300
Message-Id: <835yjf6u2p.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <bf6b6a6fd35ae2bb3303@HIDDEN> (message from Gregory
 Heytings on Fri, 29 Jul 2022 20:26:00 +0000)
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN>
 <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56815
Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 29 Jul 2022 20:26:00 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
> 
> > And yes, if we want truncate-lines to work reasonably well, we need to 
> > fix any features which behave silly in that display mode.
> 
> If we want truncate-lines to work reasonably well without fixing all such 
> features one-by-one, we need to fix the root cause of that dysfunction, 
> which is not inside these individual features, but is the fact that (- 
> (window-end) (window-start)) is huge.

I'm not convinced that this is the root cause, nor that there is
indeed a single cause.  So far we have found only one feature where
this is true, and even that is only because Isearch uses that
particular method of deciding when to produce the highlight overlays.

It is true that the narrowing optimizations work less well under
truncate-lines, for these reasons, but there are other places where we
can make improvements and other methods of doing that.

There's no reason to believe that the general issue of long lines can
be solved by a small number of changes that narrow the buffer.
Whatever is left after that we should try solving by other methods.

> > We will not remove truncate-lines from Emacs, and we will not make it 
> > dysfunctional.
> >
> 
> Nobody is asking or suggesting to remove truncate-lines from Emacs, or to 
> make is dysfunctional.  Admitting that it doesn't work together with long 
> lines, which has always been the case, is something entirely different.

I admit that it's a tougher nut that currently is not yet cracked,
yes.  But if improvements can be made in that mode, we should at least
try making them, even if those improvements call for some
complications in our code.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 20:26:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 16:26:07 2022
Received: from localhost ([127.0.0.1]:33534 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHWYh-000102-7c
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 16:26:07 -0400
Received: from heytings.org ([95.142.160.155]:58232)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1oHWYc-0000ze-HT
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 16:26:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1659126361;
 bh=jAqm6CAWy3xVQ1SFqwusRfVfTQs9zOCBNEKI3umLzOQ=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=aeY6HVAZXEj6I4DfcexTpyLyLgU4ljTCw0pWayrSjPx5pJ1727+D0apJMLInnxYXz
 VFehajNInxg+0lHL27S8Uxzku++whe5fGlfIw93APVGIyfPf9fSjdmRbHFBa0sOvx7
 qqEFr/CnJpp4s84Ds1w0viIqjpb4+FXY26DHeEYIRpd5u3R3PS2Ugqx1XV6IIzPTx3
 yc5F8yPjqpA8ctEEoHhRz1DAMJixlpg7uuqToEHRJF+RIMBmPADp+QWiRm3VTga0TK
 uqpmlPenGnNHZRuAnhp4dQZzk6QLuvYNGzY5EgYE+IP6DiDcGh4t20JEA+fnorwtcJ
 r2wGnb9y+oDCw==
Date: Fri, 29 Jul 2022 20:26:00 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <837d3v7kr9.fsf@HIDDEN>
Message-ID: <bf6b6a6fd35ae2bb3303@HIDDEN>
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN>
 <837d3v7kr9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56815
Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>
> And yes, if we want truncate-lines to work reasonably well, we need to 
> fix any features which behave silly in that display mode.
>

If we want truncate-lines to work reasonably well without fixing all such 
features one-by-one, we need to fix the root cause of that dysfunction, 
which is not inside these individual features, but is the fact that (- 
(window-end) (window-start)) is huge.

>
> We will not remove truncate-lines from Emacs, and we will not make it 
> dysfunctional.
>

Nobody is asking or suggesting to remove truncate-lines from Emacs, or to 
make is dysfunctional.  Admitting that it doesn't work together with long 
lines, which has always been the case, is something entirely different.

But I feel you will tell me that I'm pressuring you, so I bow out of this 
discussion.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:59:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 15:59:35 2022
Received: from localhost ([127.0.0.1]:33521 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHW91-0000Gx-Fg
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:59:35 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35616)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oHW8x-0000Gg-Hp
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:59:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47636)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHW8s-0006Lu-3k; Fri, 29 Jul 2022 15:59:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=FbbamkogBNWd863Ks30LYQwidSLL6vV2Ruslc2JxtfA=; b=eK6l3nV+gCNX
 +/BSSuqi8DRqgsbTJmkHWFJOjK2kV96vFnxc8oM6v9Mv3H2Jg4C28AU+L2Tic3/qrnS3Zuxqlh/mP
 ykW5UzMIKh9o+lBWjvgY05WIruh07zX8E3aOieinoDwfLcEkn2zFGQZHEzIXED8bHsHW9g3Ij9Djt
 XBQPZX+pApbd2zugphT6HUD8fkxcFWMGjIIry1Ro+GZnMZ44IRmv0EOq+w6wyNMYpOzQ1C8f+Mg4R
 xBGNLSo6PhwJuPbodnkWb39cOW2WfG/N+r+b3114KWBPmk7Xl8vqXGGvnhSOoNPbVmXoE9YsaxKax
 u6TMecR8+oseEMNfxGI7gA==;
Received: from [87.69.77.57] (port=4493 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHW8r-0000C0-IB; Fri, 29 Jul 2022 15:59:25 -0400
Date: Fri, 29 Jul 2022 22:59:38 +0300
Message-Id: <837d3v7kr9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <bf6b6a6fd3f0eaf40602@HIDDEN> (message from Gregory
 Heytings on Fri, 29 Jul 2022 19:52:08 +0000)
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56815
Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 29 Jul 2022 19:52:08 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: juri@HIDDEN, larsi@HIDDEN, 56815 <at> debbugs.gnu.org
> 
> > Moreover, isearch.el could use some special-purpose algorithm for 
> > looking for visible matches in this case.  For example, as soon as 
> > posn-at-point tells us a match is to the right of the window's right 
> > edge, isearch.el could go to the beginning of the next line and continue 
> > from there, instead of checking all the subsequent matches on the same 
> > line (with a result that is known in advance).  This way, we will 
> > probably have even fewer matches, and the search will be faster, except 
> > for very large values of hscroll.
> 
> And you really think it's TRT to add such a special-purpose algorithm for 
> that very specific "long-and-truncated lines" case everywhere in Emacs? 
> Because isearch is just one example, there are many other places where you 
> will similarly need to reduce the portion of the buffer that will be 
> considered by the command to the portion of the buffer that is actually 
> visible on screen.

Which other places?

In this bug we are talking specifically about isearch.el adding
thousands of overlays to a buffer, 99.99% of which are not visible.
If there are other features that do something similar, please name
them.

And yes, if we want truncate-lines to work reasonably well, we need to
fix any features which behave silly in that display mode.  We will not
remove truncate-lines from Emacs, and we will not make it
dysfunctional.  But let's begin by discovering those features, so that
this discussion could be less academical.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:52:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 15:52:15 2022
Received: from localhost ([127.0.0.1]:33512 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHW1v-000058-Af
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:52:15 -0400
Received: from heytings.org ([95.142.160.155]:58160)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1oHW1q-00004u-5t
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:52:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1659124328;
 bh=VMzWxBSE3pL9R/zQ1TubKP8ze0iGTV3xpEqdgsmF9Xw=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=gSE9H7s6jpbcmzkJEKmkURQaT6BFKcpR6U1odtA4iHFfXyDi2MdBS/ob9Rk5vhWnu
 7Zjkg3tS/99zNqnh+NLiwxPs5KZIc8Bqpe8htZd3NxYTHioG2tVkDkxZa4J769Okjg
 jPcYKaDxiOMNzsGjktvUBvH1PPOy9RNseCywI1W3PJK55V5BtRTTMOqJpb4YjwmOhl
 9Odo2glvKiKgDANtE5eo1tqhkAOpn4LG9VaD5EF1OkFp0QtcpX3vOqV5bP4FY3evpU
 RN9/PHy5xoAfYZ0+CyYs1E+JJGRtyLecQuKI41yhEE9H5Atb4P/qDXc+4H2hto1JL3
 BJc5qGQHodN6Q==
Date: Fri, 29 Jul 2022 19:52:08 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <83a68r7m2d.fsf@HIDDEN>
Message-ID: <bf6b6a6fd3f0eaf40602@HIDDEN>
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56815
Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>
> Moreover, isearch.el could use some special-purpose algorithm for 
> looking for visible matches in this case.  For example, as soon as 
> posn-at-point tells us a match is to the right of the window's right 
> edge, isearch.el could go to the beginning of the next line and continue 
> from there, instead of checking all the subsequent matches on the same 
> line (with a result that is known in advance).  This way, we will 
> probably have even fewer matches, and the search will be faster, except 
> for very large values of hscroll.
>

And you really think it's TRT to add such a special-purpose algorithm for 
that very specific "long-and-truncated lines" case everywhere in Emacs? 
Because isearch is just one example, there are many other places where you 
will similarly need to reduce the portion of the buffer that will be 
considered by the command to the portion of the buffer that is actually 
visible on screen.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:36:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 15:36:21 2022
Received: from localhost ([127.0.0.1]:33491 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHVmX-00084K-1S
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:36:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59548)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oHVmV-000846-Af
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:36:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46778)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHVmP-0008MM-LZ; Fri, 29 Jul 2022 15:36:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=yEox0ESgEzJxW+91ilq3XMD2sRrnkshQ7qYAtkHtOPE=; b=sfkIBbRw3M4k
 7yczkdBFYxU/21ejg/HfTWFj4XOZGOppIv2lua52QGflgbE+6E5PZoz+w+GSWTzPT1mRsOqm9Qj1I
 OZCzjOmKoqWxAcZQCbIk3QqwH4s9/7ukPGU1bjr69anO4vxPtlz2e6xEXp06yDWVG7qkUGgyKkLok
 qYVee3R1s4LFeUHTk/+GxzJxQZr9l12Kql9WBVUE5YIYrjj4bgr5GNQcOOlaFhsKDFcJTvxXWugNC
 5iO37d8wt2pP27BztgBj4Lu+RrAuNyWrwsLxpL0RnnGe/VIUvLrXpRskweouQdESn7JrkskQiZFsZ
 Jldkhf2Vu6r+lTpo+dQtCw==;
Received: from [87.69.77.57] (port=3076 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHVmP-000719-5Q; Fri, 29 Jul 2022 15:36:13 -0400
Date: Fri, 29 Jul 2022 22:36:25 +0300
Message-Id: <838rob7lty.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: gregory@HIDDEN
In-Reply-To: <83a68r7m2d.fsf@HIDDEN> (message from Eli Zaretskii on Fri, 29
 Jul 2022 22:31:22 +0300)
Subject: Re: bug#56815: 29.0.50;
 Isearch lazy-highlight highlights too much when truncate-lines is in
 effect
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
 <83a68r7m2d.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56815
Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
> Date: Fri, 29 Jul 2022 22:31:22 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > (benchmark-run 1000 (pos-visible-in-window-p 310000)) takes 4 seconds
> > 
> > (benchmark-run 1000 (numberp (cadr (posn-at-point 310000)))) takes 6 seconds
> 
> Why does it matter how long pos-visible-in-window-p takes when it
> cannot tell whether the position is visible?

Actually, it can: you just need to call it with the 3rd argument
non-nil.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:31:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 15:31:23 2022
Received: from localhost ([127.0.0.1]:33484 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHVhj-0007wj-8J
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:31:23 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58788)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oHVhi-0007wV-A2
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:31:22 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46332)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHVhW-0007Vl-PH; Fri, 29 Jul 2022 15:31:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ZBKxyOj3P0PJKiClSt/j7Yu5qjk26WyXOMIZX30uV1c=; b=AVIUQA8w0k7Q
 Z+5q2nBiYLHy29MyEX+t3Cm4V4yDRd+V4KwhDq3kRyfjV/B9rwY0/ytrqSKz7VHpWyReQD/QgK7Lx
 eh3ujm7kagDZGwbjktpXKg9ihh9I12fkVg7G4xZFH1QKMF2xdHwIgyV+YQkv6TTYgM1LH9UYWInPv
 fz6xmQc7qd9J7to5ig/BvdhalftOcgnb/uk4ZnLlVYUds9eMfI31zfu7+7ZzUj0HqlfeYD8ccXbJE
 +RTr539OJ2QDVSugxwEKsD1QW5OBNSShW1FhQoGBQefMsLGmvMY2bsTslJ1SBE4JDlv3z1HtXGnqn
 U/kNEPHbKasUQrrrxqGaIQ==;
Received: from [87.69.77.57] (port=2765 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHVhW-0007MB-8I; Fri, 29 Jul 2022 15:31:10 -0400
Date: Fri, 29 Jul 2022 22:31:22 +0300
Message-Id: <83a68r7m2d.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <bf6b6a6fd31548b3d6c5@HIDDEN> (message from Gregory
 Heytings on Fri, 29 Jul 2022 19:11:10 +0000)
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56815
Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 29 Jul 2022 19:11:10 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: juri@HIDDEN, larsi@HIDDEN, 56815 <at> debbugs.gnu.org
> 
> > I think posn-at-point is much faster,
> >
> 
> No, it is slower.  On my laptop, with long-line.xml and truncate-lines:
> 
> (benchmark-run 1000 (pos-visible-in-window-p 310000)) takes 4 seconds
> 
> (benchmark-run 1000 (numberp (cadr (posn-at-point 310000)))) takes 6 seconds

Why does it matter how long pos-visible-in-window-p takes when it
cannot tell whether the position is visible?

As for posn-at-point, 6 msec per position is not bad, if we in
addition limit the number of matches by some reasonable number, like
100, say.

Moreover, isearch.el could use some special-purpose algorithm for
looking for visible matches in this case.  For example, as soon as
posn-at-point tells us a match is to the right of the window's right
edge, isearch.el could go to the beginning of the next line and
continue from there, instead of checking all the subsequent matches on
the same line (with a result that is known in advance).  This way, we
will probably have even fewer matches, and the search will be faster,
except for very large values of hscroll.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:11:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 15:11:18 2022
Received: from localhost ([127.0.0.1]:33469 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHVOH-0007Me-NI
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:11:17 -0400
Received: from heytings.org ([95.142.160.155]:58118)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1oHVOC-0007MP-Ok
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:11:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1659121870;
 bh=FMC9hjvkdSljByKGKZTySl5pWSAdVgqqVVS/SLn3QmA=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=82Bb4ht4UzgPXDARz7BrqEZK2pJPqNH8VkOuA+WX0MioyLMQZJyNGgLmNe6c5KcuK
 UaVMlmPbNTBCXIYUU10FmpZcIfF2o+59Ryej0YbUsfJXKQEW4CI+hzhy+v7760YJG9
 59Vg+tACi8mfMIm4hIZ/LOGabKyuh6o4ORcJPGUW6lGUmPZpk7/Pus1O6c6AQFTKRm
 XZd3/pVUgvDFh1exfAw4CKrxLxQ5/R5NEBtyd5jUBLgd9aWUDetmYlynmVEI6vM3CM
 taUZwntlXXjt2OcABlHJwueNDmIg6Ua6xesls8bEdtAFHkE4NVeNLoH+v6zbH1WRuN
 3Q2NSR+Njn5qw==
Date: Fri, 29 Jul 2022 19:11:10 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <83bkt77nf9.fsf@HIDDEN>
Message-ID: <bf6b6a6fd31548b3d6c5@HIDDEN>
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
 <83bkt77nf9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56815
Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>> The problem is how "visible" is defined here (by 
>> pos-visible-in-window-p). With truncated lines, all buffer positions 
>> between window-start and window-end are "visible", or IOW, all buffer 
>> positions on the left or right of the actually visible line portion are 
>> "visible".
>
> One could use posn-at-point instead.
>

One could, but...

>> Moreover pos-visible-in-window-p is a slow function, so it would be 
>> terribly slow to call it for each candidate position in a buffer with 
>> (tens of) thousands of candidate positions.
>
> I think posn-at-point is much faster,
>

No, it is slower.  On my laptop, with long-line.xml and truncate-lines:

(benchmark-run 1000 (pos-visible-in-window-p 310000)) takes 4 seconds

(benchmark-run 1000 (numberp (cadr (posn-at-point 310000)))) takes 6 seconds




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:02:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 15:02:08 2022
Received: from localhost ([127.0.0.1]:33458 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHVFN-000771-Vf
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:02:08 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53586)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oHVFI-00076T-HN
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:02:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46112)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHVFA-0002QJ-V7; Fri, 29 Jul 2022 15:01:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=nU5DqKVpRfg4GWBef51zA8fiesYJQT+KITtheekTvCc=; b=YTihrS/H50Z3
 19yzXI/GviFz+NpVZAxeUrRrfL0IFpF2A63IpTZtyezOscTPonOYpWUwwhWuwnoj803/lE6DlanCp
 xkRNtUZ1MPcFKg9IVpbP+co6B2j7EFosBC/pUYIZInB8ZlZYQHhRXgjmyCqFwOWHnd4qKhMBcZ0U+
 7Ok+wxlHh23A91cUXmCiNsB8u8Zho7Yvi4jnH5bp/+AndGZSHdC2ak66OwtSAfCXQOMQ9MNJFtgTZ
 tMZnUSQAQ0PU4oDQubAhx8J3puqqHt1KYq/VejVj4X18DNGESp7VpsG/G41t3oiUbxPb+tTplC6n+
 bb4GUO67lpyc9WDhBKhg0g==;
Received: from [87.69.77.57] (port=4945 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHVF7-00041f-Tz; Fri, 29 Jul 2022 15:01:52 -0400
Date: Fri, 29 Jul 2022 22:02:02 +0300
Message-Id: <83bkt77nf9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <bf6b6a6fd369cd74b0fd@HIDDEN> (message from Gregory
 Heytings on Fri, 29 Jul 2022 18:37:55 +0000)
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56815
Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 29 Jul 2022 18:37:55 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: Lars Ingebrigtsen <larsi@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 
>     56815 <at> debbugs.gnu.org
> 
> > Indeed what is worth trying is to add pos-visible-in-window-group-p 
> > either to isearch-filter-predicate, or directly to 
> > isearch-lazy-highlight-search.
> 
> That wouldn't work alas.
> 
> The problem is how "visible" is defined here (by pos-visible-in-window-p). 
> With truncated lines, all buffer positions between window-start and 
> window-end are "visible", or IOW, all buffer positions on the left or 
> right of the actually visible line portion are "visible".

One could use posn-at-point instead.

> Moreover pos-visible-in-window-p is a slow function, so it would be 
> terribly slow to call it for each candidate position in a buffer with 
> (tens of) thousands of candidate positions.

I think posn-at-point is much faster, because it never actually looks
beyond the right edge of the window (it considers every position
beyond the rightmost shown one to be at the edge of the window, either
on the right-fringe, if fringes are shown, or at the last_visible_x
coordinate).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 18:38:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 14:38:01 2022
Received: from localhost ([127.0.0.1]:33448 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHUs5-0006QX-92
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 14:38:01 -0400
Received: from heytings.org ([95.142.160.155]:58074)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1oHUs1-0006QO-4Z
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 14:38:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1659119875;
 bh=9G3wIYKpHqH9OH/IEtJ00+ekd1lUZmyDYCVP99W48rE=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=TtHRy8A9Mv0mYENnA48rnpQjCZnG+d1b1l75Ysy/pC3KuYX89EQmPiqyAbhkoQKcI
 MSAWk3Gqsb/2Oc5hpjawWcZPipMKFQGdio5P+pBZyjkrCRmM5myUWiEtBlXZ06tCNJ
 rekY8I6pcehC3c+zVRp+PifuZ0hgvfykdRlB2lEH+7UW+ElichrOB0IbRyX7pDYz2M
 cvMq8x/VK7KTGD9LraRrpczjMh3hg30BtG/SRxINpKWI2LyRbIctEIMFkWtVHXjIYA
 0DrsM4RwS2UgRFbtlPVD1GbOoRX7H3aZWUEph78/MJrRRERESA0QpLl1+qjLv8RNZU
 1/QdGJtUrjhsg==
Date: Fri, 29 Jul 2022 18:37:55 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <86mtcrpyzs.fsf@HIDDEN>
Message-ID: <bf6b6a6fd369cd74b0fd@HIDDEN>
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
 <86mtcrpyzs.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>> Would it be possibly to make the isearch lazy-highlight just skip the 
>> portions of the buffer that aren't visible?
>
> Indeed what is worth trying is to add pos-visible-in-window-group-p 
> either to isearch-filter-predicate, or directly to 
> isearch-lazy-highlight-search.
>

That wouldn't work alas.

The problem is how "visible" is defined here (by pos-visible-in-window-p). 
With truncated lines, all buffer positions between window-start and 
window-end are "visible", or IOW, all buffer positions on the left or 
right of the actually visible line portion are "visible".

Moreover pos-visible-in-window-p is a slow function, so it would be 
terribly slow to call it for each candidate position in a buffer with 
(tens of) thousands of candidate positions.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 18:18:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 14:18:02 2022
Received: from localhost ([127.0.0.1]:33421 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHUYj-0005ti-1P
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 14:18:01 -0400
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:35853)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1oHUYd-0005tM-FW
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 14:18:00 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 8617020002;
 Fri, 29 Jul 2022 18:17:45 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <87r124kul6.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Fri,
 29 Jul 2022 13:48:53 +0200")
Organization: LINKOV.NET
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN>
Date: Fri, 29 Jul 2022 21:14:47 +0300
Message-ID: <86mtcrpyzs.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 56815
Cc: Eli Zaretskii <eliz@HIDDEN>, 56815 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> This reminds me of something I wondered about when futzing about with
> inhibiting lazy-highlights w.r.t. text covered by a `display' property
> (which was fixed a different way):
>
> Would it be possibly to make the isearch lazy-highlight just skip the
> portions of the buffer that aren't visible?

Indeed what is worth trying is to add pos-visible-in-window-group-p
either to isearch-filter-predicate, or directly to isearch-lazy-highlight-search.
Isearch.el already has some uses of pos-visible-in-window-group-p,
but currently only in isearch-update.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 11:49:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 07:49:06 2022
Received: from localhost ([127.0.0.1]:60072 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHOUM-0003Dh-CC
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 07:49:06 -0400
Received: from quimby.gnus.org ([95.216.78.240]:42410)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oHOUK-0003DB-3T
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 07:49:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Agn/NsIki+i1B5u7qXbwXk7I7RghDOyEfMVfn6yUymo=; b=N9Ed5eaxuH2yNbw/CHD/W1sWbs
 g62Z5n4RytXzullMyhHQTVkwlUHqJqisiKgHO/s8gveBNnvXngHtkylb91WSqfC4p9SYopizTxCYs
 7H4ck+zpcYup+u7BlVKYH4Rn/5pKsRKsjJUu93hTIvi9Hgh/ZVo1Ea9i1RDfCIJUCBVY=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oHOUB-0006Ag-5P; Fri, 29 Jul 2022 13:48:57 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <83fsik8o39.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 29 Jul
 2022 08:50:02 +0300")
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
 <83fsik8o39.fsf@HIDDEN>
X-Now-Playing: Normil Hawaiians's _More Wealth Than Money_: "Return Of
 Hollow Lands"
Date: Fri, 29 Jul 2022 13:48:53 +0200
Message-ID: <87r124kul6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  This reminds me of something I wondered about when futzing
 about with inhibiting lazy-highlights w.r.t. text covered by a `display'
 property (which was fixed a different way): Would it be possibly to make the
 isearch lazy-highlight just skip the portions of the buffer that aren't
 visible? Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This reminds me of something I wondered about when futzing about with
inhibiting lazy-highlights w.r.t. text covered by a `display' property
(which was fixed a different way):

Would it be possibly to make the isearch lazy-highlight just skip the
portions of the buffer that aren't visible?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 05:50:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 29 01:50:03 2022
Received: from localhost ([127.0.0.1]:59734 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oHIss-0007zv-M0
	for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 01:50:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46820)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oHIso-0007zJ-Sl
 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 01:50:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:34312)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHIsh-0001Ow-Lk; Fri, 29 Jul 2022 01:49:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=FnBg9TX2vlbM7AkuZiYbESYE+xoOeQVj25u3UKzBURY=; b=lQbaxXISmcTY
 LViHdwEx/RJ8lFt/1/eFh3ByplO3kb7GyvghTguKPEeML1d2b3ZCnPf+OOy1mgmDjdSAY43p5Yy9x
 NtrT91s89IgB6Bhx6bKS7iX01Jy6qki4Rj5v98b/PZrtol4lYh04B+KGOxKzTRVMWFczpkl7NML25
 F98TcEmC1U1B88S5gdcibX4DGSqLygspgW2FO3827i1FRTRGT+zR5tuwkF7TYQtdfhE283VnLybbP
 EBxU29CTUL9DNIhkWoY3eNbXC3P/uodDSMYycmZo98TVJ1VIc0C3tfsPDlvqxfLkQW4gs5uFg8+Xr
 cNikXL4dRyROLaUGva6EbA==;
Received: from [87.69.77.57] (port=3916 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oHIsg-0005Sw-Jo; Fri, 29 Jul 2022 01:49:51 -0400
Date: Fri, 29 Jul 2022 08:50:02 +0300
Message-Id: <83fsik8o39.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <865yjhc85k.fsf@HIDDEN> (message from Juri Linkov on
 Thu, 28 Jul 2022 23:08:23 +0300)
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Juri Linkov <juri@HIDDEN>
> Cc: 56815 <at> debbugs.gnu.org
> Date: Thu, 28 Jul 2022 23:08:23 +0300
> 
> > If isearch.el cannot find a better criterion for stopping highlighting
> > beyond some buffer position, it should at least use some reasonable
> > fixed (or customizable) limit.  Another possibility is to turn off
> > lazy-highlight by default when truncate-lines is turned on.
> >
> > This issue is related to poor Emacs performance in buffers with very
> > long lines, and its fix is essential for making Emacs more usable with
> > such buffers.
> 
> I didn't follow the new design of long lines handling.
> Does it just narrow each long truncated line?

I don't think it matters, because that narrowing is in effect only as
long as redisplay runs.  Isearch's lazy-highlight runs off a timer,
not from redisplay.

I think the main point here is that under truncate-lines, whether a
given buffer position is or isn't visible cannot be easily deduced
from just its position and the window-end position.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at 56815 <at> debbugs.gnu.org:


Received: (at 56815) by debbugs.gnu.org; 28 Jul 2022 20:09:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 28 16:09:42 2022
Received: from localhost ([127.0.0.1]:59452 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oH9pG-0000WQ-Bl
	for submit <at> debbugs.gnu.org; Thu, 28 Jul 2022 16:09:42 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:36435)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1oH9pF-0000WC-6r
 for 56815 <at> debbugs.gnu.org; Thu, 28 Jul 2022 16:09:41 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id A52BF240003;
 Thu, 28 Jul 2022 20:09:34 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much
 when truncate-lines is in effect
In-Reply-To: <83mtct87ti.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 28 Jul
 2022 20:29:13 +0300")
Organization: LINKOV.NET
References: <83mtct87ti.fsf@HIDDEN>
Date: Thu, 28 Jul 2022 23:08:23 +0300
Message-ID: <865yjhc85k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 56815
Cc: 56815 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> To reproduce, visit any file with very long lines, turn on
> truncate-lines, and invoke Isearch. after typing some search string
> for which there are matches in the buffer, Isearch will highlight many
> matches that are not visible in the window.  In an extreme case where
> a file has a single very long line, all the matches in the buffer will
> be highlighted.  This both takes long time, and slows down many
> display-related commands, because the large number of overlays created
> for the highlighting slows down redisplay.
>
> This happens because isearch.el uses window-end as the limit beyond
> which to stop highlighting, but that is a poor indicator of visibility
> in buffers under truncate-lines.
>
> If isearch.el cannot find a better criterion for stopping highlighting
> beyond some buffer position, it should at least use some reasonable
> fixed (or customizable) limit.  Another possibility is to turn off
> lazy-highlight by default when truncate-lines is turned on.
>
> This issue is related to poor Emacs performance in buffers with very
> long lines, and its fix is essential for making Emacs more usable with
> such buffers.

I didn't follow the new design of long lines handling.
Does it just narrow each long truncated line?
When narrowing is in effect then lazy-highlight
should already do the right thing since it can't go
outside of the narrowed regions.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Jul 2022 17:29:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 28 13:29:07 2022
Received: from localhost ([127.0.0.1]:59341 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oH7Jr-0004cl-5u
	for submit <at> debbugs.gnu.org; Thu, 28 Jul 2022 13:29:07 -0400
Received: from lists.gnu.org ([209.51.188.17]:38442)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oH7Jo-0004cc-JN
 for submit <at> debbugs.gnu.org; Thu, 28 Jul 2022 13:29:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:47416)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oH7Jo-0008Cx-Ec
 for bug-gnu-emacs@HIDDEN; Thu, 28 Jul 2022 13:29:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52494)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oH7Jo-0004un-5y
 for bug-gnu-emacs@HIDDEN; Thu, 28 Jul 2022 13:29:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to:
 references; bh=SKiELSD+E1HmGoiXGAZSpKHtalI0szjkU7F8cgdRCEA=; b=HICSKWR4/Clhhr
 JDAgZaDnBXoiUXGWJU8/nQe7il6dcmrS+LvT6EvEofcZH0c3tA+oxk6eKNZqX7ABNVlGLvdpj2TmP
 8XFhd8JuwMvoSKLoTWSbl/9EZwkCBF2cHPZG4ClZENrudohSDfvdQTDGpOCAyelMmf4pfcfr5NoVB
 a+DzT+8lweIuAhWXY955upxb4xTHK6PJHTZ8l22Jw4k1PC3w9YFLw/5yNdarck9AFoseXkEjwvAXu
 n5OVTbHa1OffTDkYau+mtQ/7kW0Lk8xoodyq1tzyGkKZRV8BVyCZfEg9+ny+ZpH+hJS4CE3r9t1Qk
 ZTsCvfmmgWInj5JwEpog==;
Received: from [87.69.77.57] (port=2374 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oH7Jn-0003bi-Ky
 for bug-gnu-emacs@HIDDEN; Thu, 28 Jul 2022 13:29:04 -0400
Date: Thu, 28 Jul 2022 20:29:13 +0300
Message-Id: <83mtct87ti.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50;
 Isearch lazy-highlight highlights too much when truncate-lines is in
 effect
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

To reproduce, visit any file with very long lines, turn on
truncate-lines, and invoke Isearch. after typing some search string
for which there are matches in the buffer, Isearch will highlight many
matches that are not visible in the window.  In an extreme case where
a file has a single very long line, all the matches in the buffer will
be highlighted.  This both takes long time, and slows down many
display-related commands, because the large number of overlays created
for the highlighting slows down redisplay.

This happens because isearch.el uses window-end as the limit beyond
which to stop highlighting, but that is a poor indicator of visibility
in buffers under truncate-lines.

If isearch.el cannot find a better criterion for stopping highlighting
beyond some buffer position, it should at least use some reasonable
fixed (or customizable) limit.  Another possibility is to turn off
lazy-highlight by default when truncate-lines is turned on.

This issue is related to poor Emacs performance in buffers with very
long lines, and its fix is essential for making Emacs more usable with
such buffers.

In GNU Emacs 29.0.50 (build 1562, i686-pc-mingw32)
 of 2022-07-28 built on HOME-C4E4A596F7
Repository revision: 5999dc1cd925ddf8af0b893432124af7904a6918
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 5.1.2600
System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600)

Configured using:
 'configure -C --prefix=/d/usr --with-wide-int
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -gdwarf-4 -g3''

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY
W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP XPM ZLIB

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1255

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32
ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty
make-network-process emacs)

Memory information:
((conses 16 42081 12220)
 (symbols 48 6231 0)
 (strings 16 16687 2024)
 (string-bytes 1 454721)
 (vectors 16 9209)
 (vector-slots 8 143790 14221)
 (floats 8 23 45)
 (intervals 40 268 7)
 (buffers 888 10))




Acknowledgement sent to Eli Zaretskii <eliz@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#56815; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 8 Aug 2022 17:30:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.