Re: [PATCH v2 09/12] pretty: add %C(auto) for auto-coloring on the next placeholder
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Apr 15, 2013, 09:54 UTC
- Message-ID
- <CACsJy8A6vMxZLn8RXaxxMAg2yx-Pmfriip_u_DSSYeyjwY2aHg@mail.gmail.com>
- In-Reply-To
- <7v8v4wdhpd.fsf@alter.siamese.dyndns.org>
On Sat, Apr 6, 2013 at 4:13 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> If %C(auto) applies to some %<placeholder> but not to some others, > the user needs to learn which %<placeholder> will eat the "auto" (so > it no longer applies to the next one) and which one will not even > look at "auto" (so the next %<placeholder> is affected by the auto, > i.e. making the effect of auto skip a %<placeholder>). If the rule > were "%C(auto) applies to -next- placeholder", then the user does > not have to worry about which ones are what you call textual and > which ones are not (and there is no textual placeholder defined in > the glossary). > > That would make it harder to learn. It would be much easier to > explain if you said "%C(auto) affects the next %-placeholder and > then resets".
So far (after this series, that is), we have two modifiers: %C(auto) and %< (and friends). Both can be used to modify the "next" placeholder, so either of them must learn to ignore the next non-textual placeholder...
> I wonder if "Everything after %C(auto) will not be coloured if the > output is not going to the terminal.", i.e. not resetting once > colouring decision is made, makes more sense, though...
.. or we do this, which makes %< and friends the only placeholders that care about the next one. Thanks for the idea. -- Duy