public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrei Pikas <gdb@mail.api.win>
Cc: gdb-patches@sourceware.org, gdb@mail.api.win
Subject: Re: [PATCH v4] Add an option with a color type.
Date: Sun, 16 Oct 2022 16:45:30 +0300	[thread overview]
Message-ID: <83mt9v51c5.fsf@gnu.org> (raw)
In-Reply-To: <20221016114036.6246-1-gdb@mail.api.win> (message from Andrei Pikas on Sun, 16 Oct 2022 14:40:36 +0300)

> From: Andrei Pikas <gdb@mail.api.win>
> Date: Sun, 16 Oct 2022 14:40:36 +0300
> Cc: Andrei Pikas <gdb@mail.api.win>
> 
> Colors can be specified as "none" for terminal's default color, as a name of
> one of the eight standard colors of ISO/IEC 6429 "black", "red", "green", etc.,
> as an RGB hexadecimal tripplet #RRGGBB for 24-bit TrueColor, or as an
> integer from 0 to 255.  Integers 0 to 7 are the synonyms for the standard
> colors.  Integers 8-15 are used for the so-called bright colors from the
> aixterm extended 16-color palette.  Integers 16-255 are the indexes into xterm
> extended 256-color palette (usually 6x6x6 cube plus gray ramp).  In
> general, 256-color palette is terminal dependent and sometimes can be
> changed with OSC 4 sequences, e.g. "\033]4;1;rgb:00/FF/00\033\\".
> 
> It is the responsibility of the user to verify that the terminal supports
> the specified colors.

Thanks.

> diff --git a/gdb/NEWS b/gdb/NEWS
> index d2efe2a0a58..00173c09227 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS

The NEWS part is OK.

> +@item $_colorsupport
> +@vindex $_colorsupport@r{, convenience variable}
> +Comma-separated list of color space names supported by terminal.  Names could
> +be any of @samp{monochrome}, @samp{ansi_8color}, @samp{aixterm_16color},
> +@samp{xterm_256color}, @samp{rgb_24bit}.  E.g. for plain linux terminal the

Please follow "E.g." either by a comma or by @:, so that TeX wouldn't
mistakenly decide that the sentence ends there, and typeset it
accordingly.

>  @table @code
>  @item set style filename background @var{color}
> -Set the background to @var{color}.  Valid colors are @samp{none}
> -(meaning the terminal's default color), @samp{black}, @samp{red},
> -@samp{green}, @samp{yellow}, @samp{blue}, @samp{magenta}, @samp{cyan},
> -and@samp{white}.
> +Set the background to @var{color}.  @var{color} can be @samp{none}
> +(meaning the terminal's default color), a name of one of the eight standard
> +colors of ISO/IEC 6429, index from 0 to 255 into terminal's color
> +palette or a hexadecimal RGB triplet in @samp{#RRGGBB} format for
> +24-bit TrueColor.
> +
> +Valid color names are @samp{black}, @samp{red}, @samp{green},
> +@samp{yellow}, @samp{blue}, @samp{magenta}, @samp{cyan}, and
> +@samp{white}.
> +
> +Integers 0 to 7 are the synonyms for the standard colors.  Integers 8-15 are
> +used for the so-called bright colors from the aixterm extended 16-color
> +palette.  Integers 16-255 are the indexes into xterm extended 256-color palette
> +(usually 6x6x6 cube plus gray ramp).  In general, 256-color palette is terminal
> +dependent and sometimes can be changed with OSC 4 sequences, e.g.
> +"\033]4;1;rgb:00/FF/00\033\\".
> +
> +It is the responsibility of the user to verify that the terminal supports
> +the specified colors.
>  
>  @item set style filename foreground @var{color}
> -Set the foreground to @var{color}.  Valid colors are @samp{none}
> -(meaning the terminal's default color), @samp{black}, @samp{red},
> -@samp{green}, @samp{yellow}, @samp{blue}, @samp{magenta}, @samp{cyan},
> -and@samp{white}.
> +Set the foreground to @var{color}.  @var{color} can be @samp{none}
> +(meaning the terminal's default color), a name of one of the eight standard
> +colors of ISO/IEC 6429, index from 0 to 255 into terminal's color
> +palette or a hexadecimal RGB triplet in @samp{#RRGGBB} format for
> +24-bit TrueColor.
> +
> +Valid color names are @samp{black}, @samp{red}, @samp{green},
> +@samp{yellow}, @samp{blue}, @samp{magenta}, @samp{cyan}, and
> +@samp{white}.
> +
> +Integers 0 to 7 are the synonyms for the standard colors.  Integers 8-15 are
> +used for the so-called bright colors from the aixterm extended 16-color
> +palette.  Integers 16-255 are the indexes into xterm extended 256-color palette
> +(usually 6x6x6 cube plus gray ramp).  In general, 256-color palette is terminal
> +dependent and sometimes can be changed with OSC 4 sequences, e.g.
> +"\033]4;1;rgb:00/FF/00\033\\".
> +
> +It is the responsibility of the user to verify that the terminal supports
> +the specified colors.

This includes the same text twice very close to one another.  I
suggest to leave only the first part, and for "set style filename
foreground" just say that the COLOR can be given in the same ways as
for the background.

> +@deffn {Scheme Procedure} color-escape-sequence color is_foreground
> +Return string to change terminal's color to this.
> +
> +@var{is_foreground} if this color should be applied to foreground or background

The last sentence reads strangely and seems incomplete: did you
perhaps forgot some words there?

> +@defun Color.escape_sequence (@var{self}, @var{is_foreground})
> +Returns string to change terminal's color to this.
> +
> +@var{is_foreground} if this color should be applied to foreground or background
> +@end defun

Same here.

> +@findex COLORSPACE_XTERM_256COLOR
> +@findex gdb.COLORSPACE_XTERM_256COLOR
> +@item gdb.COLORSPACE_XTERM_256COLOR
> +Palette with 256 colors.  First 16 are from COLORSPACE_AIXTERM_16COLOR.  Next
> +216 colors are 6x6x6 RGB cube.  And last 24 colors forms grayscale ramp.
                                                      ^^^^^
"form", in plural.

Thanks.

  reply	other threads:[~2022-10-16 13:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 11:40 Andrei Pikas
2022-10-16 13:45 ` Eli Zaretskii [this message]
2022-10-16 16:03   ` [PATCH v5] " Andrei Pikas
2022-10-16 16:22     ` Eli Zaretskii
2022-10-16 16:28       ` [PATCH v6] " Andrei Pikas
2022-10-16 16:45         ` Eli Zaretskii
2024-04-19 19:33         ` Tom Tromey
2024-04-19 19:52           ` Andrei Pikas
2024-04-19 20:19             ` Tom Tromey
2024-04-20 18:24               ` Tom Tromey
2024-04-20 18:32                 ` Andrei Pikas
2024-05-11 15:17                 ` Andrei Pikas
2024-05-13 19:02                   ` Tom Tromey

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

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

  git send-email \
    --in-reply-to=83mt9v51c5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=gdb@mail.api.win \
    /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.
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).