From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#50806: 27.2; [PATCH] Optimize ansi-color.el Date: Sun, 3 Oct 2021 13:16:05 -0700 Message-ID: <3e19d87f-371b-31d5-cc1a-dd0b22659acf@gmail.com> References: <87tui8wakb.fsf@miha-pc> <25ed8125-3f78-c9c9-9324-d75e48e702c6@gmail.com> <87k0itc2ap.fsf@miha-pc> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24548"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen To: miha@kamnitnik.top, 50806@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 03 22:17:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mX7vA-00064k-5t for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Oct 2021 22:17:16 +0200 Original-Received: from localhost ([::1]:46008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mX7v7-0008Ne-Gy for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Oct 2021 16:17:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mX7uw-0008NV-Fg for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 16:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mX7uw-0007Xf-7z for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 16:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mX7uv-0003Ix-Oc for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 16:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Oct 2021 20:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50806 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 50806-submit@debbugs.gnu.org id=B50806.163329217810624 (code B ref 50806); Sun, 03 Oct 2021 20:17:01 +0000 Original-Received: (at 50806) by debbugs.gnu.org; 3 Oct 2021 20:16:18 +0000 Original-Received: from localhost ([127.0.0.1]:35050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX7uE-0002kx-1Z for submit@debbugs.gnu.org; Sun, 03 Oct 2021 16:16:18 -0400 Original-Received: from mail-pl1-f181.google.com ([209.85.214.181]:39793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX7u9-0002cT-Le for 50806@debbugs.gnu.org; Sun, 03 Oct 2021 16:16:17 -0400 Original-Received: by mail-pl1-f181.google.com with SMTP id c4so9716225pls.6 for <50806@debbugs.gnu.org>; Sun, 03 Oct 2021 13:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=NMYHLR5IzkVkk7a8Emg1rWqHbalLOGY/oHrJQCpHFB4=; b=k+HRxS74hwkXRuoTvvGcC1cQMgwh0R/eoMaaJ0BUDPfdIUR7EMPRiDdJyyM6lLPkcK bI/8Z7MjO2Gone6lCKR6kCWqX67tx3j/D3xyXcoZ34W1AGhuoT7LyBEsBZTiTrWcYw5u 1R+9yZUors7FoPWvj5bqfFDzHj+t+RYVwDJNYCep9+HFroK4BPDlIPWOudFQ8jpSCFLH bGwcaeulgBW8tUZFinJDenCqboSq5CNT30FWMB7hczP7GuYU1YM6GPc8MoDpQpDwSjQ1 7GpDOwDW/XsSvc1ugh0i85icqv2+hvRLsFoAiua0hjrrEHeyIw4sTa5hKSF4UQe+U+fx KekA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NMYHLR5IzkVkk7a8Emg1rWqHbalLOGY/oHrJQCpHFB4=; b=llqL4zZLJpMeqok7TonLjPpvoJUDFxkZQks05f+Zcgl0BkljAA3IK27eHNnV0s0RhH pTYdzYBlcx/LZJHHO6TJGxUmxj8DV3B7c3KXMtTq9f3yOlj5vS8l9jdH/CxUfiQHIRN/ rznT9TwHYY8VVKEIEHQu488FxEDMOWT+jvtpGi4PqgV/0oe5QtQlyJeh9WPpgR7UaM0G BpAF+MsUFMYSeijEtY8G1qRWlZAKnbaOc4cdbqb4Tq+5YUI3PbTcjmF5H+5QVWLbDv/F mUdNerYtJJaLAoKFh1rUBfAZ/Sb7BEH02JvEjbSm9vxzmS0NnJ03w4rEqP4IXziOdIZj vTOw== X-Gm-Message-State: AOAM530tKgcqLhJRgWToFB0V/CNGyGgxU3ECj3Zt8o2wW007KDHGXXC3 iLJ9WKfi0k0AsvhlWtmPpIw= X-Google-Smtp-Source: ABdhPJzH70s7SkmfVqu0UobQnK8rkw6uUQiRmAavR+EQo1SsG4ZWWkN6UiLBtqWxrGLb27sY6f8CJA== X-Received: by 2002:a17:90b:4c43:: with SMTP id np3mr8456610pjb.187.1633292167784; Sun, 03 Oct 2021 13:16:07 -0700 (PDT) Original-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 s3sm13664069pjr.1.2021.10.03.13.16.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Oct 2021 13:16:07 -0700 (PDT) In-Reply-To: <87k0itc2ap.fsf@miha-pc> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:216309 Archived-At: On 10/3/2021 12:54 PM, miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Ok, thanks. I have actually already prepared patches for all these > features: full-color in ansi-color.el and term.el and also "basic" ANSI > escapes 1-8 for term.el that you mentioned. > > I guess there's no harm in sending them right now. I took a brief look at these and they seem reasonable to my eyes. It'll be nice to have (mostly) complete support for reading ANSI colors in Emacs. Thinking about it a bit more, one thing that might be nice to add for the first patch would be some additional tests to be sure that `ansi-color-context-region' and `ansi-color-context' work as expected (i.e. testing that multiple calls to `ansi-color-apply-on-region' and similar produce the correct results). That's one of the trickier bits in ansi-color.el (to me, anyway), and it'd be good to be sure all the various cases still work there. That said, it might be best to let the maintainers take a look before spending too much time on further tests. >> I see you posted an updated patch that doesn't merge these vectors. I >> don't have an opinion here, although if we do merge them, it would >> probably be nice to get that into Emacs 28; other packages might >> conceivably want to let-bind those[1]. > > Indeed, if we wanted to merge them we'd have to do it in Emacs 28. > That's why I think its best to simply leave them un-merged. If there's a performance benefit to merging them, I think it would be nice to do so while we have the chance. Perhaps a patch that just merges the two vectors, and nothing else, would make sense for Emacs 28. Best to ask the maintainers in this case too, though.