From unknown Wed Jun 25 00:21:44 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#57367 <57367@debbugs.gnu.org> To: bug#57367 <57367@debbugs.gnu.org> Subject: Status: [PATCH] Speed up em-smart Reply-To: bug#57367 <57367@debbugs.gnu.org> Date: Wed, 25 Jun 2025 07:21:44 +0000 retitle 57367 [PATCH] Speed up em-smart reassign 57367 emacs submitter 57367 Morgan Smith severity 57367 normal tag 57367 moreinfo patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 23 16:06:35 2022 Received: (at submit) by debbugs.gnu.org; 23 Aug 2022 20:06:35 +0000 Received: from localhost ([127.0.0.1]:45097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQaAU-00077Y-UO for submit@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 ) id 1oQaAT-00077P-BY for submit@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 ) id 1oQaAT-0003bQ-5X for bug-gnu-emacs@gnu.org; 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 ) 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 To: bug-gnu-emacs@gnu.org Subject: [PATCH] Speed up em-smart Date: Tue, 23 Aug 2022 16:06:21 -0400 Message-ID: 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@outlook.com> 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@outlook.com; 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@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -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 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 17:56:22 2022 Received: (at 57367) by debbugs.gnu.org; 4 Sep 2022 21:56:22 +0000 Received: from localhost ([127.0.0.1]:45861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUxbK-0005sP-8N for submit@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 ) id 1oUxbJ-0005sA-3b for 57367@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 ) id 1oUxb9-00035E-Pz; Sun, 04 Sep 2022 23:56:14 +0200 From: Lars Ingebrigtsen To: Morgan Smith Subject: Re: bug#57367: [PATCH] Speed up em-smart In-Reply-To: (Morgan Smith's message of "Tue, 23 Aug 2022 16:06:21 -0400") References: X-Now-Playing: Neil Young's _Harvest_: "Heart Of Gold" Date: Sun, 04 Sep 2022 23:56:11 +0200 Message-ID: <87r10q6byc.fsf@gnus.org> 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 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 , johnw@gnu.org, 57367@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Morgan Smith 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 17:56:26 2022 Received: (at control) by debbugs.gnu.org; 4 Sep 2022 21:56:26 +0000 Received: from localhost ([127.0.0.1]:45864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUxbO-0005sh-GV for submit@debbugs.gnu.org; Sun, 04 Sep 2022 17:56:26 -0400 Received: from quimby.gnus.org ([95.216.78.240]:33146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUxbN-0005sG-1V for control@debbugs.gnu.org; Sun, 04 Sep 2022 17:56:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9XOVxNVtSP8aLQIYq6shfxuG8xtoGjRsIhtxATW0hxg=; b=QWhz5osK1W++sx0jlGPl3UCOkA +2WFNjglRDOUqC2MURUzbTuBA6+/MUkj1cYSZ3R/Tm+U0Vwnemi88seRHPG3MR7XTsZSIt8h2Oujg XZSnDynBidrCJQluSy4T+ih1cqrMMCqNCoLVOXiTrbGpiSCTiI4Jbz0JY2LOUwwOporQ=; 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 ) id 1oUxbF-00035O-EI for control@debbugs.gnu.org; Sun, 04 Sep 2022 23:56:19 +0200 Date: Sun, 04 Sep 2022 23:56:17 +0200 Message-Id: <87pmga6by6.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #57367 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: tags 57367 + moreinfo quit 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: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 57367 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 05 15:01:31 2022 Received: (at 57367) by debbugs.gnu.org; 5 Sep 2022 19:01:31 +0000 Received: from localhost ([127.0.0.1]:48878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVHLe-0001Jb-Rm for submit@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 ) id 1oVHLd-0001JM-Ly for 57367@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@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 , Morgan Smith References: <87r10q6byc.fsf@gnus.org> From: Jim Porter Message-ID: <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> Date: Mon, 5 Sep 2022 12:01:21 -0700 MIME-Version: 1.0 In-Reply-To: <87r10q6byc.fsf@gnus.org> 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@gnu.org, 57367@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 9/4/2022 2:56 PM, Lars Ingebrigtsen wrote: > Morgan Smith 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 05 17:48:22 2022 Received: (at 57367) by debbugs.gnu.org; 5 Sep 2022 21:48:22 +0000 Received: from localhost ([127.0.0.1]:49070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVJx7-0003pG-QK for submit@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 ) id 1oVJx6-0003p3-AF for 57367@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 To: Jim Porter Subject: Re: bug#57367: [PATCH] Speed up em-smart In-Reply-To: <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> (Jim Porter's message of "Mon, 5 Sep 2022 12:01:21 -0700") References: <87r10q6byc.fsf@gnus.org> <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> Date: Mon, 05 Sep 2022 17:48:09 -0400 Message-ID: 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@outlook.com> 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 , johnw@gnu.org, 57367@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Jim Porter 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)) )" Whereas the previous code used this logic in a few hooks: (walk-windows (lambda (wind) (with-current-buffer (window-buffer wind) (if eshell-mode ))) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 05 17:51:42 2022 Received: (at 57367) by debbugs.gnu.org; 5 Sep 2022 21:51:42 +0000 Received: from localhost ([127.0.0.1]:49074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVK0M-0003uO-Fu for submit@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 ) id 1oVK0K-0003u0-BA for 57367@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 ) id 1oVK0B-0005rQ-6K; Mon, 05 Sep 2022 23:51:33 +0200 From: Lars Ingebrigtsen To: Morgan Smith Subject: Re: bug#57367: [PATCH] Speed up em-smart In-Reply-To: (Morgan Smith's message of "Mon, 05 Sep 2022 17:48:09 -0400") References: <87r10q6byc.fsf@gnus.org> <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> 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@gnus.org> 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 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 , johnw@gnu.org, 57367@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Morgan Smith 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.) From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 06 06:00:44 2022 Received: (at 57367) by debbugs.gnu.org; 6 Sep 2022 10:00:44 +0000 Received: from localhost ([127.0.0.1]:49615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVVNp-0008E1-3h for submit@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 ) id 1oVVNm-0008Dk-G6 for 57367@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 ) id 1oVVNc-0003Hr-Dw; Tue, 06 Sep 2022 12:00:31 +0200 From: Lars Ingebrigtsen To: Morgan Smith Subject: Re: bug#57367: [PATCH] Speed up em-smart In-Reply-To: (Morgan Smith's message of "Mon, 05 Sep 2022 22:28:37 -0400") References: <87r10q6byc.fsf@gnus.org> <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> <87bkrtxzfj.fsf@gnus.org> 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@gnus.org> 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 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) (Please keep the debbugs address in the CCs -- otherwise it won't reach the bug tracker.) Morgan Smith 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 06 21:30:37 2022 Received: (at 57367) by debbugs.gnu.org; 7 Sep 2022 01:30:37 +0000 Received: from localhost ([127.0.0.1]:53000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVjtl-0005zt-5T for submit@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 ) id 1oVjth-0005ze-IX for 57367@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 To: Lars Ingebrigtsen Subject: Re: bug#57367: [PATCH V2] Speed up em-smart In-Reply-To: <87ilm0x1ol.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 06 Sep 2022 12:00:26 +0200") References: <87r10q6byc.fsf@gnus.org> <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> <87bkrtxzfj.fsf@gnus.org> <87ilm0x1ol.fsf@gnus.org> Date: Tue, 06 Sep 2022 21:30:18 -0400 Message-ID: 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_-_@outlook.com> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= 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 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 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 07 08:55:30 2022 Received: (at 57367) by debbugs.gnu.org; 7 Sep 2022 12:55:30 +0000 Received: from localhost ([127.0.0.1]:53959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVuaY-0002mW-J0 for submit@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 ) id 1oVuaX-0002mK-0j for 57367@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 ) id 1oVuaN-0006vV-S5; Wed, 07 Sep 2022 14:55:23 +0200 From: Lars Ingebrigtsen To: Morgan Smith Subject: Re: bug#57367: [PATCH V2] Speed up em-smart In-Reply-To: (Morgan Smith's message of "Tue, 06 Sep 2022 21:30:18 -0400") References: <87r10q6byc.fsf@gnus.org> <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> <87bkrtxzfj.fsf@gnus.org> <87ilm0x1ol.fsf@gnus.org> 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@gnus.org> 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 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 , 57367@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Morgan Smith 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? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 09 00:36:31 2022 Received: (at 57367) by debbugs.gnu.org; 9 Sep 2022 04:36:31 +0000 Received: from localhost ([127.0.0.1]:60662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWVkl-0000sm-Fz for submit@debbugs.gnu.org; Fri, 09 Sep 2022 00:36:31 -0400 Received: from mail-pj1-f43.google.com ([209.85.216.43]:54223) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWVkf-0000sV-1X for 57367@debbugs.gnu.org; Fri, 09 Sep 2022 00:36:29 -0400 Received: by mail-pj1-f43.google.com with SMTP id q3so430503pjg.3 for <57367@debbugs.gnu.org>; Thu, 08 Sep 2022 21:36:25 -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=upt5QZFo8D3dZDz5bXXFispcpbOS+C9LZ8a4Iw/nQdo=; b=EaZWtayoiJ953N/84WPS2+SWW5u9oii35MszcwmM6l5OGXg2pkD4jsroP8FnHbLsw5 puHz3o0Eqprk8s7XIVmzFAGHypij8Vhn1kI66KJQ3eVt6N24RV9Ko8jZzQQW/jcO3Nk5 57Tlp9YNxay/nVhuyD+6MistCSoUFAD8OGy1nchmiF+o0DZdA1fqaBTXVf/BT5f8uBHg nWgbpCaoENL4FUbgQOECjbW9ggAFTxcuCpftU9xTjqzUFMCh7p3xdseYKUetJqDgF9bO T1YdWpbCV3L2y7vFtdfyHJs+7BTrafEtggI4RaTB2GegzlQt2pUAW/Ui/ZNInsPUKV8S HjUA== 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=upt5QZFo8D3dZDz5bXXFispcpbOS+C9LZ8a4Iw/nQdo=; b=FAFblH2YFgf517BAa8vnIGhdYywrJrDX8Z1xiEcbtF8JJhlEzpFo6/WmF7uSevCeUo veh2jANYM58DTIMsgrZ50WPyW2eLO7c/CmsXAyLoV9wnNwbS9JhtgRGVX5I6dwk2hfhe WQ2lujtQ13y4Iq8JugPb4t6p/roY97F6DqbojjGFvWMgLEQ86nd+R+EB6ithFjFi5fdw YCBED8esV4AS/4tfKIvT03d9RFD37K/WF08XQt50svrlGv3HuMBlrGP/LaZnxfEGBKdZ ewexfy8DYnA7P17E7tE7I7QKIx6rI567fGZeX2elnf4pIDwIZffP3g51jTOrEpJ5FqES PXkA== X-Gm-Message-State: ACgBeo2kRrFyyIVHH99xdjI84nAoPxaZC2Lt+m5HfxzHXbGwztAe0r29 09kqBxCOye3VrMwubUll9MAiqptk6xE= X-Google-Smtp-Source: AA6agR7wyuneqBgUU4Z9Zpl0BMNdP6ZUfRtXcZ3gD6vOJvz3x0b1gnFllGOIabSCnfBN7bZlmvItZw== X-Received: by 2002:a17:90b:264a:b0:1fd:f88d:dbad with SMTP id pa10-20020a17090b264a00b001fdf88ddbadmr7806854pjb.93.1662698178980; Thu, 08 Sep 2022 21:36:18 -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 lw2-20020a17090b180200b00200b12f2bf5sm10551091pjb.1.2022.09.08.21.36.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Sep 2022 21:36:17 -0700 (PDT) Subject: Re: bug#57367: [PATCH V2] Speed up em-smart To: Morgan Smith , Lars Ingebrigtsen References: <87r10q6byc.fsf@gnus.org> <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> <87bkrtxzfj.fsf@gnus.org> <87ilm0x1ol.fsf@gnus.org> From: Jim Porter Message-ID: Date: Thu, 8 Sep 2022 21:36:17 -0700 MIME-Version: 1.0 In-Reply-To: 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: 57367@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 9/6/2022 6:30 PM, Morgan Smith wrote: > 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). Thanks, this does indeed seem a lot faster. I do notice one small change in behavior though: after starting Eshell with the em-smart module loaded, run "echo hi" and then split the window vertically with 'C-x 2'. Before the patch, the window doesn't scroll. After the patch, the window is scrolled so that the "echo hi" block is at the top (i.e. the "Welcome to the Emacs shell" banner is hidden). The same sort of thing happens if you run a command with a lot of output first and then run "echo hi". Before splitting, the "echo hi" block is at the bottom. Without this patch, 'C-x 2' maintains that position (i.e. it scrolls the minimum amount of the previous command out of view so that you can see the most-recent command). With the patch, 'C-x 2' scrolls *all* of the previous command out of view, so the "echo hi" block is at the top. I think the pre-patch behavior is the most-usable: if you can fit all of the last command in the window, it should be at the bottom so that you can see (some of) the previous command. (I also saw some strange issue with resizing the windows via the mouse, but I can't reproduce it anymore. If I can figure out how trigger this reliably, I'll send an update. Sorry that's not very helpful at present...) From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 06 18:46:38 2023 Received: (at 57367) by debbugs.gnu.org; 6 Sep 2023 22:46:38 +0000 Received: from localhost ([127.0.0.1]:38087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qe1IE-0001iN-0u for submit@debbugs.gnu.org; Wed, 06 Sep 2023 18:46:38 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:45448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qe1IC-0001iA-9x for 57367@debbugs.gnu.org; Wed, 06 Sep 2023 18:46:36 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-501eec0a373so454518e87.3 for <57367@debbugs.gnu.org>; Wed, 06 Sep 2023 15:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694040389; x=1694645189; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=kZZFM+6NAS4kgZGz7WwJYLwGFyzEq94XfIdnSZ+bt3I=; b=MurjP+BatKPhBLuj89p1R/+xSOIb8WO2dkEt0H747YeEDWa2hvrguTbHQa9jdTOgtL Qpe/YQYNeZkkkY5IEzJHwI+AmFFZTy4vWNLIRyMsMkkqAK6D2snDgjaAihcH8adt1BKI 04UOxRl4eNqpoYcawJyRdb5zh3jFF58FaIvXK9riNUDZ+cBGWMxWfyAGtKgyGtaTeCU1 vvH1ZNSNZt/apof4KHIoXuXitJk2eFI0GwIQsHjl3dcGUSe85crt8LYBDjHF2Rck7EyQ 8uJCqug5T+SGTa53hdZlGw2SwtT/ixrGBcos5+v0/SA9dlOnzZERi7NaK08FvxRhxT9X e8Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694040389; x=1694645189; h=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=kZZFM+6NAS4kgZGz7WwJYLwGFyzEq94XfIdnSZ+bt3I=; b=XVlNSGajdSwBcKlNQAhh8CFpvjs4Ue2tEYUk/GMlfR+mE7oDLFdb3ZLP31xA8wS0TI 6THLobO+7J58xDb8O0w4GgGKEN0KK1znCMqUttfDpfiBuwn0icr/1hCGFa8ZI0vJXU9H KpkMHr7CR7Bp1eHQaXJZhR7JiGxTDMvRMH3QYUD8CZz7fYVOKLJP9ge0Q1wN3fhXyofP 9s17LYn0iBtfGciZPBLvUiYBcImFX3w2c7qKjj4Uf6egdZZ9IFDwAnsLB96f/BQfnW95 YNDsdW7DDCDA1Krx1/NVWZ8CDUQjtuOGMmqFTFhp5XMIu0xlr1B1vIDZSEDuhz96kQ5N 4uzw== X-Gm-Message-State: AOJu0YzduA1MhYY7E1kD6i3+7IR4LPtAdqz5tnEn7PMN6lYlZFYlnckG 24GltssxSZu7gmSBH9i0PVgFPUFEweAfNis+7Ls= X-Google-Smtp-Source: AGHT+IEoHNNiJ7EVWKNF7fHlUH9+ZG1Vrhob+lFWn5Sn+c3958DcQfm/9cXhqYW7MumanKNON6A7HeuiDfpCrVrgeJI= X-Received: by 2002:ac2:4d0b:0:b0:500:bb99:69a6 with SMTP id r11-20020ac24d0b000000b00500bb9969a6mr3808768lfi.39.1694040388879; Wed, 06 Sep 2023 15:46:28 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 6 Sep 2023 15:46:28 -0700 From: Stefan Kangas In-Reply-To: (Jim Porter's message of "Thu, 8 Sep 2022 21:36:17 -0700") References: <87r10q6byc.fsf@gnus.org> <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> <87bkrtxzfj.fsf@gnus.org> <87ilm0x1ol.fsf@gnus.org> MIME-Version: 1.0 Date: Wed, 6 Sep 2023 15:46:28 -0700 Message-ID: Subject: Re: bug#57367: [PATCH] Speed up em-smart To: Jim Porter Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57367 Cc: Morgan Smith , Lars Ingebrigtsen , 57367@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jim Porter writes: > On 9/6/2022 6:30 PM, Morgan Smith wrote: >> 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). > > Thanks, this does indeed seem a lot faster. I do notice one small change in > behavior though: after starting Eshell with the em-smart module loaded, run > "echo hi" and then split the window vertically with 'C-x 2'. Before the patch, > the window doesn't scroll. After the patch, the window is scrolled so that the > "echo hi" block is at the top (i.e. the "Welcome to the Emacs shell" banner is > hidden). > > The same sort of thing happens if you run a command with a lot of output first > and then run "echo hi". Before splitting, the "echo hi" block is at the > bottom. Without this patch, 'C-x 2' maintains that position (i.e. it scrolls the > minimum amount of the previous command out of view so that you can see the > most-recent command). With the patch, 'C-x 2' scrolls *all* of the previous > command out of view, so the "echo hi" block is at the top. > > I think the pre-patch behavior is the most-usable: if you can fit all of the > last command in the window, it should be at the bottom so that you can see (some > of) the previous command. > > (I also saw some strange issue with resizing the windows via the mouse, but I > can't reproduce it anymore. If I can figure out how trigger this reliably, I'll > send an update. Sorry that's not very helpful at present...) That was one year ago. Morgan, did you get a chance to look into the issues Jim pointed out above? From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 18 11:47:37 2023 Received: (at 57367) by debbugs.gnu.org; 18 Oct 2023 15:47:37 +0000 Received: from localhost ([127.0.0.1]:34505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qt8lk-00050R-JH for submit@debbugs.gnu.org; Wed, 18 Oct 2023 11:47:37 -0400 Received: from mail-bn7nam10olkn2033.outbound.protection.outlook.com ([40.92.40.33]:55086 helo=NAM10-BN7-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qt8lj-00050A-1M for 57367@debbugs.gnu.org; Wed, 18 Oct 2023 11:47:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=grqK8gfCVt+3OH7ZJxHet94XrsMMs8am7ZYHDUd8Haplhmz4TzQynamPlBiN1mpMyhBhCnDJ7zVoRAICi8HKk6kP0g8yuWwlIRRJHZBgkTOZ7d2fzmkFjhBvFfSd303jek8/g0DMmrQxY9UTk7QFsVCjOb7GUzn4Pg5lIBRJ5sNcDLCwZmNmXXgYZqA2xp7i6P82ZKG7z7FBL8wYWFQyZ40l5lNuHIh+dCjCZ0UIMDUldWyabg0XIB4Y3YhplqC44FbjX4wRIEk0PjWvwuNYpyPtHdNWcxjCkfSEHCiVa7SDwQjBpftGDsY0mdQXphXMUkm8Loc7yzgeQMxwwFBSMA== 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=1wDyXf5KCysXiLl2teTEqxTSy6YxRXFNlipB7EV9Fkk=; b=byjQRUIpFmhURVuVejAy+L1pkvMqXwZNKW0TJiXOUT2IgTDilLHWjqXQ+3y1rFJGs1K9P43hrMPiuUns/7g8EYz91GwIU9Dk2raUREbU8LNQ4om/Tjj2QPGLu2u/jkUK3SvrAwlcTIRJAgwNecZWB87x5hVqUoaVgS3y61trx4BaLjygefmG//iDBv0XXJ8gBuqzKaynO9CN5FrFELW1LHIvdTJmVqJDIXUg5hZiB7eZhRQ+FrmDz53/l/yUd7QFg84drxkIeRG6PxV0I/HsKvY+sox5jETQKfzmN36HrxwKlB5rzlHmHOH4uy4fb5Oz0IKyHOjCW4rL5O10qWtsHw== 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=1wDyXf5KCysXiLl2teTEqxTSy6YxRXFNlipB7EV9Fkk=; b=Xd30eFeft85XGWUPUwUZbanP9FhvsSthfeiC73geOPaO4Ir3xQJZYPaoU4tou+fTPpG9XGTPCtT+FKOHuzL6MT4HO9Ot4DMGcOQ6R/4QDXiIgWJNHMdHdmITdtk8J6Em0dDRZSYQSl3h3z1/Tn17C4ve7cBO51FErNh7gPB6QfaBvHDlTkK4fpn31d4cjlK0L+BmzGzNJ5BvC/3FV8+Bdm1izSdtZprXTjkLRRDgtGQ3DPDJ7KaFLQFuqTMoaTAnfT/bDVzEMNeAraRg+OkqFg0OcAnr2pMclJ2cJHh7RcpnUf4mQzNvDGOrZcBjvaYonUCO7pZ1lu4UQX8wst1agg== Received: from DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) by CH2PR03MB5350.namprd03.prod.outlook.com (2603:10b6:610:99::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.7; Wed, 18 Oct 2023 15:47:02 +0000 Received: from DM5PR03MB3163.namprd03.prod.outlook.com ([fe80::c75b:8346:2a6a:fdcf]) by DM5PR03MB3163.namprd03.prod.outlook.com ([fe80::c75b:8346:2a6a:fdcf%4]) with mapi id 15.20.6907.021; Wed, 18 Oct 2023 15:47:01 +0000 From: Morgan Smith To: Stefan Kangas Subject: Re: bug#57367: [PATCH v3] Speed up em-smart In-Reply-To: (Stefan Kangas's message of "Wed, 6 Sep 2023 15:46:28 -0700") References: <87r10q6byc.fsf@gnus.org> <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> <87bkrtxzfj.fsf@gnus.org> <87ilm0x1ol.fsf@gnus.org> X-Hashcash: 1:20:231018:57367@debbugs.gnu.org::qwLmoxK/ysSB3hej:0uQl X-Hashcash: 1:20:231018:larsi@gnus.org::LQhKvk1dXTWPs7qN:4rOI X-Hashcash: 1:20:231018:jporterbugs@gmail.com::i5+6PGHeO9qJtwxz:hmC X-Hashcash: 1:20:231018:stefankangas@gmail.com::s78X1M+gc4DGo/ph:3n+v Date: Wed, 18 Oct 2023 11:46:57 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [OHeCfx5Ked05h4LbJD8qh6poRvPHOiLb] X-ClientProxiedBy: YQBPR01CA0006.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01::14) To DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) X-Microsoft-Original-Message-ID: <8734y8ndam.fsf_-_@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR03MB3163:EE_|CH2PR03MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: d0fc3018-b04f-4017-4f2f-08dbcff1782f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WmfXrQOU+bVC2lYjEhiCxtL1PvO4suAS7BC9wI7655Ua4opUfxgqFg1EXHwtUTK3ohiwc0uuiv65iN71Cx+JKQcmIJmp805c8edVEJfwWqcgR0TTascLCFvuEA5U+LYpqGHiTGgndXeDXmA9ri3nHM+TMKXtCsCiAo7KP1iSkkozY1AyiVNrA6K06G+t9fe0Wa96gGtKHPXC9ocPa9n/0dmyUdQrz+YBqbT4Nztp7AJj4UeLoIW/G+EL0F3BD5p+LQmykNFhFt6ZI5Z4Xhmm5oukYX6xSLztevPU+70ENcFjCFG9QjqanLH6qV9q7uOHlhrgvLxxLnAbLy+DNmYl43Y74M6QM+1oXoBv+os5XQPAeezoHUGmbhQSaY/fKWzbSuefqenXZi0lrOWJUAtvgMWlzaLABdHpukwxc6qJS4VC011fIJPxscCcfn8u1sNUZZ3fdBd+5J++CMDMgskrHDK8V3WpSZXtiN1PBeS4xues/hoxmS5Jxuf4uxo1GcFE1TV4j7yOFwBSy+Omfl86S4F9+6BF5OzjZDwsr/2i7U8FO85i1TeH/rPPRApaNbcg X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nGqAqBfZ+JTB+2m6JTJK/Iopd8qg8EXuPl2PQWf117/3voSybVPDC4vmLf0V?= =?us-ascii?Q?wVx78xGdXM0KNG7hQ2D671wOEP/89WJlqBnzfy1YcY16mF/hiGzuQuPItGCI?= =?us-ascii?Q?vYAs0Qmpg4FMoYp4v5Q8qi6T9hn0dgltQ2vWVNxAmoioYBO0MufBCsY4BzWy?= =?us-ascii?Q?W0QisNWr2Lsf8EUBjSQFiJzZoVUzmw/SrNQnY+3KruRUvMtHIZoY+Y53KN2l?= =?us-ascii?Q?c7lhvtP+AT3wvHhW6fSUJS3uEz+F1UGXcJcpqKg50nGze6r4Hj6KBS1xst8P?= =?us-ascii?Q?89RQ4T1DXxehl25yBwXefxBU+FlMMP/fsHpnUQDsisEIMrirxuQpSqli/b3y?= =?us-ascii?Q?kexCxyN3mlfkeBJsjJaHOmzUaVAr5rMvEdE/qinX/kyETtaCQVgZQDFuLh0p?= =?us-ascii?Q?dq5+sBYNsS8Jw5o1AWrszuPzAbK6a9V7vd9tqTen9I94pXchsOe4gYgrSP8Z?= =?us-ascii?Q?PWzjhk4QUVxTYaeY9ddAZtQiMq9Hd8qS0oJFaiX9ipHdPRYQZoDdxD4PlvXs?= =?us-ascii?Q?s/BoWL3rkPQcrwxbaAD6ZZKN2CghPlbTm6LfF/QBYkwjkFm7IdNCuFnb0Ip9?= =?us-ascii?Q?YXxCkuXmxvKKZ0DGul5O9ygR4mKX+4LR7+6rxdS0FwGlmtnqhVifrvPu3fK3?= =?us-ascii?Q?3CnweRGIeG1WXV0ToXqOr4tLOi9CCiazRl9sEJvQpoQbRtQD2Voo8j0tdvnh?= =?us-ascii?Q?9CCENVoki0s77VEBxdMYR0nBKM8OtIyf7BusiHwwu9An2ISc+ZHvf3DiJ76V?= =?us-ascii?Q?WFj9QNjViPfDiZ8pt230lYJuBj5zaDcN5QJwM4nEqAtA6oTBJ6yBF1iNmodH?= =?us-ascii?Q?dZvjjKPmWOUPYC89mJagNZahsWkxvb4DBqB6LzVSepfFM1tYapZeYI0lxLh8?= =?us-ascii?Q?J3LuZXqCFfbIP/sNYmKNSJGaSSTeohc6ghNXv7ODlU8/w44giZMmo5TquxSM?= =?us-ascii?Q?NE7n/gJL8nKfof5tR/BKEzDShLYVnw9zJVRDUfr5X1ktNafucKqMvc1oov0A?= =?us-ascii?Q?b3IALofzYDMLkNk05g1r8d2MtO1HLcMNIUfWxNMGxdMEs+EMqf5hCbq0vAmc?= =?us-ascii?Q?kz7qHSPmFJpH6EESGQdkpy1lhyh9sa4mZfbUWv15iXHz6i7fgqI+aCXFz0IN?= =?us-ascii?Q?VsshRUjQRvuk4HCWek3cEl1AVcqhVH4jqFkFCsrToFOZzKy9APhI7gr56TiX?= =?us-ascii?Q?82M97XAuu+WOEdzI+Cx7mOxtOHNecfEWZ5nfqMX5lkkDyCgdld37PLS+HQg?= =?us-ascii?Q?=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0fc3018-b04f-4017-4f2f-08dbcff1782f X-MS-Exchange-CrossTenant-AuthSource: DM5PR03MB3163.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 15:47:01.8780 (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: CH2PR03MB5350 X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 57367 Cc: Jim Porter , Lars Ingebrigtsen , 57367@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) --=-=-= Content-Type: text/plain Stefan Kangas writes: > Jim Porter writes: > >> On 9/6/2022 6:30 PM, Morgan Smith wrote: >>> 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). >> >> Thanks, this does indeed seem a lot faster. I do notice one small change in >> behavior though: after starting Eshell with the em-smart module loaded, run >> "echo hi" and then split the window vertically with 'C-x 2'. Before the patch, >> the window doesn't scroll. After the patch, the window is scrolled so that the >> "echo hi" block is at the top (i.e. the "Welcome to the Emacs shell" banner is >> hidden). >> >> The same sort of thing happens if you run a command with a lot of output first >> and then run "echo hi". Before splitting, the "echo hi" block is at the >> bottom. Without this patch, 'C-x 2' maintains that position (i.e. it scrolls the >> minimum amount of the previous command out of view so that you can see the >> most-recent command). With the patch, 'C-x 2' scrolls *all* of the previous >> command out of view, so the "echo hi" block is at the top. >> >> I think the pre-patch behavior is the most-usable: if you can fit all of the >> last command in the window, it should be at the bottom so that you can see (some >> of) the previous command. >> >> (I also saw some strange issue with resizing the windows via the mouse, but I >> can't reproduce it anymore. If I can figure out how trigger this reliably, I'll >> send an update. Sorry that's not very helpful at present...) > > That was one year ago. > > Morgan, did you get a chance to look into the issues Jim pointed out > above? Thanks for the ping. Reading the documentation for `window-configuration-change-hook' I found out I can run the scroll command only on updated windows. Furthermore, that hook selects the window which is nice. I believe the problems pointed out above stem from using `(point)` to scroll a window that wasn't actually selected. Anyways here is V3 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v3-0001-Speed-up-em-smart.patch >From 801bcf3fb761f9f32423b2c46e7e1b68a2c2ecdc Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Tue, 6 Sep 2022 21:18:51 -0400 Subject: [PATCH v3] 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. By using fewer hooks and never explicitly calling `redisplay` (which was unnecessary) the performance issues go away. lisp/eshell/em-smart.el: (em-smart-unload-hook, eshell-smart-unload-hook): Remove `eshell-smart-scroll' instead of the now deleted `eshell-refresh-windows' (eshell-smart-displayed, eshell-currently-handling-window, eshell-refresh-windows): 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-redisplay): Rename to `eshell-smart-scroll'. Delete 'eobp' case. --- lisp/eshell/em-smart.el | 83 +++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 53 deletions(-) diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el index 4c39a991ec6..f34a9ec0309 100644 --- a/lisp/eshell/em-smart.el +++ b/lisp/eshell/em-smart.el @@ -95,7 +95,7 @@ eshell-smart-unload-hook (list (lambda () (remove-hook 'window-configuration-change-hook - 'eshell-refresh-windows))) + 'eshell-smart-scroll))) "A hook that gets run when `eshell-smart' is unloaded." :type 'hook :group 'eshell-smart) @@ -159,9 +159,7 @@ eshell-where-to-jump ;;; Internal Variables: -(defvar eshell-smart-displayed nil) (defvar eshell-smart-command-done nil) -(defvar eshell-currently-handling-window nil) ;;; Functions: @@ -174,10 +172,9 @@ eshell-smart-initialize (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 'window-configuration-change-hook 'eshell-smart-scroll nil t) - (add-hook 'eshell-output-filter-functions 'eshell-refresh-windows t t) + (add-hook 'eshell-output-filter-functions 'eshell-smart-scroll-windows 90 t) (add-hook 'after-change-functions 'eshell-disable-after-change nil t) @@ -193,28 +190,15 @@ eshell-smart-initialize (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 ((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? - (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 + (with-selected-window wind + (eshell-smart-scroll))))) + 0 t)) (defun eshell-smart-display-setup () "Set the point to somewhere in the beginning of the last command." @@ -231,8 +215,7 @@ eshell-smart-display-setup (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) @@ -254,28 +237,22 @@ eshell-smart-maybe-jump-to-end (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 - (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 () + "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 (selected-window) + (pos-bol) t)) + (if (pos-visible-in-window-p (point-max) (selected-window)) + (save-excursion + (goto-char (point-max)) + (recenter -1) + (unless (pos-visible-in-window-p top-point (selected-window)) + (goto-char top-point) + (set-window-start (selected-window) + (pos-bol) t)))))) (defun eshell-smart-goto-end () "Like `end-of-buffer', but do not push a mark." @@ -323,7 +300,7 @@ eshell-smart-display-move (remove-hook 'pre-command-hook 'eshell-smart-display-move t)))) (defun em-smart-unload-hook () - (remove-hook 'window-configuration-change-hook #'eshell-refresh-windows)) + (remove-hook 'window-configuration-change-hook #'eshell-smart-scroll)) (provide 'em-smart) -- 2.41.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 28 18:48:33 2023 Received: (at 57367-done) by debbugs.gnu.org; 28 Oct 2023 22:48:33 +0000 Received: from localhost ([127.0.0.1]:39828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qws6b-0000lU-51 for submit@debbugs.gnu.org; Sat, 28 Oct 2023 18:48:33 -0400 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]:47612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qws6Z-0000ki-J5 for 57367-done@debbugs.gnu.org; Sat, 28 Oct 2023 18:48:32 -0400 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-586a5d76413so1832802eaf.3 for <57367-done@debbugs.gnu.org>; Sat, 28 Oct 2023 15:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698533273; x=1699138073; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=guciBZd1bHzSkqtvOXAINny9LtsywSg9o4zGmBGY4t0=; b=kOwMO0keDm5bT43yTjG2GbXJAUBCMyby1o/23OM/LwvZJ2eEkeEDbfgFzk+lO7wEfG +a6qRobyjg+h+igVqU2JH84BRnSwfpxs+Plh+EymKB3sryp0BQIQPR81iwHneXQENM7w hfMUul0+7bomlrgSS2myq0iyxLcD/KCm129xHmq3CGM/rlcCQmhUUrWbMeXn3HajYjYk eqtmBtx23XGBg2INH4WacAZTHvyKvGVVOex3U9JMMUZqmIKLuYaXblJ8+mCkntuf2+oN rjrEOgzyXvZI7IWiK1SOg58jFXNfrV/e5mpU3xpp0crWVMAVL41gToCmddS2wXvLrSYy H3Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698533273; x=1699138073; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=guciBZd1bHzSkqtvOXAINny9LtsywSg9o4zGmBGY4t0=; b=T6rNbcuJc8mEWML2IfGeEoZbs39tUYHVZa9aJ8m2a0Gr+QNuIdcfdKuffiEpQpKTdM A5O10VpfslKSII7cgVvtA8qVKyQKecNhkFn8MPDUeJkVvsgjJNPRiiiWJlN0rpHoKC32 cW2Ids9B3gPmiwGJwLVqUKTLjKloqs45drhqgCycTn9iLFBVTyfk0Wo4ldFzS7TtvtFb QBzEOu8WMJfskA+QaXLEmhTQIFQT4KVQPJnJf4/yi2bfylo/lhdt2vPW3R+4T1K2OorH lXPS0XXV0Wr3enMnlIMfbi5keIom6SItV2dhsPBT5/+T+dKinWVYDFDHAXafNg6FLfQN yfCw== X-Gm-Message-State: AOJu0YxchLnQKXQ/m/wJUWx/VCDBG6l5VaVYLCSVn0FXAyPN0K3BIVbS FLg3Q3HKnQsrzzvcG8RWBBU= X-Google-Smtp-Source: AGHT+IHWOj72N7ns8mqoBZ/10DYi3RbIkSBCWLofVEISxv4vcwrwlbroH3ocPt757/ClF6BkLLL1ow== X-Received: by 2002:aca:1b07:0:b0:3ab:84f0:b491 with SMTP id b7-20020aca1b07000000b003ab84f0b491mr6945827oib.19.1698533273554; Sat, 28 Oct 2023 15:47:53 -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 29-20020a17090a199d00b0027ffff956bcsm163723pji.47.2023.10.28.15.47.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Oct 2023 15:47:53 -0700 (PDT) Message-ID: Date: Sat, 28 Oct 2023 15:47:52 -0700 MIME-Version: 1.0 Subject: Re: bug#57367: [PATCH v3] Speed up em-smart Content-Language: en-US To: Morgan Smith , Stefan Kangas References: <87r10q6byc.fsf@gnus.org> <9257e0e5-232e-7e20-f4d1-385066c4337e@gmail.com> <87bkrtxzfj.fsf@gnus.org> <87ilm0x1ol.fsf@gnus.org> From: Jim Porter In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57367-done Cc: Lars Ingebrigtsen , 57367-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Version: 30.1 On 10/18/2023 8:46 AM, Morgan Smith wrote: > Thanks for the ping. Reading the documentation for > `window-configuration-change-hook' I found out I can run the scroll > command only on updated windows. Furthermore, that hook selects the > window which is nice. I believe the problems pointed out above stem > from using `(point)` to scroll a window that wasn't actually selected. > > Anyways here is V3 Thanks for the updated patch. As far as I can tell (I don't use the smart display module in Eshell), everything works here, and you even fixed a bug I noticed on master with long output! (Previously, if you ran a command with a lot of output, the prompt got hidden for some reason, probably due to using field properties for the prompt/output. That's fixed now.) I've merged this to master as e08238cdd74 now. Closing this bug. Thanks again. From unknown Wed Jun 25 00:21:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 26 Nov 2023 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator