From unknown Mon Jun 23 07:51:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt. Resent-From: Mat Smiglarski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Aug 2014 10:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18282 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 18282@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14082710389632 (code B ref -1); Sun, 17 Aug 2014 10:24:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Aug 2014 10:23:58 +0000 Received: from localhost ([127.0.0.1]:45140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XIxcz-0002VC-GT for submit@debbugs.gnu.org; Sun, 17 Aug 2014 06:23:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58086) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XIxcx-0002Up-8C for submit@debbugs.gnu.org; Sun, 17 Aug 2014 06:23:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIxcm-0004uD-7n for submit@debbugs.gnu.org; Sun, 17 Aug 2014 06:23:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIxcm-0004u9-4K for submit@debbugs.gnu.org; Sun, 17 Aug 2014 06:23:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIxcg-0000n3-VH for bug-gnu-emacs@gnu.org; Sun, 17 Aug 2014 06:23:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIxcb-0004rn-SQ for bug-gnu-emacs@gnu.org; Sun, 17 Aug 2014 06:23:38 -0400 Received: from mx.sdf.org ([192.94.73.24]:54837 helo=sdf.lonestar.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIxcb-0004rT-JG for bug-gnu-emacs@gnu.org; Sun, 17 Aug 2014 06:23:33 -0400 Received: from wm.sdf.org (mx.sdf.org [192.94.73.24]) by sdf.lonestar.org (8.14.8/8.14.5) with ESMTP id s7HA7g1i000867 for ; Sun, 17 Aug 2014 10:07:42 GMT MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 17 Aug 2014 11:07:42 +0100 From: Mat Smiglarski Message-ID: X-Sender: penthief@SDF.ORG User-Agent: Roundcube Webmail/1.0.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello, Tab completion in gud-gdb replaces the prompt with the completed string. As a result this string is not sent to the gdb process. This bug does not occur in 24.3.1. It does occur on trunk and 24.3.92, as well as 24.3.93. To reproduce: 1. emacs -Q 2. M-: (gud-gdb "gdb") 3. Type the following at the gdb prompt "hel" What happens is the command "help" is correctly completed, but the prompt "(gdb)" is overwritten. This completed string has the face "comint-highlight-prompt" and is not evaluated by the gdb process. For what it is worth, the bug does not occur with "M-x gdb", only "M-x gud-gdb". Regards, Mat In GNU Emacs 24.3.93.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-08-16 on zz Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS Configured using: `configure 'CFLAGS=-O0 -g3'' Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Debugger Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x M-p g u d - g d b C-a M-f C-k h e M-x r e p - e - b < return> Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: Beginning of history; no preceding item Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils help-mode easymenu gud easy-mmode comint ansi-color ring time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 79181 7387) (symbols 48 18300 0) (miscs 40 49 200) (strings 32 11682 4841) (string-bytes 1 317029) (vectors 16 10558) (vector-slots 8 397115 7916) (floats 8 66 210) (intervals 56 233 0) (buffers 960 13) (heap 1024 17278 783)) From unknown Mon Jun 23 07:51:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt. Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Aug 2014 17:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18282 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Cc: Mat Smiglarski , Stefan Monnier , 18282@debbugs.gnu.org Received: via spool by 18282-submit@debbugs.gnu.org id=B18282.14083839513252 (code B ref 18282); Mon, 18 Aug 2014 17:46:01 +0000 Received: (at 18282) by debbugs.gnu.org; 18 Aug 2014 17:45:51 +0000 Received: from localhost ([127.0.0.1]:46412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJR0B-0000qN-4m for submit@debbugs.gnu.org; Mon, 18 Aug 2014 13:45:51 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:45953 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJR08-0000qE-DC for 18282@debbugs.gnu.org; Mon, 18 Aug 2014 13:45:49 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XJR06-0003xE-9b; Mon, 18 Aug 2014 13:45:46 -0400 From: Glenn Morris References: X-Spook: keyhole Jyllandsposten CIDA BRLO PLO underground Indigo X-Ran: ZN&7lhHGE}_aLUCm~P\BC>*tC;bCGm/gx2!~_0#9wHOic`6~aef'$0;Kzm^B25LVFq#T/, X-Hue: magenta X-Attribution: GM Date: Mon, 18 Aug 2014 13:45:46 -0400 In-Reply-To: (Mat Smiglarski's message of "Sun, 17 Aug 2014 11:07:42 +0100") Message-ID: 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: -4.5 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) Mat Smiglarski wrote: > 1. emacs -Q > 2. M-: (gud-gdb "gdb") > 3. Type the following at the gdb prompt "hel" > > What happens is the command "help" is correctly completed, but the > prompt "(gdb)" is overwritten. Bisected to emacs-24: revno: 114162 committer: Stefan Monnier timestamp: Fri 2013-09-06 18:46:44 -0400 message: * lisp/minibuffer.el: Make minibuffer-complete call completion-in-region rather than other way around. [...] From unknown Mon Jun 23 07:51:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt. Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Aug 2014 18:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18282 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: Mat Smiglarski , 18282@debbugs.gnu.org Received: via spool by 18282-submit@debbugs.gnu.org id=B18282.14083865447777 (code B ref 18282); Mon, 18 Aug 2014 18:30:02 +0000 Received: (at 18282) by debbugs.gnu.org; 18 Aug 2014 18:29:04 +0000 Received: from localhost ([127.0.0.1]:46434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJRfz-00021N-QF for submit@debbugs.gnu.org; Mon, 18 Aug 2014 14:29:04 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:53341) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJRfx-00020q-8i for 18282@debbugs.gnu.org; Mon, 18 Aug 2014 14:29:01 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s7IIT0T1021481; Mon, 18 Aug 2014 14:29:00 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id B86BDAE091; Mon, 18 Aug 2014 14:28:57 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Mon, 18 Aug 2014 14:28:57 -0400 In-Reply-To: (Glenn Morris's message of "Mon, 18 Aug 2014 13:45:46 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5038=0 X-NAI-Spam-Version: 2.3.0.9378 : core <5038> : inlines <1187> : streams <1267111> : uri <1804089> X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) >> 1. emacs -Q >> 2. M-: (gud-gdb "gdb") >> 3. Type the following at the gdb prompt "hel" >> >> What happens is the command "help" is correctly completed, but the >> prompt "(gdb)" is overwritten. > Bisected to emacs-24: > revno: 114162 > committer: Stefan Monnier > timestamp: Fri 2013-09-06 18:46:44 -0400 > message: > * lisp/minibuffer.el: Make minibuffer-complete call > completion-in-region rather than other way around. > [...] Thanks for bisecting it! That'll be very helpful, Stefan From unknown Mon Jun 23 07:51:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt. Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Aug 2014 19:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18282 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Mat Smiglarski , 18282@debbugs.gnu.org Received: via spool by 18282-submit@debbugs.gnu.org id=B18282.140847751611260 (code B ref 18282); Tue, 19 Aug 2014 19:46:02 +0000 Received: (at 18282) by debbugs.gnu.org; 19 Aug 2014 19:45:16 +0000 Received: from localhost ([127.0.0.1]:47827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJpLH-0002vY-T0 for submit@debbugs.gnu.org; Tue, 19 Aug 2014 15:45:16 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:46907 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJpLE-0002vO-QP for 18282@debbugs.gnu.org; Tue, 19 Aug 2014 15:45:13 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XJpLD-0006jF-9P; Tue, 19 Aug 2014 15:45:11 -0400 From: Glenn Morris References: X-Spook: global Peking Sundevil SHA terrorist government weapons X-Ran: U"Q(.*8Q'MY`n|1!}c3w]vMu#(]^z-ar02Bb-u#/1a}<|%V@N*]pFETNiTP`:.]V!|LIV= X-Hue: black X-Attribution: GM Date: Tue, 19 Aug 2014 15:45:10 -0400 In-Reply-To: (Stefan Monnier's message of "Mon, 18 Aug 2014 14:28:57 -0400") Message-ID: 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: -5.7 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) I wonder if the problem is this note from gud-gdb-completions: ;; `gud-gdb-run-command-fetch-lines' has some nasty side-effects on the ;; buffer (via `gud-delete-prompt-marker'): it removes the prompt and then ;; re-adds it later, thus messing up markers and overlays along the way. ;; This is a problem for completion-in-region which uses an overlay to ;; create a field. ;; So we restore completion-in-region's field if needed. completion-in-region doesn't use an overlay any more (so the comment and workaround are in any case outdated), it uses a marker, which presumably gets moved behind its back. Dunno how you fix things up to make the marker point back where it should. python.el seems to have a similar need, and to solve it using python-shell-send-string-no-output (use comint-preoutput-filter-functions to prevent completion output getting inserted into the buffer). From unknown Mon Jun 23 07:51:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt. Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Aug 2014 19:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18282 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Mat Smiglarski , 18282@debbugs.gnu.org Received: via spool by 18282-submit@debbugs.gnu.org id=B18282.140847782011733 (code B ref 18282); Tue, 19 Aug 2014 19:51:02 +0000 Received: (at 18282) by debbugs.gnu.org; 19 Aug 2014 19:50:20 +0000 Received: from localhost ([127.0.0.1]:47832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJpQA-00033A-OH for submit@debbugs.gnu.org; Tue, 19 Aug 2014 15:50:19 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:46990 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJpQ7-000331-TY for 18282@debbugs.gnu.org; Tue, 19 Aug 2014 15:50:16 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XJpQ7-0007sT-15; Tue, 19 Aug 2014 15:50:15 -0400 From: Glenn Morris References: X-Spook: Semtex Aladdin Abu Ghraib Merlin military North Korea X-Ran: s\)JPO6.R6Eilc%; (Glenn Morris's message of "Tue, 19 Aug 2014 15:45:10 -0400") Message-ID: 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: -5.7 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) PS perhaps comint-dynamic-list-filename-completions can/should be similarly updated to us explicit start/end args rather than overlays. From unknown Mon Jun 23 07:51:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt. Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Aug 2014 06:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18282 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Mat Smiglarski , 18282@debbugs.gnu.org Received: via spool by 18282-submit@debbugs.gnu.org id=B18282.14091223918128 (code B ref 18282); Wed, 27 Aug 2014 06:54:02 +0000 Received: (at 18282) by debbugs.gnu.org; 27 Aug 2014 06:53:11 +0000 Received: from localhost ([127.0.0.1]:53163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMX6U-000270-2Y for submit@debbugs.gnu.org; Wed, 27 Aug 2014 02:53:10 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:47235 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMX6R-00026m-01 for 18282@debbugs.gnu.org; Wed, 27 Aug 2014 02:53:07 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XMX6P-0006ib-Sy; Wed, 27 Aug 2014 02:53:06 -0400 From: Glenn Morris References: X-Spook: Al Jazeera strategic Gazprom ISEC cracking Lexis-Nexis X-Ran: fLEbKR*ztg";w)sSrU`f+89R4i{kp`pViz2r6`|~=e$/'/v(p-f@,K X-Hue: cyan X-Attribution: GM Date: Wed, 27 Aug 2014 02:53:05 -0400 In-Reply-To: (Glenn Morris's message of "Tue, 19 Aug 2014 15:50:14 -0400") Message-ID: 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: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Her's an awful kludge that seems to work somewhat, maybe. But it can't be the right solution. But it can't be worse than it is now (?). *** lisp/progmodes/gud.el 2014-02-10 01:34:22 +0000 --- lisp/progmodes/gud.el 2014-08-27 06:48:45 +0000 *************** *** 778,784 **** (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point nil 'local) (set (make-local-variable 'gud-gdb-completion-function) 'gud-gdb-completions) ! (local-set-key "\C-i" 'completion-at-point) (setq comint-prompt-regexp "^(.*gdb[+]?) *") (setq paragraph-start comint-prompt-regexp) --- 778,784 ---- (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point nil 'local) (set (make-local-variable 'gud-gdb-completion-function) 'gud-gdb-completions) ! (setq-local completion-in-region-function 'gud--completion-in-region) (local-set-key "\C-i" 'completion-at-point) (setq comint-prompt-regexp "^(.*gdb[+]?) *") (setq paragraph-start comint-prompt-regexp) *************** *** 787,792 **** --- 787,795 ---- (setq gud-filter-pending-text nil) (run-hooks 'gud-gdb-mode-hook)) + (defun gud--completion-in-region (start end collection &optional predicate) + (completion--in-region (copy-marker start t) end collection predicate)) + ;; The completion process filter indicates when it is finished. (defvar gud-gdb-fetch-lines-in-progress) From unknown Mon Jun 23 07:51:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt. Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Aug 2014 03:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18282 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: Mat Smiglarski , 18282@debbugs.gnu.org Received: via spool by 18282-submit@debbugs.gnu.org id=B18282.140919564522655 (code B ref 18282); Thu, 28 Aug 2014 03:15:01 +0000 Received: (at 18282) by debbugs.gnu.org; 28 Aug 2014 03:14:05 +0000 Received: from localhost ([127.0.0.1]:53960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMqA1-0005tK-0G for submit@debbugs.gnu.org; Wed, 27 Aug 2014 23:14:05 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:39971) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMq9y-0005sz-QA for 18282@debbugs.gnu.org; Wed, 27 Aug 2014 23:14:03 -0400 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s7S3E00v031671; Wed, 27 Aug 2014 23:14:00 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 20427660C4; Wed, 27 Aug 2014 23:14:00 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Wed, 27 Aug 2014 23:14:00 -0400 In-Reply-To: (Glenn Morris's message of "Wed, 27 Aug 2014 02:53:05 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV5046=0 X-NAI-Spam-Version: 2.3.0.9378 : core <5046> : inlines <1219> : streams <1275659> : uri <1807499> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Her's an awful kludge that seems to work somewhat, maybe. > But it can't be the right solution. > But it can't be worse than it is now (?). I'll come up with a better fix, Stefan From unknown Mon Jun 23 07:51:19 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mat Smiglarski Subject: bug#18282: closed (Re: bug#18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt.) Message-ID: References: X-Gnu-PR-Message: they-closed 18282 X-Gnu-PR-Package: emacs Reply-To: 18282@debbugs.gnu.org Date: Tue, 02 Sep 2014 18:18:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1409681882-25458-1" This is a multi-part message in MIME format... ------------=_1409681882-25458-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrite= s the prompt. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 18282@debbugs.gnu.org. --=20 18282: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18282 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1409681882-25458-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 18282-done) by debbugs.gnu.org; 2 Sep 2014 18:17:40 +0000 Received: from localhost ([127.0.0.1]:57104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOseB-0006by-Rz for submit@debbugs.gnu.org; Tue, 02 Sep 2014 14:17:40 -0400 Received: from mercure.iro.umontreal.ca ([132.204.24.67]:41090) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOse9-0006bq-Q9 for 18282-done@debbugs.gnu.org; Tue, 02 Sep 2014 14:17:38 -0400 Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 3FFFD84E9D; Tue, 2 Sep 2014 14:17:37 -0400 (EDT) Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 75DD41E5B8D; Tue, 2 Sep 2014 14:17:10 -0400 (EDT) Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 4D0BCB40F7; Tue, 2 Sep 2014 14:17:10 -0400 (EDT) From: Stefan Monnier To: Mat Smiglarski Subject: Re: bug#18282: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt. Message-ID: References: Date: Tue, 02 Sep 2014 14:17:10 -0400 In-Reply-To: (Glenn Morris's message of "Mon, 18 Aug 2014 13:45:46 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-Spam-Status: No X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: 18282-done Cc: Glenn Morris , 18282-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) >> 1. emacs -Q >> 2. M-: (gud-gdb "gdb") >> 3. Type the following at the gdb prompt "hel" >> >> What happens is the command "help" is correctly completed, but the >> prompt "(gdb)" is overwritten. I installed the patch below which seems to fix it for now. Stefan === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2014-02-10 01:34:22 +0000 +++ lisp/progmodes/gud.el 2014-09-02 18:14:45 +0000 @@ -809,18 +809,6 @@ (current-buffer) ;; From string-match above. (length context)))) - ;; `gud-gdb-run-command-fetch-lines' has some nasty side-effects on the - ;; buffer (via `gud-delete-prompt-marker'): it removes the prompt and then - ;; re-adds it later, thus messing up markers and overlays along the way. - ;; This is a problem for completion-in-region which uses an overlay to - ;; create a field. - ;; So we restore completion-in-region's field if needed. - ;; FIXME: change gud-gdb-run-command-fetch-lines so it doesn't modify the - ;; buffer at all. - (when (/= start (- (point) (field-beginning))) - (dolist (ol (overlays-at (1- (point)))) - (when (eq (overlay-get ol 'field) 'completion) - (move-overlay ol (- (point) start) (overlay-end ol))))) ;; Protect against old versions of GDB. (and complete-list (string-match "^Undefined command: \"complete\"" (car complete-list)) @@ -859,7 +847,14 @@ (save-excursion (skip-chars-backward "^ " (comint-line-beginning-position)) (point)))) - (list start end + ;; FIXME: `gud-gdb-run-command-fetch-lines' has some nasty side-effects on + ;; the buffer (via `gud-delete-prompt-marker'): it removes the prompt and + ;; then re-adds it later, thus messing up markers and overlays along the + ;; way (bug#18282). + ;; We use an "insert-before" marker for `start', since it's typically right + ;; after the prompt, which works around the problem, but is a hack (and + ;; comes with other downsides, e.g. if completion adds text at `start'). + (list (copy-marker start t) end (completion-table-dynamic (apply-partially gud-gdb-completion-function (buffer-substring (comint-line-beginning-position) ------------=_1409681882-25458-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Aug 2014 10:23:58 +0000 Received: from localhost ([127.0.0.1]:45140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XIxcz-0002VC-GT for submit@debbugs.gnu.org; Sun, 17 Aug 2014 06:23:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58086) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XIxcx-0002Up-8C for submit@debbugs.gnu.org; Sun, 17 Aug 2014 06:23:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIxcm-0004uD-7n for submit@debbugs.gnu.org; Sun, 17 Aug 2014 06:23:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIxcm-0004u9-4K for submit@debbugs.gnu.org; Sun, 17 Aug 2014 06:23:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIxcg-0000n3-VH for bug-gnu-emacs@gnu.org; Sun, 17 Aug 2014 06:23:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIxcb-0004rn-SQ for bug-gnu-emacs@gnu.org; Sun, 17 Aug 2014 06:23:38 -0400 Received: from mx.sdf.org ([192.94.73.24]:54837 helo=sdf.lonestar.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIxcb-0004rT-JG for bug-gnu-emacs@gnu.org; Sun, 17 Aug 2014 06:23:33 -0400 Received: from wm.sdf.org (mx.sdf.org [192.94.73.24]) by sdf.lonestar.org (8.14.8/8.14.5) with ESMTP id s7HA7g1i000867 for ; Sun, 17 Aug 2014 10:07:42 GMT MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 17 Aug 2014 11:07:42 +0100 From: Mat Smiglarski To: bug-gnu-emacs@gnu.org Subject: 24.3.93; Tab completion in gud-gdb at the start of a line overwrites the prompt. Message-ID: X-Sender: penthief@SDF.ORG User-Agent: Roundcube Webmail/1.0.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello, Tab completion in gud-gdb replaces the prompt with the completed string. As a result this string is not sent to the gdb process. This bug does not occur in 24.3.1. It does occur on trunk and 24.3.92, as well as 24.3.93. To reproduce: 1. emacs -Q 2. M-: (gud-gdb "gdb") 3. Type the following at the gdb prompt "hel" What happens is the command "help" is correctly completed, but the prompt "(gdb)" is overwritten. This completed string has the face "comint-highlight-prompt" and is not evaluated by the gdb process. For what it is worth, the bug does not occur with "M-x gdb", only "M-x gud-gdb". Regards, Mat In GNU Emacs 24.3.93.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-08-16 on zz Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS Configured using: `configure 'CFLAGS=-O0 -g3'' Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Debugger Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x M-p g u d - g d b C-a M-f C-k h e M-x r e p - e - b < return> Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: Beginning of history; no preceding item Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils help-mode easymenu gud easy-mmode comint ansi-color ring time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 79181 7387) (symbols 48 18300 0) (miscs 40 49 200) (strings 32 11682 4841) (string-bytes 1 317029) (vectors 16 10558) (vector-slots 8 397115 7916) (floats 8 66 210) (intervals 56 233 0) (buffers 960 13) (heap 1024 17278 783)) ------------=_1409681882-25458-1--