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

Previous Next

Package: emacs;

Reported by: Morgan Smith <Morgan.J.Smith <at> outlook.com>

Date: Tue, 23 Aug 2022 20:07:02 UTC

Severity: normal

Tags: moreinfo, patch

Fixed in version 30.1

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, johnw <at> gnu.org, 57367 <at> debbugs.gnu.org
Subject: bug#57367: [PATCH] Speed up em-smart
Date: Mon, 05 Sep 2022 17:48:09 -0400
Hello,

Jim Porter <jporterbugs <at> gmail.com> 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




This bug report was last modified 1 year and 211 days ago.

Previous Next


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