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#50179: [PATCH] Add support for "bright" ANSI colors to ansi-color and term-mode Date: Tue, 24 Aug 2021 10:38:06 -0700 Message-ID: References: <838s0rvyfu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27750"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50179@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 24 19:39:17 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 1mIaOK-0006yP-Ag for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Aug 2021 19:39:16 +0200 Original-Received: from localhost ([::1]:44490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIaOI-0005k9-5L for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Aug 2021 13:39:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIaO7-0005jN-3C for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 13:39:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIaO6-0003fi-SJ for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 13:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mIaO6-0003mo-NT for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 13:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Aug 2021 17:39: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.162982670214479 (code B ref 50179); Tue, 24 Aug 2021 17:39:02 +0000 Original-Received: (at 50179) by debbugs.gnu.org; 24 Aug 2021 17:38:22 +0000 Original-Received: from localhost ([127.0.0.1]:45118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIaNS-0003lT-Bv for submit@debbugs.gnu.org; Tue, 24 Aug 2021 13:38:22 -0400 Original-Received: from mail-ua1-f54.google.com ([209.85.222.54]:43643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIaNR-0003lH-C4 for 50179@debbugs.gnu.org; Tue, 24 Aug 2021 13:38:21 -0400 Original-Received: by mail-ua1-f54.google.com with SMTP id j31so5584519uad.10 for <50179@debbugs.gnu.org>; Tue, 24 Aug 2021 10:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i3sCoPKU3DJGW4Diek13Hk2cqVKBGojZGD8uEXp8A0g=; b=iJ8lPHMgq4WjIVIkQjy34Yvf+3SSbrMCqu0A53pYJmVdecrJVykm47qeAfNkwDFsMS KpJe7UVG6dUetbSzKUKAoit3gkwf3tsxWZJp0IdbIfoYeNJQR+uR6qUlsdLG9+DsdQRl HQG8sC6ziHIncjnjAltR85FYEMzqm8JuD2UXOaIR191OOVise9gmG+ByL5JJpuAMd7nz SHyut1+qohPIEBvV0G5C2M/GaRMk9y9mp68FUxLEDc70UL+aiiWC934eoJQhU6xaZePc 97jk+D/gj1ovhxomZdUbzhy2n7NrClR9ExzoigUG8GGxs1uqS6dscYQbiW8jEfJ2mCnC WscA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i3sCoPKU3DJGW4Diek13Hk2cqVKBGojZGD8uEXp8A0g=; b=dY9paz0wpjjC4P3nf+xZY7r0mECd51uOxGpfzrMdcKM51pPDmUO7rqDH4xMvEpwBzT rdFiiS3Zw0NyIAAfWihTqT9bPC0gvMJWbF227SPtweqU8cX6k2XkXxwz2EhmYlgPGhvk AVEHInyEQxxQjlW3tp0uehlQ6RaXHgJWVRd/9kY4PFRWobB9mjWC6gbXWgZkqe6R0UME Esu1u0NyyJPAyDmSoQjnJFD9mea/NIBWQhDmdgP+wkZL9C2qmUs+fuKdSlLz89ESHp2J wZljm2G675UEvArAQivHy8xxO/8x+iy+ZH2+JdVauPge7cmdP/rGzW3fy6I7qnfc/w/W PnCg== X-Gm-Message-State: AOAM531e1WXzjIwrhuwn7FGtY1ATkjBJ1apQ8I/1k6KdCU6Ha+mutm9m zpqtRFH+Hcyve/0ft1ulvuDk3eu/7odqD/D36RE= X-Google-Smtp-Source: ABdhPJwGjxXlsusNg+50O9f2K1eGvOx6bFqcJQOp2FgQ4Vaiq6scCJo7aNupqfkfgWEhMgqYPwc7CiKhpjQ0vlUJDTs= X-Received: by 2002:a67:e343:: with SMTP id s3mr29359855vsm.33.1629826695851; Tue, 24 Aug 2021 10:38:15 -0700 (PDT) In-Reply-To: <838s0rvyfu.fsf@gnu.org> 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:212560 Archived-At: On Tue, Aug 24, 2021 at 5:07 AM Eli Zaretskii wrote: > > > +(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. I made this a defcustom because `ansi-color-faces-vector' and `ansi-color-names-vector' are defcustoms too. More practically speaking, I'd want to customize this new variable to make these colors match the Emacs theme I use. I chose colors in this patch to complement `ansi-color-names-vector', but they'd clash with my theme. > > +(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? I doubt anyone would want to control these independently. It'd be nice to have a single defcustom for this, but I wasn't sure where it should go in that case. Would it be ok to use `ansi-color-bold-is-bright' (from patch 1 in `ansi-color.el') in `term.el'? I see that `term.el` requires `comint.el', which requires `ansi-color.el', so `term.el' should see it without changing what gets loaded. (It might even be nice to use the same definitions for the colors in both `ansi-color.el' and `term.el', but that would take a bit of work to migrate users'/themes' customizations. Maybe that's something to do for Emacs 29 so I have time to figure out a good migration path.)