From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#50179: [PATCH] Add support for "bright" ANSI colors to ansi-color and term-mode Date: Tue, 24 Aug 2021 15:07:01 +0300 Message-ID: <838s0rvyfu.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36107"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50179@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 24 14:08:34 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 1mIVEG-0009Ab-Nb for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Aug 2021 14:08:32 +0200 Original-Received: from localhost ([::1]:58008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIVEF-0007Qd-Po for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Aug 2021 08:08:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIVDm-0007Bf-N1 for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 08:08:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIVDm-0005AC-Ee for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 08:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mIVDm-0007Ce-36 for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 08:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Aug 2021 12:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50179 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 50179-submit@debbugs.gnu.org id=B50179.162980683727633 (code B ref 50179); Tue, 24 Aug 2021 12:08:02 +0000 Original-Received: (at 50179) by debbugs.gnu.org; 24 Aug 2021 12:07:17 +0000 Original-Received: from localhost ([127.0.0.1]:43374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIVD2-0007Bd-PA for submit@debbugs.gnu.org; Tue, 24 Aug 2021 08:07:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIVD0-0007BP-DB for 50179@debbugs.gnu.org; Tue, 24 Aug 2021 08:07:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33660) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIVCv-0004g0-2j; Tue, 24 Aug 2021 08:07:09 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3233 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIVCu-0001bP-My; Tue, 24 Aug 2021 08:07:09 -0400 In-Reply-To: (message from Jim Porter on Mon, 23 Aug 2021 21:02:46 -0700) 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:212535 Archived-At: > From: Jim Porter > Date: Mon, 23 Aug 2021 21:02:46 -0700 > > With the administrative issues out of the way... these patches provide > support for "bright" ANSI colors (SGR 90-97 and 100-107 for foreground > and background, respectively)[1]. Most of the complexity here is due > to the new defcustoms `*-bold-is-bright'. Enabling this results in > ANSI "bold" text (SGR 1) to be rendered in the bright color palette > (as well as being bold). This is a pretty common option in terminal > emulators; all the ones I looked at[2] support it, and it's often the > default behavior. For me, the main benefit of this option is so I can > easily match the color palettes between Emacs and my terminal > emulator. > > I've split this into two patches, one for 'ansi-color' and one for > 'term-mode'. Despite the similarity in functionality, the > implementations are pretty different. It might be nice if they could > be unified somehow, but that may be more trouble than it's worth... Thanks, please see some comments below. > +(defcustom ansi-bright-color-names-vector > + ["gray30" "red2" "green2" "yellow2" "blue1" "magenta2" "cyan2" "white"] > + "Colors used for SGR control sequences determining a \"bright\" color. > +This vector holds the colors used for SGR control sequences parameters > +90 to 97 (bright foreground colors) and 100 to 107 (brightbackground > +colors). I wouldn't offer a customizable list for this: users have no particular reason to redefine standard colors. > (defun ansi-color--find-face (codes) > "Return the face corresponding to CODES." > - (let (faces) > + ;; Sort the codes in ascending order to can guarantee that "bold" comes ^^^^^^^^^^^^^^^^ Something wrong with the wording here. > (term-color-bright-*): New faces. Please name the new faces explicitly. > +(defcustom term-color-bold-is-bright nil > + "If set to non-nil, combining ANSI bold and a color produces the bright > +version of that color." > + :group 'term > + :type 'boolean > + :version "28.1") Do we really need 2 separate knobs for these two features? How probable is it that the same user will want to have bright colors in one package, but not in the other?