all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pierre Neidhardt <ambrevar@gmail.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 29854@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	[thread overview]
Message-ID: <CAASvgtq+Gan6JGcGdBab=gHgJashamJ5i+iiDrk9v2sXxLUWqA@mail.gmail.com> (raw)
In-Reply-To: <87mv1ytjpg.fsf@users.sourceforge.net>

[-- Attachment #1: Type: text/plain, Size: 1744 bytes --]

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@users.sourceforge.net> wrote:

> Pierre Neidhardt <ambrevar@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.
>

[-- Attachment #2: Type: text/html, Size: 2362 bytes --]

  reply	other threads:[~2018-01-02 12:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-26 10:43 bug#29854: 25.3; Eshell buffer editing gets slower as colored output grows Pierre Neidhardt
2018-01-01  2:07 ` Noam Postavsky
2018-01-02 12:40   ` Pierre Neidhardt [this message]
2018-01-02 13:50     ` Noam Postavsky
2018-01-03 11:46       ` Pierre Neidhardt
2018-01-03 13:33         ` Noam Postavsky
2019-05-04 19:49           ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAASvgtq+Gan6JGcGdBab=gHgJashamJ5i+iiDrk9v2sXxLUWqA@mail.gmail.com' \
    --to=ambrevar@gmail.com \
    --cc=29854@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.