unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Hannu Hartikainen <hannu@hrtk.in>
To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
Subject: Re: [PATCH v2] cli/show: add --format=pretty
Date: Sun, 04 Jul 2021 14:54:49 +0300	[thread overview]
Message-ID: <60e1a18a.1c69fb81.6fa74.570b@mx.google.com> (raw)
In-Reply-To: <m2zgv25sd0.fsf@guru.guru-group.fi>

Thanks for the review!

On Sun, 04 Jul 2021 12:40:59 +0300, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> The code looks good to me, just that these "hardcoded" color values gives
> me a bit of suspicion...

That's true and I do think the colors could eventually be configurable,
but right now I don't know how the configuration should work. Should it
be a palette, should each header have a configurable color (and should
the displayed headers be configurable too) etc. It's easy to make this
hugely bloated so I'll avoid going there until I have a clear idea of a
good, minimal approach.

> the colors look OK when background is dark (black). on light background
> (white) color 33 (yellow), color 36 (cyan) and color 32 (green) are
> somewhat hard to read (in decreasing hardness)...

Most terminals have user-configurable colors so I don't think this is a
showstopper. But as I said, yes, it would be best to make the colors
configurable.

> I did not try to apply this and see how those looks like when displaying
> real emails (no setup on this machine for now...)

Here's a screenshot: https://i.imgur.com/7dlP7lt.png

I'm happy to receive any suggestions but I think it's best to stay with
the original 3-bit spec (SGR codes 30-37, or in practice 31-36: red,
green, yellow, blue, magenta, cyan) if the values are hardcoded. Those
are most widely supported.

> One option would be to first send this without color support and then
> add *configurable* color support -- I don't know which way is better
> but as a rewiever that would be easier to accept...

That's an excellent idea! I'll post PATCH v3 later. I don't really want
to try real feature detection because some terminals have weird corner
cases with their ANSI sequence support. `isatty` is what other CLI tools
tend to use as default AFAIK.

Hannu

  reply	other threads:[~2021-07-04 11:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-19 20:38 [PATCH] cli/show: add --format=pretty Hannu Hartikainen
2021-06-22 12:34 ` [PATCH] cli/show: add --color/--no-color Hannu Hartikainen
2021-07-12  8:38   ` Yet another revision of --format=pretty Hannu Hartikainen
2021-07-12  8:38     ` [PATCH v3 1/2] cli/show: add --format=pretty Hannu Hartikainen
2021-07-12 23:40       ` David Bremner
2021-07-13 10:24         ` David Bremner
2021-07-13 11:50           ` Hannu Hartikainen
2021-07-12  8:38     ` [PATCH v3 2/2] cli/show: add color for --format=pretty Hannu Hartikainen
2021-07-12 23:19     ` Yet another revision of --format=pretty David Bremner
2021-07-13 12:07       ` Hannu Hartikainen
2021-07-02 20:31 ` [PATCH v2] cli/show: add --format=pretty Hannu Hartikainen
2021-07-04  9:40   ` Tomi Ollila
2021-07-04 11:54     ` Hannu Hartikainen [this message]
2021-07-04 14:38 ` [PATCH] " David Bremner
2021-07-05 13:31   ` Hannu Hartikainen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60e1a18a.1c69fb81.6fa74.570b@mx.google.com \
    --to=hannu@hrtk.in \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).