From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86529 invoked by alias); 1 Jun 2019 08:47:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 86017 invoked by uid 89); 1 Jun 2019 08:47:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=Typo, deem, wish, HContent-Transfer-Encoding:8bit X-HELO: mailsec115.isp.belgacom.be Received: from mailsec115.isp.belgacom.be (HELO mailsec115.isp.belgacom.be) (195.238.20.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Jun 2019 08:47:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1559378852; x=1590914852; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=/oiAOeHjbEgd1qag8X9zJr2pynFBC3xN65jUfX3ozg4=; b=NabQHiAd7TejivE4DTmvFE+azt+pjvfDEMOC8BPXzo4JyUUkb3xmYW3q h6h3LrkDnhR945Azvyl0LxK+e90L/g==; Received: from 161.32-242-81.adsl-dyn.isp.belgacom.be (HELO md) ([81.242.32.161]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 01 Jun 2019 10:47:30 +0200 Message-ID: <1559378849.1454.48.camel@skynet.be> Subject: Re: [RFA 1/4] Add highlight style, title style, fputs_highlighted. Improve 'show style' From: Philippe Waroquiers To: Tom Tromey Cc: gdb-patches@sourceware.org Date: Sat, 01 Jun 2019 08:47:00 -0000 In-Reply-To: <87ef4epeqb.fsf@tromey.com> References: <20190531131903.21203-1-philippe.waroquiers@skynet.be> <20190531131903.21203-2-philippe.waroquiers@skynet.be> <87ef4epeqb.fsf@tromey.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00001.txt.bz2 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