public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH] [gdb/tui] Factor out border-mode help text
Date: Sun, 21 May 2023 21:59:32 +0200	[thread overview]
Message-ID: <20230521195933.5351-1-tdevries@suse.de> (raw)

I noticed that the help texts for tui border-mode and tui active-border-mode
are similar.

Factor out the common part into macro HELP_ATTRIBUTE_MODE.

Tested on x86_64-linux.
---
 gdb/tui/tui-win.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 6710b3e17e5..9d89658ef20 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -1219,18 +1219,22 @@ This variable controls the border of TUI windows:\n\
 			show_tui_border_kind,
 			&tui_setlist, &tui_showlist);
 
-  add_setshow_enum_cmd ("border-mode", no_class, tui_border_mode_enums,
-			&tui_border_mode, _("\
-Set the attribute mode to use for the TUI window borders."), _("\
-Show the attribute mode to use for the TUI window borders."), _("\
-This variable controls the attributes to use for the window borders:\n\
+#define HELP_ATTRIBUTE_MODE "\
    normal          normal display\n\
    standout        use highlight mode of terminal\n\
    reverse         use reverse video mode\n\
    half            use half bright\n\
    half-standout   use half bright and standout mode\n\
    bold            use extra bright or bold\n\
-   bold-standout   use extra bright or bold with standout mode"),
+   bold-standout   use extra bright or bold with standout mode"
+
+  add_setshow_enum_cmd ("border-mode", no_class, tui_border_mode_enums,
+			&tui_border_mode, _("\
+Set the attribute mode to use for the TUI window borders."), _("\
+Show the attribute mode to use for the TUI window borders."),
+			_("\
+This variable controls the attributes to use for the window borders:\n"
+			  HELP_ATTRIBUTE_MODE),
 			tui_set_var_cmd,
 			show_tui_border_mode,
 			&tui_setlist, &tui_showlist);
@@ -1238,19 +1242,16 @@ This variable controls the attributes to use for the window borders:\n\
   add_setshow_enum_cmd ("active-border-mode", no_class, tui_border_mode_enums,
 			&tui_active_border_mode, _("\
 Set the attribute mode to use for the active TUI window border."), _("\
-Show the attribute mode to use for the active TUI window border."), _("\
-This variable controls the attributes to use for the active window border:\n\
-   normal          normal display\n\
-   standout        use highlight mode of terminal\n\
-   reverse         use reverse video mode\n\
-   half            use half bright\n\
-   half-standout   use half bright and standout mode\n\
-   bold            use extra bright or bold\n\
-   bold-standout   use extra bright or bold with standout mode"),
+Show the attribute mode to use for the active TUI window border."),
+			_("\
+This variable controls the attributes to use for the active window border:\n"
+			  HELP_ATTRIBUTE_MODE),
 			tui_set_var_cmd,
 			show_tui_active_border_mode,
 			&tui_setlist, &tui_showlist);
 
+#undef HELP_ATTRIBUTE_MODE
+
   add_setshow_zuinteger_cmd ("tab-width", no_class,
 			     &internal_tab_width, _("\
 Set the tab width, in characters, for the TUI."), _("\

base-commit: f1cc4f02cb558d513cb4575211dbbb690391618f
-- 
2.35.3


             reply	other threads:[~2023-05-21 19:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-21 19:59 Tom de Vries [this message]
2023-05-22  9:09 ` Tom de Vries
2023-05-24  9:56   ` Bruno Larsen
2023-06-07 13:12   ` Tom de Vries
2023-06-09 13:39   ` Tom Tromey
2023-06-09 15:12     ` Tom de Vries

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=20230521195933.5351-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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).