From: Per Bothner <per@bothner.com>
To: gdb-patches@sources.redhat.com
Subject: gdb patch to suppress empty lines, re-visited
Date: Tue, 10 Dec 2002 23:01:00 -0000 [thread overview]
Message-ID: <3DF6CDC2.5050105@bothner.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
This is a revision of a patch originally from 1999:
http://sources.redhat.com/ml/gdb-patches/1999-q2/msg00093.html
I'm not sure if the patch in top.c does anything, since I don't
know when/if readline is called from command_line_input.
OK to check in? With or without the top.c change?
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/
[-- Attachment #2: gdb-erase-empty-line.patch --]
[-- Type: text/plain, Size: 1486 bytes --]
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.68
diff -u -p -r1.68 top.c
--- top.c 26 Sep 2002 17:46:04 -0000 1.68
+++ top.c 7 Dec 2002 06:21:11 -0000
@@ -1211,7 +1211,12 @@ command_line_input (char *prompt_arg, in
}
else if (command_editing_p && instream == stdin && ISATTY (instream))
{
+ int can_repeat = repeat && *line != NULL;
+ if (can_repeat)
+ rl_erase_empty_line++;
rl = gdb_readline_wrapper (local_prompt);
+ if (can_repeat)
+ rl_erase_empty_line--;
}
else
{
Index: event-top.c
===================================================================
RCS file: /cvs/src/src/gdb/event-top.c,v
retrieving revision 1.24
diff -u -p -r1.24 event-top.c
--- event-top.c 5 Nov 2002 22:38:11 -0000 1.24
+++ event-top.c 7 Dec 2002 06:21:12 -0000
@@ -191,6 +191,7 @@ cli_command_loop (void)
strcpy (a_prompt, PREFIX (0));
strcat (a_prompt, gdb_prompt);
strcat (a_prompt, SUFFIX (0));
+ rl_erase_empty_line = *line != NULL;
rl_callback_handler_install (a_prompt, input_handler);
}
else
@@ -296,6 +297,7 @@ display_gdb_prompt (char *new_prompt)
if (async_command_editing_p)
{
rl_callback_handler_remove ();
+ rl_erase_empty_line = *line != NULL;
rl_callback_handler_install (new_prompt, input_handler);
}
/* new_prompt at this point can be the top of the stack or the one passed in */
next reply other threads:[~2002-12-11 5:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-10 23:01 Per Bothner [this message]
2002-12-11 15:38 ` Michael Snyder
2002-12-11 15:50 ` Per Bothner
2002-12-11 16:01 ` Daniel Jacobowitz
2002-12-13 12:22 ` Per Bothner
2002-12-13 12:38 ` Andrew Cagney
[not found] ` <ac131313@redhat.com>
2002-12-13 12:44 ` Kevin Buettner
2002-12-13 13:16 ` Daniel Jacobowitz
2002-12-13 13:49 ` Per Bothner
2002-12-13 12:53 ` David Carlton
2002-12-13 13:36 ` Per Bothner
2002-12-11 22:17 Michael Elizabeth Chastain
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=3DF6CDC2.5050105@bothner.com \
--to=per@bothner.com \
--cc=gdb-patches@sources.redhat.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