From: Pedro Alves <palves@redhat.com>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>,
gdb-patches@sourceware.org
Subject: Re: [RFA 0/4] Improve "show style", use style in "help" and "apropos".
Date: Tue, 18 Jun 2019 13:09:00 -0000 [thread overview]
Message-ID: <02aed9b6-1ce0-b48f-ed01-ef0fc0fa20b5@redhat.com> (raw)
In-Reply-To: <20190531131903.21203-1-philippe.waroquiers@skynet.be>
On 5/31/19 2:18 PM, Philippe Waroquiers wrote:
> Improve "show style", have "help" and "apropos" styling their output.
>
> This patch series improves the "show style" output to let the
> user visualize all the styles with one command.
>
> "help" and "apropos" commands are now styling their output.
>
> The "help" testing is also better factorized.
I tried this new feature today, and I admit that I felt a bit lost
with the output. I think the reason why is that I have pagination
disabled in my .gdbinit, usually preferring to scroll up/down
than to press enter to move pagination to the next page. So
while scrolling up, it isn't immediately obvious to me where
each of the command's docs are split.
(
another use for "with":
(gdb) with pagination off -- apropos -v breakpoint
)
I tried the patchlet below, to add a "-------" separator line
between commands, and to me, the guidelines help.
It also helps when styling is disabled, as with:
(gdb) | with pagination off -- apropos -v breakpoint | less
WDYT?
From ce57941ee6e1240f1b7c16374d6f6c18ea12053e Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Tue, 18 Jun 2019 13:25:15 +0100
Subject: [PATCH] apropos
---
gdb/cli/cli-decode.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index a6ddd8cc6d8..ca5751dc2f6 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -25,6 +25,7 @@
#include "cli/cli-decode.h"
#include "cli/cli-style.h"
#include "common/gdb_optional.h"
+#include "readline/readline.h"
/* Prototypes for local functions. */
@@ -970,7 +971,18 @@ print_doc_of_command (struct cmd_list_element *c, const char *prefix,
this documentation from the previous command help, in the likely
case that apropos finds several commands. */
if (verbose)
- fputs_filtered ("\n", stream);
+ {
+ fputc_filtered ('\n', stream);
+
+ int width;
+ rl_get_screen_size (nullptr, &width);
+ if (width > 80)
+ width = 80;
+
+ for (int i = 0; i < width; i++)
+ fputc_filtered ('-', stream);
+ fputc_filtered ('\n', stream);
+ }
fprintf_styled (stream, title_style.style (),
"%s%s", prefix, c->name);
--
2.14.5
next prev parent reply other threads:[~2019-06-18 13:09 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 13:19 Philippe Waroquiers
2019-05-31 13:19 ` [RFA 1/4] Add highlight style, title style, fputs_highlighted. Improve 'show style' Philippe Waroquiers
2019-05-31 20:10 ` Tom Tromey
2019-06-01 8:47 ` Philippe Waroquiers
2019-06-03 14:21 ` Tom Tromey
2019-05-31 13:19 ` [RFA 2/4] Improve usability and/or readibility of help and apropos output Philippe Waroquiers
2019-05-31 20:22 ` Tom Tromey
2019-05-31 13:19 ` [RFA 4/4] Document in NEWS and gdb.texinfo the "help", "apropos" and "show style" changes Philippe Waroquiers
2019-05-31 13:46 ` Eli Zaretskii
2019-05-31 13:19 ` [RFA 3/4] Update tests following changes to "help" and "apropos" Philippe Waroquiers
2019-05-31 20:34 ` Tom Tromey
2019-05-31 20:35 ` [RFA 0/4] Improve "show style", use style in " Tom Tromey
2019-06-18 13:09 ` Pedro Alves [this message]
2019-06-18 16:04 ` Tom Tromey
2019-06-18 20:11 ` Philippe Waroquiers
2019-06-18 20:46 ` Tom Tromey
2019-06-18 20:53 ` Philippe Waroquiers
2019-06-18 20:58 ` Philippe Waroquiers
2019-06-18 22:40 ` Pedro Alves
2019-06-19 0:25 ` Philippe Waroquiers
2019-06-19 19:44 ` Tom Tromey
2019-06-19 19:26 ` Tom Tromey
2019-06-19 22:56 ` Pedro Alves
2019-06-20 14:21 ` 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=02aed9b6-1ce0-b48f-ed01-ef0fc0fa20b5@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
/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