GNU bug report logs - #7461
23.2; gud.el always uses comint-prompt-regexp; things can break if prompt is changed

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Rolando Pereira <finalyugi@HIDDEN>; Keywords: notabug; dated Sun, 21 Nov 2010 19:23:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) notabug. Request was from Chong Yidong <cyd@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 7461 <at> debbugs.gnu.org:


Received: (at 7461) by debbugs.gnu.org; 23 Nov 2010 01:56:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 22 20:56:04 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PKi72-0002op-GX
	for submit <at> debbugs.gnu.org; Mon, 22 Nov 2010 20:56:04 -0500
Received: from fencepost.gnu.org ([140.186.70.10])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rgm@HIDDEN>) id 1PKi70-0002oN-2V
	for 7461 <at> debbugs.gnu.org; Mon, 22 Nov 2010 20:56:02 -0500
Received: from localhost ([127.0.0.1]:59168)
	by fencepost.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rgm@HIDDEN>)
	id 1PKiC3-00031t-Aa; Mon, 22 Nov 2010 21:01:15 -0500
To: Rolando Pereira <finalyugi@HIDDEN>
Subject: Re: bug#7461: 23.2;
	Gdb only does tab completion inside Emacs when prompt is (gdb)
References: <20101121174502.GA14674@rolando-laptop>
From: Glenn Morris <rgm@HIDDEN>
X-Spook: DRM Mafia ANDVT pink noise Agfa Iran afsatcom Security
X-Ran: /|K{7wC\P"yVt\riGgZfK`hgR3\`63c+b|W/Dp-FC-CQ,``y^a\9_.cL.(G*>BVC4KtpnC
X-Hue: cyan
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Mon, 22 Nov 2010 21:01:14 -0500
In-Reply-To: <20101121174502.GA14674@rolando-laptop> (Rolando Pereira's
	message of "Sun\, 21 Nov 2010 17\:45\:14 +0000")
Message-ID: <bwmxp06bo5.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -6.2 (------)
X-Debbugs-Envelope-To: 7461
Cc: 7461 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.2 (------)

Rolando Pereira wrote:

> When running gdb inside emacs, either by doing M-x gdb or M-x gud-gdb,
> if the prompt is set to something that isn't "(gdb)" (or similar, see
> the examples below), pressing TAB doesn't do the completion of
> commands, functions or variables.

Thank you for the complete example.

It looks like, after you have changed the prompt, you can set the
local value of comint-prompt-regexp to match it.

More generally, when comint-use-prompt-regexp is nil (which it is by
default), gud.el probably ought not to try and use comint-prompt-regexp.
Instead it should use whatever field properties comint adds.

> Emacs version is: GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version
> 2.16.1)
>
> GDB version is: GNU gdb (GDB) 7.2




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#7461; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Nov 2010 19:22:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 21 14:22:12 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PKFUJ-0003hL-Bk
	for submit <at> debbugs.gnu.org; Sun, 21 Nov 2010 14:22:12 -0500
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <finalyugi@HIDDEN>) id 1PKDth-0002JV-DK
	for submit <at> debbugs.gnu.org; Sun, 21 Nov 2010 12:40:18 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <finalyugi@HIDDEN>) id 1PKDyj-0004Wi-V4
	for submit <at> debbugs.gnu.org; Sun, 21 Nov 2010 12:45:30 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([199.232.76.165]:53033)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <finalyugi@HIDDEN>) id 1PKDyj-0004We-N5
	for submit <at> debbugs.gnu.org; Sun, 21 Nov 2010 12:45:29 -0500
Received: from [140.186.70.92] (port=38823 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1PKDyh-0003Ko-K5
	for bug-gnu-emacs@HIDDEN; Sun, 21 Nov 2010 12:45:28 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <finalyugi@HIDDEN>) id 1PKDyf-0004WE-Ro
	for bug-gnu-emacs@HIDDEN; Sun, 21 Nov 2010 12:45:26 -0500
Received: from smtp.fe.up.pt ([193.136.28.30]:31816)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <finalyugi@HIDDEN>) id 1PKDyf-0004Vw-JE
	for bug-gnu-emacs@HIDDEN; Sun, 21 Nov 2010 12:45:25 -0500
Received: from localhost (localhost [127.0.0.1])
	by smtp.fe.up.pt (Postfix) with ESMTP id A3D4013F75C
	for <bug-gnu-emacs@HIDDEN>; Sun, 21 Nov 2010 17:45:24 +0000 (WET)
Received: from smtp.fe.up.pt ([127.0.0.1])
	by localhost (smtp2.fe.up.pt [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id HXn5qIiQbERZ for <bug-gnu-emacs@HIDDEN>;
	Sun, 21 Nov 2010 17:45:24 +0000 (WET)
Received: from rolando-laptop (unknown [192.168.56.20])
	by smtp.fe.up.pt (Postfix) with ESMTPA id BCC8713F714
	for <bug-gnu-emacs@HIDDEN>; Sun, 21 Nov 2010 17:45:22 +0000 (WET)
Date: Sun, 21 Nov 2010 17:45:14 +0000
From: Rolando Pereira <finalyugi@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 23.2; Gdb only does tab completion inside Emacs when prompt is (gdb)
Message-ID: <20101121174502.GA14674@rolando-laptop>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.18 (2008-05-17)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 21 Nov 2010 14:22:08 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.9 (-----)

When running gdb inside emacs, either by doing M-x gdb or M-x gud-gdb,
if the prompt is set to something that isn't "(gdb)" (or similar, see
the examples below), pressing TAB doesn't do the completion of
commands, functions or variables.

Use the following steps to reproduce the error using emacs -Q:

1) Create a new C file, for example code.c, with the following
contents:

#include <stdio.h>

int main(void) {
	printf("Hello World\n");
	return 0;
}

2) Compile code using gcc -g code.c -o code

3) Open emacs -Q

4) Start debugging the file using M-x gdb

5) Prompt should be "(gdb) ". Try to type "b ma" and press TAB. It
should expand to "b main".

6) Change gdb's prompt to something else using "set prompt". I changed
it to "gdb> ".

7) Try to type "b ma" and press TAB. It should display on the
minibuffer the message "No completions of ma".


Prompts I've tried where TAB completion still worked:

* "(gdb)"
* "        (gdb)        " (the prefix whitespace is discarded by gdb,
  so this is the same as "(gdb)        ")
* "( gdb) "
* "(gdb)_______________________"
* "(GDB) "
* "( GDB) "

Prompts I've tried where TAB completion DIDN'T work:

* "(gdb )"
* "_(gdb)"
* "(gdb "
* "gdb) "
* "( gdb )"
* "" (removed prompt by typing "set prompt" in gdb)
* "gdb> "
* "gdb>"
* "gdb "
* "gdb"
* "<gdb "
* "<gdb"

Emacs version is: GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version
2.16.1)

GDB version is: GNU gdb (GDB) 7.2




Acknowledgement sent to Rolando Pereira <finalyugi@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#7461; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.