From patchwork Wed Sep 3 13:39:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [1,of,3] color: document that labels are used for colourising text From: =?utf-8?q?Jordi_Guti=C3=A9rrez_Hermoso?= X-Patchwork-Id: 5689 Message-Id: To: mercurial-devel@selenic.com Date: Wed, 03 Sep 2014 09:39:06 -0400 # HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1408916136 14400 # Sun Aug 24 17:35:36 2014 -0400 # Node ID c1b3584876e7a2e3001ce1324adde0fb94d23804 # Parent e3045cd4dc22cbd9cbf0c3a22756b4e409d54627 color: document that labels are used for colourising text It is a deeply hidden secret that it's possible to colorise so many things with so many different labels. This is an attempt to document this. The text is a bit long, but it seems as short as can be while documenting everything. Perhaps it should be hidden under a --verbose option. diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -19,7 +19,16 @@ terminal codes used to change color and available, then effects are rendered with the ECMA-48 SGR control function (aka ANSI escape codes). -Default effects may be overridden from your configuration file:: +Text receives color effects depending on the labels that it has. Many +default Mercurial commands emit labelled text. You can also define +your own labels in templates using the label function, see :hg:`help +templates`. A single portion of text may have more than one label. In +that case, effects given to the last label will override any other +effects. This includes the special "none" effect, which nullifies +other effects. + +The following are the default effects for some default labels. Default +effects may be overridden from your configuration file:: [color] status.modified = blue bold underline red_background