GNU bug report logs - #72830
Big rectangular selections are slow

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: Mattias Engdegård <mattias.engdegard@HIDDEN>; dated Tue, 27 Aug 2024 12:41:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 72830) by debbugs.gnu.org; 23 Sep 2024 10:43:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 23 06:43:39 2024
Received: from localhost ([127.0.0.1]:43252 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ssgXb-0004zN-Ch
	for submit <at> debbugs.gnu.org; Mon, 23 Sep 2024 06:43:39 -0400
Received: from mail-lj1-f181.google.com ([209.85.208.181]:49441)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1ssgXZ-0004zA-Kk
 for 72830 <at> debbugs.gnu.org; Mon, 23 Sep 2024 06:43:38 -0400
Received: by mail-lj1-f181.google.com with SMTP id
 38308e7fff4ca-2f763e9e759so46535691fa.3
 for <72830 <at> debbugs.gnu.org>; Mon, 23 Sep 2024 03:43:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1727088129; x=1727692929; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=qjoNnebypIF2IOuDJclBsAjhRYPbV3n2mNeUTN/hlWA=;
 b=MzPghHBTR8fdA0Uyn/kLb5HsT0giSgqtAOgiL/uhPFYL10NQrEk0KK/KaWL82+ATxT
 v+25EPdkpoWosyKZDYJZoQq2hY0zgVMCoFWgmpkbMkxHTOPlQ5e9YFnueEntw+LkcXoM
 HCG1Kx6Mz6ZnWqvMfJcTN+O9GGbc3EujVIRj1P8rknPv17GbyKQkne0SKthFC9fVPQhy
 2+4EB+de6y0MX8K7P3hgNdgkHjroCQctdyr+6nraJf1oQ3AM6z0Y+JqSYnoplREowuPq
 O1UtGWl1T2gg90mB6kXn2yawPs8wssPMgvTq3ajizj5C8U98Oe/Dfiev+jrj3D0jLUZ1
 Tq2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1727088129; x=1727692929;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=qjoNnebypIF2IOuDJclBsAjhRYPbV3n2mNeUTN/hlWA=;
 b=MBjZorLMpJf9+2HPsMwHWXnHz7HjTHoSTNtGe92OMuzaSoopi2dV9EBoi6IXdp6iux
 HnrdOmi6bZxFAq1fPMc8bbSJELXnP9p24Sn7FzNTRRR4eVp7361VrKjB/JycjUR48CEa
 KDHvQNwWZh4ls7XmwxeaX36ZwlPNLWHg+KMCZDBZrfprr3DekHIusbSGaHT0iJfJuPip
 jLFZVob5xORx341B3GlExSOE08rINrmPlNS7msZdxlka0xSaliujAN1RALt1xmYs+SxV
 GyXzctwnQDSxWn17fNKPpKjgE3nLE19/O+CgkjHktLEnNM436U4udrvwPpG0mNeox/QV
 JGaQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCU178ylugiOzBIJZWFOvffAYhqR8V1WQRyvA7zIVcZiEkExZruFX0caYmbO2cJvYxBeUTPnSA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwE5kG1gKqCeD4lKhaEj+kOEbNEl6NKXmHSkRGompkHfdr44mps
 UY+Ovm2W9uOhbYJhcUPhnq8kNmXY/gmInzPalZBJ/zqCLMxU48OO
X-Google-Smtp-Source: AGHT+IGgSMLVci7JA98khwX/WPw6H9ydDf+4jc2NvKKPYV0Ngac3WMMXn6cyxHf+RHLV+EGJK6LuzQ==
X-Received: by 2002:a2e:4c19:0:b0:2f3:d82b:1959 with SMTP id
 38308e7fff4ca-2f7cb32a432mr43856911fa.23.1727088128139; 
 Mon, 23 Sep 2024 03:42:08 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f79d2e1dbdsm29001351fa.14.2024.09.23.03.42.06
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 23 Sep 2024 03:42:07 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#72830: Big rectangular selections are slow
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <jwvfrpr617t.fsf-monnier+emacs@HIDDEN>
Date: Mon, 23 Sep 2024 12:42:06 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <FE654FEE-DDE6-4128-AEA2-FC29066E3B96@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
 <jwvcykx7lo6.fsf-monnier+emacs@HIDDEN>
 <5F6C5DCE-88F0-446D-8CBD-5E9EE26FFFC6@HIDDEN>
 <jwvwmj36b6r.fsf-monnier+emacs@HIDDEN>
 <3413563D-0343-4764-8D44-DAE3D3642A80@HIDDEN>
 <jwvldzj6782.fsf-monnier+emacs@HIDDEN>
 <DD890314-7B23-44E2-854B-A812385670EA@HIDDEN>
 <jwvfrpr617t.fsf-monnier+emacs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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: -1.0 (-)

22 sep. 2024 kl. 19.37 skrev Stefan Monnier <monnier@HIDDEN>:
>=20
>> Sorry if I've lost track with your step numbering, but the problem is =
still
>> that we extract and retain the selected text both at selection and =
each
>> incremental modification of it.
>=20
> "incremental modification" is my step 2.  And in the design, step
> 2 should not actually compute the content of the selection.
> IOW, what you describe sounds like a plain bug.

No argument there!

> Modifications deactivate the selection, so if we want to preserve the
> selection until after modifications, that's when step 4 comes into =
play.

Yes, let's not do that then.

(I'm not sure if it's even possible to delay the text extraction of =
PRIMARY until it is actually requested on macOS, where PRIMARY and =
SECONDARY are just alternative pasteboards. I think the idea is to =
cooperate with XQuartz, but it should be safe to have that feature =
disabled by default.)






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

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


Received: (at 72830) by debbugs.gnu.org; 22 Sep 2024 17:37:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 22 13:37:53 2024
Received: from localhost ([127.0.0.1]:42704 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ssQWv-0008D7-7O
	for submit <at> debbugs.gnu.org; Sun, 22 Sep 2024 13:37:53 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11592)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1ssQWs-0008Ct-Vs
 for 72830 <at> debbugs.gnu.org; Sun, 22 Sep 2024 13:37:52 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D45DA100044;
 Sun, 22 Sep 2024 13:37:22 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1727026642;
 bh=l81cMyfVcbgtq741j8zy/aMSy+xm1rqERHZNe6Hj0rg=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Bb9JnwM30Jv7Sbxfcofq4SpfQ5SrBMX1IJr0GcJwzZOm/H9WvfTMOfeXsvPksObrZ
 wNBIDrHbfAvNyY3CN0d+x13dUIcLITnecIq6fZVG0nSa8izBxC3q2dOyuM4mLcod9T
 74EGnXDsCpIFmWem81pY3djoV6lwSBsGT9r1fhmTTFJnOoJXjBzkbSN/iCAXFZ6Wkn
 vR16ZDSYoUSxxvP7GFacjFFkB0XI3+xRuCERvvWQYnuQpekROlK6GZwK+D4bf9chyD
 JIdcS4Io5yJ2iyqkgdR1CmkNxveh1nLAI22LmzzYI8CdEaWk18QHueuLZrYOONuXf5
 sxX4BQVoNKEQg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 395CC100035;
 Sun, 22 Sep 2024 13:37:22 -0400 (EDT)
Received: from pastel (unknown [45.72.221.103])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id F2A0D120642;
 Sun, 22 Sep 2024 13:37:21 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <DD890314-7B23-44E2-854B-A812385670EA@HIDDEN> ("Mattias
 =?windows-1252?Q?Engdeg=E5rd=22's?= message of "Sun, 22 Sep 2024 18:22:04
 +0200")
Message-ID: <jwvfrpr617t.fsf-monnier+emacs@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
 <jwvcykx7lo6.fsf-monnier+emacs@HIDDEN>
 <5F6C5DCE-88F0-446D-8CBD-5E9EE26FFFC6@HIDDEN>
 <jwvwmj36b6r.fsf-monnier+emacs@HIDDEN>
 <3413563D-0343-4764-8D44-DAE3D3642A80@HIDDEN>
 <jwvldzj6782.fsf-monnier+emacs@HIDDEN>
 <DD890314-7B23-44E2-854B-A812385670EA@HIDDEN>
Date: Sun, 22 Sep 2024 13:37:19 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.020 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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 (---)

> Sorry if I've lost track with your step numbering, but the problem is still
> that we extract and retain the selected text both at selection and each
> incremental modification of it.

"incremental modification" is my step 2.  And in the design, step
2 should not actually compute the content of the selection.
IOW, what you describe sounds like a plain bug.

> So the extraction needs to be delayed until either requested by the X server
> or locally by mouse-yank-primary. This means that we need to decide whether
> it would be a problem to do so, as the buffer may have changed between the
> selection and text extraction. (I think we shouldn't bother preserving
> PRIMARY data across buffer modification.)

Modifications deactivate the selection, so if we want to preserve the
selection until after modifications, that's when step 4 comes into play.


        Stefan





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

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


Received: (at 72830) by debbugs.gnu.org; 22 Sep 2024 16:23:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 22 12:23:38 2024
Received: from localhost ([127.0.0.1]:42687 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ssPN3-0004Nd-NA
	for submit <at> debbugs.gnu.org; Sun, 22 Sep 2024 12:23:38 -0400
Received: from mail-lf1-f44.google.com ([209.85.167.44]:59789)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1ssPN0-0004NM-5B
 for 72830 <at> debbugs.gnu.org; Sun, 22 Sep 2024 12:23:36 -0400
Received: by mail-lf1-f44.google.com with SMTP id
 2adb3069b0e04-53653ee23adso3098482e87.3
 for <72830 <at> debbugs.gnu.org>; Sun, 22 Sep 2024 09:23:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1727022126; x=1727626926; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=8KGy3bwBSQFPH/vh+W4VCtcG9AcOhej8Fssrnnrudnc=;
 b=YuqGdv1lV6cQp8B53Yie1t5T3j9cpL0iQDrr2TO0+hOOkuGWZWcvZ9Dpqg7rMZDKJU
 mmWoNbKreoWqBvCLBZUU/7FiuROJCzQMWhGRUYcLYRBh6yGBkhShKSASDTbn+Siwyakb
 luJklV5BNbbrEHsJT7xdA213MjsXS6BJwAdpk2TkNnK2Aw+elWRynsvy0tKpbJy5gs9D
 HCqQ+6fLjFY/o/KvTgLDVE+LeiDqX9uStrQJcZOnj3KtxlgfeMcSRFzJpDnXcj7LIvmH
 dJ0B2cU8R+iRtr0xkHOkx+EY8vAxV9my6nxSWS9+l8aEhB8RLW1F23r81qy8ghEvh3nb
 rSeA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1727022126; x=1727626926;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=8KGy3bwBSQFPH/vh+W4VCtcG9AcOhej8Fssrnnrudnc=;
 b=OTJg6GFwzm08gbrX5k0t7PfyHzIywmvG/d1PR2gb0spizn1iKe3FkVbefzEohhfHrL
 WvSWSlPJ3eKfg3aRoyJvic9cO/gMRHHtqR6I4NNB1+2i9kbjWFBEoEG9W5Wl2JH+f2IR
 5CYLujo9wjDcjjHNuqTKh39MWz/0noVtKt6XRbaRQo3HQsQ3m71xsHalW358YypVqN1H
 9QkZhf4kYyzUA0uKN/9E8lV7aTCkO2xviMKd2mxUPZmSbFBlWb9ieHmcxoU50bZkGSSv
 iZtcqzO1OjVtO/AJRoi20hDKQKZqPzEJt6X6vYlBWh4cPteiJyVt2xb9/zmId7BWebBg
 V5rQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCWFG6oqudNevzVYKCQRP8qzrxY9t1XXyRgMjn0SdOIWwmXqjQ76SBnb+mY71jmP4Vu/y0ZR0Q==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyDVZ9M9wZTnjXIfmfdozZq27k1G2tB3b61lAEr0CEM0zYGjPJn
 ZJUkqQz/nkttregUb2zJAv9Naweq1tib3xjF2J5AHmsVB6lxsDF3
X-Google-Smtp-Source: AGHT+IEvnZ3JIDXg5LeaaY8ubEfOAM1RzMnSEAA70ze5Ws/w23gqbAYYqtqyjdHWN4SlnfB8M963EQ==
X-Received: by 2002:a05:6512:1107:b0:52c:dd3d:85af with SMTP id
 2adb3069b0e04-536ad17d3ecmr3802799e87.25.1727022125868; 
 Sun, 22 Sep 2024 09:22:05 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53687096909sm2958623e87.163.2024.09.22.09.22.04
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 22 Sep 2024 09:22:05 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#72830: Big rectangular selections are slow
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <jwvldzj6782.fsf-monnier+emacs@HIDDEN>
Date: Sun, 22 Sep 2024 18:22:04 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <DD890314-7B23-44E2-854B-A812385670EA@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
 <jwvcykx7lo6.fsf-monnier+emacs@HIDDEN>
 <5F6C5DCE-88F0-446D-8CBD-5E9EE26FFFC6@HIDDEN>
 <jwvwmj36b6r.fsf-monnier+emacs@HIDDEN>
 <3413563D-0343-4764-8D44-DAE3D3642A80@HIDDEN>
 <jwvldzj6782.fsf-monnier+emacs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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: -1.0 (-)

22 sep. 2024 kl. 17.32 skrev Stefan Monnier <monnier@HIDDEN>:

> Hmm... I thought your complaint about the cost of
> `select-active-regions` was due to the cost being too high in step
> 2 (which would indicate that the code does not behave quite like the
> design I described, and would thus be a simple bug we should fix).
>=20
> Are you saying that when you said:
>=20
>    - `select-active-regions`: as mentioned, it slows down rectangle
>      selection massively ...
>=20
> you were talking about the slowdown imposed in step 4 rather than in
> step 2?

Sorry if I've lost track with your step numbering, but the problem is =
still that we extract and retain the selected text both at selection and =
each incremental modification of it.

So the extraction needs to be delayed until either requested by the X =
server or locally by mouse-yank-primary. This means that we need to =
decide whether it would be a problem to do so, as the buffer may have =
changed between the selection and text extraction. (I think we shouldn't =
bother preserving PRIMARY data across buffer modification.)





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

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


Received: (at 72830) by debbugs.gnu.org; 22 Sep 2024 15:32:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 22 11:32:51 2024
Received: from localhost ([127.0.0.1]:42655 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ssOZv-0001gI-Hq
	for submit <at> debbugs.gnu.org; Sun, 22 Sep 2024 11:32:51 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36775)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1ssOZs-0001g5-Ma
 for 72830 <at> debbugs.gnu.org; Sun, 22 Sep 2024 11:32:50 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A8B98441861;
 Sun, 22 Sep 2024 11:32:20 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1727019139;
 bh=67qD1omW2NCKjZWgqLg4CsUYMJEGom56jhIYL/xjB2Y=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=ABDB1IQFhOLLpR6UbtUjzyWGNyhO7DA7d/mAm8jKyuUSCwcLfTvspAXwflbW3DTh5
 6XhY2KhSg+U2e75syvUtVEvWnQ94iZjRnSF4uHm44gx0Q1551cOG/u0YIAyndMt42P
 OIJeqV8vY7JDphKcjZ8JXDXvwgOYxy0uUinrLErW5KxnuHciaaccetUu8kImyzy22G
 7x2zVccxiKhvKKPhmC+AJdS+LKzy02lrj8ql0wMPHUw/OVVkK8xbxbfyfQJDNN0lgR
 TUyb/pIEt28wgwsT6Bz588RL3hEn1tQwKAS3CneRQOR5qmKPw7ZALzx00zF6x1IS3X
 12YZWdHIejgYg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AA587441492;
 Sun, 22 Sep 2024 11:32:19 -0400 (EDT)
Received: from pastel (unknown [45.72.221.103])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6D062120751;
 Sun, 22 Sep 2024 11:32:19 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <3413563D-0343-4764-8D44-DAE3D3642A80@HIDDEN> ("Mattias
 =?windows-1252?Q?Engdeg=E5rd=22's?= message of "Sun, 22 Sep 2024 17:16:20
 +0200")
Message-ID: <jwvldzj6782.fsf-monnier+emacs@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
 <jwvcykx7lo6.fsf-monnier+emacs@HIDDEN>
 <5F6C5DCE-88F0-446D-8CBD-5E9EE26FFFC6@HIDDEN>
 <jwvwmj36b6r.fsf-monnier+emacs@HIDDEN>
 <3413563D-0343-4764-8D44-DAE3D3642A80@HIDDEN>
Date: Sun, 22 Sep 2024 11:32:18 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.160 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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 (---)

Mattias Engdeg=E5rd [2024-09-22 17:16:20] wrote:
[ ... Various questions about what behavior we want to provide ...  ]

Hmm... I thought your complaint about the cost of
`select-active-regions` was due to the cost being too high in step
2 (which would indicate that the code does not behave quite like the
design I described, and would thus be a simple bug we should fix).

Are you saying that when you said:

    - `select-active-regions`: as mentioned, it slows down rectangle
      selection massively ...

you were talking about the slowdown imposed in step 4 rather than in
step 2?


        Stefan





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

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


Received: (at 72830) by debbugs.gnu.org; 22 Sep 2024 15:17:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 22 11:17:54 2024
Received: from localhost ([127.0.0.1]:42645 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ssOLS-0000qz-DQ
	for submit <at> debbugs.gnu.org; Sun, 22 Sep 2024 11:17:54 -0400
Received: from mail-lj1-f178.google.com ([209.85.208.178]:57595)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1ssOLO-0000qh-K2
 for 72830 <at> debbugs.gnu.org; Sun, 22 Sep 2024 11:17:53 -0400
Received: by mail-lj1-f178.google.com with SMTP id
 38308e7fff4ca-2f75c6ed397so36580091fa.2
 for <72830 <at> debbugs.gnu.org>; Sun, 22 Sep 2024 08:17:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1727018182; x=1727622982; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=HxgG9suXztCl4cnBSVp7WIqiZ0xNc5yHtIvFc7Humjg=;
 b=LmcCp5/xlQdH/7HHzVqjCRivHVTYrJErGR/FiU0P84R1BE4Ufb1K/MUKKX1FcKGqdl
 TuOeLTd+9r3UcXx072gWdmM3JV/ch5u1bkbju7+jRRla1KWRknMe2zGwlbkrvE3grIz8
 31tlPM6QYRlMTeH6fGSEAwAJJEkvnu3R0TmVxjBn7RDuIFpJPytMvEvk/F/+xJMwP428
 dZAtjPQm7SeLSqkAbRBq8vDaUvMvwVwlIwFQBFubEginq/P8PC2jEldF0A8rfK3fwy98
 /HLctwKs/o9+yLeTEeOTb0+MNnW/tUPyJmD1pNpxmvvZYqN1r00kVXUzEFTlIhnRrh8l
 f0nA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1727018182; x=1727622982;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=HxgG9suXztCl4cnBSVp7WIqiZ0xNc5yHtIvFc7Humjg=;
 b=Hw9UQ8mpg9PLVDiRAr79YS80PpXkIRqH3X2Hr5BxCTglbEW7J7C9u5BtYlP9Nql4Da
 MuXlUZyjNGR3ehwb31/ab9RchNFP2pGiINxTlwgp23trg+qKoPLu/ktqmf/ocnGFFxrO
 /6IYsJHakTnYIh6GuEnnupO+Bw/6mA7x/QD9fepyO736eY8dsw8zw4kriVxkiomagxxW
 bbeYcWtDEs3Rny76r4LGOEsJ+00ZfbsOIVZ+lox79IcnrWduOcWwpVvLrqHj0Bm8yFbc
 lJjXcZUrX0NI8p5lpzTHx5YJa1mNcDhAkIDgOj7RGKOxjKwyINo1YS9kcr4WmX+lQj1i
 gCyw==
X-Forwarded-Encrypted: i=1;
 AJvYcCWp40TdlVMxGP5Fu3kjVAbLltv8Z1Q+zIgpCRPRarKzUNxWPHQZKH4GUZ61VUdSuYF6jjt/hg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxcywDnHG8aZMbvEcll9KS4+GG92A3JWDrUlJSLxKt2biFlhSBo
 PvscjW4Av2rSuscwA2GnH/xiH/mK2QzTPDNk26rRgafP0QWDJ1tt
X-Google-Smtp-Source: AGHT+IHjOZ+ZeSZuA3fgoXdOHljdXTn074BOepm2uE1lOoZjPot+/ESd2O0jSSQisfL35jTvZnQPMg==
X-Received: by 2002:a05:6512:1395:b0:533:4505:5b2d with SMTP id
 2adb3069b0e04-536ad3e2061mr3977548e87.60.1727018181999; 
 Sun, 22 Sep 2024 08:16:21 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-536870b8c46sm3026393e87.280.2024.09.22.08.16.21
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 22 Sep 2024 08:16:21 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#72830: Big rectangular selections are slow
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <jwvwmj36b6r.fsf-monnier+emacs@HIDDEN>
Date: Sun, 22 Sep 2024 17:16:20 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <3413563D-0343-4764-8D44-DAE3D3642A80@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
 <jwvcykx7lo6.fsf-monnier+emacs@HIDDEN>
 <5F6C5DCE-88F0-446D-8CBD-5E9EE26FFFC6@HIDDEN>
 <jwvwmj36b6r.fsf-monnier+emacs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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: -1.0 (-)

22 sep. 2024 kl. 16.12 skrev Stefan Monnier <monnier@HIDDEN>:

> IIRC from the last time I looked at that code, I got the impression =
that
> the design was made [pun ahead!] primarily for the CLIPBOARD selection
> and *should* work something like this:
> - when we make a new selection, we tell X11 that we own the CLIPBOARD.
>  This should be an O(1) operation.
> - when the selection changes because we move point or mark, we don't
>  need to do anything.
> - we get the content of that selection (an O(N) operation) only =
if/when
>  X11 asks for it.
> - in order to still be able to send the CLIPBOARD's content after the
>  selection has disappeared, we pay the O(N) cost when the region is
>  deactivated and "squirrelled away" (like you say) that content.

I don't think an X11 client should ever claim CLIPBOARD ownership merely =
for marking a selection, as opposed to issuing a 'Copy[ to clipboard]' =
operation, but seem to recall that it did happen with some broken =
clients. PRIMARY is indeed different and that's probably what confused =
programmers back in the day, especially since old clients like Xterm =
emphasised the use of PRIMARY.

> So the big rectangular selections should slow down only steps 3 and
> 4 but not step 1 or 2.  And as you point out, maybe step 4 =
could/should
> be skipped for PRIMARY, tho I'm not sure in which cases it would
> be beneficial (beside those cases where the region is so large that =
the
> O(N) cost is a problem).

The O(N) cost in time and space is a problem. X11 convention is that =
PRIMARY is available for as long as the selection is visibly marked in =
the client.
[ What happens if another client claims PRIMARY? The first (losing) =
client typically has two choices: either remove the selection so that =
the user sees that the selection is no more (the classic Xterm way), or =
repaint it in a 'local-only' colour to show that it can still be used =
for other purposes. ]

> Of course, if needed, maybe the step 4 could be made faster by
> squirreling away not the exact rectangular region, but something that
> can be computed more quickly and from which we can later still extract
> the exact rectangular region if/when needed.

Yes, we'd need some sort of current-selection-extent object. The =
question is, what should its lifetime be?

A. For as long as the selection is active
B. Until buffer is modified
C. Indefinitely, using absolute buffer offsets
D. Indefinitely, using markers

I'd suggest A because that's closest to X11 practice. B would be doable. =
C and D are taking it too far and recovering a rectangle would be a =
mess.






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

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


Received: (at 72830) by debbugs.gnu.org; 22 Sep 2024 14:13:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 22 10:13:18 2024
Received: from localhost ([127.0.0.1]:42611 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ssNKv-0005ZV-Tz
	for submit <at> debbugs.gnu.org; Sun, 22 Sep 2024 10:13:18 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25490)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1ssNKt-0005Z6-Rm
 for 72830 <at> debbugs.gnu.org; Sun, 22 Sep 2024 10:13:16 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 085C780982;
 Sun, 22 Sep 2024 10:12:47 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1727014366;
 bh=xy5ZYngKIviflvYFgK2INp3cQeb67Q5RChdZglwOwAw=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=e36446ZJ3gVMQvsTRZmM+kU0KCMUAT1WSavuc0FsXPIMkjX1uN3kyDrl1w0EGsaSU
 vzpDthtwR62Svf7lTmWRU/FHEIx1hkQrnFZLvcI+OI5C+aqXArM++H59pMnVa5qE4a
 gWoB0NGb1T1mNeQUNutbdTgwGAH12pllmnrGpBf55X3m0rfY/wo1w8YWJvUIk3yb6m
 j458yEz4gG1Tiz8xtMaI3TzyGgCkaqY6hjjZDEFP8bxp4MclAN0DhplcKtf3YQNMnb
 O8UAP8cPmiX07wyieEmuffN/gj36Vqt4SjC5tBWuui5A25MGQVcjm0slgi4xmsfUR3
 61jIZs6oeqg9w==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0611380187;
 Sun, 22 Sep 2024 10:12:46 -0400 (EDT)
Received: from pastel (unknown [45.72.221.103])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A696512045A;
 Sun, 22 Sep 2024 10:12:45 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <5F6C5DCE-88F0-446D-8CBD-5E9EE26FFFC6@HIDDEN> ("Mattias
 =?windows-1252?Q?Engdeg=E5rd=22's?= message of "Sun, 22 Sep 2024 15:27:50
 +0200")
Message-ID: <jwvwmj36b6r.fsf-monnier+emacs@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
 <jwvcykx7lo6.fsf-monnier+emacs@HIDDEN>
 <5F6C5DCE-88F0-446D-8CBD-5E9EE26FFFC6@HIDDEN>
Date: Sun, 22 Sep 2024 10:12:44 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.224 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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 (---)

>>> - `select-active-regions`: as mentioned, it slows down rectangle selection
>>> massively and is alien to non-X11 platforms so I'd suggest it be set to nil
>>> by default on macOS and Windows at least.
>> I think we should first try and make it not-slow, by making it lazy.
> No objections there but we would need to rework some plumbing. Emacs's behaviour is odd.
> When a selection is made, that text is extracted and squirrelled away just
> in case, so the user can actually select some text, deselect and move
> around, and even make some changes the the buffer, and then paste PRIMARY
> from Emacs or any other X11 client and still get the originally
> selected text.

IIRC from the last time I looked at that code, I got the impression that
the design was made [pun ahead!] primarily for the CLIPBOARD selection
and *should* work something like this:
- when we make a new selection, we tell X11 that we own the CLIPBOARD.
  This should be an O(1) operation.
- when the selection changes because we move point or mark, we don't
  need to do anything.
- we get the content of that selection (an O(N) operation) only if/when
  X11 asks for it.
- in order to still be able to send the CLIPBOARD's content after the
  selection has disappeared, we pay the O(N) cost when the region is
  deactivated and "squirrelled away" (like you say) that content.

So the big rectangular selections should slow down only steps 3 and
4 but not step 1 or 2.  And as you point out, maybe step 4 could/should
be skipped for PRIMARY, tho I'm not sure in which cases it would
be beneficial (beside those cases where the region is so large that the
O(N) cost is a problem).


        Stefan


PS: Of course, if needed, maybe the step 4 could be made faster by
squirreling away not the exact rectangular region, but something that
can be computed more quickly and from which we can later still extract
the exact rectangular region if/when needed.





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

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


Received: (at 72830) by debbugs.gnu.org; 22 Sep 2024 13:29:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 22 09:29:24 2024
Received: from localhost ([127.0.0.1]:41084 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ssMeR-0002js-Pi
	for submit <at> debbugs.gnu.org; Sun, 22 Sep 2024 09:29:24 -0400
Received: from mail-lf1-f48.google.com ([209.85.167.48]:56396)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1ssMeO-0002jZ-8q
 for 72830 <at> debbugs.gnu.org; Sun, 22 Sep 2024 09:29:22 -0400
Received: by mail-lf1-f48.google.com with SMTP id
 2adb3069b0e04-5366fd6fdf1so3821079e87.0
 for <72830 <at> debbugs.gnu.org>; Sun, 22 Sep 2024 06:28:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1727011672; x=1727616472; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=bq4ir/UwmuT3yBuI7Fv5Qd2n17JDwPT/h//5dGUPGV0=;
 b=M4NobvRX00aL6R7i1eyroTPxNH/nfLAGX6gQIBE2EeWE7rXC7Ems6gXzr1chAfz4YC
 NXZtQigmJL51rfsxajY81crRN5xOrdQAp7ZV55b+QdASNUjfqjF4S1fmbqTUmtCcg2Wm
 +xgpv3I9wya973W6lHVli70Fn1TuDk1S/xoA7psHuPF7UfZCf2nqnumZqutT/7R+tGE5
 +cI5XnLYZsCFuM9MNURzfDi0COHzJi/dPX9dy7Z85tBNx2LsxX+90wbuNp+D1/463lgW
 sF1vSkusV10pVNBygPPQUYqOGEQH98yrfLZQtgcd5I7/nxnXpbBoaEti95aigvchKF13
 B0vw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1727011672; x=1727616472;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=bq4ir/UwmuT3yBuI7Fv5Qd2n17JDwPT/h//5dGUPGV0=;
 b=ZjqKZfjhDYLqfdo/wLbajtr9WrbWc4qmgcEhQbbReY1UI5yRHM9NsMU5InuJa21Z31
 dCBb6EyRRpQtMHQ3BRcrJFtla3ekWh32mbUwBKYh7YStOwMAde6kRBOnOnJgodoSwwis
 4IvpDoBKUR0lIJXBsfhYFIGg+lT5gq2T23X7gjKK51tebBtMRbwWYayeoTOZPlLjtq1V
 DNDeb2wBcOd/Y66M4x9Sn6jCcEzuQAD/8Ydliwcyv/jXa3iJuFiMcNdLFlmpiYZufXqz
 gYbCseZKup+JmV5G0rnFTpfL/MYbCQSgMuoYSSKNgallh4yxLmczOMGjWbX52AwwNLqb
 0wtA==
X-Forwarded-Encrypted: i=1;
 AJvYcCUo+dIsoyRCCBd79nENDUD/b4BB8FayHGtqYlmwikiBdcisW6geGTNEkRuOKbYB86Nn/kMlYA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxMojBh0moRLmo1QSd1VJfKqANhjSZUFyrbBEDmliGVE+mhQUKt
 G6UZfpCLvf7HgT28luY0wFBJg3J7apRj9Q9RyT1NHf/MqIjDO/Wr
X-Google-Smtp-Source: AGHT+IGj5fJl3zhvcrnDRpSAMKFpt+hGLQb3mEE54EHeJ3mb/oEDIej4S1OK+uluJVEV7A3uo4Py8A==
X-Received: by 2002:a05:6512:3e25:b0:530:c2f0:4a98 with SMTP id
 2adb3069b0e04-536ad3ddd30mr4292251e87.51.1727011671905; 
 Sun, 22 Sep 2024 06:27:51 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-536870b42f7sm2932185e87.261.2024.09.22.06.27.51
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 22 Sep 2024 06:27:51 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#72830: Big rectangular selections are slow
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <jwvcykx7lo6.fsf-monnier+emacs@HIDDEN>
Date: Sun, 22 Sep 2024 15:27:50 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <5F6C5DCE-88F0-446D-8CBD-5E9EE26FFFC6@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
 <jwvcykx7lo6.fsf-monnier+emacs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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: -1.0 (-)

21 sep. 2024 kl. 05.05 skrev Stefan Monnier <monnier@HIDDEN>:

>> - `select-active-regions`: as mentioned, it slows down rectangle =
selection
>> massively and is alien to non-X11 platforms so I'd suggest it be set =
to nil
>> by default on macOS and Windows at least.
>=20
> I think we should first try and make it not-slow, by making it lazy.

No objections there but we would need to rework some plumbing. Emacs's =
behaviour is odd.

When a selection is made, that text is extracted and squirrelled away =
just in case, so the user can actually select some text, deselect and =
move around, and even make some changes the the buffer, and then paste =
PRIMARY from Emacs or any other X11 client and still get the originally =
selected text.

This isn't how typical old-fashioned X11 clients work and is more likely =
to be by accident than design but then again I'm not using X11 much =
these days.

Untangling this mess would take some time.


21 sep. 2024 kl. 10.26 skrev Eli Zaretskii <eliz@HIDDEN>:

> I can test on MS-Windows if someone tells what to try and what to pay
> attention to.

Thank you Eli, I'll make sure to ask you when I have something to show.





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

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


Received: (at 72830) by debbugs.gnu.org; 21 Sep 2024 08:27:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 04:27:05 2024
Received: from localhost ([127.0.0.1]:37034 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srvSL-0007nC-DJ
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 04:27:05 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47404)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1srvSJ-0007mf-0F
 for 72830 <at> debbugs.gnu.org; Sat, 21 Sep 2024 04:27:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1srvRs-0001ef-5T; Sat, 21 Sep 2024 04:26:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=m75qaAh16GMfL3XFvvR4LOsPWFh5zVOTWIvT6CSQwUY=; b=dv7XfjPspyDKAAliNycS
 0D2007fgNVRMC8iOWCsQoylaboMuR/XqzcVxzssI4vLHd3vuH5Il1ndSi1kUO2oSQuQRp43odzDrL
 qslZ8YthiKb3uu+7yhH5ymR4aZWzH3qqIJiHzGDnfjP0ay3TyLq9+wSl3JI1Idv1+5YJyEhBQVXcN
 9eimDpbx4vox7rpL1OPoNPaVuaL8OFZqmCONSDxqEXUBhdhS5J44D4qAGaAWvjlKUbBbzWtc4sv7R
 5/3WAxYuXsQAFcw0+L5O4+LTAEvZarOVc3CPkmihR/HKcYGuP1UPC1VSwnhL0z1mSwfLhzN1pfslF
 J69P47me8yBDdw==;
Date: Sat, 21 Sep 2024 11:26:32 +0300
Message-Id: <867cb55s5j.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <CADwFkmn8H2gHz+6QUBTpX_6u46L-L0sYdjfUQCVLpP-smS5=xw@HIDDEN>
 (message from Stefan Kangas on Fri, 20 Sep 2024 19:07:29 -0700)
Subject: Re: bug#72830: Big rectangular selections are slow
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
 <CADwFkmn8H2gHz+6QUBTpX_6u46L-L0sYdjfUQCVLpP-smS5=xw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: michael_heerdegen@HIDDEN, mattias.engdegard@HIDDEN,
 72830 <at> debbugs.gnu.org, monnier@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 (---)

> From: Stefan Kangas <stefankangas@HIDDEN>
> Date: Fri, 20 Sep 2024 19:07:29 -0700
> Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 72830 <at> debbugs.gnu.org, 
> 	Juri Linkov <juri@HIDDEN>
> 
> Mattias Engdegård <mattias.engdegard@HIDDEN> writes:
> 
> > - `select-active-regions`: as mentioned, it slows down rectangle
> > selection massively and is alien to non-X11 platforms so I'd suggest
> > it be set to nil by default on macOS and Windows at least. Not sure
> > what to do on TTY frames.
> 
> I see no problem with making this change on macOS.  I have no idea about
> anything related to MS-Windows, so I can't comment on that.

I can test on MS-Windows if someone tells what to try and what to pay
attention to.




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

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


Received: (at 72830) by debbugs.gnu.org; 21 Sep 2024 03:05:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 23:05:53 2024
Received: from localhost ([127.0.0.1]:36838 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srqRV-0006w3-41
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 23:05:53 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13469)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1srqRT-0006vn-9G
 for 72830 <at> debbugs.gnu.org; Fri, 20 Sep 2024 23:05:51 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 620BE80982;
 Fri, 20 Sep 2024 23:05:25 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1726887924;
 bh=JAG0OC0V/a91kLruHdULpvP1B6UgK6j+AAZ5VjTsL9Q=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Kab1FKdnS/YQ8aMegPrKyOIEjY/sV7YMF26z/lbDZwsQO3+9pqrXwn3TLQw29zWyM
 QdQUNdA1RmBImnhthstt/UNO1CM1yWMfu0LtsqGkmkShquqeAssGfPX3R7oayjbAQG
 wnClJykPK01MpxjTp6zf9NUavioI98JNTUwbQH1hheC3SX7JKl1xOTRGS19KLaNCJx
 xTDCiJjae93Y8WiehmoK4H3vUAWlJZ/z2E3DEjkNf7LoT/gvkeJXmLgjKIarXeg7B+
 dbT3M6641wmCjvBRnNl3jMgjvOplMSkr5CcsbKs1wTyk/x3HsHGokEL9nHR92WfXH+
 iill1cGJA4x6A==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6464580357;
 Fri, 20 Sep 2024 23:05:24 -0400 (EDT)
Received: from pastel (unknown [45.72.221.103])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 224611202E2;
 Fri, 20 Sep 2024 23:05:24 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN> ("Mattias
 =?windows-1252?Q?Engdeg=E5rd=22's?= message of "Fri, 20 Sep 2024 14:53:32
 +0200")
Message-ID: <jwvcykx7lo6.fsf-monnier+emacs@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
Date: Fri, 20 Sep 2024 23:05:22 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.229 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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 (---)

> - `select-active-regions`: as mentioned, it slows down rectangle selection
> massively and is alien to non-X11 platforms so I'd suggest it be set to nil
> by default on macOS and Windows at least.

I think we should first try and make it not-slow, by making it lazy.


        Stefan





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

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


Received: (at 72830) by debbugs.gnu.org; 21 Sep 2024 02:08:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 22:08:57 2024
Received: from localhost ([127.0.0.1]:36822 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srpYP-0003r6-FX
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 22:08:57 -0400
Received: from mail-ed1-f42.google.com ([209.85.208.42]:57807)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1srpYN-0003qs-Ob
 for 72830 <at> debbugs.gnu.org; Fri, 20 Sep 2024 22:08:56 -0400
Received: by mail-ed1-f42.google.com with SMTP id
 4fb4d7f45d1cf-5c465578555so1646112a12.3
 for <72830 <at> debbugs.gnu.org>; Fri, 20 Sep 2024 19:08:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1726884450; x=1727489250; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=seAC51puf5dfmZ1JO3Zj/Grgrqozu5q+zYCRbY4cOIM=;
 b=FZzbQL6V9Qx528ALB1bdq7qAxzwn6rpjhZoRfmPD7ihIbac2aOBgoM+vH5M1qseC2n
 QKiVsMYBdNS7JQHBhUooBbNTvccSTKzlLCmuV2HvEYIynZynb9QICipPCdUV07UBmIwx
 dXMzRrY5Pe8sOPJ/h/IOnc805L6wg1vxjldy9QBr9xGaIOZUCtLgUweNrvd5karFxsUZ
 fgGaflztBZhmJ0OchXn8sfp+bpj/4gMODGIIoxJSY9LliCV5W6gcZAm39FnYx3V6DHsl
 UfuDUPPXVJ12eS7YFj1u1lRaJxIGg5ZXtyA+CIkMh1+ZEhsOWrvwe/fiFcUTdS5ePGCR
 KFvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1726884450; x=1727489250;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=seAC51puf5dfmZ1JO3Zj/Grgrqozu5q+zYCRbY4cOIM=;
 b=ZVIJNB2RN0Dsf/I6g0mmoNnEyyRWKKYpz4dgs/TMoxua1za3UlKR90F3pNRVDxgaSE
 YA2/EqBd8KnNUPIVS5w9YDfOb2D3J1IZhL/SPYkRNhmYoP43I+8BTbYgkOWqBQYJFZJQ
 WPfgo/6JQr8b8QD1fZCiOncvFEDOjNWWRKeG/ELr5sErXLOR7Enq2nJeQ4IkxsHK/gad
 KorQGzCrHdwf9ktiCpZCtnEOgue9tEStlMRD/Kelmktw8e9TuegV8hKqFvyXZvi3wnWc
 JoPuLnG8mx0rpkaiytjHeZ5aNiRM9sK7QQlx7cQQGVChSaeWVw0/FFQH9oU75RahknU1
 ILhw==
X-Forwarded-Encrypted: i=1;
 AJvYcCVEG87yO+4KPX1G54Vc5qaP6OD/Y1KYX/33eFqyXRc+u3K/U5AQNqwkYJQYGIvWqtBW0JZzgg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxX91v/6EqJFakYSQ3aFe9X7i/j4d48O0r8Q1w0LcsBT71RSNJU
 7qDeF7LG7x2qG5VxIE+fIaixtj1Je28IhIzzv5jON1/grk1j88pOokH7t66iUts5v0iDwZynzQp
 Acu2WvKIS47Fv9KIXCSp0CfQevhM=
X-Google-Smtp-Source: AGHT+IEaS6FX8BTB8AmCXJq/tjAEBYt0CwCgmk8ozyyNUmyl75OX9zeQrL/PA+ra+UBVCKZ4iYveuG1qIZCkmP7BOEg=
X-Received: by 2002:a05:6402:40c3:b0:5c2:5620:8ba3 with SMTP id
 4fb4d7f45d1cf-5c464df28cbmr2815368a12.30.1726884450131; Fri, 20 Sep 2024
 19:07:30 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Fri, 20 Sep 2024 19:07:29 -0700
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
 <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
MIME-Version: 1.0
Date: Fri, 20 Sep 2024 19:07:29 -0700
Message-ID: <CADwFkmn8H2gHz+6QUBTpX_6u46L-L0sYdjfUQCVLpP-smS5=xw@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
To: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>, 
 Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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: -1.0 (-)

Mattias Engdeg=C3=A5rd <mattias.engdegard@HIDDEN> writes:

> - `select-active-regions`: as mentioned, it slows down rectangle
> selection massively and is alien to non-X11 platforms so I'd suggest
> it be set to nil by default on macOS and Windows at least. Not sure
> what to do on TTY frames.

I see no problem with making this change on macOS.  I have no idea about
anything related to MS-Windows, so I can't comment on that.




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

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


Received: (at 72830) by debbugs.gnu.org; 20 Sep 2024 12:55:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 08:55:01 2024
Received: from localhost ([127.0.0.1]:34339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srdA5-0000Ua-0t
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 08:55:01 -0400
Received: from mail-lf1-f51.google.com ([209.85.167.51]:61509)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1srdA2-0000UK-QR
 for 72830 <at> debbugs.gnu.org; Fri, 20 Sep 2024 08:54:59 -0400
Received: by mail-lf1-f51.google.com with SMTP id
 2adb3069b0e04-53655b9bbcdso2408821e87.2
 for <72830 <at> debbugs.gnu.org>; Fri, 20 Sep 2024 05:54:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1726836814; x=1727441614; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=07o8ja0OVMYGWHezKApKJ10IXqKU74punu6rThquNT0=;
 b=IR+4dAsaTyeXY5FLg4QWN8HmYAyLvbSG6QKuHd7FBNIsstHr+S9vn/oQAL5Mapz+Xd
 A6L/o59nsKYyeMHy8TDpa5zLFgBnWmOzMNjZgUzQoNHgPTuVKA/URoWrxbiBVWnq229i
 3HRaCJsKgnHt8s5EWqkLyju+XqBl6r88M/LAavq17OmiYlAzoq/22obI9+DwPVxgKf1N
 DbiC/B6JqMDhpGzTOdtYx4xfAcWqaqE7ZjrgJ1UIp7NN77d2N7z2Zu9LLgcfLwHgQ4c/
 DKvLJGHF0A2X8JiuaU0YO5Yvb+FcX/bmINXI4r5jv2v75MtsJefyjVt1B/rzmvjrIt9O
 kHiw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1726836814; x=1727441614;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=07o8ja0OVMYGWHezKApKJ10IXqKU74punu6rThquNT0=;
 b=QFg3HRrF/DnqnUWEbLa1c03CC6sYmXaf/PXaGLL/94p2AH7JypQ+jsxj4DG29grg/A
 o86l3CKyorsB9tPblBR6IkwnzDvibBHqUqYSQALtnA+n3tmj9kpYFg4wO310Vm2RIpQT
 BAb+RJeqE2ANCDZdY7tdZOr9OsbgFW2RsbepMoN2MxROcUHHiK2A8CNWpIewY1UtQN10
 7/hNcRG8BkyNDymwfOPHKCBsgQv9nkqqQ0ZrELPIh15cIJMAAOK3WFrDbMZY36HPyiqI
 tTTYgMfnsNTqVkvPq/DlAjxYxTGyl3TKXPrEhcPIyhuO70xyCUdIGO16v6Cw5Gsi88iL
 I7jw==
X-Forwarded-Encrypted: i=1;
 AJvYcCVeGEU+R0iD8zjhuSFjyUSp7fBzm/zjZ0xu70S2PMTWew5pxKv229Ujnh1VYKUiKXDRdx4OOQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzPr8z2aJ+RHSxcDtCjTd2rKq2bAv5Kd6OTX6gIkeKJG/SxZgON
 KkEmQEyvBrrYo1X4Q/ifTrAbfW/HhG9B7SN/OgXcI+osHWdK6soA
X-Google-Smtp-Source: AGHT+IGwfOUwMPGQMKp6GehxGSUR0vHAhk7LmOsBM43J1KeSDPtMAaHpQz6+Cb9vq42X7Ti1RDQZHg==
X-Received: by 2002:ac2:4e09:0:b0:532:fdba:e7bc with SMTP id
 2adb3069b0e04-536ad3f168fmr1405430e87.57.1726836813597; 
 Fri, 20 Sep 2024 05:53:33 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-536870a89d7sm2179535e87.239.2024.09.20.05.53.32
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 20 Sep 2024 05:53:33 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#72830: Big rectangular selections are slow
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
Date: Fri, 20 Sep 2024 14:53:32 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <0D0565B4-EF53-43B6-9B33-7EE1600E1AD3@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
 <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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: -1.0 (-)

30 aug. 2024 kl. 17.20 skrev Mattias Engdeg=C3=A5rd =
<mattias.engdegard@HIDDEN>:

> I think the patch is good enough for master.

And it has now been pushed. To recap, remaining concerns:

- `select-active-regions`: as mentioned, it slows down rectangle =
selection massively and is alien to non-X11 platforms so I'd suggest it =
be set to nil by default on macOS and Windows at least. Not sure what to =
do on TTY frames.
For that matter, on X11 it seems strange to copy the entire selection =
each time it is made or modified even slightly; PRIMARY selection data =
isn't sent to the server until actually requested.

- Rectangle operations other than selection are still very slow. This =
isn't quite as big a problem but still annoying. Both `move-to-column` =
and `line-end-position` are unexpectedly expensive here. (And shouldn't =
rect.el use `pos-eol` instead? It's not much faster, though.)

- There are some mostly theoretical cases when the current rectangular =
selection code produces ugly results. I don't think they are likely to =
occur in practice but would be happy to work with someone who thinks he =
or she can do better.





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

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


Received: (at 72830) by debbugs.gnu.org; 30 Aug 2024 15:22:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 30 11:22:43 2024
Received: from localhost ([127.0.0.1]:53334 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sk3SV-00025G-29
	for submit <at> debbugs.gnu.org; Fri, 30 Aug 2024 11:22:43 -0400
Received: from mail-lj1-f170.google.com ([209.85.208.170]:61916)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1sk3SR-00024v-Gc
 for 72830 <at> debbugs.gnu.org; Fri, 30 Aug 2024 11:22:42 -0400
Received: by mail-lj1-f170.google.com with SMTP id
 38308e7fff4ca-2f51b67e16dso22118491fa.3
 for <72830 <at> debbugs.gnu.org>; Fri, 30 Aug 2024 08:21:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1725031236; x=1725636036; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=ewsZqznCyPlr646BOxzfb2zmRnamrFLLXtnfvDLA6Ks=;
 b=JvV03AbbyXZ87CoRYXeTVqpQKw9j+m+qfD9e6K4J/AiU5STP+Ogyg3dRkpnjg5QNDR
 Ahv+XuFVqRUwmuzjYIwWy/CsJvuBpOvkXq9l/gR/dGuqT0hni9aw+UakipjJVhcn2c70
 INQPwdkY+HqWcyxZ/I5SvwHxtT/2Hv1yv6jttuJIncv9cfIDx094iNQp7EYNDYqXT/Jw
 FiqS9pxXDWVbFrOESzOxcVz0hjOvl443wUNfVnxcoD9+5xshg1ebYcP6T7NPofjUAo0J
 MwIyOo7epzH4v1OIkUXQDOIG79px1cLVdIkHtcX3EDK98QQ91OdXnE1Hoa6etBS6vMrT
 J2QQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1725031236; x=1725636036;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=ewsZqznCyPlr646BOxzfb2zmRnamrFLLXtnfvDLA6Ks=;
 b=ir/X2CkGr9FXYQ7nzHzmmsyYtmleWaJrfoxDOHLMmxO3ATMfi0Q68unU1auNQ+UOUF
 ogFkwF4l2WyWy3zlkY1cpsZ/gIeg4LjPwM93JYfjIL4OfHf3MXgaqGKsIK4onZ0b0dxL
 aDmUH8OOB3vP59y/aL+8aHdOcQkHmK6tta/+5R/fWoG1LkJQdfi8PwmBbmKRIM1kFPfy
 7VQuoqganr70mEDLlhqj8K30OOjoXED/8noZAT0jQoA2zT3otYLQzrvemuMGMvE/mmte
 6DAPnG7zzhv095xKrLd6zBNNpsdYUdYqZvwPbdOJPzCYEPlVglisuvn6u3oRcq7YM7N8
 D+kA==
X-Forwarded-Encrypted: i=1;
 AJvYcCU3zjIRCf4c4QQ30yVol8Xjp3MwKyM+y+Y9lrGrVC8dH0vh0WEkgLolYL9EOaJJGLGtUZadVg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzRo3BNmBW67gP+DXYvrEhWw4+XfKuwX/Sz6U5tN8IPKGSZw25Z
 vwbidLUNmOApHjbT8dlELohbGqSsiLO5RBCpA9QCg7XIsMvVYnMq
X-Google-Smtp-Source: AGHT+IF08vDdjHGs8EBGNSZZBmKNQVn0G8UVcCFlwWJRnSLllhYOnYegbrHH59xlHqx0S8KHeCPFOQ==
X-Received: by 2002:a05:651c:199f:b0:2f0:198e:cf86 with SMTP id
 38308e7fff4ca-2f6108908bamr58709251fa.33.1725031235975; 
 Fri, 30 Aug 2024 08:20:35 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f614f23a93sm7105071fa.51.2024.08.30.08.20.34
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 30 Aug 2024 08:20:34 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#72830: Big rectangular selections are slow
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
Date: Fri, 30 Aug 2024 17:20:34 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <1B4E9D0B-2223-42D9-BA22-17A5F6F49F84@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
 <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 72830 <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: -1.0 (-)

29 aug. 2024 kl. 22.04 skrev Stefan Monnier <monnier@HIDDEN>

> We should investigate the case(s) where it doesn't work well and fix
> them (not by changing your `pre-redisplay-function` but by re-running
> that hook), because these cases likely affect other users of this hook
> (such as the normal region highlighting).

What would the problem be for normal (contiguous) region highlighting? =
There is a single overlay, so there should be no particular cost for =
large selections. Is there?

The latest patch posted seems to work well enough and all but eliminates =
the problem (when `select-active-regions` is nil, anyway), so that it =
outweighs some rare cosmetic issues.

(Those cosmetic issues may occur when a rectangular selection straddles =
invisible text, because this invalidates the assumption that the other =
end of the selection is at most (window-height) away. But the selection =
still operate on the invisible test, so I don't think it's a problem in =
practice.)

I think the patch is good enough for master. If you have an even better =
solution, perhaps it could be made as a subsequent improvement?






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

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


Received: (at 72830) by debbugs.gnu.org; 29 Aug 2024 20:06:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 29 16:06:05 2024
Received: from localhost ([127.0.0.1]:52172 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjlPB-00031w-36
	for submit <at> debbugs.gnu.org; Thu, 29 Aug 2024 16:06:05 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7864)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1sjlP9-00030z-8H
 for 72830 <at> debbugs.gnu.org; Thu, 29 Aug 2024 16:06:04 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B28F24445E4;
 Thu, 29 Aug 2024 16:05:00 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1724961898;
 bh=qHT4BPE/dO/bd4GmJXz0beSAAWME12s49QBH1nPV3P8=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=EoGCaOHCxGhY04ZQo7evArFTKDzPbPnkyr90hUCk7S7P24pA80RKkQvXwxIhVaZ7T
 GRTnZzbxKgZHyPjLWczSEDsTk07nO/Jmgfbd/YGtyv4aRSo1Mf8vR1TD31GDRiRcU4
 8F60fmtvMRYghxfx3f6xfZ0kwBuZmdoKdXMSWkjy0JwU690vb54i5WUl7SPIR8S4/Y
 /gbgw21d6DbgSy8sALNAjKoH6Rup5tlx7tahpWG40JJDF53tCvHw/bG65y6tisF4np
 76S6Azpdev8xMV+qKBFsirEjhGHCszLy6B2p/gJezkrWYrMsJ7F8HbF0j8RX3vXt1i
 VoaW60I4QAeig==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D2FAD4445E5;
 Thu, 29 Aug 2024 16:04:58 -0400 (EDT)
Received: from pastel (unknown [216.154.9.87])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9FDF612024C;
 Thu, 29 Aug 2024 16:04:58 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN> ("Mattias
 =?windows-1252?Q?Engdeg=E5rd=22's?= message of "Thu, 29 Aug 2024 10:09:06
 +0200")
Message-ID: <jwvseunt83k.fsf-monnier+emacs@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
 <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
Date: Thu, 29 Aug 2024 16:04:57 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.163 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: Eli Zaretskii <eliz@HIDDEN>, 72830 <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 (---)

>> There might be some remaining issues with (re)running the
>> `pre-redisplay-function(s)` when redisplay forces a change in
>> `window-start` (or in the unlikely case where the highlighting moves the
>> `window-end` further), but these are things we need to fix anyway.
> That's what I wondered how to deal with. I agree we can probably assume that
> highlighting won't affect the viewport in any substantial way.
> To be clear, just using the (inaccurate) window-start and window-end to clip
> the setting of highlight overlays works very well and with excellent speed
> until the viewport moves, in which case it no longer does.

"The viewport moves" is what I referred to as "when redisplay forces
a change in `window-start`" (there are actually many cases where the
viewport moves before redisplay is invoked, in which case "just using
the (inaccurate) window-start and window-end to clip the setting of
highlight overlays works very well").

We should investigate the case(s) where it doesn't work well and fix
them (not by changing your `pre-redisplay-function` but by re-running
that hook), because these cases likely affect other users of this hook
(such as the normal region highlighting).

>> There are further issues when several windows display the buffer.
> Are there? The highlight overlay is set with a `window` parameter that keeps
> it visible in one window only.

Ah, great, then.  I didn't remember this.

>> We could also move some of the work to jit-lock, which would have the
>> advantage that it would additionally be able to skip over (large) chunks
>> that are marked as `invisible`.
> Not sure how this would work. Isn't it guided by (comparatively
> persistent) `fontified` properties?

We'd set that property to nil.
[ See the recentish discussion about how to change jit-lock so that it
  can be told to flush only some of its backends.  ]


        Stefan





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

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


Received: (at 72830) by debbugs.gnu.org; 29 Aug 2024 11:20:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 29 07:20:07 2024
Received: from localhost ([127.0.0.1]:50572 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjdCB-0003nQ-DJ
	for submit <at> debbugs.gnu.org; Thu, 29 Aug 2024 07:20:07 -0400
Received: from mail-lj1-f178.google.com ([209.85.208.178]:49406)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1sjdC8-0003mp-Pv
 for 72830 <at> debbugs.gnu.org; Thu, 29 Aug 2024 07:20:05 -0400
Received: by mail-lj1-f178.google.com with SMTP id
 38308e7fff4ca-2f3edb2d908so5762811fa.2
 for <72830 <at> debbugs.gnu.org>; Thu, 29 Aug 2024 04:19:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1724930283; x=1725535083; darn=debbugs.gnu.org;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:sender:from:to:cc:subject:date:message-id:reply-to;
 bh=4ZQtZI/G6xI08kxhy17NyKUihQY1V1/YthKsoJgRlFc=;
 b=DcocuWO4shvmwbdqZSLkTZQTgLhG+wYAbZx4rhQcwPxuWlKOdzzG/t1C37VKQ6vIf4
 Nun/+I2Hswbg1MP9Ky2D4mazyF60FIEiIhqRqjUubj8SUW4ElDbmcGP0buZXVc6xQuOM
 +2tA9NpXj10IOl8oWHONpdMXvfnoJrwVPcEHt6Pe2A8iKuq3YiXOq7I0uvbmNGSEiFp1
 G+SJ7DUsrXA2CKTwTCEaXfHrh/vYR1cJUM/iauiifMKWofSeP2fnqDSWgG3I9OOzbC6a
 6cdVQBdA4pmU7P6x+roaioY9T+UwB7qtPX+zrAjDcj11qXFT+M/YZxsNpAqHqG27SNCL
 tf1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1724930283; x=1725535083;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=4ZQtZI/G6xI08kxhy17NyKUihQY1V1/YthKsoJgRlFc=;
 b=YUhM8cMEMJ3kw7RG4J1lwGL9GR9gYdSMuZaPEd7/GNu3Q1ZQzo1W01xlYOQvU5Losa
 IgPw5BY3ofiBM52HgWkLn0IfO2iyi9MagZmaUfPMekWGI/xubqdYSm40DlyyP/IN288I
 Tz1P2Lvr6qKvPuip6B2jhJPU/p+lpzYoqSxlC4PM/9iESlKeERHKYRd587ihA+sWIc7W
 uJkFzFiAYphpj3WaWsnBS03QrEJclf1rWVxc9vF/+srVsouIxxanARt3zMhFUfdArzir
 mc94hH0u9KTyIFUODpnJsm7Oc2ut+Sg50ISQd0rmzZxz4eoiKLcsd4c1oa6QtX5s/UC6
 XagQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVVYzTC8+VbyCoteCxtOy2fCXypft1hpzjYTUXAFI0iPQsGraYmzhjB2sz/h31+ZS7PYzPlxA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzLn3h+CLLks8HHPNclTArNaD7QAPBlOTO6cDxAnPJX/kZwKzwy
 DwNbt6YfeHmsmpezSkXaF0GsXhWAbQ3YOK/DLXzhIX/yrF1fg77f
X-Google-Smtp-Source: AGHT+IGt8KabRuKEYxVEHOAGGIP4nsuv/snEXx16bCQtvSeO3OAPiqaw8V5bHUybGy80FO00eDakig==
X-Received: by 2002:a2e:b8d5:0:b0:2ef:22ef:a24e with SMTP id
 38308e7fff4ca-2f610877205mr21879051fa.10.1724930282584; 
 Thu, 29 Aug 2024 04:18:02 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f615183134sm1527921fa.122.2024.08.29.04.18.01
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 29 Aug 2024 04:18:02 -0700 (PDT)
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Message-Id: <41AF14A6-33A9-4EAB-ACBF-34079135AE8F@HIDDEN>
Content-Type: multipart/mixed;
 boundary="Apple-Mail=_D5ACA449-8F4F-4F03-969A-FC1F01187225"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#72830: Big rectangular selections are slow
Date: Thu, 29 Aug 2024 13:18:01 +0200
In-Reply-To: <AE14E0AC-FBE5-49FD-8931-D39FAD343EE9@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN> <87zfow2d90.fsf@HIDDEN>
 <AE14E0AC-FBE5-49FD-8931-D39FAD343EE9@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Eli Zaretskii <eliz@HIDDEN>, 72830 <at> debbugs.gnu.org,
 Stefan Monnier <monnier@HIDDEN>, 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: -1.0 (-)


--Apple-Mail=_D5ACA449-8F4F-4F03-969A-FC1F01187225
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

29 aug. 2024 kl. 12.22 skrev Mattias Engdeg=C3=A5rd =
<mattias.engdegard@HIDDEN>:

> The patch below is crude but seems to work.

That phrase is highly effective for forcing bugs into daylight. Here is =
an improved version.

Previously, `exchange-point-and-mark` didn't regenerate the overlays =
because it wasn't necessary, but now it is, so we save point in our =
rectangle overlay tuple. (Should use a struct at this point.)


--Apple-Mail=_D5ACA449-8F4F-4F03-969A-FC1F01187225
Content-Disposition: attachment;
	filename=rect-highlight.diff
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="rect-highlight.diff"
Content-Transfer-Encoding: 7bit

diff --git a/lisp/rect.el b/lisp/rect.el
index 93007824679..5d68a6bafab 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -857,102 +857,131 @@ rectangle--highlight-for-redisplay
          (eq (nth 1 rol) (buffer-chars-modified-tick))
          (eq start (nth 2 rol))
          (eq end (nth 3 rol))
-         (equal (rectangle--crutches) (nth 4 rol)))
+         (equal (rectangle--crutches) (nth 4 rol))
+         (eq (nth 5 rol) (point)))
     rol)
    (t
     (save-excursion
-      (let* ((nrol nil)
+      (let* ((pt (point))
+             (nrol nil)
              (old (if (eq 'rectangle (car-safe rol))
-                      (nthcdr 5 rol)
+                      (nthcdr 6 rol)
                     (funcall redisplay-unhighlight-region-function rol)
                     nil)))
         (cl-assert (eq (window-buffer window) (current-buffer)))
         ;; `rectangle--pos-cols' looks up the `selected-window's parameter!
         (with-selected-window window
-          (apply-on-rectangle
-           (lambda (leftcol rightcol)
-             (let* ((mleft (move-to-column leftcol))
-                    (left (point))
-                    ;; BEWARE: In the presence of other overlays with
-                    ;; before/after/display-strings, this happens to move to
-                    ;; the column "as if the overlays were not applied", which
-                    ;; is sometimes what we want, tho it can be
-                    ;; considered a bug in move-to-column (it should arguably
-                    ;; pay attention to the before/after-string/display
-                    ;; properties when computing the column).
-                    (mright (move-to-column rightcol))
-                    (right (point))
-                    (ol
-                     (if (not old)
-                         (let ((ol (make-overlay left right)))
-                           (overlay-put ol 'window window)
-                           (overlay-put ol 'face 'region)
-                           ol)
-                       (let ((ol (pop old)))
-                         (move-overlay ol left right (current-buffer))
-                         ol))))
-               ;; `move-to-column' may stop before the column (if bumping into
-               ;; EOL) or overshoot it a little, when column is in the middle
-               ;; of a char.
-               (cond
-                ((< mleft leftcol)      ;`leftcol' is past EOL.
-                 (overlay-put ol 'before-string (rectangle--space-to leftcol))
-                 (setq mright (max mright leftcol)))
-                ((and (> mleft leftcol) ;`leftcol' is in the middle of a char.
-                      (eq (char-before left) ?\t))
-                 (setq left (1- left))
-                 (move-overlay ol left right)
-                 (goto-char left)
-                 (overlay-put ol 'before-string (rectangle--space-to leftcol)))
-                ((overlay-get ol 'before-string)
-                 (overlay-put ol 'before-string nil)))
-               (cond
-                ;; While doing rectangle--string-preview, the two sets of
-                ;; overlays steps on the other's toes.  I fixed some of the
-                ;; problems, but others remain.  The main one is the two
-                ;; (rectangle--space-to rightcol) below which try to virtually
-                ;; insert missing text, but during "preview", the text is not
-                ;; missing (it's provided by preview's own overlay).
-                (rectangle--string-preview-state
-                 (if (overlay-get ol 'after-string)
-                     (overlay-put ol 'after-string nil)))
-                ((< mright rightcol)    ;`rightcol' is past EOL.
-                 (let ((str (rectangle--space-to rightcol)))
-                   (put-text-property 0 (length str) 'face 'region str)
-                   ;; If cursor happens to be here, draw it at the right place.
-                   (rectangle--place-cursor leftcol left str)
-                   (overlay-put ol 'after-string str)))
-                ((and (> mright rightcol) ;`rightcol's in the middle of a char.
-                      (eq (char-before right) ?\t))
-                 (setq right (1- right))
-                 (move-overlay ol left right)
-                 (if (= rightcol leftcol)
-                     (overlay-put ol 'after-string nil)
-                   (goto-char right)
-                   (let ((str (rectangle--space-to rightcol)))
-                     (put-text-property 0 (length str) 'face 'region str)
-                     (when (= left right)
-                       (rectangle--place-cursor leftcol left str))
-                     (overlay-put ol 'after-string str))))
-                ((overlay-get ol 'after-string)
-                 (overlay-put ol 'after-string nil)))
-               (when (and (= leftcol rightcol) (display-graphic-p))
-                 ;; Make zero-width rectangles visible!
-                 (overlay-put ol 'after-string
-                              (concat (propertize " "
-                                                  'face '(region (:height 0.2)))
-                                      (overlay-get ol 'after-string))))
-               (push ol nrol)))
-           start end))
+          (let* ((cols (rectangle--pos-cols start end))
+                 (startcol (car cols))
+                 (endcol (cdr cols))
+                 (leftcol (min startcol endcol))
+                 (rightcol (max startcol endcol))
+                 ;; We don't know what lines will actually be displayed,
+                 ;; so add highlight overlays on lines within the window
+                 ;; height from point.
+                 (height (window-height))
+                 (start-pt (max start (progn (forward-line (- height))
+                                             (point))))
+                 (end-pt (min end (progn (goto-char pt)
+                                         (forward-line height)
+                                         (point)))))
+            ;; (printf
+            ;;  "pt %S (%S) height %S start %S end %S start-pt %S end-pt %S\n"
+            ;;  pt (point) height start end start-pt end-pt)
+            (goto-char start-pt)
+            (beginning-of-line)
+            (while
+                (let* ((mleft (move-to-column leftcol))
+                       (left (point))
+                       ;; BEWARE: In the presence of other overlays with
+                       ;; before/after/display-strings, this happens to move to
+                       ;; the column "as if the overlays were not applied",
+                       ;; which is sometimes what we want, tho it can be
+                       ;; considered a bug in move-to-column (it should
+                       ;; arguably pay attention to the
+                       ;; before/after-string/display properties when computing
+                       ;; the column).
+                       (mright (move-to-column rightcol))
+                       (right (point))
+                       (ol
+                        (if (not old)
+                            (let ((ol (make-overlay left right)))
+                              (overlay-put ol 'window window)
+                              (overlay-put ol 'face 'region)
+                              ol)
+                          (let ((ol (pop old)))
+                            (move-overlay ol left right (current-buffer))
+                            ol))))
+                  ;; `move-to-column' may stop before the column (if bumping
+                  ;; into EOL) or overshoot it a little, when column is in the
+                  ;; middle of a char.
+                  (cond
+                   ((< mleft leftcol)      ;`leftcol' is past EOL.
+                    (overlay-put ol 'before-string
+                                 (rectangle--space-to leftcol))
+                    (setq mright (max mright leftcol)))
+                   ((and (> mleft leftcol) ;`leftcol' is in the middle of a char
+                         (eq (char-before left) ?\t))
+                    (setq left (1- left))
+                    (move-overlay ol left right)
+                    (goto-char left)
+                    (overlay-put ol 'before-string
+                                 (rectangle--space-to leftcol)))
+                   ((overlay-get ol 'before-string)
+                    (overlay-put ol 'before-string nil)))
+                  (cond
+                   ;; While doing rectangle--string-preview, the two sets of
+                   ;; overlays steps on the other's toes.  I fixed some of the
+                   ;; problems, but others remain.  The main one is the two
+                   ;; (rectangle--space-to rightcol) below which try to
+                   ;; virtually insert missing text, but during "preview", the
+                   ;; text is not missing (it's provided by preview's own
+                   ;; overlay).
+                   (rectangle--string-preview-state
+                    (if (overlay-get ol 'after-string)
+                        (overlay-put ol 'after-string nil)))
+                   ((< mright rightcol)    ;`rightcol' is past EOL.
+                    (let ((str (rectangle--space-to rightcol)))
+                      (put-text-property 0 (length str) 'face 'region str)
+                      ;; If cursor happens to be here, draw it at the right
+                      ;; place.
+                      (rectangle--place-cursor leftcol left str)
+                      (overlay-put ol 'after-string str)))
+                   ((and (> mright rightcol) ;`rightcol' in the middle of a char
+                         (eq (char-before right) ?\t))
+                    (setq right (1- right))
+                    (move-overlay ol left right)
+                    (if (= rightcol leftcol)
+                        (overlay-put ol 'after-string nil)
+                      (goto-char right)
+                      (let ((str (rectangle--space-to rightcol)))
+                        (put-text-property 0 (length str) 'face 'region str)
+                        (when (= left right)
+                          (rectangle--place-cursor leftcol left str))
+                        (overlay-put ol 'after-string str))))
+                   ((overlay-get ol 'after-string)
+                    (overlay-put ol 'after-string nil)))
+                  (when (and (= leftcol rightcol) (display-graphic-p))
+                    ;; Make zero-width rectangles visible!
+                    (overlay-put ol 'after-string
+                                 (concat (propertize
+                                          " " 'face '(region (:height 0.2)))
+                                         (overlay-get ol 'after-string))))
+                  (push ol nrol)
+                  (and (zerop (forward-line 1))
+                       (bolp)
+                       (<= (point) end-pt))))
+            )
+          )
         (mapc #'delete-overlay old)
         `(rectangle ,(buffer-chars-modified-tick)
-                    ,start ,end ,(rectangle--crutches)
+                    ,start ,end ,(rectangle--crutches) ,pt
                     ,@nrol))))))
 
 (defun rectangle--unhighlight-for-redisplay (orig rol)
   (if (not (eq 'rectangle (car-safe rol)))
       (funcall orig rol)
-    (mapc #'delete-overlay (nthcdr 5 rol))
+    (mapc #'delete-overlay (nthcdr 6 rol))
     (setcar (cdr rol) nil)))
 
 (defun rectangle--duplicate-right (n displacement)

--Apple-Mail=_D5ACA449-8F4F-4F03-969A-FC1F01187225--




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

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


Received: (at 72830) by debbugs.gnu.org; 29 Aug 2024 10:24:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 29 06:24:14 2024
Received: from localhost ([127.0.0.1]:50524 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjcK6-0002B3-3D
	for submit <at> debbugs.gnu.org; Thu, 29 Aug 2024 06:24:14 -0400
Received: from mail-lf1-f46.google.com ([209.85.167.46]:52652)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1sjcK4-0002Ai-A5
 for 72830 <at> debbugs.gnu.org; Thu, 29 Aug 2024 06:24:13 -0400
Received: by mail-lf1-f46.google.com with SMTP id
 2adb3069b0e04-533521cd1c3so564028e87.1
 for <72830 <at> debbugs.gnu.org>; Thu, 29 Aug 2024 03:23:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1724926931; x=1725531731; darn=debbugs.gnu.org;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:sender:from:to:cc:subject:date:message-id:reply-to;
 bh=PFd9DSvTOZ2A1DL/MUTs+THiM8Y2kgnMGNWnrllqj50=;
 b=nRG3k5RXcfVmG11Wha/Gd/q5IiSXM69mvE5IPOEutX2SV90KGmLMlR0wH88yB5XEKR
 rkf2Vjvy4DZ5u9Z1RKm8DJvrTgmDlaCC8d1PPj8XR5jIuYOGAleUcX0WbijpnpAfcMwt
 22SqCEhpW45Y4iMfWNMVnaLRX3FEfRZb1/bO0u9ZLwIvJ0bQMlrbtQEXXtixK0XBlM99
 MIheX6Ay3x3an5aGTc7t6cA4wX3yU5Mht/4iH/qInytcT4og8sL+3Qkk5flDswWY9/FS
 F7ImIV8a4EsdeWT7k8PoaOEljgO509BxfAkzxUnfZ5s7QklAGzTwPXLn6/UvyyxyHuF2
 mypA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1724926931; x=1725531731;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=PFd9DSvTOZ2A1DL/MUTs+THiM8Y2kgnMGNWnrllqj50=;
 b=QNjf95QZMiAviMJH6xnpHLu0E+2AVQVTTJ7ym+lfJ/rv5FS/uxfmm2KydowY8gJBWu
 YP457mlfw8L/7zIsK7afSL4FUs/+wGc1xv/6rxIuwfEXcIdZiNL5bEOfD5BEgPojrKtq
 rzyv26gnv6NFdBbZFJWVUYR3lH1kQ13hQy5yiEv6s7JwlPiH2crRcTrxuoSdTbe7kBWH
 da7EqRq+uyE2wVjxTSMqUcKrJfvlWUalTDX+x+i5zjgcNyk8gpqs4tgzB/HXyuxwQ3rD
 GfPpaFBdHeA+V8JKnWdWoVale5ArkBjerR0HN/VJDccgLmH13ScktZg+4gWFoH8GGPNZ
 TbGQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCWSipMUWOPvAx9ArGat9nXfXV8jB56yZ+K+85qChR1CLK7Tf1qzxny2NPNPoWZAEicUgNLi1Q==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzhFHpdayd++/d19P9epWzmRM3Q0LJqYg17CY+poU8o1RZpXVPP
 nbwa75et4IIT0U2BRPBl3f6LhhNwOpxiTbgeecLGO2Tm4W/K8sT3
X-Google-Smtp-Source: AGHT+IFbq59AkCGkZfqIKXnjqCB5FXu1K5sqq4nCVHMGqcFoKH38NDol096z1JFbAKv4lWyuBkGQDA==
X-Received: by 2002:a05:6512:3986:b0:533:77d:115f with SMTP id
 2adb3069b0e04-5353e5b7527mr1712100e87.56.1724926930161; 
 Thu, 29 Aug 2024 03:22:10 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-535407ac17asm115967e87.81.2024.08.29.03.22.08
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 29 Aug 2024 03:22:09 -0700 (PDT)
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Message-Id: <AE14E0AC-FBE5-49FD-8931-D39FAD343EE9@HIDDEN>
Content-Type: multipart/mixed;
 boundary="Apple-Mail=_02B8ABC5-85B5-46A4-B410-6607750EE046"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#72830: Big rectangular selections are slow
Date: Thu, 29 Aug 2024 12:22:08 +0200
In-Reply-To: <87zfow2d90.fsf@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN> <87zfow2d90.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Eli Zaretskii <eliz@HIDDEN>, 72830 <at> debbugs.gnu.org,
 Stefan Monnier <monnier@HIDDEN>, 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: -1.0 (-)


--Apple-Mail=_02B8ABC5-85B5-46A4-B410-6607750EE046
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

29 aug. 2024 kl. 05.56 skrev Michael Heerdegen =
<michael_heerdegen@HIDDEN>:

> My idea would be: highlight from or up to "rectangle point" maximally
> (window-height) lines.

Here I was digging into the redisplay code in the hope of finding an =
obscure hook to subvert, and you turn up and give us the obvious, simple =
and correct solution right away. Thank you, Michael!

The patch below is crude but seems to work. Please give it a try.
If the original recipe is still stuttering, try setting =
`select-active-regions` to nil.


--Apple-Mail=_02B8ABC5-85B5-46A4-B410-6607750EE046
Content-Disposition: attachment;
	filename=rect-highlight.diff
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="rect-highlight.diff"
Content-Transfer-Encoding: 7bit

diff --git a/lisp/rect.el b/lisp/rect.el
index 93007824679..1fadb4c768a 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -869,81 +869,107 @@ rectangle--highlight-for-redisplay
         (cl-assert (eq (window-buffer window) (current-buffer)))
         ;; `rectangle--pos-cols' looks up the `selected-window's parameter!
         (with-selected-window window
-          (apply-on-rectangle
-           (lambda (leftcol rightcol)
-             (let* ((mleft (move-to-column leftcol))
-                    (left (point))
-                    ;; BEWARE: In the presence of other overlays with
-                    ;; before/after/display-strings, this happens to move to
-                    ;; the column "as if the overlays were not applied", which
-                    ;; is sometimes what we want, tho it can be
-                    ;; considered a bug in move-to-column (it should arguably
-                    ;; pay attention to the before/after-string/display
-                    ;; properties when computing the column).
-                    (mright (move-to-column rightcol))
-                    (right (point))
-                    (ol
-                     (if (not old)
-                         (let ((ol (make-overlay left right)))
-                           (overlay-put ol 'window window)
-                           (overlay-put ol 'face 'region)
-                           ol)
-                       (let ((ol (pop old)))
-                         (move-overlay ol left right (current-buffer))
-                         ol))))
-               ;; `move-to-column' may stop before the column (if bumping into
-               ;; EOL) or overshoot it a little, when column is in the middle
-               ;; of a char.
-               (cond
-                ((< mleft leftcol)      ;`leftcol' is past EOL.
-                 (overlay-put ol 'before-string (rectangle--space-to leftcol))
-                 (setq mright (max mright leftcol)))
-                ((and (> mleft leftcol) ;`leftcol' is in the middle of a char.
-                      (eq (char-before left) ?\t))
-                 (setq left (1- left))
-                 (move-overlay ol left right)
-                 (goto-char left)
-                 (overlay-put ol 'before-string (rectangle--space-to leftcol)))
-                ((overlay-get ol 'before-string)
-                 (overlay-put ol 'before-string nil)))
-               (cond
-                ;; While doing rectangle--string-preview, the two sets of
-                ;; overlays steps on the other's toes.  I fixed some of the
-                ;; problems, but others remain.  The main one is the two
-                ;; (rectangle--space-to rightcol) below which try to virtually
-                ;; insert missing text, but during "preview", the text is not
-                ;; missing (it's provided by preview's own overlay).
-                (rectangle--string-preview-state
-                 (if (overlay-get ol 'after-string)
-                     (overlay-put ol 'after-string nil)))
-                ((< mright rightcol)    ;`rightcol' is past EOL.
-                 (let ((str (rectangle--space-to rightcol)))
-                   (put-text-property 0 (length str) 'face 'region str)
-                   ;; If cursor happens to be here, draw it at the right place.
-                   (rectangle--place-cursor leftcol left str)
-                   (overlay-put ol 'after-string str)))
-                ((and (> mright rightcol) ;`rightcol's in the middle of a char.
-                      (eq (char-before right) ?\t))
-                 (setq right (1- right))
-                 (move-overlay ol left right)
-                 (if (= rightcol leftcol)
-                     (overlay-put ol 'after-string nil)
-                   (goto-char right)
-                   (let ((str (rectangle--space-to rightcol)))
-                     (put-text-property 0 (length str) 'face 'region str)
-                     (when (= left right)
-                       (rectangle--place-cursor leftcol left str))
-                     (overlay-put ol 'after-string str))))
-                ((overlay-get ol 'after-string)
-                 (overlay-put ol 'after-string nil)))
-               (when (and (= leftcol rightcol) (display-graphic-p))
-                 ;; Make zero-width rectangles visible!
-                 (overlay-put ol 'after-string
-                              (concat (propertize " "
-                                                  'face '(region (:height 0.2)))
-                                      (overlay-get ol 'after-string))))
-               (push ol nrol)))
-           start end))
+          (let* ((pt (point))
+                 (cols (rectangle--pos-cols start end))
+                 (startcol (car cols))
+                 (endcol (cdr cols))
+                 (leftcol (min startcol endcol))
+                 (rightcol (max startcol endcol))
+                 ;; We don't know what lines will actually be displayed,
+                 ;; so add highlight overlays on lines within the window
+                 ;; height from point.
+                 (height (window-height))
+                 (start-pt (max (point-min) start
+                                (progn (forward-line (- height)) (point))))
+                 (end-pt (min (point-max) end
+                              (progn (goto-char pt)
+                                     (forward-line height)
+                                     (point)))))
+            (goto-char start-pt)
+            (beginning-of-line)
+            (while
+                (let* ((mleft (move-to-column leftcol))
+                       (left (point))
+                       ;; BEWARE: In the presence of other overlays with
+                       ;; before/after/display-strings, this happens to move to
+                       ;; the column "as if the overlays were not applied",
+                       ;; which is sometimes what we want, tho it can be
+                       ;; considered a bug in move-to-column (it should
+                       ;; arguably pay attention to the
+                       ;; before/after-string/display properties when computing
+                       ;; the column).
+                       (mright (move-to-column rightcol))
+                       (right (point))
+                       (ol
+                        (if (not old)
+                            (let ((ol (make-overlay left right)))
+                              (overlay-put ol 'window window)
+                              (overlay-put ol 'face 'region)
+                              ol)
+                          (let ((ol (pop old)))
+                            (move-overlay ol left right (current-buffer))
+                            ol))))
+                  ;; `move-to-column' may stop before the column (if bumping
+                  ;; into EOL) or overshoot it a little, when column is in the
+                  ;; middle of a char.
+                  (cond
+                   ((< mleft leftcol)      ;`leftcol' is past EOL.
+                    (overlay-put ol 'before-string
+                                 (rectangle--space-to leftcol))
+                    (setq mright (max mright leftcol)))
+                   ((and (> mleft leftcol) ;`leftcol' is in the middle of a char
+                         (eq (char-before left) ?\t))
+                    (setq left (1- left))
+                    (move-overlay ol left right)
+                    (goto-char left)
+                    (overlay-put ol 'before-string
+                                 (rectangle--space-to leftcol)))
+                   ((overlay-get ol 'before-string)
+                    (overlay-put ol 'before-string nil)))
+                  (cond
+                   ;; While doing rectangle--string-preview, the two sets of
+                   ;; overlays steps on the other's toes.  I fixed some of the
+                   ;; problems, but others remain.  The main one is the two
+                   ;; (rectangle--space-to rightcol) below which try to
+                   ;; virtually insert missing text, but during "preview", the
+                   ;; text is not missing (it's provided by preview's own
+                   ;; overlay).
+                   (rectangle--string-preview-state
+                    (if (overlay-get ol 'after-string)
+                        (overlay-put ol 'after-string nil)))
+                   ((< mright rightcol)    ;`rightcol' is past EOL.
+                    (let ((str (rectangle--space-to rightcol)))
+                      (put-text-property 0 (length str) 'face 'region str)
+                      ;; If cursor happens to be here, draw it at the right
+                      ;; place.
+                      (rectangle--place-cursor leftcol left str)
+                      (overlay-put ol 'after-string str)))
+                   ((and (> mright rightcol) ;`rightcol' in the middle of a char
+                         (eq (char-before right) ?\t))
+                    (setq right (1- right))
+                    (move-overlay ol left right)
+                    (if (= rightcol leftcol)
+                        (overlay-put ol 'after-string nil)
+                      (goto-char right)
+                      (let ((str (rectangle--space-to rightcol)))
+                        (put-text-property 0 (length str) 'face 'region str)
+                        (when (= left right)
+                          (rectangle--place-cursor leftcol left str))
+                        (overlay-put ol 'after-string str))))
+                   ((overlay-get ol 'after-string)
+                    (overlay-put ol 'after-string nil)))
+                  (when (and (= leftcol rightcol) (display-graphic-p))
+                    ;; Make zero-width rectangles visible!
+                    (overlay-put ol 'after-string
+                                 (concat (propertize
+                                          " " 'face '(region (:height 0.2)))
+                                         (overlay-get ol 'after-string))))
+                  (push ol nrol)
+                  (and (zerop (forward-line 1))
+                       (bolp)
+                       (<= (point) end-pt))))
+            )
+          )
         (mapc #'delete-overlay old)
         `(rectangle ,(buffer-chars-modified-tick)
                     ,start ,end ,(rectangle--crutches)

--Apple-Mail=_02B8ABC5-85B5-46A4-B410-6607750EE046--




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

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


Received: (at submit) by debbugs.gnu.org; 29 Aug 2024 08:10:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 29 04:10:16 2024
Received: from localhost ([127.0.0.1]:50316 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjaES-0006Vt-0F
	for submit <at> debbugs.gnu.org; Thu, 29 Aug 2024 04:10:16 -0400
Received: from lists.gnu.org ([209.51.188.17]:49926)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1sjaEN-0006Vf-0Z
 for submit <at> debbugs.gnu.org; Thu, 29 Aug 2024 04:10:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mattias.engdegard@HIDDEN>)
 id 1sjaDT-0005bM-Az
 for bug-gnu-emacs@HIDDEN; Thu, 29 Aug 2024 04:09:15 -0400
Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <mattias.engdegard@HIDDEN>)
 id 1sjaDP-0004wR-KC; Thu, 29 Aug 2024 04:09:13 -0400
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-5334a8a1af7so357749e87.2; 
 Thu, 29 Aug 2024 01:09:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1724918949; x=1725523749; darn=gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=UCpUpTQWTHiaPPK+iQvR5eF1v1RrpYpK14d6v2QLFno=;
 b=abprNLoo0l9ZSf+oSdMlhdkQwV0a1vqYyhJVcBW0dDkPrYeqQ6GUVFGN4hWB4E9gnx
 X7c3943tGbuG0bVShbmdtDradnQ+oihKRW5sgg1ZD6OYoEdkj/uzbZfdPa4bnOgp07SI
 zTQFzN0G7neVGpcfPsIWNealYGD00NnjO01Gn9OnFbCWamk04CRwzazC8mUuLQYsAMuD
 agxcRkryFdB6x1XBhX5DzBZZec1vUYBNx8xOIijyi//ZVWANpXFIRy7EnSwsBJkXWgqs
 Pp2i/PSpSDUz6XFTQXEEHnB+ewQFIKJbjkmRbtvIG2L7NoA3uFHIJyzVMPbh1a0legns
 moNA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1724918949; x=1725523749;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=UCpUpTQWTHiaPPK+iQvR5eF1v1RrpYpK14d6v2QLFno=;
 b=mmEzZM9pOr9ALYiHPwjNLWLIsMJLrmwjoVuIMAPkvQMVj6flDXtoyjy4AhskvgHn5g
 aoIUfIHTZvwkmuw6yIkuJXqAwXwsQJyZY4ACYVvw9DTN+KARttKrHawuDdGRJ8eFZTus
 p6Px+uor2Z9maOIyPZGno7lXvjNIZZ8m8oCUTBuF+p+VcqLO8pz16LXOoQUkWh1+ROAW
 hvpXXNRSgiv00mvXAO9hGU3w+UJUQjEx+KJCAzrWUnL1/wy5RG2/qViWjMqRpEVU9HLJ
 vFdeZsL7IukQ37jMvdR/SZjWKuSPOqWAIpDnNg8u/oRyICl8nqMgsMzSBKHoTBA36zmr
 +E7w==
X-Forwarded-Encrypted: i=1;
 AJvYcCWvA9hjfElFlldDNQT+Kf8XSp6L4kPIRiqCC7VCAJT3pZJCr/uR6YmepEc/fLrynPv8Sss1DgSqXWhdFCFs@HIDDEN
X-Gm-Message-State: AOJu0YyZuxJ8Anx7Gl1Lx5VkqZCfxCjC1leN4NG/Gkfny5oP3x382pK7
 evt3eN+q47NQDFCYnXjdDSxutONcMD198yYgSKtUca/wG3HrvzFX
X-Google-Smtp-Source: AGHT+IFk65WFNisyEWBlCci8QxWbeL/FUFRDE1vE7WSaNVXTpT1b05WOA7x0A/IE51GRVSnRikaqVQ==
X-Received: by 2002:a05:6512:3f08:b0:52e:9f6b:64 with SMTP id
 2adb3069b0e04-5353e57e930mr1150506e87.34.1724918947976; 
 Thu, 29 Aug 2024 01:09:07 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53540827b1bsm88409e87.127.2024.08.29.01.09.07
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 29 Aug 2024 01:09:07 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: Big rectangular selections are slow
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
Date: Thu, 29 Aug 2024 10:09:06 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <3F6C6CAB-8CD1-4336-B1D1-949E716139FE@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
Received-SPF: pass client-ip=2a00:1450:4864:20::12e;
 envelope-from=mattias.engdegard@HIDDEN; helo=mail-lf1-x12e.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Eli Zaretskii <eliz@HIDDEN>, Emacs Bug Report <bug-gnu-emacs@HIDDEN>,
 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: -2.3 (--)

27 aug. 2024 kl. 21.16 skrev Eli Zaretskii <eliz@HIDDEN>:

>> It has to be done with the display code, but does not have to be as
>> part of redisplay.  We can use functions like vertical-motion,
>> window-text-pixel-size, posn-at-point, and other similar APIs, which
>> all employ display code that performs layout-related calculations
>> without actually displaying anything.
>=20
> Btw, the horizontal dimensions of the window are known in advance even
> without calling the display code, and we could use posn-at-x-y to find
> the buffer position that corresponds to the right edge of the window.
> Isn't that what's needed to avoid highlighting the portions of text
> that are outside of the viewport?

Unfortunately I don't think that helps. The way it works now is that a =
pre-redisplay function puts a highlight overlay on every line in the =
rectangular selection. All this work and memory completely tanks =
performance.

Only putting overlays on lines where they can be seen would solve the =
problem, but we have to know the first and last line that will be =
displayed. I tried using `posn-at-x-y` but it doesn't seem to recompute =
`window-start` so it has the same problem.

27 aug. 2024 kl. 21.44 skrev Stefan Monnier <monnier@HIDDEN>:

> I rely on it on a regular basis, and I'm probably not the only one, so
> even if we disable it by default, we should make it work well enough =
for
> large rectangular regions.

Yes, that's probably true. Let's deal with that concern later; it's =
orthogonal to the redisplay problem.

> There might be some remaining issues with (re)running the
> `pre-redisplay-function(s)` when redisplay forces a change in
> `window-start` (or in the unlikely case where the highlighting moves =
the
> `window-end` further), but these are things we need to fix anyway.

That's what I wondered how to deal with. I agree we can probably assume =
that highlighting won't affect the viewport in any substantial way.

To be clear, just using the (inaccurate) window-start and window-end to =
clip the setting of highlight overlays works very well and with =
excellent speed until the viewport moves, in which case it no longer =
does.

> There are further issues when several windows display the buffer.

Are there? The highlight overlay is set with a `window` parameter that =
keeps it visible in one window only.

> We could also move some of the work to jit-lock, which would have the
> advantage that it would additionally be able to skip over (large) =
chunks
> that are marked as `invisible`.

Not sure how this would work. Isn't it guided by (comparatively =
persistent) `fontified` properties?







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

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


Received: (at 72830) by debbugs.gnu.org; 29 Aug 2024 04:45:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 29 00:45:35 2024
Received: from localhost ([127.0.0.1]:50036 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjX2N-0000KB-6Z
	for submit <at> debbugs.gnu.org; Thu, 29 Aug 2024 00:45:35 -0400
Received: from sonic307-10.consmr.mail.ne1.yahoo.com ([66.163.190.33]:43397)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1sjX2K-0000Jx-W2
 for 72830 <at> debbugs.gnu.org; Thu, 29 Aug 2024 00:45:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1724906672; bh=SURRRinNhKcY/+VZXBcEhWlx1B60/aNlgz9UqM++gek=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To;
 b=QjAARgBYmxreAaDPVrHrhOWId05/X6+00LmbQUjChph2EciRdCfE6sXIC4mP+UkaYw4belXdf6p04rvObUofczPfAhVDPqks0q78ZTVQ545QeeAKW44Aq2il3MX2bKlqIQxIzj++rGi+vNed2K8/Fhg0BJtMkQCOXSQVPvpCwWheX3gT4bMmKD2a9VjR9eW67yirzkMtrVl7XqDuU6/d5dUeUPBjAactQODaqQV1J2KUMN1v/X9z1Tw0RByYNsWeZztdtUnbP9ythSwB4AMJtIh8aUTeHr+J85GsMB8SylwSk0TVLOvTngLrtCn5NOT47CciD7IsJkEQxhbqhKc9Mw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1724906672; bh=LpG0xF6XZLGGwQuBwzOUaru2K1EOSnLMnSDnwwTu7Gx=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=rS3DNnOOT/BCaEtFb3T+U2JBQa/v1VERvqHQq8YtSVmqX51BcY6nPLFuJB1EeRYdO9f4942oKAK3GbjO/ABYoa/jbY8AB0qyYJP6ix0cTBkxvqdEz2lAKm6yAXpiWd0P1H064rUSHggqOXD/JQ4HqBxEoQCM8xg3eqUgyCIibh891wHlxZ9JQ+azzTQTEmrrtJq0bGZuuZKIjmUaWyRgUGRH0ELZK7MvbRtnVgyTiBdIGWMML9SXvuA2uI/PrdK6f71V5cKwfwNFoiYmODExcQcpnzMpVk50vT7yvcklfP8cSeky+Rm6Fd32H4RFG4Rm/Y2Bv2OZuFw0I/aYqYHf/g==
X-YMail-OSG: GKV36wYVM1knr1L3a65s6ncEt6z9wxdJYsrH7phjAeYa2ZvHL6BfecfF3xyPWBF
 wGWli8mK0TKz4gn8Xpnfr5EfEw3fWBunyB1IJp__8qSYC3XCDaBf1ZtG4_0qkc36YGEhc4WCCq27
 UdJDN7dbVvWZMN1vUkoYXQcE6UhTqUAvuVVeOr00hz8Lq31aiZHJgpiRbQHDX61Ob7cRVnihG1Y0
 7SnJiAZ753Xb.AmS1edDF0TP3jCw8guSS1cvkfIvZnM3jmOv2ziamgn9RAgBGgI0XDEMCYh7GreB
 HXuUADcHEHii1Qv76HNeA2EN8o9_hbY7.m.5e8RQidthDKzuotylo0.dZWonWn0MsOYURl6p1L3I
 yiXqPf3APofyKnf2zPS37s2xT2CelOfy0z0L8cXcu6tCWbdl_Gp25vu.bFBBur3qIPc5kIniVMRt
 lycz9zUS6Xxatc4hesinqgZADDNTMyswW17flWNEBwZXcJDpfh5o2b2dI_vZVsQXlhhqgjXiRj0D
 X4VdAw0DLTawxGWXxNldNvPZLMpLwMmO1HKZVX2Qep6N1qNTY9FKw13qAqC.camJJhi0HdSQSCG8
 ZZRdPB11JUqq8mxasA9omMWxWItP3V1pvuQad.OGwYlbEZyvnFl0pNMZLfhN6tpnvwQD4wIP5ZHK
 I4l6mPAEJ1rLvRhppYz43b6BXKr4FMwKOg6Xgse68xp2AGw1E7p.hzknzVf08O2SIqytSTtpARNf
 jJpAA.DXiLWGGgYW0VXbTYbwm9fAlphj4b_Z0x4m8jg_7f4hxScNKuj5ydiyAoXqaBzLS9dphGLU
 iSBicMNKor81jWHk1Z6E1z0F7_h3VL1_fwGc7y6h_Mt8MHMWzzkWVxS5W0XI3DWtIwndHXyBapuc
 rJaHNpfuEKBdACkVpoiPoOK6EPQ5VQvLJWN3lLewt_7d3EPPc0wpA8pO81KtENu.Tt0fgV4LG3pd
 iSsNkxiGsgZQL03nQwLu4Q79RcGEd0jc7.4BPwc1Drqk4JODcGgQPsvmrsr3auojyDTsGpevlUXZ
 2CZwFtt_WMYZVoHvBRZxiR2I8Iu1R3sZwvNEvw3nFt7bY3KASoPMU5WmZMOxEMG.ELnQunyn3tGN
 7yhsnx0Kgc6d_cfZMZsDzdhJeKc22zq.ykN1BH5VC5yP17J7wNF1v9IoQpQRpC1QPZocbbY0ulY0
 l3zcfW2M1edOUnJMmKXL6iRAfcQ6wVAmfx3Pq9vNnE4oDPitB9NYzKurWNg3z0BcSW6piGGm.NAy
 vrZ1luk.VIiBmPu9xj2kpTNMd.yjKkZ3i7bnekNGyBFn0JqW4vW8yC9FYcBPxVi.j._AoK02IOrb
 u6DpYrIprYlzCDhdY1ZiWFO0Ai20hHoQxIZ_EZ_BJC_VFjZIDV5PKU2_mDoYdVHUeJEdaqunBchS
 NzTZroCYzqdG2psfZGiH7nq9g7BYIXeaPLnpkhiRY6RcLoWDHzWwcwmJfeuynrXVgzBpURvJd3dz
 M7GzUZHoPcUdfXF._6j6LSNQnNum5kAeWBm3RBGfEOtBuNk8UgeovQLdUy9_EqBKJ.7syIUZ6FMI
 JXbs7Shl049FHh6pKgC1YiWUUflfdC5SPh3X.GArpAJ2CEii3Zbpyt0ZA2P5Ua0wAc_N74GsleRu
 xJ1AXz7cLlwJ7EPuTrt.5Tb8pHm9CfXnWDcxpLCusyEw71BMe.ed17Mt9dgdcvl6zPoW4P1pVdk4
 GZLyMetaLd03YyDpyNXHO.D2acGS0TBKrIwxWq9CZ76ekOO6_TJAwseWM6uEmGdrbkKH8nrEx_YX
 D4z_2WMW59RhpSOuMxSoN6lTcsKKrs3mCS193F7kakM0iVVZ6fZlwn74OiMNyYEV.7ulp5QKJZfl
 ahGWhdZsbghZoZ51Xo0dTTQ9h61t0vLIj5q.ZtmkgeVldXp3YMqdA3vPqIaE6a4IM0QcwurlFrTM
 Jjvpe_S7pocGWDHTxts7XBkH9NWUDpytVMIzyKNbWuF27cAGDkv7Kw4SClNeBYICEXllGAeqar0f
 S2NsAj5Tk9.Cx3TX7stGzKXunA8xdAb9wngjLTTLdMyHbyQ3m3xPdTXzOxW1pj8V_0ad8uPGeE34
 5_j.pn6UXm.oFFosABYp4GjwQPXmWAyoVsgz2NvAmrNxzfsLIHyPcVHBx2XGSd8yPtKM3aBF8L.k
 8FwpmsnczVTZpIPQbh5nfIWClXmkFfAiNxgpOah1wAYW1JLpXCAOYejPO2ay84x0JZ.q3Ca5X34D
 aYpBMhdHMKltAdgtWw9A8ozTv.WoozzlUuxiPxwbG_zgiT_3kKJQRpINgEsPFsoYCPDK9gTXzNyW
 GkQ--
X-Sonic-MF: <luangruo@HIDDEN>
X-Sonic-ID: 8cef9e0b-647c-42b8-8cd8-cbfc4848e97e
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic307.consmr.mail.ne1.yahoo.com with HTTP; Thu, 29 Aug 2024 04:44:32 +0000
Received: by hermes--production-sg3-fc85cddf6-gmtjx (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 12be8b243fb309b305126f4c29310c1f; 
 Thu, 29 Aug 2024 04:44:27 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <874j743sle.fsf@HIDDEN> (Michael Heerdegen's message of "Thu, 29
 Aug 2024 05:39:41 +0200")
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <87wmk0upgg.fsf@HIDDEN> <874j743sle.fsf@HIDDEN>
Date: Thu, 29 Aug 2024 12:44:22 +0800
Message-ID: <87jzg0uee1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.22645
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 486
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: juri@HIDDEN,
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>,
 72830 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Monnier <monnier@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 (-)

Michael Heerdegen <michael_heerdegen@HIDDEN> writes:

> One data point from me: When I foll the recipe and then insert the
> current primary selection into a different Emacs instance, I get a
> column of 2500 "x"s inserted.  The recipe had 200,000 lines of "x"s.
> That means, at least using my settings, what Emacs does in this extreme
> case seems to be a waste of time because 99% of the selection is thrown
> away by X or whatever.

This must be isolated to rectangular selections.




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

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


Received: (at 72830) by debbugs.gnu.org; 29 Aug 2024 03:56:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 28 23:56:46 2024
Received: from localhost ([127.0.0.1]:49999 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjWH8-0007KM-3y
	for submit <at> debbugs.gnu.org; Wed, 28 Aug 2024 23:56:46 -0400
Received: from mout.web.de ([212.227.15.14]:58053)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sjWH5-0007K6-O6
 for 72830 <at> debbugs.gnu.org; Wed, 28 Aug 2024 23:56:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1724903736; x=1725508536;
 i=michael_heerdegen@HIDDEN;
 bh=7QL7S0HNIfawUx3uiKBFWCguc9hIXSXuc0UZq81F2ww=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc:
 content-transfer-encoding:content-type:date:from:message-id:
 mime-version:reply-to:subject:to;
 b=N7wfJrGW7rx/rsivFoutnSw7XF2Y+pAu4oZMHqr/Rp4Oh4gWbK9gDiU2mMI54Okr
 pR41g+jCqNc0KOu84PlIGHvdbXuuqGCR9g5xKbd3xXRtYqM4cVeWyCupooSHc/3lu
 OySIfQuji75Hk17nCyxjT4rJCudIcrzIO1Qm855zXq+jXtG/k3Effje5ueZuQMVXK
 zoXz4ff2dEKDL4hBRF+snPkwt6WQUsxJS77fXwCuPl/wGSNWdzLvAJrAOpEqJ5/+R
 ND35FYHtw3j3SYYjrDkYWTs0ZvWD+I+dQT50oZK9ak1PDdmsZYCgWKMfAYfuUnIQQ
 sKZhaq/+xnETjPiGlQ==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.176]) by smtp.web.de (mrweb006
 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MzkOL-1rwcjB1bkX-00vnwA; Thu, 29
 Aug 2024 05:55:36 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN> (Stefan Monnier via's
 message of "Tue, 27 Aug 2024 15:44:44 -0400")
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
Date: Thu, 29 Aug 2024 05:56:27 +0200
Message-ID: <87zfow2d90.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:tKzvFpfH57t0+7AayVAP5oLqZsKrQ3KD2T4yd4LnVS/5S8/iIu7
 L8VsonhDHF01KMhrFwIs8XCLWSfKOIb6lRoH7t6FaqrQVv+q142l9zIlfsnKWRyVc45HoVY
 EyA7XPMQ4jZ1muyc90Jc5Kj811QEjsYM7RdcMSFUUFnrAzG0AWKOKuN0UTi5i+bDk7pYJvV
 59rp08YRUt0oA0dqNNeVA==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:T7FmRTlDYzI=;oguqShQm6ZYv4II/olDbYtrqugx
 yOTu5IIk00FOlSHQhM8wy5nRJZhnz3I3DQPJrXZAONdMeON7LxYVjLoZSjKFSRFlxyYrFjJFP
 JW6qlmD8PO8geG1oxwyqk7UjOiWHs7NzucNTeCVztwTtvU7i7zDnhFBWKnk7B3ZV98w43B6vD
 io1bYqNISjaoJblTvkX7AVSpz+i+X/OqTgsW1jrtWiFMNzf8/VkY4rmGZDZN6T72ICzy/ZUIQ
 44xHURlzUEMqUTTI+UWNhMuTddYWbzHtxLnDjPRNIdvToz1Ejcq4SfqYUtLB8bvK3aXftnKXf
 DAlRuvrgz91nRO27sJPjKC0KtYgFxgcluBVFBh2UMGSaek1UwrU/1P1Fd0R3Yt08mJOoWeT3H
 iCX4vORH8OMsMV28Hs4bo5SbCI1/8lnQPB+UBWf+Q9pjnOHDMtlAg7oDUZpk35M2AA792vpQU
 3HoqXCjyg9MJVGluWQk0WJhdvT3aEVmEbbOmi93hT+zEpwczAkXSwTxxNCQp+MS7xLcPeX5uS
 dEo9c0Vmh0PAubOOfGxhS39bhz9AITlHZKQ8dzVqGCGLq8kwdlqeqz4lCuDQQwMUzzart1DCL
 Z+c5SHTfVZqYoCqksyJ5WpPsEPuimdzt/Ba5aJSQFDoL5oT7CBH8823Y8QXQlAsy2dusISoXt
 icYwKXkgKgemU+PyuLEi4ClEjXWdCOwC09fdxWzdx2Ar/xbfYvCt3ppC+aO0O0LjVDmIFtQVc
 lnxPLt0+ig+UMaC3exyIqRV4aOP5kVLPG1UO9J3mnhQ7zeZQYUEpjgHUnD9h2EYXGJXpeiLG7
 DAwdV56LT6bX7OhRfJvH1Uaw==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 72830
Cc: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>,
 72830 <at> debbugs.gnu.org, eliz@HIDDEN, Stefan Monnier <monnier@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: -1.7 (-)

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@HIDDEN> writes:

> There are further issues when several windows display the buffer.  =F0=9F=
=99=82

Is it that bad?  Currently the overlays used for rectangle visualizing
specify a window overlay property.  Only one window gets updated now.


My idea would be: highlight from or up to "rectangle point" maximally
(window-height) lines.  Then the visual appearance is the same as now
(right?), and when the user moves point or selects a different window,
AFAIU the rectangle needs to be redrawn anyway.


Michael.




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

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


Received: (at submit) by debbugs.gnu.org; 29 Aug 2024 03:56:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 28 23:56:51 2024
Received: from localhost ([127.0.0.1]:50002 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjWHD-0007Ke-DT
	for submit <at> debbugs.gnu.org; Wed, 28 Aug 2024 23:56:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:43690)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sjWHB-0007KV-22
 for submit <at> debbugs.gnu.org; Wed, 28 Aug 2024 23:56:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <michael_heerdegen@HIDDEN>)
 id 1sjWGH-0005BF-UN
 for bug-gnu-emacs@HIDDEN; Wed, 28 Aug 2024 23:55:53 -0400
Received: from mout.web.de ([212.227.15.14])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <michael_heerdegen@HIDDEN>)
 id 1sjWGF-0003jw-P2; Wed, 28 Aug 2024 23:55:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1724903736; x=1725508536;
 i=michael_heerdegen@HIDDEN;
 bh=7QL7S0HNIfawUx3uiKBFWCguc9hIXSXuc0UZq81F2ww=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc:
 content-transfer-encoding:content-type:date:from:message-id:
 mime-version:reply-to:subject:to;
 b=N7wfJrGW7rx/rsivFoutnSw7XF2Y+pAu4oZMHqr/Rp4Oh4gWbK9gDiU2mMI54Okr
 pR41g+jCqNc0KOu84PlIGHvdbXuuqGCR9g5xKbd3xXRtYqM4cVeWyCupooSHc/3lu
 OySIfQuji75Hk17nCyxjT4rJCudIcrzIO1Qm855zXq+jXtG/k3Effje5ueZuQMVXK
 zoXz4ff2dEKDL4hBRF+snPkwt6WQUsxJS77fXwCuPl/wGSNWdzLvAJrAOpEqJ5/+R
 ND35FYHtw3j3SYYjrDkYWTs0ZvWD+I+dQT50oZK9ak1PDdmsZYCgWKMfAYfuUnIQQ
 sKZhaq/+xnETjPiGlQ==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.176]) by smtp.web.de (mrweb006
 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MzkOL-1rwcjB1bkX-00vnwA; Thu, 29
 Aug 2024 05:55:36 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN> (Stefan Monnier via's
 message of "Tue, 27 Aug 2024 15:44:44 -0400")
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
Date: Thu, 29 Aug 2024 05:56:27 +0200
Message-ID: <87zfow2d90.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:tKzvFpfH57t0+7AayVAP5oLqZsKrQ3KD2T4yd4LnVS/5S8/iIu7
 L8VsonhDHF01KMhrFwIs8XCLWSfKOIb6lRoH7t6FaqrQVv+q142l9zIlfsnKWRyVc45HoVY
 EyA7XPMQ4jZ1muyc90Jc5Kj811QEjsYM7RdcMSFUUFnrAzG0AWKOKuN0UTi5i+bDk7pYJvV
 59rp08YRUt0oA0dqNNeVA==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:T7FmRTlDYzI=;oguqShQm6ZYv4II/olDbYtrqugx
 yOTu5IIk00FOlSHQhM8wy5nRJZhnz3I3DQPJrXZAONdMeON7LxYVjLoZSjKFSRFlxyYrFjJFP
 JW6qlmD8PO8geG1oxwyqk7UjOiWHs7NzucNTeCVztwTtvU7i7zDnhFBWKnk7B3ZV98w43B6vD
 io1bYqNISjaoJblTvkX7AVSpz+i+X/OqTgsW1jrtWiFMNzf8/VkY4rmGZDZN6T72ICzy/ZUIQ
 44xHURlzUEMqUTTI+UWNhMuTddYWbzHtxLnDjPRNIdvToz1Ejcq4SfqYUtLB8bvK3aXftnKXf
 DAlRuvrgz91nRO27sJPjKC0KtYgFxgcluBVFBh2UMGSaek1UwrU/1P1Fd0R3Yt08mJOoWeT3H
 iCX4vORH8OMsMV28Hs4bo5SbCI1/8lnQPB+UBWf+Q9pjnOHDMtlAg7oDUZpk35M2AA792vpQU
 3HoqXCjyg9MJVGluWQk0WJhdvT3aEVmEbbOmi93hT+zEpwczAkXSwTxxNCQp+MS7xLcPeX5uS
 dEo9c0Vmh0PAubOOfGxhS39bhz9AITlHZKQ8dzVqGCGLq8kwdlqeqz4lCuDQQwMUzzart1DCL
 Z+c5SHTfVZqYoCqksyJ5WpPsEPuimdzt/Ba5aJSQFDoL5oT7CBH8823Y8QXQlAsy2dusISoXt
 icYwKXkgKgemU+PyuLEi4ClEjXWdCOwC09fdxWzdx2Ar/xbfYvCt3ppC+aO0O0LjVDmIFtQVc
 lnxPLt0+ig+UMaC3exyIqRV4aOP5kVLPG1UO9J3mnhQ7zeZQYUEpjgHUnD9h2EYXGJXpeiLG7
 DAwdV56LT6bX7OhRfJvH1Uaw==
Received-SPF: pass client-ip=212.227.15.14;
 envelope-from=michael_heerdegen@HIDDEN; helo=mout.web.de
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>,
 72830 <at> debbugs.gnu.org, eliz@HIDDEN, Stefan Monnier <monnier@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: -2.3 (--)

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@HIDDEN> writes:

> There are further issues when several windows display the buffer.  =F0=9F=
=99=82

Is it that bad?  Currently the overlays used for rectangle visualizing
specify a window overlay property.  Only one window gets updated now.


My idea would be: highlight from or up to "rectangle point" maximally
(window-height) lines.  Then the visual appearance is the same as now
(right?), and when the user moves point or selects a different window,
AFAIU the rectangle needs to be redrawn anyway.


Michael.




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

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


Received: (at 72830) by debbugs.gnu.org; 29 Aug 2024 03:40:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 28 23:40:07 2024
Received: from localhost ([127.0.0.1]:49983 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjW10-0006rF-PA
	for submit <at> debbugs.gnu.org; Wed, 28 Aug 2024 23:40:06 -0400
Received: from mout.web.de ([217.72.192.78]:54205)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sjW0y-0006qd-7a
 for 72830 <at> debbugs.gnu.org; Wed, 28 Aug 2024 23:40:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1724902732; x=1725507532;
 i=michael_heerdegen@HIDDEN;
 bh=Kd1uS9q7d1x7QWSJOS7hrNyYSIjrdw6ssDk1bMyifeo=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=KKSTu5Gy6vmpsgw7Acd9NeOzsE12AOTvZHlCBxjt3KFk0HK6NtnydGHcBJBWz65T
 kRDGREmaw4QkvI7mLUBVyheeowk6Zad3WOoTSSL7miFq5g25wgTNRlHRbXfKMFvXs
 4b0zjenwqQU+z+AoEiWM8pst89DiObQ/8AVt4Ny4k01MihUsvbHmqxjabuZsCPR5X
 DFnTNEp0zdFDHzB/gq8XD/6/2QytEpRnZkfY332rPlqKCLDgwqN1d57kSPadpbPd3
 tUpPWllm8l+xoSKJ+88U4i40R+74MOROTA7c1M/tvicdiXW1mdiPzaliacdCsFRsI
 /3dcwS+dKgx9auZlxg==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.176]) by smtp.web.de (mrweb106
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N5CQh-1rzthR11rJ-00y8Tm; Thu, 29
 Aug 2024 05:38:52 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <87wmk0upgg.fsf@HIDDEN> (Po Lu via's message of "Thu, 29 Aug
 2024 08:45:19 +0800")
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <87wmk0upgg.fsf@HIDDEN>
Date: Thu, 29 Aug 2024 05:39:41 +0200
Message-ID: <874j743sle.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:Op4whUTKJx2iIvAZrSFMr/b8gJ8fJQamvH5uWiCTDm21KavuPlk
 hs34xH6WjdnWQLmNZFB1xR6cJgvLF30hpIt4ODSPi0t9XK5XmiYGu0d5nYX3SVcEiqpZYhP
 44qra4EnEOZ5QB+6UjlUX4AKelwMVwMmRLF6ZH1UQDpKn7BZTejtu8MXc0MpkeyvmSWONg+
 MveXZLsOEnRHLm+sOCxtw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:mMoYFCGHM2s=;tK7M3/xm3REO76i454G1QePwvFi
 uDaYhNGtNi51oP1bhiW+xmg3zRIUQ/Kzo3TQYYB8vc3mBOdqTUfdjlu1NcPQvbEY3Ucx4kcz9
 GfPwLZsEwFltrblsmgAgr6UIap+HtJL2ZRik/Q3P9yLRsdSmgYknyGIBG1QP+sjcPUm8MAC9x
 P6SNncUqvy3hHUdp+wESMxk9JI+MCI4+LGOyMzT2OGPO1k8dOzoh5TvN62Kda1cQKeTUKXKJf
 49/ioQ9OzLv7YGXVfamxoUbWB7vC3BBJn8XOuNOWEbr+Jz61tL4wkPFGA7nSGQC3uGabKbrkT
 hG5luRMkzhgEFfk86J+s4Z1nVJxZnMLU44UN3fzOC1JMGzAeHIbGeguikWDjuNX/jtRUoBImH
 QBgayyrVjSaWGKtd+RmstFD9J0WhKqRH3RFR+C3E57IKYTRPR30rP7oAZQxtJPlhwOmmyRKFG
 N1Ys0HQIbIanMthWBx/5iDsq89bV1c7ClAwLDyC1Aqes4hobiyvvEsYM+nXDMCQzdD7KYq9a8
 Q/7jAa6HX3RHWVPT+muvJChZPJqSqJnsejuzd2YLiDBueYd8QoAo2Bg5T0VzXRfOvAY9+QAu+
 Gt1vhA4fRUOZ9mJTRGP7A5lv/szu+hSiXuS6H5/f99bUSPxfh/Ep4KOFGPEquLMsdEHHeJClp
 ykeAFZpyKGQINai+dDKHWSWm7Lp39lmYS7brw/C+SeD0s+8Ac0Wm9T3z5egdz1J69zcdX//Uq
 uFRaq/xxVHr/OVIB/o2jbNiBeiTuj99q+oVMRBYRKmCwmRmAyykS2t43AKp2pJ6NeMao8OSrV
 y7jCuY2boI8jVaYUq/N8WRjQ==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 72830
Cc: 72830 <at> debbugs.gnu.org,
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>,
 juri@HIDDEN, Po Lu <luangruo@HIDDEN>,
 Stefan Monnier <monnier@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.7 (-)

Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@HIDDEN> writes:

> No well-written X program of the past 30 years does not export its
> selected text as the primary selection, and users of free desktops are
> long accustomed to its existence, with the result that Wayland desktops
> implement primary selections by a number of protocols.  This is simply
> not an option.

One data point from me: When I foll the recipe and then insert the
current primary selection into a different Emacs instance, I get a
column of 2500 "x"s inserted.  The recipe had 200,000 lines of "x"s.
That means, at least using my settings, what Emacs does in this extreme
case seems to be a waste of time because 99% of the selection is thrown
away by X or whatever.


Michael.




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

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


Received: (at submit) by debbugs.gnu.org; 29 Aug 2024 03:40:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 28 23:40:20 2024
Received: from localhost ([127.0.0.1]:49986 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjW1E-0006rh-1n
	for submit <at> debbugs.gnu.org; Wed, 28 Aug 2024 23:40:20 -0400
Received: from lists.gnu.org ([209.51.188.17]:56100)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sjW1C-0006ra-EO
 for submit <at> debbugs.gnu.org; Wed, 28 Aug 2024 23:40:19 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <michael_heerdegen@HIDDEN>)
 id 1sjW0J-0003Yv-Bb
 for bug-gnu-emacs@HIDDEN; Wed, 28 Aug 2024 23:39:23 -0400
Received: from mout.web.de ([217.72.192.78])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <michael_heerdegen@HIDDEN>)
 id 1sjW09-0001uw-TH; Wed, 28 Aug 2024 23:39:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1724902732; x=1725507532;
 i=michael_heerdegen@HIDDEN;
 bh=Kd1uS9q7d1x7QWSJOS7hrNyYSIjrdw6ssDk1bMyifeo=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=KKSTu5Gy6vmpsgw7Acd9NeOzsE12AOTvZHlCBxjt3KFk0HK6NtnydGHcBJBWz65T
 kRDGREmaw4QkvI7mLUBVyheeowk6Zad3WOoTSSL7miFq5g25wgTNRlHRbXfKMFvXs
 4b0zjenwqQU+z+AoEiWM8pst89DiObQ/8AVt4Ny4k01MihUsvbHmqxjabuZsCPR5X
 DFnTNEp0zdFDHzB/gq8XD/6/2QytEpRnZkfY332rPlqKCLDgwqN1d57kSPadpbPd3
 tUpPWllm8l+xoSKJ+88U4i40R+74MOROTA7c1M/tvicdiXW1mdiPzaliacdCsFRsI
 /3dcwS+dKgx9auZlxg==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.176]) by smtp.web.de (mrweb106
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N5CQh-1rzthR11rJ-00y8Tm; Thu, 29
 Aug 2024 05:38:52 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <87wmk0upgg.fsf@HIDDEN> (Po Lu via's message of "Thu, 29 Aug
 2024 08:45:19 +0800")
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <87wmk0upgg.fsf@HIDDEN>
Date: Thu, 29 Aug 2024 05:39:41 +0200
Message-ID: <874j743sle.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:Op4whUTKJx2iIvAZrSFMr/b8gJ8fJQamvH5uWiCTDm21KavuPlk
 hs34xH6WjdnWQLmNZFB1xR6cJgvLF30hpIt4ODSPi0t9XK5XmiYGu0d5nYX3SVcEiqpZYhP
 44qra4EnEOZ5QB+6UjlUX4AKelwMVwMmRLF6ZH1UQDpKn7BZTejtu8MXc0MpkeyvmSWONg+
 MveXZLsOEnRHLm+sOCxtw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:mMoYFCGHM2s=;tK7M3/xm3REO76i454G1QePwvFi
 uDaYhNGtNi51oP1bhiW+xmg3zRIUQ/Kzo3TQYYB8vc3mBOdqTUfdjlu1NcPQvbEY3Ucx4kcz9
 GfPwLZsEwFltrblsmgAgr6UIap+HtJL2ZRik/Q3P9yLRsdSmgYknyGIBG1QP+sjcPUm8MAC9x
 P6SNncUqvy3hHUdp+wESMxk9JI+MCI4+LGOyMzT2OGPO1k8dOzoh5TvN62Kda1cQKeTUKXKJf
 49/ioQ9OzLv7YGXVfamxoUbWB7vC3BBJn8XOuNOWEbr+Jz61tL4wkPFGA7nSGQC3uGabKbrkT
 hG5luRMkzhgEFfk86J+s4Z1nVJxZnMLU44UN3fzOC1JMGzAeHIbGeguikWDjuNX/jtRUoBImH
 QBgayyrVjSaWGKtd+RmstFD9J0WhKqRH3RFR+C3E57IKYTRPR30rP7oAZQxtJPlhwOmmyRKFG
 N1Ys0HQIbIanMthWBx/5iDsq89bV1c7ClAwLDyC1Aqes4hobiyvvEsYM+nXDMCQzdD7KYq9a8
 Q/7jAa6HX3RHWVPT+muvJChZPJqSqJnsejuzd2YLiDBueYd8QoAo2Bg5T0VzXRfOvAY9+QAu+
 Gt1vhA4fRUOZ9mJTRGP7A5lv/szu+hSiXuS6H5/f99bUSPxfh/Ep4KOFGPEquLMsdEHHeJClp
 ykeAFZpyKGQINai+dDKHWSWm7Lp39lmYS7brw/C+SeD0s+8Ac0Wm9T3z5egdz1J69zcdX//Uq
 uFRaq/xxVHr/OVIB/o2jbNiBeiTuj99q+oVMRBYRKmCwmRmAyykS2t43AKp2pJ6NeMao8OSrV
 y7jCuY2boI8jVaYUq/N8WRjQ==
Received-SPF: pass client-ip=217.72.192.78;
 envelope-from=michael_heerdegen@HIDDEN; helo=mout.web.de
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: 72830 <at> debbugs.gnu.org,
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>,
 juri@HIDDEN, Po Lu <luangruo@HIDDEN>,
 Stefan Monnier <monnier@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: -2.3 (--)

Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@HIDDEN> writes:

> No well-written X program of the past 30 years does not export its
> selected text as the primary selection, and users of free desktops are
> long accustomed to its existence, with the result that Wayland desktops
> implement primary selections by a number of protocols.  This is simply
> not an option.

One data point from me: When I foll the recipe and then insert the
current primary selection into a different Emacs instance, I get a
column of 2500 "x"s inserted.  The recipe had 200,000 lines of "x"s.
That means, at least using my settings, what Emacs does in this extreme
case seems to be a waste of time because 99% of the selection is thrown
away by X or whatever.


Michael.




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

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


Received: (at 72830) by debbugs.gnu.org; 29 Aug 2024 00:46:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 28 20:46:32 2024
Received: from localhost ([127.0.0.1]:49902 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjTJ2-0001xU-HH
	for submit <at> debbugs.gnu.org; Wed, 28 Aug 2024 20:46:32 -0400
Received: from sonic309-22.consmr.mail.ne1.yahoo.com ([66.163.184.148]:41885)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1sjTJ0-0001x6-U4
 for 72830 <at> debbugs.gnu.org; Wed, 28 Aug 2024 20:46:31 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1724892330; bh=L1JXRi+rYkjW5ApOBTawhyxheZz3CRzccrwDwY8SM1A=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To;
 b=TDONEH6LCBSszzVc8fy6jfiQFdI4l5ZigWcJ4ouPpwiXeODLLudpFH8qIzOur9hUVoTkf1oXIC9KpjzklljLgcz6MYh5NOotwJU3uOkEvmqa7TTkPVDdzoOwHMs1mpTBkQI/aWBanKdrsJz9XkBAIxX9zNNxhS9G4iW9GBG7X1nPlUCjfE9NpVfiC2QhGvNe+lES1O2+zsNyDlpTvJ68JBibNmJaYCqE8IhkA2E8s726Tlukc0/8xGFONWJmcDM+dCIlUPILa0FhC9F5jjPGejByzX9vjeThv9HnaZN5H3ewYi4/NziQlpYgncd6RBGFW/vxd0EqMEgpCPTpZtT86Q==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1724892330; bh=PYScPQZQ2IS+IJ9LTAJAgQwKONMr1mwzS7VDuxL1koY=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=gwqTLYZ3APTBU48rFQUWaK2JFauy5oBA2Is9wfPn/vvo6B8fVIzU/w2drWD2n7ymt5n5wA/kI20Mi26VC/duK20Rxs9B7EtmHMACvwYIc4Ekum3Nrhp4WyLrSf3ApulrI658rZ2whrWjquwMLJqdezboiuht1+fQd6Kh0YkVIlbrmcZgWjjc7t6cg63HyOWMfe7jmsdGM+SwlCaZUvJNEl5x0k/1xXQ+tUcwZ0pI8AGkjnqtNW99pmi4j0LPtd3MjMnNBdibTqW2v43NZVxebbpJYvPMaWWd9pvNRxTqOdkWlhbZ8bow7Zf4OkAhZmNnhkHXPk6B23yJuxoJmuWTgg==
X-YMail-OSG: 6vzQPjkVM1mwS9LVoVvqv2zeyCoIWL2TGfubEs_.7VvLdMTwMPFYxhPvTvOg4WO
 PwdEA0gB263_vR1.hAIzQpmP1JxBHXHbYfQ2PXKP_qf5a.gClI0hEMZrrWSqiVIMokLi2Ap5XnJd
 XjBT4125d5Hi7TEiUsg35doxTAetMRDkHgrPO.ECMEgZjoYJs0w4DRpkrcKbSUgFPlxZ8c4GSxSi
 Z4Jnz4luONVibuCziWSeSFdiud38Z9e1bqBukl4EZobQMYTgm5k_a52N50s08Mbiv0fDHGoA55ic
 Ps15p9XHKSL6ngSPVLC8lYOUbIW7aG1k6MaZlip4nbrkmADdpFXBHZp_uCGAe5RA5y.gbjrJEMxw
 Oa6SRXWnnHFJ80xVx4RAtn1s1V6GkxqXluEljdwFoP4AtJX6OB_Qdt4c2x2.ZPXft5qMEQDaAsR1
 dydynO6RomZnQw4NKGf38OsrVfSKyeZ70Bn9buTSM6ulWe0nDzEnlDJGpwXSkPxqFJlXB9iE3Lp1
 Hsneem2hni0IJ2maOBfO8rb8ndwxmeYiqwAB4cbCNqGxg8l4b105QMDl1h6uA_7TmgMZGSp.VsGV
 6aF9y0cw7p.xyf4JUAzd1oQSTG7WE_EbgQAHVolyC30.Rppo8NeYED.N9ExHdSefVkrpYccKWCtY
 6cLoi6siKL7O9ku2RjDCCVN9rYhu7rKCysS04FlRapKHdzpyEzYeDDA1bOflIcHThMu0mKH8o4kL
 y27JrZK0jRb67kpX7_76E8ai.wSfjZjYcV7KwJPLFAZUtaHyRA2V..avogpvYgnxOkL9wtfqZxgN
 cTq5a2pN83eZ0byfCGBuKMQsL.n2aDwlW0PFQDGWImWRDR4TGXtMQjinbBiMIQumaJFS4.fODDrZ
 HKiwCxUievbQQmy1F3EAlfKApy_ZNfOrGuaxvEoicOSCxh2lEYWOrR40X1zN_Ef3I0fhOvQ3Zvz0
 XXuX4uOEAuRGd5T0T_8CDURqMwh5R2tNeRdJJaziyH6AGA4Tvdg4wHl.d9VuJXk0aNeqlisH_IS6
 asRoUabyG0N6B2qnBTlInLzQ8GXlQ_XQe_WigCYRQUQEB2I4tfuihER41rXUekaICALhVipuoJ.N
 ACYgYqHGgSXFEh02Tml9DURydXpYEUcdamfdroTfPqfa3rKvStB.30JtMYL5uQqvLzEjEfbjN_QR
 WBJLgqFKZDg4kPSLz_oEJxwe8McTBMj8_rfQSJz24sDz_5gDLvllT0m7DzvPc9uw3hhJXWmM8zZT
 ZT_5PaNNlIIhw1TjLhwi0_j0MzFtYYXs2A9PdaXqtTjHImCZFS9vght0xswwQYuMagpDSt4FZdiu
 qYyAF2Nsb7C1KUbxCfDTa2.CsLyMkn4mBP1ILMia4BubYWLeaXWjUUg9xhs114hOwbIcLovx9Gpm
 Bwd8o0i49eMv1_O.GZ1kq4o9c7YzGvgll2w3w3jGOFvNXg91g2VFB5Ek2c7C..2LPG19PmlRVGh_
 6DI8mqs6kE4BEbLbvcjXL7OltvMW9KSARISw4h8UwUIJA4afjU50Wxjrkagt9gVwiyEAYqqspodx
 uNzIsoDpdb8Gn0W_4Ob3YukOihp5BRQ6jK70qGLI7GRIwWe14gi0plWnAcX5e.B1.o5kAScMZ4sS
 .ADGJRETfAvGuXW8klTY8Qd7q981zsdKTmxzzJjCNiB68sJbjfrGRRNQz5iFOyTSBJE_TyYNev7O
 YFsRgPlJucqRbErAuYsgdTSn0Phmn_b72qc4VxvrRYFA_JrwfrDmtbqamU8EE1C6mr2d_jQH6YnO
 OIe403cmZ68RxqtYhURAqhirNDmEAEbNArxnXTbCSQgy2Q4oIjoZlxozhh9nNj4Nyd.yPfbXhaly
 W9F8vxLs8jz84G6m.o6OW4wS3rpt_lHEZI8LuvnQDb50MPa_TBUKQ.QyucDQuxi.GMp0VCaEKf3Q
 43jnQZHDbUDvdlW_UaTpeXNrpeJOqe9eWNRpwngjpmn3oxf2p7YaF6S.Em2dQrMzsG8DhEMKoJat
 kPFg_BrRwdlzmhIm2hHcm4qxQ2V4Chk_n66vU0r9dyEWTpfwd68Hv4Gc_xmCwhb7QcBR6e08fhtF
 oNt5h6UzQLjb8tKJtxusHxsPSiwCFpwQTme6R18swrj2xtwcUbGG_3Fg4bH_xf19eLS.bt7KyymH
 Tply4.LLFo95Fk5P1s8_HbTPhe6kyiy5R5SpdX69fMoF3bOEhK5vkNFLuKQSi7eUDBWoR5KA.A8M
 HSQ5GReXVwWqAx1pQHL.vRQAzOABJFEj3VOzYNg3I2Az1QJmTsXyg7orbZHSyLYQCYqEN
X-Sonic-MF: <luangruo@HIDDEN>
X-Sonic-ID: e786e8ca-90a6-4b9f-91f4-ac7cc97ce589
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic309.consmr.mail.ne1.yahoo.com with HTTP; Thu, 29 Aug 2024 00:45:30 +0000
Received: by hermes--production-sg3-fc85cddf6-6lk5x (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID a68ef655dc0f662529286c70785d1622; 
 Thu, 29 Aug 2024 00:45:25 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN> ("Mattias
 =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Tue, 27 Aug 2024 18:42:19
 +0200")
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
Date: Thu, 29 Aug 2024 08:45:19 +0800
Message-ID: <87wmk0upgg.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Mailer: WebService/1.1.22645
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 813
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Eli Zaretskii <eliz@HIDDEN>, 72830 <at> debbugs.gnu.org,
 Stefan Monnier <monnier@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: -1.0 (-)

Mattias Engdeg=C3=A5rd <mattias.engdegard@HIDDEN> writes:

> It's pretty bonkers, yes. There is even a noticeable slow-down with a
> single contiguous selection.  Fortunately the cure is easy.
>
>> I thought the extraction of the region's content to put it into PRIMARY
>> and friends happened more lazily (e.g. when another application
>> requests the PRIMARY/CLIPBOARD, or when we deactivate the region).
>
> That would indeed have made some kind of sense. If confined to X11,
> that is. And opt-in, even then.

No well-written X program of the past 30 years does not export its
selected text as the primary selection, and users of free desktops are
long accustomed to its existence, with the result that Wayland desktops
implement primary selections by a number of protocols.  This is simply
not an option.




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

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


Received: (at 72830) by debbugs.gnu.org; 29 Aug 2024 00:41:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 28 20:41:55 2024
Received: from localhost ([127.0.0.1]:49891 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sjTEZ-0001nX-EF
	for submit <at> debbugs.gnu.org; Wed, 28 Aug 2024 20:41:55 -0400
Received: from sonic305-22.consmr.mail.ne1.yahoo.com ([66.163.185.148]:32897)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1sjTEX-0001nD-Hu
 for 72830 <at> debbugs.gnu.org; Wed, 28 Aug 2024 20:41:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1724892052; bh=3447crHehuyAfUo+Xj+vY9kHa+vnZQHi0mKdBEBS+68=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To;
 b=A6jg8/CX0IwSA6ImujuuFocwxMujoN74EQCO05SuxFVhq1MBN1jcgOcKxa5IPoWkXCGALdT6KLBOrje6za2evlRMxPAPA/1kk4PVYm5044dilexnIJs4YfBpVNCkHoSZD+UVeYpQGD2xSoxeX+bB6TZlGtX/klrCZw1wMLpBH9CsPtAhjEaKDyUhciY1C2dbQIcEsbzwP5V3C+ogoUVFoahWIQVh8XceM4ysAaajNHTew9LCkAfpAXFHKWrVlLSL8s+GLwfEs7+3/QKJZOrNgXmR/GcUbdWSMKRAKouTu0Mbpwu0mY/m8n6Y/urVAcs0mkn+6Fzu2f9J8UriAuc16A==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1724892052; bh=EPCXhKSbRcdxnTTLpGsyZpgAF7bT/5olyDubHhpNmJ7=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=WLzNyhpYFW0j/6i0G6dKF/1hKamtt/7Tai8MOY9UP3ql9wgpvxDjTGo3x0saIcJej7uHdYJ9vEWL1xkCocB+R5UQohb14d7Lm8HOBPLTCWKNBHX2VjspGvDZnr8JLbJTTv51iSkGJqDZk9VEhDlqjHCkNFtjH9GLA8xRjvzp6FS0SmtM7lJSPPby0AmkkQbaGwmte/+rutk3Gd4F5/P0W0hIb8JltkQNwZajHTvEO+wZSV8i3/tfW97Wzr6keBj7fDbB8ABZgZlvwmQdd1pG/5OLOSWSRsjk6v1MnVu3vw067Ykhyygompali0O8Ng5I6oQ8PycMfwZuBgSWqx/qQw==
X-YMail-OSG: WSfm4f4VM1mK1TPpgQnSriIUIis8Smy9mqn.7nx4xNU23Vm4SgtQA3nBrFNTOWT
 1NOQnJaP_QcuirwP2Dvib92EHvyc4X6GHRxEC.64tv6C1cfGPyqEarfjAc0QcMZ30sZsSKAGgmZ3
 F1B.Nk0ShAj8xnvWcVFOSyRuUCxB3raiao.ybE2uMbqlE.TJ4jWaC5cIRmmgbUzQz4xyrLeaLjQG
 CJIzsPxSqd4an_vTAzp21xae_NBhpW0cmF_skFd5GrxMOXyjiv1D4PxbNLE95_gx1OEUYGmYbzU7
 bekTm4IfBCQtKnHK.b7Lu0FqTBsMM8MEFdelD6jhPAa_aTrkb1ajhr48tJYrHqflrOonwmMM2DNF
 xhXUGH4Uh_W5Sz0SW.a50UWWwDObdGRTEbGkFq9nG6f6HnQcDkU2cePWwxJY85FT7vJJ94O5nFGj
 X12S8MwKWchZcwR.WkWC0Uirg5oImz_FGx2ywIlObzmXeWft5e8PSvHyeB8Yh67Zzu7tSzYlvvdU
 E1Mf3BBW5Xc1UgRx5KLWFOrPhiVAHXRlskbY0KW0zs4dbitGsNLraUgLfp4JSWEfXQ4D6UK1LVua
 s5jAEUZrmKy7vX6FtwUPp8atNRAtDc3GGkT.Zvk3qwu5sGj3ReYldjeEEdFIYEuv9_i5BcT5ZuvL
 Mq1F70omI.ak2qvAU..r9nY2Xmd93mIRf2xDhwROJou9B9yPIrJFtpNY_fm5wZfVMYc7mtDQ2A6m
 1l4Hxgcot3W6k4PGtTjse_NvR4Ye0DRGXHgXe516G2Ca_kiho7CcK5u91BDGqyI1NaB4eB6vMqyg
 QyElsUUjJ9neZzEqOihAha20f8UjXmIQkB9e_weDtKLuMU7PgirB.ZP35HDz0c7XDTHigjEu8Xge
 wEz9cykOqTrx_fy_fA7.xFTbphmNARaRJ3.GR7jUF20iaUVmnCnr.TKOyXTRTDW_H__Y5pDDtvAn
 LPxRBWZLsFhOkesZQAeCWtNMcqDvkKQJfNgHWsZePIkpJYzH5MnQ429v.j.B9ZOSTPfdI9dUyCWG
 BRVZPw0oWjYQlgm_xoZQ5kVTGGgknR_tLHmNWb3YUZSR.u3r2YCLDHEy_JUEnKlMF3sMhmE7K1T1
 Dx9W2bM7JggAYA72sftfkE7CwevboChkekWlBb7TMt_kX5KxwhbPJfNAMGnvc2JAZy81YUqCANq8
 Dj4PDG3oYVjBGvWTl9BRcmsR7pXS78V1N_11ULpa2QYpBpW.9s4VGwCxEnjsGO6USLshMBTYB4sJ
 rSGQT13QazQj_ytc7QHFObxsitbH4BvrOUNla9dFWDDhmurJPTvBVerZQ_zJUnl1AkJpW5isTBde
 eWH0TaImQ1DhMX3IImuGEBm8ZAv74Uh8RSbr7GQJV5uYzZSEFiSKlc6oC0Q9SDjpymaBFQfGEaI9
 yDkYrbO6jmvzDCyDgzt8vIm7NC0rrfcJ.4JnBWrM0.xB4mdh7l.QXPF0w.NEY0VfWnPvV54VX0yq
 xp13lWmNi_E155QU0Tu4syT.xzzMyLu7KZp.DdbhMl2AFhsJvfs0ufo5MmGmLGP.f3yjyPnti3xF
 Vx4tLooV1HpBrXxvdh4fxcp6eznHkpdZz3ZAs8m9WptlcGd3xDruInfOiBPKq_rpVrMaiTppOXQx
 WDwoxmOHm4FlZxDQ7AF6qCJYh9OfXJiiPW7sfCA5rpPkQb6czre5Ri.oc9fynCrnZwkmjnpVKaKs
 HlW3JFn5f5dOrQI8pKp8Utv.D45Yik7dNjTdmXEYDAnw5m_9e9hMbNj3iIckUjcZKJtRXihJAOZ_
 KQ1vqsiV7FEND6D5cNb.DgpKHvUrWunwjWoR4LMT71DgmonrL1Jj7TSSjE6OT60DEja4XWoWF8ip
 gRhoVgRuuZ2Q427bSLlFjMThIMHiPT6m9NLdqPBdrz0pGnyNDlQweAzBxRt23Gh1.OQWNeTGWm8G
 UYzPVYG0vU0ZLWF3UrNiX0cxhhZjCHZunfM28YJjXAHK.92R6wEUaeJMpFcP2feDRrWVKLoEY7re
 iYDq0PsRPopU5JLntU77Cpx69mEiVo564.XHHLn5CseoeCwV1QcQeWNnjaBFLBPNOuIjhOXEg45.
 5t.ZmrbFEi6livI.4q8x0nMKXIelVLGg2RHv78a5qXuNJrsM9QEVQ4dV.jVjMFKVrN1cnL3_okOH
 gaMZJbKMuopw.wEE3FC.S6cOO0TonBsFOd7oPH2z65xZwSQKUu4bk0L_HKzTxEq17nFGJZ_zufB1
 uM_7wXGdS5QRS6wPTEWsVaOzxuw3Gg7wYIp3G7Y_J0p_HI5Z0HprWcYsov28BeSxTug--
X-Sonic-MF: <luangruo@HIDDEN>
X-Sonic-ID: fe982461-ed93-481a-ae1f-31a1f9ce07ff
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic305.consmr.mail.ne1.yahoo.com with HTTP; Thu, 29 Aug 2024 00:40:52 +0000
Received: by hermes--production-sg3-fc85cddf6-277r8 (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 3f7e9d21018d49be730a087b9b05a735; 
 Thu, 29 Aug 2024 00:40:49 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#72830: Big rectangular selections are slow
In-Reply-To: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN> ("Mattias
 =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Tue, 27 Aug 2024 14:39:37
 +0200")
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
Date: Thu, 29 Aug 2024 08:40:42 +0800
Message-ID: <874j74w48l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Mailer: WebService/1.1.22645
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 644
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: 72830 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
 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: -1.0 (-)

Mattias Engdeg=C3=A5rd <mattias.engdegard@HIDDEN> writes:

> - `select-active-regions` makes each selection change very expensive.
>   Can be set to nil by the user, but I really suggest that we change
>   the default to nil, at least for non-X11 since the default assumes
>   old-school X11 PRIMARY selection which is alien on most other
>   platforms.

No!!!  Primary selections are an integral part of X, and users (many
trained on X) have come to expect it of Emacs on other systems.

Emacs supports saving a region in a buffer as a selection rather than an
entire string, which could be exercised in the case of rectangular
selections.




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

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


Received: (at submit) by debbugs.gnu.org; 27 Aug 2024 19:45:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 15:45:49 2024
Received: from localhost ([127.0.0.1]:47625 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sj28S-00073I-Kw
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 15:45:49 -0400
Received: from lists.gnu.org ([209.51.188.17]:59378)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1sj28Q-000737-A8
 for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 15:45:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1sj27Y-0006h0-Pb
 for bug-gnu-emacs@HIDDEN; Tue, 27 Aug 2024 15:44:53 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1sj27W-0004g5-TY; Tue, 27 Aug 2024 15:44:52 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 546AD8092C;
 Tue, 27 Aug 2024 15:44:47 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1724787885;
 bh=Lr7uWtDPBHfzPAEnXXqKsyfGeghKqdn+LRFV49P+G90=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=cUR5beQGcvH0u+YymBJ5AHNjx2YdLRUhXo1oKjXjfoW81IdV8wF/y82OPNkXnFTti
 e/Vof/fA7KhXNdDISSgYdUlgJewZlgZqCaiDB42HSTZgX9S+fv2DP/AQ87bPjhZelt
 /Bcv6aZaO5ggnbP+gcrnKHr6Fb66QRWJPYkI5UijqFsY8o5xqNLKoxVQFRIOYwgOML
 AiOoV1CBmLJjF8hb8RcGcF5oRGK3KBHghO2rfHto4Trcwc1hhvcfWu0BR+GoWN+yWK
 w4tihzjAaBMRJfedx7PdxETYBVYxdBiTFtoZaX7Yp587xdhMuuqkYLRpIU6ZpxC4uv
 VCVrrblTV5y+A==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id CAEEB8025B;
 Tue, 27 Aug 2024 15:44:45 -0400 (EDT)
Received: from asado (unknown [23.233.149.155])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AB60F1202B1;
 Tue, 27 Aug 2024 15:44:45 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: Big rectangular selections are slow
In-Reply-To: <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN> ("Mattias
 =?windows-1252?Q?Engdeg=E5rd=22's?= message of "Tue, 27 Aug 2024 18:42:19
 +0200")
Message-ID: <jwv7cc14v8f.fsf-monnier+emacs@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
Date: Tue, 27 Aug 2024 15:44:44 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.086 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
Received-SPF: pass client-ip=132.204.25.50;
 envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Eli Zaretskii <eliz@HIDDEN>, Emacs Bug Report <bug-gnu-emacs@HIDDEN>,
 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: -2.3 (--)

>>> - `select-active-regions` makes each selection change very expensive.
>>>  Can be set to nil by the user, but I really suggest that we change the
>>> default to nil, at least for non-X11 since the default assumes old-scho=
ol
>>> X11 PRIMARY selection which is alien on most other platforms.
>>=20
>> Didn't think of that.  Do we re-set the PRIMARY every time the (active)
>> rectangular region is changed (i.e. after each key press)?  That would
>> make it non-scalable to large rectangular regions, indeed.
>
> It's pretty bonkers, yes. There is even a noticeable slow-down with
> a single contiguous selection.  Fortunately the cure is easy.

I rely on it on a regular basis, and I'm probably not the only one, so
even if we disable it by default, we should make it work well enough for
large rectangular regions.

> But how do we know what the viewport will be in
> `rectangle--highlight-for-redisplay`? Since it is redisplay that determin=
es
> window-start and window-end, and it hasn't run yet, this puts us in some
> kind of chicken-egg situation. Maybe it has to be done inside redisplay.

The code should use `window-start` and `window-end` for that.

There might be some remaining issues with (re)running the
`pre-redisplay-function(s)` when redisplay forces a change in
`window-start` (or in the unlikely case where the highlighting moves the
`window-end` further), but these are things we need to fix anyway.

There are further issues when several windows display the buffer.  =F0=9F=
=99=82

We could also move some of the work to jit-lock, which would have the
advantage that it would additionally be able to skip over (large) chunks
that are marked as `invisible`.


        Stefan





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

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


Received: (at 72830) by debbugs.gnu.org; 27 Aug 2024 19:18:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 15:18:05 2024
Received: from localhost ([127.0.0.1]:47593 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sj1hc-0006DK-SK
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 15:18:05 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43268)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sj1ha-0006Ch-RI
 for 72830 <at> debbugs.gnu.org; Tue, 27 Aug 2024 15:18:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sj1gb-00027Q-OD; Tue, 27 Aug 2024 15:17:01 -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=PceZvgzBfcUs6QPCLfoPwHfRvYBhNqVulurAiVDPtQ4=; b=MvxrWOblAg9j
 HKFYojLSHtjMUCiDTUz655YnShndsrVHHGWbAD9OG3qxndNZibluRYw9bpAoTZm9f2HXEF1W+Y2ow
 MRG5aKYAGl6p7oVbdToslToXXXbl4BRAui4zTTGqAwcW8ZAWxmD+E4gE7nNuJw40PmvIT31fhFh1g
 4edO9KIKBr0g4hyZRwXwskuXdG5YBuEfpuOB43Tx3rxGSZCQDKURFFeXDt2SLAxwBYzzTH3f/RsJC
 hOV9MpcS91BTkowMPsmDodMWYN9zxcEcsb27vP7sf+IpAr9Yxxkvyp+mXaAtwIMhfDzXFFvbokEMd
 aeiAN9Hz3qMX1KUw/a3l2g==;
Date: Tue, 27 Aug 2024 22:16:58 +0300
Message-Id: <86ed69ixn9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: mattias.engdegard@HIDDEN
In-Reply-To: <86h6b5j1sp.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 27
 Aug 2024 20:47:18 +0300)
Subject: Re: bug#72830: Big rectangular selections are slow
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN> <86h6b5j1sp.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: 72830 <at> debbugs.gnu.org, monnier@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 (---)

> Cc: 72830 <at> debbugs.gnu.org, monnier@HIDDEN, juri@HIDDEN
> Date: Tue, 27 Aug 2024 20:47:18 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > But how do we know what the viewport will be in `rectangle--highlight-for-redisplay`? Since it is redisplay that determines window-start and window-end, and it hasn't run yet, this puts us in some kind of chicken-egg situation. Maybe it has to be done inside redisplay.
> 
> It has to be done with the display code, but does not have to be as
> part of redisplay.  We can use functions like vertical-motion,
> window-text-pixel-size, posn-at-point, and other similar APIs, which
> all employ display code that performs layout-related calculations
> without actually displaying anything.

Btw, the horizontal dimensions of the window are known in advance even
without calling the display code, and we could use posn-at-x-y to find
the buffer position that corresponds to the right edge of the window.
Isn't that what's needed to avoid highlighting the portions of text
that are outside of the viewport?




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

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


Received: (at 72830) by debbugs.gnu.org; 27 Aug 2024 19:04:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 15:04:46 2024
Received: from localhost ([127.0.0.1]:47574 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sj1Uk-0005nj-2d
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 15:04:46 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39910)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sj1Ug-0005nS-65
 for 72830 <at> debbugs.gnu.org; Tue, 27 Aug 2024 15:04:44 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sj1Ti-0000mZ-7q; Tue, 27 Aug 2024 15:03:42 -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=7OApEPmV03+qnJt/Da8qeDWOrGt3SYLYh5DJl90EvWo=; b=RrLi9+cKP6CR
 Mf2jtfgefadHf7rvxVkRHS6WKpGqTLZT594wag2ousNMz27mPBvj5iOxJo75ANmgyoC48me3xpZ5Q
 ST+/3YUcrr80qljb10Pi/YssgzOsDMs9QKefYU01knnFI310aUyumMfJBvx0rn6DoT944/lest6J7
 qvOsFRvCpsbb+olIj2TBsp1IQajVOSm6166WlrtXRwjheUL9K65+480AhTWUew8wTejLTXNuk+ttu
 0TuuWL4EcRVydEEugWoXp8b7sAYgKuikupT+wYcqiHuJWYnWSjB7nxZqGnWEv5uic+5t9emVEL7XP
 sOX1AK8lBo6zxtl+dFspMw==;
Date: Tue, 27 Aug 2024 22:03:39 +0300
Message-Id: <86frqpiy9g.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <86cyltx1ti.fsf@HIDDEN> (message from Juri Linkov on
 Tue, 27 Aug 2024 21:23:05 +0300)
Subject: Re: Big rectangular selections are slow
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <86cyltx1ti.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: mattias.engdegard@HIDDEN, 72830 <at> debbugs.gnu.org,
 monnier@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: Stefan Monnier <monnier@HIDDEN>,  Eli Zaretskii
>  <eliz@HIDDEN>,  72830 <at> debbugs.gnu.org
> Date: Tue, 27 Aug 2024 21:23:05 +0300
> 
> >> 27 aug. 2024 kl. 15.48 skrev Eli Zaretskii <eliz@HIDDEN>:
> >>
> > I didn't have time to try, sorry.  Too much stuff on my plate, and
> > still only 24 hours a day, even with Emacs 30...
> 
> For Emacs 30 it's time to increase the default value of hours-per-day to 30.

That'd be backward-incompatible, so we'd need a user option to get
back the old behavior.  And it's too late for new features in Emacs 30
anyway.




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

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


Received: (at 72830) by debbugs.gnu.org; 27 Aug 2024 18:57:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 14:57:01 2024
Received: from localhost ([127.0.0.1]:47569 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sj1NF-0005Xd-51
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 14:57:01 -0400
Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:24548)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1sj1NB-0005XR-17
 for 72830 <at> debbugs.gnu.org; Tue, 27 Aug 2024 14:57:00 -0400
Received: from pps.filterd (m0246632.ppops.net [127.0.0.1])
 by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47RHMUp2009091;
 Tue, 27 Aug 2024 18:56:03 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=
 from:to:cc:subject:date:message-id:references:in-reply-to
 :content-type:content-transfer-encoding:mime-version; s=
 corp-2023-11-20; bh=1CQDXgVfcbaMN1Sm/UtUKftORa/iW45LnKXuqGMpqWU=; b=
 Ih1nYiZ2lbtzqc+7rNnCzU2+IxXH5hcwgk/5LqP3AJNsoxRY3tEE9PheC+HTXwpF
 YXbm3W45MpD4yX993BQj+WxSJ2mCORIrbdLXDc1zxKcxf2/Cbgo/QMPtUwJWldJO
 eLiHVSBn/KFFc23K5ffxW1Cg0KZ1piz4+3G1nUMX0Q7WV+MAhI42GqKT3Bkn0nJo
 gMVa6Hr71sHtCKYIvfMjQaTxfIURbgnwiDmiKtgA5TFa1yKpTfFaJahlRMMmRBJK
 v5ZtrB38ewjLrnyQJJ/4S2ujGTvXO2Wrl9WXBH1f4JMKLoLcO87++eAAy8XfWmrM
 WqP/uj+vVrtSU81YB68hCQ==
Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com
 (iadpaimrmta03.appoci.oracle.com [130.35.103.27])
 by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4177n46der-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Tue, 27 Aug 2024 18:56:03 +0000 (GMT)
Received: from pps.filterd
 (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1])
 by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2)
 with ESMTP id 47RHWdrg036567; Tue, 27 Aug 2024 18:56:02 GMT
Received: from nam10-mw2-obe.outbound.protection.outlook.com
 (mail-mw2nam10lp2046.outbound.protection.outlook.com [104.47.55.46])
 by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id
 4189jjurrh-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Tue, 27 Aug 2024 18:56:02 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FE4nJDYfEf44NChkHRDVYPIUtzIR7aV+iJPVQ5aZ7fhp+ggiJsEvCIiGfpWxSLXnm1hT3sv/XkYkA24t806xFQqTo9NojZFuSthKvMasWJrYO6chZciJPiozGdpBa8ASZYua60alkTdmRRBMTBNeBWUMSolsMMraNwszWeEjTY+dXnO9lRw/W9n6sVql1sqz2oOjnA/Qi4TiZgS3DBraMfKuCr6oDv3dJNp53CLvFQOwNDfzH7e1msOvuHSr3RWN8+u9/a8xdRssjAhBb76OYms37YWfjALSiTowV5IzOtKFRG1oB2YAytMuLdDOR8zGv0zh2Yl9bOykVxlPVBhlsQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1CQDXgVfcbaMN1Sm/UtUKftORa/iW45LnKXuqGMpqWU=;
 b=qVE7el5XI3aSs1zvbVTbxHZ8pB3x9rF4g47raYOK/KdiyyD4DQTZfqXeKYzhzXyH2plNmkC3VeQ2OmjLLb3hWY5bS55QajzHG58rpPToIzhU36biuO1Yqj54AEwevJckdPUY/yZI7scQFHcp9mFNFx1cp8lvjl7qDvvKpYcKEPt3OwFS0yxS7mX1u4Gu5T4rc6a3idoMIaMr+JSs4eREATxRKlIBkMQYMerVj5z7pGjtx377NeXBcfRLCQwlK7J/hNgXz+IopKmmq9BZJf/dh/H6wC5GvXeygfiHskewxB5TnWjX8leI5COaT7OhTrm5M+mHMgrFEMTHTifWDsQ5Zg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com;
 dkim=pass header.d=oracle.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1CQDXgVfcbaMN1Sm/UtUKftORa/iW45LnKXuqGMpqWU=;
 b=c1L9tAPclPEqeMDK56zUoV6Niox0OAOu00flKai4HwpDJGdXgczlU4h+dX5PxHEvQrR4JdNiDOcKzOM3rN2vSpSvlfPt2JeEEqsAWvuHp98c4c0hHqyRBn92gfNUF1Ray0ayk7dCQLYcGn1iZb8/rnGnhxDmX7JV4GtsVkJY0hs=
Received: from DS7PR10MB5232.namprd10.prod.outlook.com (2603:10b6:5:3aa::24)
 by BLAPR10MB4980.namprd10.prod.outlook.com (2603:10b6:208:334::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.17; Tue, 27 Aug
 2024 18:55:59 +0000
Received: from DS7PR10MB5232.namprd10.prod.outlook.com
 ([fe80::8303:658f:14f8:2324]) by DS7PR10MB5232.namprd10.prod.outlook.com
 ([fe80::8303:658f:14f8:2324%5]) with mapi id 15.20.7918.012; Tue, 27 Aug 2024
 18:55:59 +0000
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>, =?iso-8859-1?Q?Mattias_Engdeg=E5rd?=
 <mattias.engdegard@HIDDEN>
Subject: RE: [External] : bug#72830: Big rectangular selections are slow
Thread-Topic: [External] : bug#72830: Big rectangular selections are slow
Thread-Index: AQHa+K70nLtStXmNk0KbZqyUimkZDLI7c/Vw
Date: Tue, 27 Aug 2024 18:55:59 +0000
Message-ID: <DS7PR10MB52325BBC1563AAAC62F2CD5CF3942@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
 <86cyltx1ti.fsf@HIDDEN>
In-Reply-To: <86cyltx1ti.fsf@HIDDEN>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DS7PR10MB5232:EE_|BLAPR10MB4980:EE_
x-ms-office365-filtering-correlation-id: ca8e862d-ebc6-49e4-3c03-08dcc6c9e42a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0; ARA:13230040|376014|366016|1800799024|38070700018;
x-microsoft-antispam-message-info: =?iso-8859-1?Q?Q7baYsy01AYHWjKeT7tzhRUl9ovkPpbF7qi0mkMKj0PkRNSiCVP8DSv5JM?=
 =?iso-8859-1?Q?hjaZ6iHqXL9kXQucdgg1lx8evaDCypFSmzFBmWV7GwUTQSVW2/L/sW5TVE?=
 =?iso-8859-1?Q?jUng31q/zY8ge4/5sSSHedIJCNgA40VFWbMtcsbSw5RM2OS8yQN6PSDtdm?=
 =?iso-8859-1?Q?XfRsF6XRoK5xCwExDj6UDG/qenMADvS1/AJ4uA/yGdvW0Q/Nyn+IE+bV5Z?=
 =?iso-8859-1?Q?TUZGEC//90WxJfYtMyHvIPSZph8Dv+g3wKL7DwYHSQmipuWRLJl6GCiRpQ?=
 =?iso-8859-1?Q?luJ5pmOJ7zlH+RzZCBWDKX/O4GWHntDQ0kpGxruimQTuV7xeluvtJ8qiTf?=
 =?iso-8859-1?Q?WDUtJeWHXiTxZ7KyLsD+hOLy8ejhoQDYORNazXuIp8wHagAYjASC0IZhGs?=
 =?iso-8859-1?Q?OIBfda6wxwENAKjMt8QFJZ3D+TFGb4mKkHeStDbKZW2nN+wq+vn0yVvP6V?=
 =?iso-8859-1?Q?SDZ+ekkquRlQkr4YK0hcFlrEO5KELaNND6ZCQDXbbzzzMVYaXD0C9e7LVW?=
 =?iso-8859-1?Q?1PyNiBCmiKOoYpJ70loGqmvz9FQDq6W9SFyDiUal4weltVCgWuhuUmE/Ki?=
 =?iso-8859-1?Q?y1oriutSQovEMC8/l5psdeFOGs8Xys7OIQNlqSgNUvLOXpv+U0t11PKntc?=
 =?iso-8859-1?Q?UfOS+1IcW5bZR4N19woZKC9KEGJQRwixJ2ZUpjI60E5t7tY/uB3hVpC+wO?=
 =?iso-8859-1?Q?+k7Ngd5pQIKEKXHQnG9sItubzsWlBsjbB1q8e/p/c9WsfFR0O14nKBWBBQ?=
 =?iso-8859-1?Q?UqBLs0AYDz8Zmoam9XoHSGwqOfEgDOzHIJ9kZrEN+8r+h07lC7iK1OFWkG?=
 =?iso-8859-1?Q?pMX+uCcmGjxzyJfrq2kXJAcLgg8/mEWdFM9kw52yODGj1/UWIfsUR9+2ZM?=
 =?iso-8859-1?Q?l3muDkalFQ+DqcaeTWLjHgBjTLxu6InQW6b/LGgWNSB4iQgGyadkUyRd98?=
 =?iso-8859-1?Q?WFH0/8GvDrnrw+xZVyMRUoT5WNYE7+PvOdtNPvI9QC4Eaqk4K0KgDK8A8c?=
 =?iso-8859-1?Q?TAfH2fB9BU19tmC3iC/8bh0sTPQZRgicYJD9UITNeS80/8nbmIIMNxInaY?=
 =?iso-8859-1?Q?B6CjjITdEcz9PTL8VKUNesynvwQH9iPAWckr/IASEi4FHKLWy8ZcGf47Ph?=
 =?iso-8859-1?Q?ot2zWdUyq862uHy49wXrb+47pX9EINrEClnoJeZMvPZKc5Jst9zlk8Qoit?=
 =?iso-8859-1?Q?Li8pqiGR5v+sKTDk/QthASTzWJ5CblCNLnT6qQwzx+U91QazqQZRlSqIit?=
 =?iso-8859-1?Q?54aYfz3tUpzR/7GgfbcONP1JLN2cSLqLoS2ILBhV3ecd3Q5Gb7/X7Gr2rj?=
 =?iso-8859-1?Q?uKblyDih0z5Epyx1eYNmJWWfp1UAi5NndYVRwKcklKzyWVSOak5w9x9iY9?=
 =?iso-8859-1?Q?VYkRnx/JIl5ZdGvvneWmUrFu7cS23NWKGaaCKFyvkpJTrnAavazoLHsDD9?=
 =?iso-8859-1?Q?N8XV4YqIXadJJFbrknUwsmFokdU6OpXvWwFuoA=3D=3D?=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:DS7PR10MB5232.namprd10.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230040)(376014)(366016)(1800799024)(38070700018); DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?OBjsMkxA3MjUcA38CntdnJyUlD3ONb4XV89llpGteQc/MdkMtEWEmVQNpR?=
 =?iso-8859-1?Q?3gDUHcoAhDj2N5sMTDtU2Zw3xF23yzl95jnIG5IkBGXgzIvDe0IQXBn+Zl?=
 =?iso-8859-1?Q?3jH8VXL8zVtiODUfEfOv2gD0chPaEy+kW1MLavwXXSPfF9JWpM5dwQ1LSH?=
 =?iso-8859-1?Q?y3wfWHeic37z/nHMmJvu5HX+SbuwTBEyyttEvBqYh6AmiVAY2Tl2MceEBV?=
 =?iso-8859-1?Q?Vbgyw0U0t/8HpvCpolrTxXEtNr563fLnHKpDqhpQzUUR08+QH6+b9nofcr?=
 =?iso-8859-1?Q?xK0d001rn5Ii5YiUpuEMNf26BFh9xXMvdt7jYaCQy1i2E7Hswco+m52xhB?=
 =?iso-8859-1?Q?3ha56fEmtQwiFGoSwArsg5k8A+gG/BFCA3Rm0UCq0qhrpS8HET6EwfRgGL?=
 =?iso-8859-1?Q?6bG/BsPDBABxFrZvfTqfJTaMOvguWDp894JbTUqgPfXVAwiBVcaeBGtNnX?=
 =?iso-8859-1?Q?igIlEnu3A691Bp+306DKjTKGTIzNu+TtAbO4XSq16TkL5vJNTFfn4TDrNe?=
 =?iso-8859-1?Q?SstgdfvmF6IhkdRz1jUnzuEr5kbtO3cDNYxTJmSTDIkAgolerjcYXyNK/Z?=
 =?iso-8859-1?Q?yDP2WzxdpzfAPTCpptq/hXpMFgOptj792atMH2g7zB29n3AggBij/zaFRx?=
 =?iso-8859-1?Q?ZbeT0vS5L4Xw8yJBSXm6vYnine0+IGzIKkehx1leG64FLT30tFffkGgLCs?=
 =?iso-8859-1?Q?LnOvGby7JakXxmx2vL7VoFdAV8LPDbqIbQXSygQyXF2SwOVFVg077AOnB8?=
 =?iso-8859-1?Q?2zMiVCT+i7dVCWanR8rXKQruvSwGSVoN2U0vP20RmFBFPHpPwfZeiBDXfy?=
 =?iso-8859-1?Q?ysdQsT8qCLqS2PWx8IWxeiWlrDnEMRNHGSu6Pm6nPFVeLDDlcCHelizh6Z?=
 =?iso-8859-1?Q?4GH6hZn2Z8+bj8+PpEtH5eNzuFW+YEUHm+AQz5ER3UmDCC+aMUFDoR/6B8?=
 =?iso-8859-1?Q?wOZ1y6CWGBAHR3asZboZCUk0JteuBzibyPGIKg+UJaEvdwdwevCC5dG3gK?=
 =?iso-8859-1?Q?guqLRm+hqYwKq/lqXXmgI/r738wYIZXl6LYLGhMe81hC7QthhHOitJwGrB?=
 =?iso-8859-1?Q?y85swnjVJY7uDF37RR/JAAs2Y50Rh89tbiLWebrIU7x6rsEi007+Lln0UK?=
 =?iso-8859-1?Q?WNiDcO9k8tmJGNa0uzSMfDk6xykdqx+uGZ5pWRrlNI3S5MO03CWWtLiL0p?=
 =?iso-8859-1?Q?xcoOkXQs3St02qgkMpz32aUt8k4cDScVYjazenOrzZFE0eIApnXc2WLI6X?=
 =?iso-8859-1?Q?JFzBiMfN3uCDBeAqvcFARwrOEr2pXwpeWYiEf+eglnx73bO8zE3eoFuxy+?=
 =?iso-8859-1?Q?CxHlVCOQ3/yo2YFUE+KZP8Perq2H4BoP4Hk71WiyIsJ8gaArAzJKEs/hjQ?=
 =?iso-8859-1?Q?thV0KLyO5fNAtsQTvx0uEyNVaN7lfFssxR2XF4JZ1MugFHdsXQg5QT63za?=
 =?iso-8859-1?Q?2L1LeEnpYA6Ox4V2d9paVq2PQO+c3iS2txA7JruygOJTrKMNiE/dujNz6F?=
 =?iso-8859-1?Q?5nQGjnxUtNhq58nZSMa5Vf+h70jbc58efsakHRbXrl4A5UR9asS8f3Zv8c?=
 =?iso-8859-1?Q?cdxvvvdChv8VMJAaFKBiyj4FRaVDzcWNz4G8A7d6lqd8Qtr4cIVwPk62j4?=
 =?iso-8859-1?Q?qEmpx7EODP3+LD4kdAtBkV5avA7vSg/EmO?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Vv5DkMC+30VMbES142IzcTuNbrNePJ86a7asRC5XsMQkByLLGifW9BI9dLz8TtfNJWKg7/e/WwKxP/QdWGuWpLl+yW4wnI0LdtZPzPsbsfy1iSMkgjmUUnWEgucVqht1mIYwYiCmX7NVh2KLMmKgfr+hOR3C6HAYKMN/ZY9IG3A2YiRuJZaiW6V03GzyzQIdp8EAyyOVfXU0KqPm7+Vs9E+8gFjCZFysKfOsL0My63Sa7xjRVaGt7b5sirlnrxBx6YEwlfC7sSMCZwbiKmVyQCo3tEkGPJ+Ta8+WUL7AuMQFiaNh3uN7+K1cIzdY1o7Iz3z1wBGT+zIoO2P1Lq34t7Wm/jMHGDeRF903hb7MwOrknFYelhPCZn+Q+xCvv5fIIo+75Jv4KIFbhXJvhRM0E8PoLvt6ZjdXilXsEUYOZwMyboJlnE2OXmVQSXqImuTfZrkISP338wsC+52jsc7jDH8t/8gLa8o4oxPnK3X2SdW8ZTelbOgvs8Di0xrjM+uAkaRNuz+7rkPacr6M+L6Jl4pfUFaMlVdTFYK9xCk6/Pbn2UKYfhOSNY+aOh5xxq6Szi0E58SkrxJnDTpTspUbg0ym1ke+l9qTHExs/r9+VqU=
X-OriginatorOrg: oracle.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5232.namprd10.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ca8e862d-ebc6-49e4-3c03-08dcc6c9e42a
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Aug 2024 18:55:59.8009 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: O4OdXOEB8VllzKuGA8X8Mo/Uzc7bBgEh2hmjMfyMeKS14CN22Ciqxma5WgxCGdt/lIiUs8BO4m3SvFWjt9asdg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4980
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-27_10,2024-08-27_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 mlxscore=0 suspectscore=0
 phishscore=0 malwarescore=0 bulkscore=0 mlxlogscore=743 adultscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000
 definitions=main-2408270141
X-Proofpoint-GUID: l2j_R32zb6Ffb7e6vv_HXHJT1TA0lINY
X-Proofpoint-ORIG-GUID: l2j_R32zb6Ffb7e6vv_HXHJT1TA0lINY
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 72830
Cc: Eli Zaretskii <eliz@HIDDEN>,
 "72830 <at> debbugs.gnu.org" <72830 <at> debbugs.gnu.org>,
 Stefan Monnier <monnier@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 (-)

> For Emacs 30 it's time to increase the default value of hours-per-day to =
30.

+1.





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

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


Received: (at 72830) by debbugs.gnu.org; 27 Aug 2024 18:28:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 14:28:59 2024
Received: from localhost ([127.0.0.1]:47553 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sj0w6-0004mV-Uo
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 14:28:59 -0400
Received: from relay6-d.mail.gandi.net ([217.70.183.198]:48961)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sj0w4-0004mE-0t
 for 72830 <at> debbugs.gnu.org; Tue, 27 Aug 2024 14:28:57 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id D967CC0002;
 Tue, 27 Aug 2024 18:27:52 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: Big rectangular selections are slow
In-Reply-To: <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN> ("Mattias
 =?iso-8859-1?Q?Engdeg=E5rd=22's?= message of "Tue, 27 Aug 2024 18:42:19
 +0200")
Organization: LINKOV.NET
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
Date: Tue, 27 Aug 2024 21:23:05 +0300
Message-ID: <86cyltx1ti.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 72830
Cc: Eli Zaretskii <eliz@HIDDEN>, 72830 <at> debbugs.gnu.org,
 Stefan Monnier <monnier@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 (-)

>> 27 aug. 2024 kl. 15.48 skrev Eli Zaretskii <eliz@HIDDEN>:
>>
>> > Does turning off auto-composition-mode help in any way?
>>
>> I don't think so. Were you able to reproduce the problem?
>
> I didn't have time to try, sorry.  Too much stuff on my plate, and
> still only 24 hours a day, even with Emacs 30...

For Emacs 30 it's time to increase the default value of hours-per-day to 30.

>> 27 aug. 2024 kl. 16.04 skrev Stefan Monnier <monnier@HIDDEN>:
>>
>> More promising to me would be to try and skip any part of the buffer
>> that's not displayed.
>
> Yes, I see no reason for having the highlight overlay on something that can't be seen.
>
> But how do we know what the viewport will be in
> `rectangle--highlight-for-redisplay`? Since it is redisplay that determines
> window-start and window-end, and it hasn't run yet, this puts us in some
> kind of chicken-egg situation. Maybe it has to be done inside redisplay.

I'm sure it should be possible to use `pre-redisplay-functions'
that by default updates region highlighting, and I was able to use it
to make region highlighting window-local even when the same buffer
is displayed in separate windows.




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

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


Received: (at 72830) by debbugs.gnu.org; 27 Aug 2024 17:50:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 13:50:33 2024
Received: from localhost ([127.0.0.1]:47528 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sj0Kv-0003mw-AO
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 13:50:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33356)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sj0Ks-0003me-Hk
 for 72830 <at> debbugs.gnu.org; Tue, 27 Aug 2024 13:50:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sj0Ho-0000Yd-Q3; Tue, 27 Aug 2024 13:47:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=/O0ohOXxVwFFuy6lPx+QstpR7184ssttA890RVOtZe0=; b=ZfXMKUnU+xaPLycUg161
 H1uK9tLQHwSA70ejB2f0FYO07z1/dRiv/CcExg04MwJPqFSCEsMcOXqX9q5+mRn7U5+z/SyvIeoDZ
 nwefPVeW2NVPver28jhcy24FavI7a3snjW9R5QlibN4EkZtMeZYtqdhYkrRRT2AdP8Bx97ITeMqYa
 Yc662jSfJUlluQcNqX7fAeYZtxWH+tjrP0FuyrxeZbSc4O3KwCyOBGC1YBPqZ46T8dLijgq5PL1pi
 WgUHmyzvyNupWK2d+8/BDSBaLph253FxptycnWNTcalmCIi9kJLUyq0hvYH9ERh8y8Wx+ChSfjWH6
 PN/EvzK2KtYNjA==;
Date: Tue, 27 Aug 2024 20:47:18 +0300
Message-Id: <86h6b5j1sp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN> (message from
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Tue, 27 Aug 2024 18:42:19 +0200)
Subject: Re: bug#72830: Big rectangular selections are slow
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
 <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: 72830 <at> debbugs.gnu.org, monnier@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 (---)

> From: Mattias Engdegård <mattias.engdegard@HIDDEN>
> Date: Tue, 27 Aug 2024 18:42:19 +0200
> Cc: Emacs Bug Report <bug-gnu-emacs@HIDDEN>,
>  Juri Linkov <juri@HIDDEN>
> 
> 27 aug. 2024 kl. 15.48 skrev Eli Zaretskii <eliz@HIDDEN>:
> 
> > Does turning off auto-composition-mode help in any way?
> 
> I don't think so. Were you able to reproduce the problem?

I didn't have time to try, sorry.  Too much stuff on my plate, and
still only 24 hours a day, even with Emacs 30...

> Yes, I see no reason for having the highlight overlay on something that can't be seen. 
> 
> But how do we know what the viewport will be in `rectangle--highlight-for-redisplay`? Since it is redisplay that determines window-start and window-end, and it hasn't run yet, this puts us in some kind of chicken-egg situation. Maybe it has to be done inside redisplay.

It has to be done with the display code, but does not have to be as
part of redisplay.  We can use functions like vertical-motion,
window-text-pixel-size, posn-at-point, and other similar APIs, which
all employ display code that performs layout-related calculations
without actually displaying anything.




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

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


Received: (at submit) by debbugs.gnu.org; 27 Aug 2024 16:43:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 12:43:32 2024
Received: from localhost ([127.0.0.1]:47504 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sizI4-0001wv-4D
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 12:43:32 -0400
Received: from lists.gnu.org ([209.51.188.17]:50866)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1sizI1-0001wj-5t
 for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 12:43:30 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mattias.engdegard@HIDDEN>)
 id 1sizHA-0001oQ-3V
 for bug-gnu-emacs@HIDDEN; Tue, 27 Aug 2024 12:42:36 -0400
Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <mattias.engdegard@HIDDEN>)
 id 1sizH2-0002XX-PR; Tue, 27 Aug 2024 12:42:35 -0400
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-533521cd1c3so6598034e87.1; 
 Tue, 27 Aug 2024 09:42:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1724776941; x=1725381741; darn=gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=FfEcJlEidGBYK7lnaV8I5ea0VtoZ/4ye1QZkIt0FfWI=;
 b=XFdj9+B4u9L1lTiCquUWbrET0G6Is2iD12We+euAXtXOHsiF6NLXiZ+o33PtD21oxc
 cuTK1tfveQzpUVoS46VoiDpGqjGp+rCWd15B9dzx1Q+A8FtijpmZAZ1RcCRlJ6RVis9b
 9sHQkqYcRaNfplznsI9DXM9eR45YY6OAHieOkFK1s8cjjFFdk+zsPh0IdL24joTZvhLM
 DHOtyorqP5+3UztjwyJMFS5GeJWQldJDQ48hGI/x14/jJMMFH0UMQRl9sw5Z9egTmKHP
 cKag4BumsuDmHMybFITWn4joPOZSXNNV3V1kJ4/kWsb7s0IPhS7R4+1z5J6qVRTiMXrL
 mf+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1724776941; x=1725381741;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=FfEcJlEidGBYK7lnaV8I5ea0VtoZ/4ye1QZkIt0FfWI=;
 b=HFTPnOgMUyY4zWmiVdnYN1yge1ZjkUV2dcZkOPFzNCfoiPBYPtkuNuh29f2g/3w5Tu
 qvIMq042Y2hs4IZ91Q7k/eGqC7NAr9slqjQbNGNuN8Pbp3FVOVT/WFwY9+qR88e3lH6B
 oIz6328/AavVgI7U6VPdgoQHjVTH/SuSQrnvgY0rOYPBtddEoB94FsedADGw046BPm6U
 8Lk6T+G2VnfRTAkWYs2k3Kcia7utsMjcmHYu+Zik2KAO/miMlWi4dNTMT7DiYRFMIPtL
 STIyeDF/Y73nLOTW7n1rAGLqVst5Zg1vpU2CJzYfdjOfC1083sN/DdVRiZtchpkRcmOO
 yABQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCU4/vIZaSa9rN/wGxuzYG4lNBbFATPLvJa/G6QWynUV8oIOKKFpIWwTbOhK54XPDDKynfe6@HIDDEN
X-Gm-Message-State: AOJu0YzZXoDlVlwa3HweaGXb8uAy65N/raKi5IH6U8BBBso7EaJSY3OB
 T0QIKNlXsMnv7Gcucve6M5MN//siAoattFipi8prrnT064o8LWHe
X-Google-Smtp-Source: AGHT+IEOknnzd2n3piNy1ee+7dTkWL8pQhYGouRMGX6Kk278xp5LT7+mux7KYmaZAA7Ka/6GTvFuQQ==
X-Received: by 2002:a05:6512:23a9:b0:530:da96:a990 with SMTP id
 2adb3069b0e04-53438851000mr11189577e87.32.1724776940308; 
 Tue, 27 Aug 2024 09:42:20 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334ea89415sm1850976e87.285.2024.08.27.09.42.19
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 27 Aug 2024 09:42:19 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: Big rectangular selections are slow
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
Date: Tue, 27 Aug 2024 18:42:19 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <B5EE97B2-A650-4B86-8481-11BE5D1C193A@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
 <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
Received-SPF: pass client-ip=2a00:1450:4864:20::12a;
 envelope-from=mattias.engdegard@HIDDEN; helo=mail-lf1-x12a.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Emacs Bug Report <bug-gnu-emacs@HIDDEN>, 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: -2.3 (--)

27 aug. 2024 kl. 15.48 skrev Eli Zaretskii <eliz@HIDDEN>:

> Does turning off auto-composition-mode help in any way?

I don't think so. Were you able to reproduce the problem?

> Also, since highlighting is AFAIR implemented as overlays, it slows
> down check_display_width, which I think would otherwise have moved
> very fast if you say there are no properties and no overlays.

Yes, overlays indeed seem to be at the heart of the problem.


27 aug. 2024 kl. 16.04 skrev Stefan Monnier <monnier@HIDDEN>:

>> - Slow `region-beginning` and `region-end`.
>>  Fixed on master (3a8222e7).
>=20
> Seems unlikely.

It did show up on the profile, something had to be done. Before that =
change, (region-beginning) with the active region as in the example took =
0.96 s on this machine. Now, maybe 30 =C2=B5s.

>> - `select-active-regions` makes each selection change very expensive.
>>  Can be set to nil by the user, but I really suggest that we change =
the
>> default to nil, at least for non-X11 since the default assumes =
old-school
>> X11 PRIMARY selection which is alien on most other platforms.
>=20
> Didn't think of that.  Do we re-set the PRIMARY every time the =
(active)
> rectangular region is changed (i.e. after each key press)?  That would
> make it non-scalable to large rectangular regions, indeed.

It's pretty bonkers, yes. There is even a noticeable slow-down with a =
single contiguous selection.
Fortunately the cure is easy.

> I thought the extraction of the region's content to put it into =
PRIMARY
> and friends happened more lazily (e.g. when another application
> requests the PRIMARY/CLIPBOARD, or when we deactivate the region).

That would indeed have made some kind of sense. If confined to X11, that =
is. And opt-in, even then.

> I don't think we want to try and optimize the operations here because
> that will only push the limit of what is "too large" a bit further.

Yes, but it is educational to see what the costs are

> More promising to me would be to try and skip any part of the buffer
> that's not displayed.

Yes, I see no reason for having the highlight overlay on something that =
can't be seen.=20

But how do we know what the viewport will be in =
`rectangle--highlight-for-redisplay`? Since it is redisplay that =
determines window-start and window-end, and it hasn't run yet, this puts =
us in some kind of chicken-egg situation. Maybe it has to be done inside =
redisplay.





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

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


Received: (at submit) by debbugs.gnu.org; 27 Aug 2024 14:05:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 10:05:46 2024
Received: from localhost ([127.0.0.1]:47120 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1siwpO-0005bB-14
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 10:05:46 -0400
Received: from lists.gnu.org ([209.51.188.17]:48114)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1siwpL-0005b0-9d
 for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 10:05:44 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1siwoU-00032d-7p
 for bug-gnu-emacs@HIDDEN; Tue, 27 Aug 2024 10:04:50 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1siwoS-0001oK-5o
 for bug-gnu-emacs@HIDDEN; Tue, 27 Aug 2024 10:04:49 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F1D798092C;
 Tue, 27 Aug 2024 10:04:44 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1724767483;
 bh=LQfkUl5toINZ2njK5OZyvU50TMfWbsfUqWnDgETxyIo=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=f0sJ23xYFeg4VChXJC6bpcnTuIsEOj1S62T3V2XzinFHr5UCkrwYhaJANh3YNLhum
 uaz9Ap3+hFnP+gfWSypKAVyemj9LJMtVLnL79+r3WZmQt6ritAdMCbOvFlOvWwByTc
 WA1KM8p8vmLvie4BI/4b9hiX73foMvXj62GXrFRN8R7dsQkbUYGVo5ri0ocj54AIxd
 A60Jy/1aEZsx+nFG0CceGa7jIrq6q/9Ki6fB3nAMUBIrQDJtpqBlZRataFaDtgkr6a
 ByEKdJzZuhehwSc2OKCsACASmSjMl2xQj7iHy/+rYVesFVoWh+YujKBa4+86y6yTXs
 i/FMNpptqARQQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3537B80672;
 Tue, 27 Aug 2024 10:04:43 -0400 (EDT)
Received: from pastel (unknown [216.154.9.87])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id F2E33120211;
 Tue, 27 Aug 2024 10:04:42 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: Big rectangular selections are slow
In-Reply-To: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN> ("Mattias
 =?windows-1252?Q?Engdeg=E5rd=22's?= message of "Tue, 27 Aug 2024 14:39:37
 +0200")
Message-ID: <jwvzfoyvzp7.fsf-monnier+emacs@HIDDEN>
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
Date: Tue, 27 Aug 2024 10:04:40 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.155 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
Received-SPF: pass client-ip=132.204.25.50;
 envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Emacs Bug Report <bug-gnu-emacs@HIDDEN>, 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: -2.3 (--)

> Selecting rectangles that stretch across many lines is very slow.

Yup.

> - Slow `region-beginning` and `region-end`.
>   Fixed on master (3a8222e7).

Seems unlikely.

> - `select-active-regions` makes each selection change very expensive.
>   Can be set to nil by the user, but I really suggest that we change the
> default to nil, at least for non-X11 since the default assumes old-school
> X11 PRIMARY selection which is alien on most other platforms.

Didn't think of that.  Do we re-set the PRIMARY every time the (active)
rectangular region is changed (i.e. after each key press)?  That would
make it non-scalable to large rectangular regions, indeed.

I thought the extraction of the region's content to put it into PRIMARY
and friends happened more lazily (e.g. when another application
requests the PRIMARY/CLIPBOARD, or when we deactivate the region).

> - Slow `rectangle--highlight-for-redisplay`.  This is the remaining cause.

This is the one I'm aware of.

> Profiling shows that most of the time is spent in the function passed
> to `apply-on-rectangle`.  Here is an excerpt of that profile:
>
> |        Weight         Self
> |  31.93 Gc   57.4%   103.06 Mc   Fmove_to_column
> |  31.52 Gc   56.7%   884.80 Mc     scan_for_column
> |  14.45 Gc   26.0%    27.82 Mc       check_display_width
> |  14.30 Gc   25.7%   648.23 Mc         get_char_property_and_overlay
> |   9.79 Gc   17.6%     1.07 Gc           itree_iterator_next
> |   2.00 Gc    3.6%    42.68 Mc           Fget_text_property
> | 743.88 Mc    1.3%   154.63 Mc           itree_iterator_start
> | 678.00 Mc    1.2%   183.02 Mc           lookup_char_property
> |   7.28 Gc   13.0%   155.15 Mc       skip_invisible
> |   4.22 Gc    7.6%   701.27 Mc       composition_compute_stop_pos
> |   3.00 Gc    5.3%   153.86 Mc       window_loop
> |   1.28 Gc    2.3%   216.97 Mc       find_newline
> |   2.28 Gc    4.1%    80.59 Mc   Fmove_overlay
> |   1.46 Gc    2.6%    40.18 Mc   lookup_char_property

I don't think we want to try and optimize the operations here because
that will only push the limit of what is "too large" a bit further.

More promising to me would be to try and skip any part of the buffer
that's not displayed.


        Stefan





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

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


Received: (at 72830) by debbugs.gnu.org; 27 Aug 2024 13:50:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 09:50:05 2024
Received: from localhost ([127.0.0.1]:46268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1siwaD-0004v0-BU
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 09:50:05 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35280)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1siwaA-0004uP-TF
 for 72830 <at> debbugs.gnu.org; Tue, 27 Aug 2024 09:50:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1siwZD-0008Sx-Ek; Tue, 27 Aug 2024 09:49:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=wtKowULz7owteNfyu+pZJnvS89QAIIwKPYUUAxQhHd0=; b=WC0vhHCIOVam6GquqnSD
 G9h3ACLjGipm/BngFoNsHRtbOOZ6aNrrVFtiQGPNumfbOHPhI72N9zgilxlQiqEKp2U21nnZSn9Qo
 YW1MdktMyYCImFVhQtq3BZdD4bmqwGpE/NT7nGoU1MjfUV10IRYlzt9Qs9huR8WKLFciQSI7VZREw
 4HsxCO30WCRRofm2hXS7uqHuczq2ACT8DsG0JcuFsdy5xI/Q/xwjjqO9YtWWnq5+07Nzk+G1gMwpG
 MOn5sJ+j2GanGKy2EIeXGRnXg+9R6MvxzxyBgalrBYggeNPy/zl0i9n/4v3+PCj3qSrzCiK7bfE8Q
 Y+jk+Oh+hC/3eA==;
Date: Tue, 27 Aug 2024 16:48:54 +0300
Message-Id: <86o75ehy9l.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN> (message from
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Tue, 27 Aug 2024 14:39:37 +0200)
Subject: Re: bug#72830: Big rectangular selections are slow
References: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72830
Cc: 72830 <at> debbugs.gnu.org, monnier@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 (---)

> Cc: Stefan Monnier <monnier@HIDDEN>, Juri Linkov <juri@HIDDEN>
> From: Mattias Engdegård <mattias.engdegard@HIDDEN>
> Date: Tue, 27 Aug 2024 14:39:37 +0200
> 
> It's a bit surprising (to me) how expensive move-to-column is. The text is all-ASCII without any complications (no long lines, properties, etc).

Does turning off auto-composition-mode help in any way?

Also, since highlighting is AFAIR implemented as overlays, it slows
down check_display_width, which I think would otherwise have moved
very fast if you say there are no properties and no overlays.




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

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


Received: (at submit) by debbugs.gnu.org; 27 Aug 2024 12:40:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 27 08:40:38 2024
Received: from localhost ([127.0.0.1]:46222 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sivUz-0002C7-VJ
	for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 08:40:38 -0400
Received: from lists.gnu.org ([209.51.188.17]:38692)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1sivUy-0002Bx-9B
 for submit <at> debbugs.gnu.org; Tue, 27 Aug 2024 08:40:36 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mattias.engdegard@HIDDEN>)
 id 1sivU6-0002pE-Fn
 for bug-gnu-emacs@HIDDEN; Tue, 27 Aug 2024 08:39:43 -0400
Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <mattias.engdegard@HIDDEN>)
 id 1sivU4-0000EL-S2
 for bug-gnu-emacs@HIDDEN; Tue, 27 Aug 2024 08:39:42 -0400
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-533488ffaddso6629058e87.1
 for <bug-gnu-emacs@HIDDEN>; Tue, 27 Aug 2024 05:39:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1724762379; x=1725367179; darn=gnu.org;
 h=to:cc:date:message-id:subject:mime-version
 :content-transfer-encoding:from:sender:from:to:cc:subject:date
 :message-id:reply-to;
 bh=YUh0ar81SG/vJl9RtP2LtcSvj1cMOCxz54RtWRpRbAQ=;
 b=ZVplJqoAy4MkIHKKXSaj1T9YYXnspXyjQTaVmItBk2iFcd/GaaqoZk2zvLw9QwPnz3
 NytLeVWDrAGNch4cDAPlurnvFmMebG9ewMcPcxsyyrqP3yQt//7NhZRLvhHA6cLEwu/5
 v1qpVgfwa3Ejsvoa3GDx3m8UzCqI+MYmazQtlfz/wgtkf55mBJRwzzaZKJiyKpFAoEc4
 1Us2x2jRmg376EeaPh1LIYd7k//4JudHkyirBZJdcWZHww9OsjJB5MqGXz970SI2ooMl
 6abMIZAQyr1S0EprseKvw3dSHCYEPQaVOrYMHAOsJ+Nu5zx16ojG74EF0BQXXZChAg0f
 qh3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1724762379; x=1725367179;
 h=to:cc:date:message-id:subject:mime-version
 :content-transfer-encoding:from:sender:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=YUh0ar81SG/vJl9RtP2LtcSvj1cMOCxz54RtWRpRbAQ=;
 b=vY/EpiDtUNQ7fmKDrW4bWb7PQRYnuUgHgcjcwQDm1TN3eTT/2qJ3Iqs7EBFANUGldr
 QFM0abw3bN49LFaosfXm4h4pUKRRBSVchkznnJ246NieQh3HggEog/F0h/aKJZJQgkAy
 l5aQSYkWBIygAfbBdjGDouwC98COhT4dXagr1x4hgJRaEugzI87mGlkBYv0eYhYQ9und
 9cX3IgoqMkm4chJGTBhlIcj6OeG1PQv19YZsKC0w3p7qYimZuPZtVyen0mKRwH9dv2sW
 lRIqguG+6BDalaOOU60hGPpx+1J2yo2rIrWFDKWmGjFjJc97TRYG0QLIv4JunQP9cC/P
 k3aw==
X-Gm-Message-State: AOJu0YxW8f0ieHBVOHbU08WAivXiGkTM4FnWZM9IE5FpjLlo2p0Folfp
 gs1pwnv0fCGhDMmRsvCIIFakfkoqRia4KzOvDA9p3mo2t3hX12cUNxL6Hg==
X-Google-Smtp-Source: AGHT+IF3AnOlxWHGG3d39U/OqHO5lOcLMlhW7QNLnE/1Zm0CmYrmjbTblM5vH9fFpsIHRlY/rKXVUg==
X-Received: by 2002:a05:6512:ba4:b0:530:ae22:a6f0 with SMTP id
 2adb3069b0e04-53438762c97mr8511055e87.5.1724762378698; 
 Tue, 27 Aug 2024 05:39:38 -0700 (PDT)
Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se.
 [188.150.191.82]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334ea8b8a7sm1776851e87.303.2024.08.27.05.39.38
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 27 Aug 2024 05:39:38 -0700 (PDT)
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Big rectangular selections are slow
Message-Id: <AAC45D97-2341-4A9C-90E9-60F3A8BA7F32@HIDDEN>
Date: Tue, 27 Aug 2024 14:39:37 +0200
To: Emacs Bug Report <bug-gnu-emacs@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
Received-SPF: pass client-ip=2a00:1450:4864:20::133;
 envelope-from=mattias.engdegard@HIDDEN; helo=mail-lf1-x133.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Stefan Monnier <monnier@HIDDEN>, 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: -2.3 (--)

Selecting rectangles that stretch across many lines is very slow. =
Recipe:

  C-x b example RET
  C-u 60 x C-u 200000 M-x duplicate-dwim RET C-a
  C-x SPC
  M-> C-f C-f C-f C-f

Each keystroke at the end lags noticeably, to the point that this isn't =
practical.

Why this matters: rectangular selections are very useful for editing =
large amount of data in a homogeneous way, and such a file (12 MB) isn't =
huge.

Possible causes:

- Slow `region-beginning` and `region-end`.
  Fixed on master (3a8222e7).

- `select-active-regions` makes each selection change very expensive.
  Can be set to nil by the user, but I really suggest that we change the =
default to nil, at least for non-X11 since the default assumes =
old-school X11 PRIMARY selection which is alien on most other platforms.

- Slow `rectangle--highlight-for-redisplay`. This is the remaining =
cause.
Profiling shows that most of the time is spent in the function passed to =
`apply-on-rectangle`.
Here is an excerpt of that profile:

|        Weight         Self
|  31.93 Gc   57.4%   103.06 Mc   Fmove_to_column
|  31.52 Gc   56.7%   884.80 Mc     scan_for_column
|  14.45 Gc   26.0%    27.82 Mc       check_display_width
|  14.30 Gc   25.7%   648.23 Mc         get_char_property_and_overlay
|   9.79 Gc   17.6%     1.07 Gc           itree_iterator_next
|   2.00 Gc    3.6%    42.68 Mc           Fget_text_property
| 743.88 Mc    1.3%   154.63 Mc           itree_iterator_start
| 678.00 Mc    1.2%   183.02 Mc           lookup_char_property
|   7.28 Gc   13.0%   155.15 Mc       skip_invisible
|   4.22 Gc    7.6%   701.27 Mc       composition_compute_stop_pos
|   3.00 Gc    5.3%   153.86 Mc       window_loop
|   1.28 Gc    2.3%   216.97 Mc       find_newline
|   2.28 Gc    4.1%    80.59 Mc   Fmove_overlay
|   1.46 Gc    2.6%    40.18 Mc   lookup_char_property

This excludes GC costs (about 18 % I think), which in turn is dominated =
by scanning overlays.

It's a bit surprising (to me) how expensive move-to-column is. The text =
is all-ASCII without any complications (no long lines, properties, etc).





Acknowledgement sent to Mattias Engdegård <mattias.engdegard@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#72830; 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: Sun, 12 Jan 2025 05:45:02 UTC

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