GNU bug report logs - #29854
25.3; Eshell buffer editing gets slower as colored output grows

Previous Next

Package: emacs;

Reported by: Pierre Neidhardt <ambrevar <at> gmail.com>

Date: Tue, 26 Dec 2017 10:44:02 UTC

Severity: minor

Tags: fixed

Found in version 25.3

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pierre Neidhardt <ambrevar <at> gmail.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 29854 <at> debbugs.gnu.org
Subject: bug#29854: 25.3; Eshell buffer editing gets slower as colored output grows
Date: Tue, 2 Jan 2018 13:40:00 +0100
[Message part 1 (text/plain, inline)]
The patch does not seem to do it.  Unless load order matters?

The redifinition of `ansi-color-apply-face-function` works however, plus it
comes at the bonus of making Eshell an order of magnitude faster!
I haven't tested estensively yet, but it seems to be a much better default.

On Mon, Jan 1, 2018 at 3:07 AM, Noam Postavsky <
npostavs <at> users.sourceforge.net> wrote:

> Pierre Neidhardt <ambrevar <at> gmail.com> writes:
>
> > The recipe with Evil is as follows:
> >
> > - Start Emacs.
> >
> > - `M-x eshell'.
> >
> > - Insert lots of colored text. On Linux, you can call `dmesg -L=always'
> a few times.
> >
> > - Go to normal state and press `x' wherever you can delete a character.
> >
> > It should be possible to reproduce without Evil, I just could not figure
> > out a slow operation to replace the last step in the recipe.
> >
> > According to the Evil maintainer, the issue comes from markers left
> > behind.
>
> So does this fix it?
>
> --- i/lisp/ansi-color.el
> +++ w/lisp/ansi-color.el
> @@ -417,3 +417,7 @@ ansi-color-apply-on-region
>                  start-marker end-marker (ansi-color--find-face codes))
> -       (setq ansi-color-context-region (if codes (list codes)))))))
> +       (setq ansi-color-context-region (if codes (list codes)))))
> +    ;; Clean up our temporary markers.
> +    (unless (eq start-marker (cadr ansi-color-context-region))
> +      (set-marker start-marker nil))
> +    (set-marker end-marker nil)))
>
> Also, I wonder if doing this would help also?
>
>     (setq
>      ansi-color-apply-face-function
>      (lambda (beg end face)
>        (when face
>          (put-text-property beg end 'face face))))
>
> That should make Emacs use text properties instead of overlays for the
> colored text.
>
[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 17 days ago.

Previous Next


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