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#54774: 28.1; ansi-color with no colors in Emacs-28 Date: Fri, 8 Apr 2022 11:23:41 -0700 Message-ID: <5f2525c7-bfc3-cac7-7dda-a10b11c6592d@gmail.com> References: <877d80pstl.fsf@posteo.net> <87tub37lqe.fsf@gnus.org> 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="4740"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54774@debbugs.gnu.org To: Lars Ingebrigtsen , Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 08 20:24:53 2022 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 1nctHw-0000zF-Nf for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Apr 2022 20:24:52 +0200 Original-Received: from localhost ([::1]:34546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nctHv-0007xs-C2 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Apr 2022 14:24:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nctH9-0007xb-8b for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2022 14:24:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42023) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nctH7-0001qj-PV for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2022 14:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nctH7-0003cd-M0 for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2022 14:24: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: Fri, 08 Apr 2022 18:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 54774-submit@debbugs.gnu.org id=B54774.164944223113907 (code B ref 54774); Fri, 08 Apr 2022 18:24:01 +0000 Original-Received: (at 54774) by debbugs.gnu.org; 8 Apr 2022 18:23:51 +0000 Original-Received: from localhost ([127.0.0.1]:35920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nctGw-0003cE-Q7 for submit@debbugs.gnu.org; Fri, 08 Apr 2022 14:23:51 -0400 Original-Received: from mail-pf1-f170.google.com ([209.85.210.170]:41898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nctGu-0003c2-Va for 54774@debbugs.gnu.org; Fri, 08 Apr 2022 14:23:49 -0400 Original-Received: by mail-pf1-f170.google.com with SMTP id p8so9039555pfh.8 for <54774@debbugs.gnu.org>; Fri, 08 Apr 2022 11:23:48 -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=DxfIC1/FLzS1MZ5LtuNBjexWVHVnSaunHSLiTyMbCtQ=; b=TxfSpfSxU2Tlk8xHJzqMLB8/Da8jtYkG8tRpUrWTDaPf4KOVhuwjdHEnRx/XcHM+H3 1a3MPhu3ONiJR+qtl+VOVt2iMT5dfegMee+/Q1khPjyHZDvRTgkTfvtYf+4GUY6Y65UV Xhg0PkIHE9xfgARtEonQNRKlKU6ymP/EQXRRh8fhyKpo1Y8m0Il+3mfuOdqCRG5AaK1j MQASr2Di4V0ty265Ll4JCTIFSYAYLwBW2wtPVcmZujNrRP+oPR1HXCBKs4tAgw0F4/2w WT4PegKPiWsaOR2SPhVNHLqPiw8tPWb9S0PPDceTRWb6T/SGihztxoZfSGoq7ERVyGSk WxYw== 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=DxfIC1/FLzS1MZ5LtuNBjexWVHVnSaunHSLiTyMbCtQ=; b=XqrxOPbLF8l7SQLYtygXn+V+uyKp/O/Xp2BRzENdZu9/zO6UiS9HngfrttmfK98wUb cOWxh8kBaqzLddLUwDsYZOwe5VWrBzH4O4GRIqk2gJzxtIrzxMpvTx6jHmhgEdTGJZRx t3bcXHxO0kTduKFQCQQkBSMDcGcOxABHA25jB+1X8lNqn3grSGfOpFillYNmz2P2Jx4x v7UztinMrlRtYA3uyGkhE1Z3er5Z7rtnJTk8NF7dfTTPEg+dfEW9cYCu/i5r6g1pOiNE L0oa4va5oyKORs/oJPcO4NKTRlvBigqMxDbjLtFubm9qQyzE5/xUH3ABf4AYb4LC6FMn xz2A== X-Gm-Message-State: AOAM530787MDqdTHte28fzMVBqNQKKrFZunTSiGkgG5Mce/zcp/iZtDN pMCUofrG6ANfWqgDxEfqtEmdINMfep0= X-Google-Smtp-Source: ABdhPJzOp0Sn+cbdnM0VJfKmZZG24Gj5FECgIZvVFfoKyHbozn2rEFFu5/RmhwvtDuVLHKzJ4tkDig== X-Received: by 2002:a63:7d4a:0:b0:398:dad:6963 with SMTP id m10-20020a637d4a000000b003980dad6963mr16356263pgn.329.1649442223084; Fri, 08 Apr 2022 11:23:43 -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 f14-20020a63380e000000b0038253c4d5casm22127691pga.36.2022.04.08.11.23.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 11:23:42 -0700 (PDT) In-Reply-To: <87tub37lqe.fsf@gnus.org> 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:229586 Archived-At: On 4/8/2022 6:23 AM, Lars Ingebrigtsen wrote: > Thierry Volpiatto writes: > >> it seems using ansi-color-apply in Emacs-28 is not working properly, >> there is no colors. In Emacs-29 it is working properly (very nice) >> without needing a workaround used previously in emacs-27 (code commented). >> See code below to reproduce and Screenshots attached. > > I'm not sure I understand this bug report. Are you asking for the code > in ansi-color in Emacs 29 to be backported to Emacs 28.2? I think the issue is that there were some changes in Emacs 28.1 (by me, see commit ceb9da3b7125fbdf0da04a3b158ac1e792c87f4f) to add support for ANSI "bright" colors. In 29, Miha added support for 256-color and 24-bit ANSI colors as well (see 0fa2279b90bf5a638d8377032b71135e1374e8fb). I've verified that Emacs 28.1 properly handles normal and bright ANSI colors in shell output. Bold/italic/etc works correctly as well, even though I added an unnecessary quote to the face definitions - that's been fixed in Emacs 29, and could be backported to 28, though I don't think it causes any serious problems. That said, it looks like Thierry had written some code for Emacs 27 that scans the output of a command that uses ANSI 256-color sequences and then translates those sequences into ANSI 8-color sequences that ansi-color.el will understand. However, that code no longer works in Emacs 28, possibly due to my changes to support ANSI bright colors. I'm not sure this is actually a bug in Emacs; it may just mean that Thierry's workaround needs to be updated to account for the ansi-color.el changes I made. I'm a little unclear about what actually broke though, and haven't had a chance to dig deeper. Some basic testing of `ansi-color-apply' shows that it does what I expect. From "emacs -Q": (require 'ansi-color) (ansi-color-apply "\033[44mfoo\033[0m") -> #("foo" 0 3 (font-lock-face (:background "blue2"))) (ansi-color-apply "\033[44;33mfoo\033[0m") -> #("foo" 0 3 (font-lock-face ((:foreground "yellow3") (:background "blue2")))) That's the same behavior as Emacs 27.2 with some trivial differences (Emacs 27.2 uses `foreground-color' instead of `:foreground').