From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17407 invoked by alias); 11 Dec 2002 05:47:03 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17396 invoked from network); 11 Dec 2002 05:46:59 -0000 Received: from unknown (HELO bothner.com) (216.102.199.253) by sources.redhat.com with SMTP; 11 Dec 2002 05:46:59 -0000 Received: from bothner.com (eureka.bothner.com [192.168.1.9]) by bothner.com (8.11.6/8.11.6) with ESMTP id gBB5mh826055 for ; Tue, 10 Dec 2002 21:48:43 -0800 Message-ID: <3DF6CDC2.5050105@bothner.com> Date: Tue, 10 Dec 2002 23:01:00 -0000 From: Per Bothner User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021202 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: gdb patch to suppress empty lines, re-visited Content-Type: multipart/mixed; boundary="------------070302040705020606010305" X-SW-Source: 2002-12/txt/msg00355.txt.bz2 This is a multi-part message in MIME format. --------------070302040705020606010305 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 353 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/ --------------070302040705020606010305 Content-Type: text/plain; name="gdb-erase-empty-line.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb-erase-empty-line.patch" Content-length: 1486 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 */ --------------070302040705020606010305--