GNU bug report logs - #57367
[PATCH] Speed up em-smart

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: Morgan Smith <Morgan.J.Smith@HIDDEN>; Keywords: moreinfo patch; dated Tue, 23 Aug 2022 20:07:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 57367) by debbugs.gnu.org; 7 Sep 2022 12:55:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 08:55:30 2022
Received: from localhost ([127.0.0.1]:53959 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVuaY-0002mW-J0
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 08:55:30 -0400
Received: from quimby.gnus.org ([95.216.78.240]:41670)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oVuaX-0002mK-0j
 for 57367 <at> debbugs.gnu.org; Wed, 07 Sep 2022 08:55:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=NK21coRrEzEeLNXIfp2OQJCCvHzrmkKuqKVfOJUKLxU=; b=GeXeN6NDfrTwaXcfc5zVZYRZPA
 TJqoTNV4r1/rKyni/Zqhjlkf4DO23NjDFYo2dmeByR6OKOrdepk/9cZ+vjfLhgzngX/+KiKz8pine
 dFf6WqkYU6uohWOJh+64LMXr3xVW6bCPRuuITrxpAJ1aM2zbNT4S4WRV4dPaji33JDV8=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oVuaN-0006vV-S5; Wed, 07 Sep 2022 14:55:23 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Morgan Smith <Morgan.J.Smith@HIDDEN>
Subject: Re: bug#57367: [PATCH V2] Speed up em-smart
In-Reply-To: <DM5PR03MB3163B313390CF7E1B6286E26C5419@HIDDEN>
 (Morgan Smith's message of "Tue, 06 Sep 2022 21:30:18 -0400")
References: <DM5PR03MB3163A3A177E905B852BC9F1CC5709@HIDDEN>
 <87r10q6byc.fsf@HIDDEN>
 <9257e0e5-232e-7e20-f4d1-385066c4337e@HIDDEN>
 <DM5PR03MB31639EE4FB0B119C2704444CC57F9@HIDDEN>
 <87bkrtxzfj.fsf@HIDDEN>
 <DM5PR03MB31639CBC75F62622AC4E70ABC57E9@HIDDEN>
 <87ilm0x1ol.fsf@HIDDEN>
 <DM5PR03MB3163B313390CF7E1B6286E26C5419@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACVBMVEWhlEBJRSr////o
 CFXIAAAAAWJLR0QCZgt8ZAAAAAlwSFlzAAABLAAAASwAc4jpUgAAAAd0SU1FB+YJBhYCMCj24n4A
 AADgSURBVCjPdZLRCgQhCEUVxneD/J+CejfI//+VtWxmdx9GmMHDvZlKAO+BdqKcXG/4U9AUqDEt
 oF+F0r/tR3kFfAXg0Ut5musi30Yzj6/CYz4CjJ7KA/XqkWxI0h+lpbTu4OXFBmukAL4AJwNyO6Db
 vsA/5QMrSI/trvoDDNz4htZS1kgzSascgF0HVw24xGQ03b1zrdV6juGv7OvIqe4Ta0E6B22lqBjV
 HqWzFDSxPQNQ8Q3aPNvz7Yhp1XONhwSg22xaiQ6WQoanUS8gdmz+p/UaQvBbux+7h55kou9v6gPB
 V0n+mfEx0AAAAFplWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAAB
 AAAAUgEoAAMAAAABAAEAAAITAAMAAAABAAEAAAAAAAAAAAEsAAAAAQAAASwAAAABYCqauwAAACV0
 RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wOS0wNlQyMjowMjo0NyswMDowMGs0yuQAAAAldEVYdGRhdGU6
 bW9kaWZ5ADIwMjItMDktMDZUMjI6MDI6NDcrMDA6MDAaaXJYAAAAF3RFWHRleGlmOllDYkNyUG9z
 aXRpb25pbmcAMawPgGMAAAAASUVORK5CYII=
X-Now-Playing: Ash Walker - =?utf-8?B?4oCYVGhlcmXigJlz?= Nothing Like
 =?utf-8?Q?This=E2=80=99?= (Exclusive track)'s
 _Late Night Tales: Version Excursions (Selected By Don Letts)_:
 "Originally recorded by Omar "
Date: Wed, 07 Sep 2022 14:55:19 +0200
Message-ID: <87r10nmjig.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Morgan Smith <Morgan.J.Smith@HIDDEN> writes: > I've
 attached
 my patch V2. > > This restores some more of the original logic that I have
 now realized > was indeed necessary. Again, this patch should not actually
 change > anything with respect to [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57367
Cc: Jim Porter <jporterbugs@HIDDEN>, 57367 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Morgan Smith <Morgan.J.Smith@HIDDEN> writes:

> I've attached my patch V2.
>
> This restores some more of the original logic that I have now realized
> was indeed necessary.  Again, this patch should not actually change
> anything with respect to program logic, flow, or user experience.  In my
> limited testing, it seems to act just as it did before (but
> significantly more performant).

It think that makes sense...  Jim, any comments?




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

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


Received: (at 57367) by debbugs.gnu.org; 7 Sep 2022 01:30:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 06 21:30:37 2022
Received: from localhost ([127.0.0.1]:53000 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVjtl-0005zt-5T
	for submit <at> debbugs.gnu.org; Tue, 06 Sep 2022 21:30:37 -0400
Received: from mail-dm6nam12olkn2082.outbound.protection.outlook.com
 ([40.92.22.82]:40059 helo=NAM12-DM6-obe.outbound.protection.outlook.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Morgan.J.Smith@HIDDEN>) id 1oVjth-0005ze-IX
 for 57367 <at> debbugs.gnu.org; Tue, 06 Sep 2022 21:30:36 -0400
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=S35zoZVQMrz99JEiEE1Srvh1O28hRhBMxSbafNyEKpmMoCZCaBF64/l/o3VZyKofLYPn0q0S5aS9oFbYG74EIE/+XklFEn6FcCj89h21TNKiWlwLmvjRP7dwupkGnmMbnRiGBnObmAp2nYwY68moo20DIaHuLuXI8/kpvCf4Lfh6nZN+z9iQYRxV1rZeqUqZVz2cnpfuaKeyILtjpyluWG7/vozV4LMDLrrt5obcbZKDq8m3SsSolRdHC3dJ72M8tV83TnApw97tJLE82dS6NOpghn1GCnl57rGXvh7N7F1FrF92i0mTCtmA9tTE05dfU8u2AMdDHz50inmUQBF4tA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 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=CBrVBydl/1hCsTWvRjBXDmvzGsL3pmfOzY9gAdockW4=;
 b=G2Vk4H+RtoFx8yST0HOAI4oTT5fU8nXlsT5+OEg3H/TbfgLvFP6su0l2tc4g3gRz97Wg6DZ3QFfxNVpbBLCbEUVZV9xQdiz0SYVzgRVwj1Hxen0JMIgXYZLMpR6jEBu3IQApFDfSY2XIhaQp13ANWGmfGDW0/lJAoDKT21qkx5XCt5EwSi4XYklnKKM7bouCDg3a7X1s19kn9XnPf0iY4GmDp+pGHyud3NflMZ7u+BlFBeIVwtwiey3lCnWwHe6t67s8HDfhoRQNF3uTLCMW73ytAgxsluGiy1SNPjhJnd2qgpgHGPlPMRa3Jx6wCw2R+q8HQKzfCZFKNP6XNPsnyA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CBrVBydl/1hCsTWvRjBXDmvzGsL3pmfOzY9gAdockW4=;
 b=CNRy3fYhc9eswC3z2aWHZxrtthAZzzy6chWu5r3gwcy49tmrUS1KItWuF6KoM+F5NfP2pKxhS7oFqB7uZc+moaPFFzoYPEisYPaRAr3xt8Gn8w48Cz++yLZkmETXMUhxOSJJ5xbwg+51hcRxxH/7SBnnbciRHT0Ic+TQHctEnH1amYt6mvQ0qJzVJKQ4FwxGANQGLuZGqg+4HtYDOCnJaCcGSsZZ/UZWPWzou2eIzTc/r7uD/8p9eYvGeLKomGn3pgtKuaSwLdwSAiOrCskpR/M02NCOcEkP5rlBCtAu0V0PRDcE0APyjd9SF7cSmX52++H3EJ2KjDijTkp9HXShSw==
Received: from DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) by
 BN8PR03MB5059.namprd03.prod.outlook.com (2603:10b6:408:d9::21) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.5588.10; Wed, 7 Sep 2022 01:30:20 +0000
Received: from DM5PR03MB3163.namprd03.prod.outlook.com
 ([fe80::1cf8:e25b:a93b:ffac]) by DM5PR03MB3163.namprd03.prod.outlook.com
 ([fe80::1cf8:e25b:a93b:ffac%6]) with mapi id 15.20.5588.018; Wed, 7 Sep 2022
 01:30:20 +0000
From: Morgan Smith <Morgan.J.Smith@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57367: [PATCH V2] Speed up em-smart
In-Reply-To: <87ilm0x1ol.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Tue,
 06 Sep 2022 12:00:26 +0200")
References: <DM5PR03MB3163A3A177E905B852BC9F1CC5709@HIDDEN>
 <87r10q6byc.fsf@HIDDEN> <9257e0e5-232e-7e20-f4d1-385066c4337e@HIDDEN>
 <DM5PR03MB31639EE4FB0B119C2704444CC57F9@HIDDEN>
 <87bkrtxzfj.fsf@HIDDEN>
 <DM5PR03MB31639CBC75F62622AC4E70ABC57E9@HIDDEN>
 <87ilm0x1ol.fsf@HIDDEN>
Date: Tue, 06 Sep 2022 21:30:18 -0400
Message-ID: <DM5PR03MB3163B313390CF7E1B6286E26C5419@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Content-Type: multipart/mixed; boundary="=-=-="
X-TMN: [o3NtAvVDCl+gkoaM/qfN13Kfoy9U6pRZ]
X-ClientProxiedBy: YT3PR01CA0147.CANPRD01.PROD.OUTLOOK.COM
 (2603:10b6:b01:83::19) To DM5PR03MB3163.namprd03.prod.outlook.com
 (2603:10b6:4:40::24)
X-Microsoft-Original-Message-ID: <87v8q02cph.fsf_-_@HIDDEN>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 7385c8e6-b1a2-40d8-469b-08da907086f6
X-MS-TrafficTypeDiagnostic: BN8PR03MB5059:EE_
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: AWWh06PNND6RqRX9EcxNfANE0rany+JeRDEHdNQDPH1Ms9/xOVZ3C1TwW/P2KtPc7AVo6sG4pjeBc7hCPLVxu7prWOwGvhKQFW1i1Vg1UkVYD3xzxC6q6GddDCqG0aM0q54H4QNp3u+9SBPFH/Xy93NhwxESVe8aHCwRNNnQfAabX+rb4jpcNbSbdKD21bgsuYA7+YskobLtv0CvmpDohRVDGU4wYIQbdNFncIPIlfugR2aX9ekiM+nsjavWpDkGqq6KQCGKqKxYu/EarEjC+jdho0MusAMWBVLu9z4l8Gf+XKgSUuL0ZTwqd7vnnkQWvVsY8eCTeCzPVTYa0u7HVovVQGlJYS3rkG/P5xP18clZdxhh251UqGTLNM6yOr7BVjKUa7TKP3UniFrOYOg6qHz1txa9u4TTco1cOfnvE71mReazQqFEgwba9hiyaUSZY2E5r8c4Cu1N8q89Wws0oqI4js+0bj/Ilu0OPMMBokFBu8UHlYMBcp1CLoN1nll6Oxo/b3e44gqCVUJjOQcXVMHtsA2HQqRnaVu1ueVGoMpwuNsPisdIBkfR577jaO4/9lpeD5Vp3+AJX31MlIPjFLKV/96UGgHcShBWzbaMVIcqbmloMyfzVfW9MNBqb9x4HznJ6XeFHxmRCBjPADUOL0VLmh27dg7XABH6gDakCf+RwdCXNIbqiE1AzoN6c1MQ
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vYj6xvJl6WfiShmz4eLl023PlE6KEoj9W5jViByl0KEMRrBxMVFtUhIri7sa?=
 =?us-ascii?Q?WjNxO8Uhgp4OJza6pHslS73/pbqENPaJ7/9B3YRLRMa4xzzaoAa2pOExgkpe?=
 =?us-ascii?Q?QZpSWLa9AKJJOoqhLWQRarCZfK9xQIW8mkaIAI0jMGpaTqMsmVRnQ5KY+faU?=
 =?us-ascii?Q?OiGkHi1dPfLdjQPgIDeDcX/8Ts3VPiTFO43Lsiv5PPhHh8HnlbuVcDPNLb4Z?=
 =?us-ascii?Q?I6lDPPmf6mbrIbOzqS6KfU+HYssakLIZ9uDLBOv6OlDoqiJ1VupfdWrIKMAw?=
 =?us-ascii?Q?PJ7N0kHoL4T5HZsB6WJ5cTAGUwp/PFpX6Ysstp7lWbvSleq99KAcwn+tD500?=
 =?us-ascii?Q?YR2GH6o4De04eFJLvN8+zpCYGaNJMtXifyDR17OFO5Pkqoft64Fsvr+WQ+Vx?=
 =?us-ascii?Q?jWhLDpBd9jV2NwW5calGooUjY14f2PzaEQf5q3v9Z0ZQLp4Jp0gZzzwMPaOT?=
 =?us-ascii?Q?6gy5LxwLqqKoN15Kg9dsCciFDelpQAzIbsaNSfgeuk+dM4QKBIZ7Otb2CJeD?=
 =?us-ascii?Q?CdyshP9GR2qsmZqRs86uQnl8UFdnPEpXLdweyufGDrRxMfWwe2oe7bcJJHt2?=
 =?us-ascii?Q?NaG3WiWWrkrIUm1vZrztDs9/ByBgAhK8+8a3gaN6t5kWOzKdeH1zk8C+WPH2?=
 =?us-ascii?Q?Mq1dWxD+s/U5BMGPDUhh7lyBQmd5uWdcIO1QOT2tttShp/xk4TVa5J4U8tRT?=
 =?us-ascii?Q?d/2MrZ5+6O0ynm8TwUSHspwWR+WKgGOwHwPolkig5bqi4PbNB34vJbpFh0mp?=
 =?us-ascii?Q?XRbnRjlhYRJpbpXmNT/95rLZ8IiYcreefwAD4/0uOeQNHzgpWUPpRDSotDUP?=
 =?us-ascii?Q?aKLmhCdtOCMYRVOZiUpZn0fAMwcp1GZHcFrIFkjNaWQblOgoTz5tB9S1p6Ov?=
 =?us-ascii?Q?lAMmJgfjWmizaUfQrSIz4mE/22PHxGUFsTIbvJnBvFcsYUVlu1nXulQzM9Q/?=
 =?us-ascii?Q?ip2bgGzbFh+q4efETdfiqJH0zlq3gBWiZ3cH88ndxoG51532hoJ5IoFFHBxZ?=
 =?us-ascii?Q?G1ynvIXP2ZpxhDyF7jLHUSbDWiZllEmlJgMFvuE2n/fH/QCB8fWXi4RMoazf?=
 =?us-ascii?Q?SlOq5TbepZVst4e9xxgMQzvxJFmna8NRA2XxTAa4eSsIKfr+4R+fh/sWV0Tj?=
 =?us-ascii?Q?mRuHkRVqO9ZwIFG+zEFPbeJLWnl1WkSOACSfI4GmrSeUr8DjilpVwnbDrw2Q?=
 =?us-ascii?Q?xxiEXyc3KfLD5ro5If+NBxzrSOWL6Weon0ZYNspyHtKst0xg+DYmLwsJov9D?=
 =?us-ascii?Q?IFkUlMPpjLmY1PlzOtR/js3bZcTE89KwZ6oRwQsgYWWP+Aj/1ZL3HoohgvVr?=
 =?us-ascii?Q?sPU=3D?=
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7385c8e6-b1a2-40d8-469b-08da907086f6
X-MS-Exchange-CrossTenant-AuthSource: DM5PR03MB3163.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2022 01:30:20.4495 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB5059
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57367
Cc: 57367 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain


Hello,

I've attached my patch V2.

This restores some more of the original logic that I have now realized
was indeed necessary.  Again, this patch should not actually change
anything with respect to program logic, flow, or user experience.  In my
limited testing, it seems to act just as it did before (but
significantly more performant).


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=0001-Speed-up-em-smart.patch

From 9e5b3d44019d08e12f95e5cc06c2273e3030e1bb Mon Sep 17 00:00:00 2001
From: Morgan Smith <Morgan.J.Smith@HIDDEN>
Date: Tue, 6 Sep 2022 21:18:51 -0400
Subject: [PATCH] Speed up em-smart

em-smart was forcibly re-displaying the screen upwards of 500 times
per screen of output.  This caused the eshell to feel quite slow when
the module was in use.  Everything seems to work just fine without any
redisplay stuff so I just tore it all out.

lisp/eshell/em-smart.el:

(eshell-smart-unload-hook): Remove `eshell-smart-scroll-windows'
instead of the now deleted `eshell-refresh-windows'

(eshell-smart-displayed, eshell-currently-handling-window,
eshell-refresh-windows, eshell-smart-redisplay): Delete

(eshell-smart-scroll-window): Rename to `eshell-smart-scroll-windows'
and add a bunch of logic originally from `eshell-refresh-windows'

(eshell-smart-initialize): Don't add a hook onto
`window-scroll-functions'.  Replace `eshell-refresh-windows' with
`eshell-smart-scroll-windows'

(eshell-smart-display-setup): Don't refresh windows

(eshell-smart-scroll): Add function.  Most of the logic is copied from
the now deleted `eshell-smart-redisplay'.
---
 lisp/eshell/em-smart.el | 81 ++++++++++++++---------------------------
 1 file changed, 28 insertions(+), 53 deletions(-)

diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el
index 6768cee4c3..7763396a7d 100644
--- a/lisp/eshell/em-smart.el
+++ b/lisp/eshell/em-smart.el
@@ -96,7 +96,7 @@ it to get a real sense of how it works."
   (list
    (lambda ()
      (remove-hook 'window-configuration-change-hook
-                  'eshell-refresh-windows)))
+                  'eshell-smart-scroll-windows)))
   "A hook that gets run when `eshell-smart' is unloaded."
   :type 'hook
   :group 'eshell-smart)
@@ -159,9 +159,7 @@ The options are `begin', `after' or `end'."
 
 ;;; Internal Variables:
 
-(defvar eshell-smart-displayed nil)
 (defvar eshell-smart-command-done nil)
-(defvar eshell-currently-handling-window nil)
 
 ;;; Functions:
 
@@ -174,10 +172,9 @@ The options are `begin', `after' or `end'."
     (setq-local eshell-scroll-to-bottom-on-input nil)
     (setq-local eshell-scroll-show-maximum-output t)
 
-    (add-hook 'window-scroll-functions 'eshell-smart-scroll-window nil t)
-    (add-hook 'window-configuration-change-hook 'eshell-refresh-windows)
+    (add-hook 'eshell-output-filter-functions 'eshell-smart-scroll-windows nil t)
 
-    (add-hook 'eshell-output-filter-functions 'eshell-refresh-windows t t)
+    (add-hook 'window-configuration-change-hook 'eshell-smart-scroll-windows nil t)
 
     (add-hook 'after-change-functions 'eshell-disable-after-change nil t)
 
@@ -193,29 +190,14 @@ The options are `begin', `after' or `end'."
       (add-hook 'eshell-post-command-hook
 		'eshell-smart-maybe-jump-to-end nil t))))
 
-;; This is called by window-scroll-functions with two arguments.
-(defun eshell-smart-scroll-window (wind _start)
-  "Scroll the given Eshell window WIND accordingly."
-  (unless eshell-currently-handling-window
-    (let ((inhibit-point-motion-hooks t)
-	  (eshell-currently-handling-window t))
-      (with-selected-window wind
-	(eshell-smart-redisplay)))))
-
-(defun eshell-refresh-windows (&optional frame)
-  "Refresh all visible Eshell buffers."
-  (let (affected)
-    (walk-windows
-     (lambda (wind)
-       (with-current-buffer (window-buffer wind)
-         (if eshell-mode
-             (let (window-scroll-functions) ;;FIXME: Why?
-               (eshell-smart-scroll-window wind (window-start))
-               (setq affected t)))))
-     0 frame)
-    (if affected
-	(let (window-scroll-functions) ;;FIXME: Why?
-	  (eshell-redisplay)))))
+(defun eshell-smart-scroll-windows ()
+  "Scroll all eshell windows to display as much output as possible, smartly."
+  (walk-windows
+   (lambda (wind)
+     (with-current-buffer (window-buffer wind)
+       (if eshell-mode
+           (eshell-smart-scroll wind))))
+   0 t))
 
 (defun eshell-smart-display-setup ()
   "Set the point to somewhere in the beginning of the last command."
@@ -232,8 +214,7 @@ The options are `begin', `after' or `end'."
    (t
     (error "Invalid value for `eshell-where-to-jump'")))
   (setq eshell-smart-command-done nil)
-  (add-hook 'pre-command-hook 'eshell-smart-display-move nil t)
-  (eshell-refresh-windows))
+  (add-hook 'pre-command-hook 'eshell-smart-display-move nil t))
 
 ;; Called from after-change-functions with 3 arguments.
 (defun eshell-disable-after-change (_b _e _l)
@@ -255,28 +236,22 @@ and the end of the buffer are still visible."
     (goto-char (point-max))
     (remove-hook 'pre-command-hook 'eshell-smart-display-move t)))
 
-(defun eshell-smart-redisplay ()
-  "Display as much output as possible, smartly."
-  (if (eobp)
-      (save-excursion
-	(recenter -1)
-	;; trigger the redisplay now, so that we catch any attempted
-	;; point motion; this is to cover for a redisplay bug
-	(eshell-redisplay))
-    (let ((top-point (point)))
-      (and (memq 'eshell-smart-display-move pre-command-hook)
-	   (>= (point) eshell-last-input-start)
-	   (< (point) eshell-last-input-end)
-	   (set-window-start (selected-window)
-			     (line-beginning-position) t))
-      (if (pos-visible-in-window-p (point-max))
-	  (save-excursion
-	    (goto-char (point-max))
-	    (recenter -1)
-	    (unless (pos-visible-in-window-p top-point)
-	      (goto-char top-point)
-	      (set-window-start (selected-window)
-				(line-beginning-position) t)))))))
+(defun eshell-smart-scroll (window)
+  "Scroll WINDOW to display as much output as possible, smartly."
+  (let ((top-point (point)))
+    (and (memq 'eshell-smart-display-move pre-command-hook)
+         (>= (point) eshell-last-input-start)
+         (< (point) eshell-last-input-end)
+         (set-window-start window
+                           (line-beginning-position) t))
+    (if (pos-visible-in-window-p (point-max) window)
+        (save-excursion
+          (goto-char (point-max))
+          (recenter -1)
+          (unless (pos-visible-in-window-p top-point window)
+            (goto-char top-point)
+            (set-window-start window
+                              (line-beginning-position) t))))))
 
 (defun eshell-smart-goto-end ()
   "Like `end-of-buffer', but do not push a mark."
-- 
2.37.2


--=-=-=
Content-Type: text/plain


Lars Ingebrigtsen <larsi@HIDDEN> writes:

> (Please keep the debbugs address in the CCs -- otherwise it won't reach
> the bug tracker.)

Sorry, still trying to get the hang of gnus :P


Thanks,

Morgan

--=-=-=--




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

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


Received: (at 57367) by debbugs.gnu.org; 6 Sep 2022 10:00:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 06 06:00:44 2022
Received: from localhost ([127.0.0.1]:49615 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVVNp-0008E1-3h
	for submit <at> debbugs.gnu.org; Tue, 06 Sep 2022 06:00:44 -0400
Received: from quimby.gnus.org ([95.216.78.240]:54528)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oVVNm-0008Dk-G6
 for 57367 <at> debbugs.gnu.org; Tue, 06 Sep 2022 06:00:39 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=ZzjdDeYnXl1e0Vo7aFAe3kiYcdPKNvrR609FijX+EB4=; b=UADhJpdOTD/myicEmTAVI0ekYt
 6qpGc6yEVyCw9s3dRqszptiDj2AruHUC8Ee0SMj2fZ0JSoc7VlhuFlhAwuZDlFV0lYdHSwzXRa/AU
 1KmOo1FQ6WVjbOUiMBKTXhIpmXlnOwj8eri+ofkluF59BKy4yWXpuOZ7b7gzWcIhN59s=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oVVNc-0003Hr-Dw; Tue, 06 Sep 2022 12:00:31 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Morgan Smith <Morgan.J.Smith@HIDDEN>
Subject: Re: bug#57367: [PATCH] Speed up em-smart
In-Reply-To: <DM5PR03MB31639CBC75F62622AC4E70ABC57E9@HIDDEN>
 (Morgan Smith's message of "Mon, 05 Sep 2022 22:28:37 -0400")
References: <DM5PR03MB3163A3A177E905B852BC9F1CC5709@HIDDEN>
 <87r10q6byc.fsf@HIDDEN>
 <9257e0e5-232e-7e20-f4d1-385066c4337e@HIDDEN>
 <DM5PR03MB31639EE4FB0B119C2704444CC57F9@HIDDEN>
 <87bkrtxzfj.fsf@HIDDEN>
 <DM5PR03MB31639CBC75F62622AC4E70ABC57E9@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUYFRlAUFpleITG
 xMZzk6f///+VT/LaAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+YJBgk4HV/6hD8AAAGaSURBVDjLbZQB
 tqsgDEQH6wIS6gKE5wK+1gUUZf9reiEggv9xeo42tzMZohQAGBg+7QLsgLSM+Wnrq4ARmbT1nQD3
 +gvgBsPDCeGdwasFXyl8pwzefSaYr9f62Na3ZD0roPfTaZwPVXS7owQowDzCbupN6WK6TCksJg7p
 0s0j7VvA+l+L3aWf2n/PbW/LLKVlXHFuXVjnk9U2buCzz0QKXh95Snw33+c87DUBto6tyjbviZjZ
 x/W1w7ON8bhYWWFYscS8hLFRI3kFTOAKMvV+8ez9KSA5xVjwKZ+U4cMM72yq+tgttkhFtr4j4sTQ
 O0FdL2ZCuQ251/VFkpU4EsjUbGRlLtUi1DuXBLiaHlNjRA3gasQqKFa7axKpAM8GIQODR4ODSZ1M
 7lEbSCKjTqzA/dwCZIGCdfrUzlQEApbjHka4BDbg0AZ7fhpVsDCOebpAFYAjIdxG0jkLzCTHw+gD
 zVEJedMcXTPdZFQENszXSEpUymd18mVWZxZcdQohg7MIUP4mBvut091lSKUOYj39+q6d+1EFkiA5
 /QImW6/IAe1kJQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wOS0wNlQwOTo1NjoyOSswMDowMIN/
 zwgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDktMDZUMDk6NTY6MjkrMDA6MDDyIne0AAAAAElF
 TkSuQmCC
X-Now-Playing: Peter Gabriel's _Peter Gabriel 1_: "Here Comes the Flood"
Date: Tue, 06 Sep 2022 12:00:26 +0200
Message-ID: <87ilm0x1ol.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: (Please keep the debbugs address in the CCs -- otherwise it
 won't reach the bug tracker.) Morgan Smith <Morgan.J.Smith@HIDDEN>
 writes:
 > So the hook is local to the buffer but it runs this bit of code: > >
 (set-window-start
 (selected-window) (line-beginning-position) t) > > So I want to set all
 windows that refer to the hook buffer t [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57367
Cc: 57367 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

(Please keep the debbugs address in the CCs -- otherwise it won't reach
the bug tracker.)

Morgan Smith <Morgan.J.Smith@HIDDEN> writes:

> So the hook is local to the buffer but it runs this bit of code:
>
> (set-window-start (selected-window) (line-beginning-position) t)
>
> So I want to set all windows that refer to the hook buffer to start at a
> certain location.  Ideally I want to do this even if the window doesn't
> currently exist as I want it to be properly scrolled when I get back to
> it.

Hm, right.

> I guess that explains why the original author simply walked through
> all windows and also attached the hook to
> `window-configuration-change-hook'.  I guess I could restore the
> original solution but it doesn't seem particularly elegant.
>
> Let me know if you have a better idea, otherwise I'll simply send
> another patch that puts some of the old stuff back in.

I think you probably have to wait until the window actually exists to
effect scrolling in it (you may have the same buffer in several windows,
or in none), really, so I think walking the windows is the only
practical solution here.

But there may be other tricks here -- perhaps somebody else has some
ideas.




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

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


Received: (at 57367) by debbugs.gnu.org; 5 Sep 2022 21:51:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 05 17:51:42 2022
Received: from localhost ([127.0.0.1]:49074 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVK0M-0003uO-Fu
	for submit <at> debbugs.gnu.org; Mon, 05 Sep 2022 17:51:42 -0400
Received: from quimby.gnus.org ([95.216.78.240]:44460)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oVK0K-0003u0-BA
 for 57367 <at> debbugs.gnu.org; Mon, 05 Sep 2022 17:51:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=P3C/puLnulbYMp2VrkHytUWv/4LWGFbqmOYuBTui1Y4=; b=QgEPIrZOZifNKGR7Y+DwcridWy
 jEvnL/3PqZb3R7cWopM7lROiVWd5p07G4GVmBChdT++m1te8eLD4W3bUCDqXm5mF0/SYgH23ERPI8
 SWDiiibE5nXdW1zH4CopvlGYsecS0nhUlKA1+IQmhe4hMBof9LKbiyGeSD0Qz8HilEWw=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oVK0B-0005rQ-6K; Mon, 05 Sep 2022 23:51:33 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Morgan Smith <Morgan.J.Smith@HIDDEN>
Subject: Re: bug#57367: [PATCH] Speed up em-smart
In-Reply-To: <DM5PR03MB31639EE4FB0B119C2704444CC57F9@HIDDEN>
 (Morgan Smith's message of "Mon, 05 Sep 2022 17:48:09 -0400")
References: <DM5PR03MB3163A3A177E905B852BC9F1CC5709@HIDDEN>
 <87r10q6byc.fsf@HIDDEN>
 <9257e0e5-232e-7e20-f4d1-385066c4337e@HIDDEN>
 <DM5PR03MB31639EE4FB0B119C2704444CC57F9@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUtMTxYWmd+d32n
 m57XzdL///+nVHuPAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+YJBRUtIDeu28AAAAGtSURBVDjLpZPb
 deQwCIbROgUAcgFjqQFLqIDdI/Vf0wKSJ5M5Tl7Cw1z4DPxcDPCDIacj0cF81BRTIoQABGR2ENOb
 TRAI57/wBm7s9yD2cAtyxzvAbVz+ZIBzLiQibYxHSJSOKNUAp+lUOyHr75QcIFUWcX+BFLMBNWBk
 iUO6hvyDTfSZaTqtUOLoYv4gonPM0ionQJ1uOKiNDiEWregDVaCCdcy7+xNnIwaqRsQS4tAGkhXI
 XFcfClATIfzR8lJ1NatzgIBBGxNWvRXmRg4HANsDZoNdwTUrVaUC9nFZ+UwFEMer9cJpAYRNU3Vp
 NjQEPK6IdwvfAboFCH5tM5Tz6MSFffozl4P9qypdL9AzqS3nauHb4lZEH87lXe0JlszWqKsTfGxo
 Oy2wd8KlWcF4/N1xDtKmUBz4lcH5AlT0BRKVJjegPdsQEDszkE7x3Nbgu1/U8E+7yfPj/BS7wzAC
 rvAVxPAEVsVuIqaaxHe2Ki1daIUa7H753UAlnu9LzkNwguE1ajw//MRVCcYXIHRGu4NexSLGAm2o
 y7l9nWtrM0KD2wS9fAHTlLpSB/8BlpCDa1pgnbwAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDkt
 MDVUMjE6NDU6MzErMDA6MDDEJkYAAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA5LTA1VDIxOjQ1
 OjMxKzAwOjAwtXv+vAAAAABJRU5ErkJggg==
X-Now-Playing: Supertramp's _Even in the Quietest Moments_: "Even in the
 Quietest Moments"
Date: Mon, 05 Sep 2022 23:51:28 +0200
Message-ID: <87bkrtxzfj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Morgan Smith <Morgan.J.Smith@HIDDEN> writes: > Is there
 a good way to ensure a hook is performed only on the buffer > that it was
 installed to? `add-hook' takes a LOCAL parameter. (But I haven't looked at
 the logic here, so perhaps something else is needed.) 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57367
Cc: Jim Porter <jporterbugs@HIDDEN>, johnw@HIDDEN, 57367 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Morgan Smith <Morgan.J.Smith@HIDDEN> writes:

> Is there a good way to ensure a hook is performed only on the buffer
> that it was installed to?

`add-hook' takes a LOCAL parameter.  (But I haven't looked at the logic
here, so perhaps something else is needed.)





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

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


Received: (at 57367) by debbugs.gnu.org; 5 Sep 2022 21:48:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 05 17:48:22 2022
Received: from localhost ([127.0.0.1]:49070 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVJx7-0003pG-QK
	for submit <at> debbugs.gnu.org; Mon, 05 Sep 2022 17:48:22 -0400
Received: from mail-mw2nam12olkn2040.outbound.protection.outlook.com
 ([40.92.23.40]:32736 helo=NAM12-MW2-obe.outbound.protection.outlook.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Morgan.J.Smith@HIDDEN>) id 1oVJx6-0003p3-AF
 for 57367 <at> debbugs.gnu.org; Mon, 05 Sep 2022 17:48:20 -0400
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=CG4wRagMeCZexwqOx8TAxr63HNQzUMJdT7zE0bkKjPQ88ps95ZJ7dlMgcJIXlrts+LP4QN8Crh5EmGPBNox1AfH4nCxmGF/xIUwyCNWt2NaLu6y9a9t0CR7USHf3C9/X5qM6lwtJy73eX1eubBR/9ZNu2HUA0ET2Wou6T98y9/qjgSd4TBpUHoHwXpzeoNPVx9wPqpSoOzmqUVhm5YFLFHd3RvktlY8DWs1wxE3AEH8yZDD/DdIw9OhZAcBcqGnl/+ksHXYAzoqx0sB3OEVakZtob08xNaQz+tng+v2Vq+jv9HEzVJDtANg+m0roEmiJXZ4sDFCLlkbVyOhdU8MFNQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 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=zdQgneFUGz+x6V2m9HKFmsuxHBSdCc+5YpuRG86i9zU=;
 b=FPbJu6S3y+A2xrTdH8kzED5ijlV8pDNcLB4MdF4wAktJNXi+KwRw3PjDkEASjpv6iKJnDdmkHzM7ZsceqdFiXh3/tt1UUU5qxWy9XnJDf8FHKfwWmAIF9X8qMSo/C8pWS+E4PQJWCKUJ4qTUveTBhxrCL6/gy77KFldYmrZfEuhQBd0Zmrjna/ZbFsaXTtfvHyCtLf3rRD9Y/SQEzR+W90NfI6rG/1uuk7f7QXy2RhQ305KAweHqDBy8/BGNyPSMJozZ2/rZtBhDgr+0QLV+TzKnVkfArI74G8kpYlZ308MAPqkqA0R3oHka0D/RscqTsyp0xwA7AkRn+O4ew+B1sQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zdQgneFUGz+x6V2m9HKFmsuxHBSdCc+5YpuRG86i9zU=;
 b=ruL46mdf1pssTJuKZ2bSIktM6T9IudL6hbJKi50WHiCNLKD5/Okjh+sONZqs9MECP0ZdoVAhZ+87i7QMqOEhT/3DhxllgHzXyRXw+E2h5H4Zp1O75DEpIjHb4qj7EutiBnWj8GUMJK96eVMUy/5FGYcs3l0xEEsieT/gbkVPd0DSUXwv5N+Zoj8f2vJn+JSP0H1xI7SdJbyu0QyG2OACi+DHHkfxQEl6AdRDBVU7NRrakXRdGb1OUyNJWVUIi0jIsMvRvz7GyLdToD+CgLKbGCkp86XqcIrEPcO7z+mZbUp7XJr29jOVj/jEKnZX0/Vgn7YGowrns/AQxZE4+/th/Q==
Received: from DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) by
 SA0PR03MB5449.namprd03.prod.outlook.com (2603:10b6:806:bd::12) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.5588.18; Mon, 5 Sep 2022 21:48:11 +0000
Received: from DM5PR03MB3163.namprd03.prod.outlook.com
 ([fe80::1cf8:e25b:a93b:ffac]) by DM5PR03MB3163.namprd03.prod.outlook.com
 ([fe80::1cf8:e25b:a93b:ffac%6]) with mapi id 15.20.5588.018; Mon, 5 Sep 2022
 21:48:10 +0000
From: Morgan Smith <Morgan.J.Smith@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
Subject: Re: bug#57367: [PATCH] Speed up em-smart
In-Reply-To: <9257e0e5-232e-7e20-f4d1-385066c4337e@HIDDEN> (Jim Porter's
 message of "Mon, 5 Sep 2022 12:01:21 -0700")
References: <DM5PR03MB3163A3A177E905B852BC9F1CC5709@HIDDEN>
 <87r10q6byc.fsf@HIDDEN> <9257e0e5-232e-7e20-f4d1-385066c4337e@HIDDEN>
Date: Mon, 05 Sep 2022 17:48:09 -0400
Message-ID: <DM5PR03MB31639EE4FB0B119C2704444CC57F9@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Content-Type: text/plain
X-TMN: [MsM+OKhy6iW7hjobGbem5PaL97KR8NbC]
X-ClientProxiedBy: YT3PR01CA0098.CANPRD01.PROD.OUTLOOK.COM
 (2603:10b6:b01:85::9) To DM5PR03MB3163.namprd03.prod.outlook.com
 (2603:10b6:4:40::24)
X-Microsoft-Original-Message-ID: <87wnah5w86.fsf@HIDDEN>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 2fb0570b-5a9b-44ec-5a6d-08da8f885378
X-MS-TrafficTypeDiagnostic: SA0PR03MB5449:EE_
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: pwFID6hwBZwRubQP3gegXgcK6KjXEf21XcTZ2E+lcbt6SayRcTpdvHpUDOdJr65jQFoXYFmLgqUbP9mBlKponXLLHVGxjxqvRNzQDAmyUW/kwtbiJuym1OWA4LHHgxGf9mOM/twwW5xgrk+SvubuS0rI4cK5uY9OFJR2F0deQ+/JjOJ3AWDVlwpuWs+IfwMcZ/IlpHhQn4GrYYrKhQkseWpe8JXcTLVL/8aFOSi363XVlqp3CmEQNlcKlA+7MBP+R4tD93Z1VUW8KpisymQbBaDW7ixB1FWXZvQ4uneQBh0Po6iQyO3RHGDQjOAAeDc8//iI6l9wL4SZaqRR6k2jxA4aAlKhEmg/uItGGlZBW0iUXjIywqTkeN8rhSJV6MlDx+dSm5LSxiiDX/w7RwIXgYSOhmR02a9xZSlDavLF8xlFUINwAX5MF7nxpuklCkIjAkqejdTpoLpwTOqxfLfVzi6cG/c4NWeo9QQplGcRZKMNfVx4AmJDz1AyZhu3qd1iEMxVcr/3V9Ze2muzjHfiIEiu6uw87OtIyxDALdc+0aPkfjm/O9+OYVkxDpsIkAdbQeecw/AleMwxin2qJebKXQ7o83+mTng8uXx0+ihELqU8YBbq15aWYam6hLsG3Af68FEEyMCcnL3sq7QPxiz9WygnxCUv5KAtajSZBRsY1LyVtq0OHlDbfbEnz4VNjbJ/
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zPTJdzgZVmbhbBNERsuFY+sHa2e3eXySnnnY4ClEhOqELeCJo1FY0h/oq1Rd?=
 =?us-ascii?Q?FgeAvU0RzOrnYazFhDO5RhlOllThN9w4nosG2fIHuh656J33Svrv7VOqX40J?=
 =?us-ascii?Q?W+e5P30o+B+PIMD672ZQNrgSzhcUQZUpoPw2opP+fzSIU9DnpyeKZEMwu+YY?=
 =?us-ascii?Q?TtCrZudWZCJF9dMSFP2iUg9lfaP3Rx0USm0A9G0YwAqom9sKn5Vqn8L2YfYw?=
 =?us-ascii?Q?+2Et4z8bz7yo2e1r776Yta1v9xgFgMqqVwmgPLGe70tTHw+Esim1r44HMDjP?=
 =?us-ascii?Q?2R02oyEGb+rJsGThnLeK+nC3EGZCoG6gXmW19EKgZuMGWZiGvBREZRpIkWor?=
 =?us-ascii?Q?HHWHp8/CnOrdCTfQBe7Cqqw6j3TeSSZabywk9fWEBh5xm3GWvK49PZb4dF3+?=
 =?us-ascii?Q?GvpIV+UQEa6Tvq9QtrGq7aGbtDSV1ju8X67huurONc/SGVULLTTQAipTUjKi?=
 =?us-ascii?Q?B3orvFHQlB/59dFQ/UF261WZP/kisSUh3pYs0ZPGYE6SE3oSNJx5QVHzN+YN?=
 =?us-ascii?Q?MTkLZy7+wawXfEkHmSK3gnSgSjSvPB5QbqlV+4CIK6O9LkEqbpFVdV1l15oT?=
 =?us-ascii?Q?/YqBdzlDneOibja0bggjxAuIkOmntdrfbckvnK13Q/bWzh+5/K/J87JdxkGz?=
 =?us-ascii?Q?O5tB9YtGCNuA12dTAye5BzznnYUh1mN0Zme8QR9Pgi0KG7ZtZ635nLA1orUN?=
 =?us-ascii?Q?Rf+Yhn7ee/HwWQG5JxHY0TaYJP8iD38ZcoIXFF/+mlOAfGMh6rtGhpfynUIg?=
 =?us-ascii?Q?pkcgNXS/iu9CyXLQByBIRUDwwJ6vopyw9phyUJXL6yHfrsIjPiQX+o3w9B0r?=
 =?us-ascii?Q?o42yfXeBdLcTyymdhfNzkFAGjybQDB5eONEImQF6LcC/m6q+m2LaAqAeKSzo?=
 =?us-ascii?Q?n5yjAnr3eyt9q9MZYZzoBxrLlNg/eh9L81kWaHCtXayf2yh8TZtkLnMAbT+x?=
 =?us-ascii?Q?62rnFxDa5nYKDonSPOtTCACW8rKkcAh7LFJiwjghcqv9cejzqUAzkTZs/S16?=
 =?us-ascii?Q?cdWvPQ7mv4S3PwemAP2tb/9PcRFYdZb8U2/c3s/wvUAqwcwWSB1d5olV1e+9?=
 =?us-ascii?Q?5V0vjgTY83pe2XnrhN0+mWERX41PK4si6gxpuESJspllUvWGJhIysbeYPGHO?=
 =?us-ascii?Q?A2IEeqcB4vaMLx+ECOQAZaPouhGiP/iCOl9vp408sR2PXDQKTWkIwgT7Op3L?=
 =?us-ascii?Q?44fPX2YB95/dD4pmfk9XIYUCeHGzkK0BMqnA171nIx8TeqPMWfS+51DpsxtC?=
 =?us-ascii?Q?KG67me+JFr5NCkr4Q5dAgH2bxzxHZwTB8roCFL7cFClhMHDlH0Wgpow5YI2H?=
 =?us-ascii?Q?MyQ=3D?=
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2fb0570b-5a9b-44ec-5a6d-08da8f885378
X-MS-Exchange-CrossTenant-AuthSource: DM5PR03MB3163.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 21:48:10.8973 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5449
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57367
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, johnw@HIDDEN, 57367 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Hello,

Jim Porter <jporterbugs@HIDDEN> writes:

>   ;; @ While output is being generated from a command, the window will
>   ;;   be constantly reconfigured (until it would otherwise make no
>   ;;   difference) in order to always show you the most output from the
>   ;;   command possible.  This happens if you change window sizes,
>   ;;   scroll, etc.

Yep the window is constantly reconfigured and that remains true even
with all the stuff I removed.  I only removed stuff which forced a
redisplay.  From what I can tell, we don't need to force redisplays as
everything shows up just fine.  If I did my job correctly (which I
didn't, see below) then there is zero change to the logic and user
experience.


That being said I have discovered one bug in my patch.  I use this
little tid bit to determine if I should scroll or not in the
eshell-output-filter-functions hook.

"(when (eq (window-buffer (selected-window)) (current-buffer)) <logic here>)"

Whereas the previous code used this logic in a few hooks:

(walk-windows
 (lambda (wind)
   (with-current-buffer (window-buffer wind)
     (if eshell-mode
         <logic here>)))
 0 frame)


My code prevents the hook from being run on buffers that aren't the
eshell buffer (no clue how but it does) but it doesn't allow the hook to
run if the window isn't selected.  The old code seems very complicated
though and will scroll all eshell buffers.

Is there a good way to ensure a hook is performed only on the buffer
that it was installed to?


Thanks,

Morgan




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

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


Received: (at 57367) by debbugs.gnu.org; 5 Sep 2022 19:01:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 05 15:01:31 2022
Received: from localhost ([127.0.0.1]:48878 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVHLe-0001Jb-Rm
	for submit <at> debbugs.gnu.org; Mon, 05 Sep 2022 15:01:31 -0400
Received: from mail-pf1-f176.google.com ([209.85.210.176]:43607)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1oVHLd-0001JM-Ly
 for 57367 <at> debbugs.gnu.org; Mon, 05 Sep 2022 15:01:29 -0400
Received: by mail-pf1-f176.google.com with SMTP id r12so55060pfl.10
 for <57367 <at> debbugs.gnu.org>; Mon, 05 Sep 2022 12:01:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:content-language:in-reply-to:mime-version
 :date:message-id:from:references:cc:to:subject:from:to:cc:subject
 :date; bh=qkvA2KRDkqrq8ABXRc2y5oN0/8+/HkevdkxznZMcwKI=;
 b=D+69Wgk80r+4VpqN5G36GnSCBQvqthZkq3EH0zsZ/QgsVclJMfIEm/2dMdAm73hPdO
 Z0xnGYdPs+D3sr+VjLgy2g6X31Q2YNSpegTs8PEkdrgA2atqnVyexGb8G36NEUhEsUmE
 wUAZopBHlrY7AejRW7GRb2s2lghuo47TBqz5iEMYOOlNgjRvTNn92r4UM17/S5vBn9Bh
 B7bUgUdgczONX+Z3/6J0lFn226K2J4KVSQSb47qQQ6woVCYqh464bOPDWIrOYLybRDp2
 lQrVsirjwQq0lrSaukj1xL/8243sUlxRAs3HVW56AmjsxHXq+zXtEC51y8oytExy8zGp
 EOMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:content-language:in-reply-to:mime-version
 :date:message-id:from:references:cc:to:subject:x-gm-message-state
 :from:to:cc:subject:date;
 bh=qkvA2KRDkqrq8ABXRc2y5oN0/8+/HkevdkxznZMcwKI=;
 b=jeTeO/AQdUNv70/++iOiGKJVQpffNc0O89fwjsDKudwxEqHhQhoqFi3gLlU4HhPH34
 C7Q5Idp/FLYMrCzLrT8JCBqTHMULJnktIp94LYAXn6U0WLBHX4QDgaOdFEjpL27VQ2qj
 pCwd26sY9I40CeDRdmPqoXH0VR+arU8JUIXHT6A4gjPkOTxqp9xKTtSIJPKbINhYlCPw
 jCMj2PDQ6KE9vCOpH5qETaNy++RYGr2rUdnZksDFs9hs4T/xnTnYHhvvBSvVl/3YDBdS
 nhc+zq85GCNfbOJ6ZqyvSFhoTjqVzE/Ouz0yMGU/Y7165e2/Se4i4WKg9MK2X+bxeNAu
 6/fg==
X-Gm-Message-State: ACgBeo0l4cORumj6YYMFECGmLw3SOa5VDlFI9H6ITqu/QTt6tbOEpZ7D
 sg+1NAnajtVPVh3CpdZqCie4BCZblUc=
X-Google-Smtp-Source: AA6agR5U+7gCr7ddEY/6OvrkNvw8Sju+EtwxaqmCTijJ4N9rq2plnaQfajalNtludwe9Nr0oENL9xg==
X-Received: by 2002:a63:87c2:0:b0:42b:74d2:e12c with SMTP id
 i185-20020a6387c2000000b0042b74d2e12cmr40713791pge.25.1662404483742; 
 Mon, 05 Sep 2022 12:01:23 -0700 (PDT)
Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com.
 [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id
 c67-20020a621c46000000b005384c3b220asm8149525pfc.50.2022.09.05.12.01.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Sep 2022 12:01:22 -0700 (PDT)
Subject: Re: bug#57367: [PATCH] Speed up em-smart
To: Lars Ingebrigtsen <larsi@HIDDEN>,
 Morgan Smith <Morgan.J.Smith@HIDDEN>
References: <DM5PR03MB3163A3A177E905B852BC9F1CC5709@HIDDEN>
 <87r10q6byc.fsf@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
Message-ID: <9257e0e5-232e-7e20-f4d1-385066c4337e@HIDDEN>
Date: Mon, 5 Sep 2022 12:01:21 -0700
MIME-Version: 1.0
In-Reply-To: <87r10q6byc.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57367
Cc: johnw@HIDDEN, 57367 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 9/4/2022 2:56 PM, Lars Ingebrigtsen wrote:
> Morgan Smith <Morgan.J.Smith@HIDDEN> writes:
> 
>> em-smart is very slow.  This patch makes it much faster.  idk why there
>> was all this redisplay stuff in the module as everything seems to work
>> great when I remove it all.
> 
> Skimming the patch, I think it makes sense, but I'm not that familiar
> with eshell.  Perhaps Jim has some comments; added to the CCs.

I don't know much about the smart scrolling module in Eshell, but I'll 
try to familiarize myself with it and then take a look. I'm slightly 
hesitant about deleting a bunch of code until I know why it was there in 
the first place; from the comments in em-smart.el, it sounds like these 
hooks are intentional:

   ;; @ While output is being generated from a command, the window will
   ;;   be constantly reconfigured (until it would otherwise make no
   ;;   difference) in order to always show you the most output from the
   ;;   command possible.  This happens if you change window sizes,
   ;;   scroll, etc.

However, maybe there's a better way to do this, or failing that, to at 
least provide some more options in the module so that users can tune the 
performance to their liking.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57367; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 57367) by debbugs.gnu.org; 4 Sep 2022 21:56:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 04 17:56:22 2022
Received: from localhost ([127.0.0.1]:45861 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oUxbK-0005sP-8N
	for submit <at> debbugs.gnu.org; Sun, 04 Sep 2022 17:56:22 -0400
Received: from quimby.gnus.org ([95.216.78.240]:33132)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oUxbJ-0005sA-3b
 for 57367 <at> debbugs.gnu.org; Sun, 04 Sep 2022 17:56:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=cMcz+xXj7bHBHdZMLqU99jAdmj4MOEiY6/7XznTj7p8=; b=DjuHVc40nblcDL95XWz1bpVWnU
 N0WFgZBsiRboPxz3wkj5il2A2kwKwvD2sWi8m7sYhsWxua+8E7ACSCjukNx1UvDsI9NSQV4nLVipA
 TkZBNN+MC59lPVUihmRvdyNw6vZdd6uGwJ+kxG4aI5X5KZRcnzlYaAd+9zF85JIhym4U=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oUxb9-00035E-Pz; Sun, 04 Sep 2022 23:56:14 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Morgan Smith <Morgan.J.Smith@HIDDEN>
Subject: Re: bug#57367: [PATCH] Speed up em-smart
In-Reply-To: <DM5PR03MB3163A3A177E905B852BC9F1CC5709@HIDDEN>
 (Morgan Smith's message of "Tue, 23 Aug 2022 16:06:21 -0400")
References: <DM5PR03MB3163A3A177E905B852BC9F1CC5709@HIDDEN>
X-Now-Playing: Neil Young's _Harvest_: "Heart Of Gold"
Date: Sun, 04 Sep 2022 23:56:11 +0200
Message-ID: <87r10q6byc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Morgan Smith <Morgan.J.Smith@HIDDEN> writes: > em-smart
 is very slow. This patch makes it much faster. idk why there > was all this
 redisplay stuff in the module as everything seems to work > great when I
 remove it all. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57367
Cc: Jim Porter <jporterbugs@HIDDEN>, johnw@HIDDEN, 57367 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Morgan Smith <Morgan.J.Smith@HIDDEN> writes:

> em-smart is very slow.  This patch makes it much faster.  idk why there
> was all this redisplay stuff in the module as everything seems to work
> great when I remove it all.

Skimming the patch, I think it makes sense, but I'm not that familiar
with eshell.  Perhaps Jim has some comments; added to the CCs.




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

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


Received: (at submit) by debbugs.gnu.org; 23 Aug 2022 20:06:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 23 16:06:35 2022
Received: from localhost ([127.0.0.1]:45097 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oQaAU-00077Y-UO
	for submit <at> debbugs.gnu.org; Tue, 23 Aug 2022 16:06:35 -0400
Received: from lists.gnu.org ([209.51.188.17]:48840)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Morgan.J.Smith@HIDDEN>) id 1oQaAT-00077P-BY
 for submit <at> debbugs.gnu.org; Tue, 23 Aug 2022 16:06:33 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45004)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Morgan.J.Smith@HIDDEN>)
 id 1oQaAT-0003bQ-5X
 for bug-gnu-emacs@HIDDEN; Tue, 23 Aug 2022 16:06:33 -0400
Received: from mail-bn7nam10olkn2063.outbound.protection.outlook.com
 ([40.92.40.63]:7264 helo=NAM10-BN7-obe.outbound.protection.outlook.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Morgan.J.Smith@HIDDEN>)
 id 1oQaAP-0001QI-QK; Tue, 23 Aug 2022 16:06:32 -0400
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ZUwYqZsxhFy1PIEjraJltzSuTsWmFGZacDotMP/EDAUyMvGSWkuBk/kCzmffXpZTcC4jRNGCkt3/4nDB2GAJFtuGsQQLC3pAANG0UkdMdrFlhO3SWvJsMOXvSJezf8yQdwz4KqS7+YEUgrq9drVuqRnvJtHb997PPUfn6Xuv8x1Mba2/h+MEfJpqArrhgwqiGJvXgjDhDiAi7r/lgI35SWy9NnaTK1C+PA553czuGtXRbpr+CieaW95swgx0mr+f5e+ucYWTu5tomxFxX/71Qa0Mf3TJyOXiQL/A34a0oXOwinMoZBSp+/90o2ruJ5Kvbp4kgWbP0pOyH5TV1omKsg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 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=Tn0fiqnxtK33/esIh0H7kuQVT6CCwP6naEksxlZirS8=;
 b=XvVYcYarb70a7TgxngCAzvYI9iiWlULy2Q5jxykZyj3f9xCT6n4QnlVwxYJgMYNojSgTbZMeC/D3wS9SFjKyheLE2NMsw46uvgBxboDCIJj9vqDfDdrSzQx4o6dpn1f32vgnIQ3OJRn6zvyfTbel6PlRlLMAakQLBa0cRcAJXxPTxe/tnZZlVz9l20w0uq0w5dJYF3vfprSJJN6RjXhFMvHAQB31TJhPHirvAN9ciPRhRvb3Ph1oL0eZQSOzu4qgE6NwXy9fVOAB0TVu2GKTZZlFI0j5ucffoIZl736N8tojwwI/5kq4AwJR2RpCCMIaxyLYkX5eNY4ym84LYPkmMw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Tn0fiqnxtK33/esIh0H7kuQVT6CCwP6naEksxlZirS8=;
 b=Yu6uM0wwblCPf3JB9w1E5fPl8ytnr9WBYgcFPnvuj6/KRE3mEhqeX8O+CdoJqvjIPiHHtErXJPPOb9v1kHzxwNsmQNOgJwUmivFn683Etfpqx2m706gp8mR4yqG0BRodZym2Z/5Em0bEdR8LpFqB2RsyZZ5zvN1XjQ4M2ccKoK31g93EoyhRay/7d6xvDVLczTA9kwdvRfIRdnF7dE8VWweITAmLT7KhpOaNff2lkk2aYCrRaZT88IKkik1i7LWwEIvDqsGi6onikAD674Lgzq6mpcj5yNDg/OoeSVhZAcIz9ATy1F72xYF5QxYkm0wJiQSYsR984LTLdx7YeDTcGQ==
Received: from DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) by
 SJ0PR03MB6469.namprd03.prod.outlook.com (2603:10b6:a03:398::6) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.5566.14; Tue, 23 Aug 2022 20:06:25 +0000
Received: from DM5PR03MB3163.namprd03.prod.outlook.com
 ([fe80::1cf8:e25b:a93b:ffac]) by DM5PR03MB3163.namprd03.prod.outlook.com
 ([fe80::1cf8:e25b:a93b:ffac%6]) with mapi id 15.20.5546.023; Tue, 23 Aug 2022
 20:06:25 +0000
From: Morgan Smith <Morgan.J.Smith@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Speed up em-smart
Date: Tue, 23 Aug 2022 16:06:21 -0400
Message-ID: <DM5PR03MB3163A3A177E905B852BC9F1CC5709@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Content-Type: multipart/mixed; boundary="=-=-="
X-TMN: [7UmaKUrDG2Rfom4x2SB/yoQQO0om2d85]
X-ClientProxiedBy: BL1PR13CA0211.namprd13.prod.outlook.com
 (2603:10b6:208:2bf::6) To DM5PR03MB3163.namprd03.prod.outlook.com
 (2603:10b6:4:40::24)
X-Microsoft-Original-Message-ID: <87k06y9136.fsf@HIDDEN>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 855b028d-53ba-4b0f-98e9-08da8542f416
X-MS-TrafficTypeDiagnostic: SJ0PR03MB6469:EE_
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: RTZr4gxcq93RE7OEN+EtmnXnwMq8arHPaxCrp2ZAjay7sqS9VfwurwKG195rsVWxVOXLwYZu0vpVVuegW8Txtb/cioZfBCJ4juvhFE3kxCYabH4iQjd8o4xucKCylpmNZsMEBvNDk4ynIN+MufBpc1NFApoToEOVzLRBaYI1iINJYXA0JhlvckPkL5FuYyIvaHA+1A2DgZ23Gz/FBZBl3OepfA3GUuSA+BsfWdvjUn6/15jCJFM/1Qji5N9wrgLXpgz0AT0EaHm30aEyQ3tgpD9PwXbti9rEsL/bUaiFKQyEXpQYOSX14FWAfw9H8LXRpihRDvbgbGHOjKdg9X2DoHRUBvAhON19Cn2ibnJ4sYQjnrjKk2BU+z2pXxf/JeH2JPBqHehsObS25jijal0IjVvJRV2QReZC/cb6RRGlSmvs9ws8lWiJIwgZOz8Lfna4e454arw5NDM0PtwSwNLk09zXsggJf0tPwUZVvvy4FqUO9/v2WuUK5Qq2i0rlstPn3fJ1Ch4CsaWU0QUyl6zDwFJmJt34M8dTUyTKCEe4PAWR2YLsEdGwt6OXom4+OC2S6VXM6BZ3ygYRor7KCl/nnIuKKatDm/XIveLp6PXX7IZqVG4jRGAQQhQt7UAu8miQ11gGVjP65179DLcp+O4wMA==
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?OwSL9del8ujAQ2ZrSj+xs8LWSqI/89FNjUk8lzndPoh1kawQ1TpXu8ysaAd+?=
 =?us-ascii?Q?oOpn2U9Q0/FrBTXYuJ2yHh4pGR0fL5uc6uofNah7XCBXND1JimAyezzO4j5b?=
 =?us-ascii?Q?A7+qWVF+jorrIxjAEZgknuQP9u190GKw2y6IObJx0g8w/FoPcmgZqNaHIIGs?=
 =?us-ascii?Q?lyRrWmgoZIbLWIU3V3/KNQvHOBM4zZGjX3bIOqJg4gecNL6pK2Jt4EI5kmCC?=
 =?us-ascii?Q?jgT+UFuK858jG0ecar/W0hM6KJe111DTQUg0dnZOXIut/LSxaR+iH60110uc?=
 =?us-ascii?Q?9ukz6/MVpizcalmAseobetO5oO6qFigslGCV1mF35MUFCphcDVC/f2tve+ui?=
 =?us-ascii?Q?MHJMHtsBsvREZSyEFDm7OgTso6vn3/vghSQr3Mb5dWqXJ+lhYCjaNo3ustd8?=
 =?us-ascii?Q?0azWmssX3nYvg01vVXpf0HCIj/lyg3ODcR5c0pw96D0jS80hTxueV4hwB24O?=
 =?us-ascii?Q?IkMUAD70MFUOhoGe4irACBCsVbuc22Wb0/QaYIYpsW2TqtIQw2lRzuKh2WV0?=
 =?us-ascii?Q?CvG7uEaDYfHpHRyeJTH1sDTR8Bq1J2AOoSTeeMdFuAkK4lvGKyJIf967Ui1n?=
 =?us-ascii?Q?mTHny3beQJlA8yyu4JN2FT286jZOkDQAAF8Xnd1c/YQTCTEwS/s5+1KpG60E?=
 =?us-ascii?Q?x9H6e+jxnRVUJPRih5fJlsNGe7oD97YMuBDF6FJiwv+ftSq1D32r+mkNnXjf?=
 =?us-ascii?Q?0Pz++a8N7573FPZOXLWw+pwPViO80oq5lyf0YLTCJsMFhZwgzHKpd3p/w/Wu?=
 =?us-ascii?Q?Femvxf0Z8o6zJD1xVMZafiYenyu/2OEqTyiqguE8P7ZmksrrMvpOf/ZZ6g8i?=
 =?us-ascii?Q?3v27LXLB0wNonRAW86RVKGN6Skh6dBqfLwf66SyBmTq65FG9FAvfSI4oFu0C?=
 =?us-ascii?Q?6/DpgD34RPNgL6jv8bITidUkjxCodRmxxD0Kktw1mUH+1y0I46OlpjsGfmPZ?=
 =?us-ascii?Q?4H8JuAfKg8+3eh/ra2W4yUXWAMoJLQc0qrNckX5rHMAL9zT8K/Q/q+41CzL4?=
 =?us-ascii?Q?IUuWdm9bLVrBaqadeZjGg+PZijjKxzXaikBKjk4CJggiY8oBBsQTubJJeN/2?=
 =?us-ascii?Q?DSY919iPFHnv7H54DIIigYF0vb2kf6auLQ87DFp38RfRf8EQoDsDqLYu/uFG?=
 =?us-ascii?Q?4thWyWjliNmXEBjlb89jUoIyUuNmNj0IxOM9BLOSSSQbkivrMKcCU/49ek69?=
 =?us-ascii?Q?I0bQ+9EK7c4s0hlxrL4wEf5fALTTeb4FwrdIuFd5ifwHV1GTE4hpyzs9Un0L?=
 =?us-ascii?Q?eyQBturb3XLEuefm4mJzn7iBrGqKd9cUkU68pl8qJ5vC4spSgs98OR2UA/ia?=
 =?us-ascii?Q?YuA=3D?=
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 855b028d-53ba-4b0f-98e9-08da8542f416
X-MS-Exchange-CrossTenant-AuthSource: DM5PR03MB3163.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2022 20:06:25.0177 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6469
Received-SPF: pass client-ip=40.92.40.63;
 envelope-from=Morgan.J.Smith@HIDDEN;
 helo=NAM10-BN7-obe.outbound.protection.outlook.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_PASS=-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: 0.2 (/)
X-Debbugs-Envelope-To: submit
Cc: johnw@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 (--)

--=-=-=
Content-Type: text/plain

Hello,

em-smart is very slow.  This patch makes it much faster.  idk why there
was all this redisplay stuff in the module as everything seems to work
great when I remove it all.

Thanks John Wiegley for writing this module!  It's a pretty cool concept
and I'm having fun playing with it

Thanks,

Morgan


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=0001-Speed-up-em-smart.patch

From f015d6ac42d18bf4dbc2223dc6c96d964e4dd994 Mon Sep 17 00:00:00 2001
From: Morgan Smith <Morgan.J.Smith@HIDDEN>
Date: Tue, 23 Aug 2022 15:47:17 -0400
Subject: [PATCH] Speed up em-smart

em-smart was forcibly re-displaying the screen upwards of 500 times
per screen of output.  This caused the eshell to feel quite slow when
the module was in use.  Everything seems to work just fine without any
redisplay stuff so I just tore it all out.

list/eshell/em-smart.el:

(eshell-mart-unload-hook): Remove eshell-refresh-windows

(eshell-smart-displayed, eshell-currently-handling-window,
eshell-refresh-windows, eshell-smart-redisplay): Delete

(eshell-smart-scroll-window): Add a bunch of logic originally from
eshell-smart-redisplay

(eshell-smart-initialize): Don't add hooks for deleted functions.  Use
eshell-output-filter-functions to run eshell-smart-scroll-window

(eshell-smart-display-setup): Don't refresh windows
---
 lisp/eshell/em-smart.el | 79 +++++++++++------------------------------
 1 file changed, 20 insertions(+), 59 deletions(-)

diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el
index 6768cee4c3..708f950d48 100644
--- a/lisp/eshell/em-smart.el
+++ b/lisp/eshell/em-smart.el
@@ -92,11 +92,7 @@ it to get a real sense of how it works."
   :type 'hook
   :group 'eshell-smart)
 
-(defcustom eshell-smart-unload-hook
-  (list
-   (lambda ()
-     (remove-hook 'window-configuration-change-hook
-                  'eshell-refresh-windows)))
+(defcustom eshell-smart-unload-hook nil
   "A hook that gets run when `eshell-smart' is unloaded."
   :type 'hook
   :group 'eshell-smart)
@@ -159,9 +155,7 @@ The options are `begin', `after' or `end'."
 
 ;;; Internal Variables:
 
-(defvar eshell-smart-displayed nil)
 (defvar eshell-smart-command-done nil)
-(defvar eshell-currently-handling-window nil)
 
 ;;; Functions:
 
@@ -174,10 +168,7 @@ The options are `begin', `after' or `end'."
     (setq-local eshell-scroll-to-bottom-on-input nil)
     (setq-local eshell-scroll-show-maximum-output t)
 
-    (add-hook 'window-scroll-functions 'eshell-smart-scroll-window nil t)
-    (add-hook 'window-configuration-change-hook 'eshell-refresh-windows)
-
-    (add-hook 'eshell-output-filter-functions 'eshell-refresh-windows t t)
+    (add-hook 'eshell-output-filter-functions 'eshell-smart-scroll-window nil t)
 
     (add-hook 'after-change-functions 'eshell-disable-after-change nil t)
 
@@ -193,29 +184,23 @@ The options are `begin', `after' or `end'."
       (add-hook 'eshell-post-command-hook
 		'eshell-smart-maybe-jump-to-end nil t))))
 
-;; This is called by window-scroll-functions with two arguments.
-(defun eshell-smart-scroll-window (wind _start)
-  "Scroll the given Eshell window WIND accordingly."
-  (unless eshell-currently-handling-window
-    (let ((inhibit-point-motion-hooks t)
-	  (eshell-currently-handling-window t))
-      (with-selected-window wind
-	(eshell-smart-redisplay)))))
-
-(defun eshell-refresh-windows (&optional frame)
-  "Refresh all visible Eshell buffers."
-  (let (affected)
-    (walk-windows
-     (lambda (wind)
-       (with-current-buffer (window-buffer wind)
-         (if eshell-mode
-             (let (window-scroll-functions) ;;FIXME: Why?
-               (eshell-smart-scroll-window wind (window-start))
-               (setq affected t)))))
-     0 frame)
-    (if affected
-	(let (window-scroll-functions) ;;FIXME: Why?
-	  (eshell-redisplay)))))
+(defun eshell-smart-scroll-window ()
+  "Scroll the selected window to display as much output as possible, smartly."
+  (when (eq (window-buffer (selected-window)) (current-buffer))
+    (let ((top-point (point)))
+      (and (memq 'eshell-smart-display-move pre-command-hook)
+           (>= (point) eshell-last-input-start)
+           (< (point) eshell-last-input-end)
+           (set-window-start (selected-window)
+                             (line-beginning-position) t))
+      (if (pos-visible-in-window-p (point-max))
+          (save-excursion
+            (goto-char (point-max))
+            (recenter -1)
+            (unless (pos-visible-in-window-p top-point)
+              (goto-char top-point)
+              (set-window-start (selected-window)
+                                (line-beginning-position) t)))))))
 
 (defun eshell-smart-display-setup ()
   "Set the point to somewhere in the beginning of the last command."
@@ -232,8 +217,7 @@ The options are `begin', `after' or `end'."
    (t
     (error "Invalid value for `eshell-where-to-jump'")))
   (setq eshell-smart-command-done nil)
-  (add-hook 'pre-command-hook 'eshell-smart-display-move nil t)
-  (eshell-refresh-windows))
+  (add-hook 'pre-command-hook 'eshell-smart-display-move nil t))
 
 ;; Called from after-change-functions with 3 arguments.
 (defun eshell-disable-after-change (_b _e _l)
@@ -255,29 +239,6 @@ and the end of the buffer are still visible."
     (goto-char (point-max))
     (remove-hook 'pre-command-hook 'eshell-smart-display-move t)))
 
-(defun eshell-smart-redisplay ()
-  "Display as much output as possible, smartly."
-  (if (eobp)
-      (save-excursion
-	(recenter -1)
-	;; trigger the redisplay now, so that we catch any attempted
-	;; point motion; this is to cover for a redisplay bug
-	(eshell-redisplay))
-    (let ((top-point (point)))
-      (and (memq 'eshell-smart-display-move pre-command-hook)
-	   (>= (point) eshell-last-input-start)
-	   (< (point) eshell-last-input-end)
-	   (set-window-start (selected-window)
-			     (line-beginning-position) t))
-      (if (pos-visible-in-window-p (point-max))
-	  (save-excursion
-	    (goto-char (point-max))
-	    (recenter -1)
-	    (unless (pos-visible-in-window-p top-point)
-	      (goto-char top-point)
-	      (set-window-start (selected-window)
-				(line-beginning-position) t)))))))
-
 (defun eshell-smart-goto-end ()
   "Like `end-of-buffer', but do not push a mark."
   (interactive)
-- 
2.37.2


--=-=-=--




Acknowledgement sent to Morgan Smith <Morgan.J.Smith@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#57367; 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: Wed, 7 Sep 2022 13:00:02 UTC

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