This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 1/4] Add highlight style, title style, fputs_highlighted. Improve 'show style'


On Fri, 2019-05-31 at 14:10 -0600, Tom Tromey wrote:
> Philippe> +{
> Philippe> +  cli_style_option *cso = (cli_style_option *) get_cmd_context (cmd);
> Philippe> +  fputs_filtered (_("The \""), file);
> Philippe> +  fprintf_styled (file, cso->style (), "%s", cso->name ());
> 
> Can't this use fputs_styled instead?
> 
> It seems like the output might be a bit odd, in that the text will refer
> to one aspect of the style, but it will be styled using the entire
> style.

The idea is effectively to show the entire style in the output,
so as to see how all styles look like, close to each other.

To make it more clear, I have changed the output to be:
style address foreground:  The "address" style foreground color is: blue
                                ^^^^^^^^^^^^^^
So, I have added the word style after the style name and styled all what
is underlined.

Does that look less odd ?


> 
> Philippe> +readibility."));
> 
> Typo, "readability".
> 
> Philippe> +      /* Output the part before pmatch with current style.  */
> Philippe> +      while (pmatch.rm_so > 0)
> Philippe> +	{
> Philippe> +	  fputc_filtered (*str, stream);
> Philippe> +	  pmatch.rm_so--;
> Philippe> +	  str++;
> 
> Sometimes I wish the lower layers of the I/O system dealt with
> string views instead of terminated strings...
> 
> I wondered if "highlight" was too generic a name, but I suppose it fits
> well enough.  The only other idea I came up with was "search", which in
> the end didn't really seem better.
Yes, the name (for both title and highlight) were not straightforward
to choose.  The idea is that these styles should be relatively generic,
but not too much :).

The very first trial I did used the "header" instead of "title", but header
was too specific.

Otherwise, I hesitated between "attention" and "highlight" style.

Of course, easy to change if you deem "attention" (or something else)
is better.

Philippe

 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]