From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pierre Neidhardt Newsgroups: gmane.emacs.bugs Subject: bug#29854: 25.3; Eshell buffer editing gets slower as colored output grows Date: Tue, 2 Jan 2018 13:40:00 +0100 Message-ID: References: <87vagt6a7d.fsf@gmail.com> <87mv1ytjpg.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113730c8a8d3670561ca659f" X-Trace: blaine.gmane.org 1514896772 10845 195.159.176.226 (2 Jan 2018 12:39:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 Jan 2018 12:39:32 +0000 (UTC) Cc: 29854@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 02 13:39:28 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWLqc-0001jq-9j for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jan 2018 13:39:14 +0100 Original-Received: from localhost ([::1]:41329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWLsY-0006CS-FE for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jan 2018 07:41:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWLsO-0006Bu-Sx for bug-gnu-emacs@gnu.org; Tue, 02 Jan 2018 07:41:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWLsM-0003Ra-7I for bug-gnu-emacs@gnu.org; Tue, 02 Jan 2018 07:41:04 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWLsM-0003R7-2H for bug-gnu-emacs@gnu.org; Tue, 02 Jan 2018 07:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eWLsL-0004Ik-PD for bug-gnu-emacs@gnu.org; Tue, 02 Jan 2018 07:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pierre Neidhardt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Jan 2018 12:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29854-submit@debbugs.gnu.org id=B29854.151489680916456 (code B ref 29854); Tue, 02 Jan 2018 12:41:01 +0000 Original-Received: (at 29854) by debbugs.gnu.org; 2 Jan 2018 12:40:09 +0000 Original-Received: from localhost ([127.0.0.1]:60582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWLrU-0004HL-Kz for submit@debbugs.gnu.org; Tue, 02 Jan 2018 07:40:09 -0500 Original-Received: from mail-ot0-f181.google.com ([74.125.82.181]:35025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWLrS-0004Gn-8F for 29854@debbugs.gnu.org; Tue, 02 Jan 2018 07:40:06 -0500 Original-Received: by mail-ot0-f181.google.com with SMTP id q5so21100946oth.2 for <29854@debbugs.gnu.org>; Tue, 02 Jan 2018 04:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=17ArDJth7CO7HQeA3ybZVQMETkWkZ5H55MEI1fa+iwk=; b=O4MntZ3GgJ31HmJN+O3pYVH6xl/wuAQgX5yP0iAIl+3JDD3qcY+inJqfPSL6AOqxxb qRPuXjYvBHDePsOI2KstF2N975R/tHiqz80tergcf/7n+IAE2k6F5NVO8fjHHDJ9xxuo 9WsVR88fResR+l1bcxSz7P35GkKC7Nmpe/v31koFIvV53NLyBEqRhy9/b21xP9UgtMXm mxnjN+QIkE2Nuo7BHDlwHucM1wZk/sboegd3/sX9ed70KuY6FeJSqC//889tEX/4K162 w9O8hBgPW76C0BT6YXYoZmyfY/YMz1aM7bZW+U/nl5vHCfCvoSMHjbrnnosNrlbTzaqN /Gfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=17ArDJth7CO7HQeA3ybZVQMETkWkZ5H55MEI1fa+iwk=; b=j3zJnXBmdGE7EbEyvWEBMOMHbaCssv7fYu1DcHlwsTPlTp51eZubRmNYiiPvqzbNZ2 ZcwAL21n9VX1LJeiCB+pZasx7WCi1cUS501fhKqfZf9m1Adxke5bnnCxS6N53Q6Orwto YOKngdRZEUs5jqXpZ+5xcACaUEwbh0X4s4X5SpSEUE61XasVAc0VyPiG51w/4KPrr1US 828Uo2He3EoT2kRc0ooootrYCYhVbJPBW8QcVNDMG6yLP1LBEkgvG3eSNTfdSzyZ/1FX piqJxJCigYk2jIVmORP/eaJmOKBsyUyNlVgdWKmnq4/SablyCETauvJFrBNXpu5c4TS7 kolg== X-Gm-Message-State: AKGB3mI5jNuQUX8+nu+Q8PYL7U9jpqUErB7gyEV34FDqRgAK/x8KBP5L p2TjZsqlOaKRXKfvFHE8UQDrD4wNoNyAgAJl5lw= X-Google-Smtp-Source: ACJfBot43nZu6pfBTxYKdWf9dN99/Q7xozpo4vMscdrqVV+fdsnyvSKgBE6G15syRulUMTk83SNRy/MGUF4x+q/f4Rw= X-Received: by 10.157.39.21 with SMTP id r21mr33001394ota.127.1514896800402; Tue, 02 Jan 2018 04:40:00 -0800 (PST) Original-Received: by 10.157.44.35 with HTTP; Tue, 2 Jan 2018 04:40:00 -0800 (PST) In-Reply-To: <87mv1ytjpg.fsf@users.sourceforge.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:141710 Archived-At: --001a113730c8a8d3670561ca659f Content-Type: text/plain; charset="UTF-8" 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 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. > --001a113730c8a8d3670561ca659f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The patch does not seem to do it.=C2=A0 Unless load order = matters?

The redifinition of `ansi-color-apply-face-func= tion` works however, plus it comes at the bonus of making Eshell an order o= f 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=3Dalwa= ys' a few times.
>
> - Go to normal state and press `x' wherever you can delete a chara= cter.
>
> It should be possible to reproduce without Evil, I just could not figu= re
> 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
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0start-marker = end-marker (ansi-color--find-face codes))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0(setq ansi-color-context-region (if codes (list= codes)))))))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0(setq ansi-color-context-region (if codes (list= codes)))))
+=C2=A0 =C2=A0 ;; Clean up our temporary markers.
+=C2=A0 =C2=A0 (unless (eq start-marker (cadr ansi-color-context-region)) +=C2=A0 =C2=A0 =C2=A0 (set-marker start-marker nil))
+=C2=A0 =C2=A0 (set-marker end-marker nil)))

Also, I wonder if doing this would help also?

=C2=A0 =C2=A0 (setq
=C2=A0 =C2=A0 =C2=A0ansi-color-apply-face-function
=C2=A0 =C2=A0 =C2=A0(lambda (beg end face)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(when face
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(put-text-property beg end 'face face= ))))

That should make Emacs use text properties instead of overlays for the
colored text.

--001a113730c8a8d3670561ca659f--