Patchwork [1,of,3] color: document that labels are used for colourising text

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date Aug. 24, 2014, 10:38 p.m.
Message ID <91070d12638c10a6fe77.1408919912@Iris>
Download mbox | patch
Permalink /patch/5577/
State Superseded
Headers show

Comments

Jordi Gutiérrez Hermoso - Aug. 24, 2014, 10:38 p.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1408916136 14400
#      Sun Aug 24 17:35:36 2014 -0400
# Node ID 91070d12638c10a6fe77d83ed5799f78a36901bf
# Parent  258f682b167cdbbbc65eeb0ad37a824e6650c42f
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 and give an option to view the labels.
Martin Geisler - Aug. 25, 2014, 9:05 a.m.
Jordi Gutiérrez Hermoso <jordigh@octave.org> writes:

> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> # Date 1408916136 14400
> #      Sun Aug 24 17:35:36 2014 -0400
> # Node ID 91070d12638c10a6fe77d83ed5799f78a36901bf
> # Parent  258f682b167cdbbbc65eeb0ad37a824e6650c42f
> 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 and give an option to view the labels.
>
> diff --git a/hgext/color.py b/hgext/color.py
> --- a/hgext/color.py
> +++ b/hgext/color.py
> @@ -19,7 +19,13 @@ 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`.

Please use "hg" role here, that is, use :hg:`help templates` instead.
That will give you a free hyperlink to the templates help topic in the
HTML documentation.
Jordi Gutiérrez Hermoso - Aug. 25, 2014, 9:07 p.m.
On Mon, 2014-08-25 at 11:05 +0200, Martin Geisler wrote:
> Jordi Gutiérrez Hermoso <jordigh@octave.org> writes:

> > @@ -19,7 +19,13 @@ 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`.
> 
> Please use "hg" role here, that is, use :hg:`help templates` instead.

Thank you for catching that. I have amended and resent.

Patch

diff --git a/hgext/color.py b/hgext/color.py
--- a/hgext/color.py
+++ b/hgext/color.py
@@ -19,7 +19,13 @@  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`.
+
+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