From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sergio Durigan Junior Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix gdb-mi.el to recognize backslashes as quotes Date: Fri, 12 Jul 2013 00:41:42 -0300 Message-ID: <8738rksavd.fsf@riseup.net> References: <87li5dslsf.fsf@riseup.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1373601309 3283 80.91.229.3 (12 Jul 2013 03:55:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Jul 2013 03:55:09 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 12 05:55:10 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UxURq-0008L7-1v for ged-emacs-devel@m.gmane.org; Fri, 12 Jul 2013 05:55:10 +0200 Original-Received: from localhost ([::1]:48767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxURp-0002YO-OJ for ged-emacs-devel@m.gmane.org; Thu, 11 Jul 2013 23:55:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxURl-0002V4-JO for emacs-devel@gnu.org; Thu, 11 Jul 2013 23:55:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxURk-0006aD-Kv for emacs-devel@gnu.org; Thu, 11 Jul 2013 23:55:05 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:44512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxURk-0006Yv-E6 for emacs-devel@gnu.org; Thu, 11 Jul 2013 23:55:04 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UxURi-0008FH-Kw for emacs-devel@gnu.org; Fri, 12 Jul 2013 05:55:02 +0200 Original-Received: from 187.106.55.194 ([187.106.55.194]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Jul 2013 05:55:02 +0200 Original-Received: from sergiodj by 187.106.55.194 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Jul 2013 05:55:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 187.106.55.194 X-URL: http://sergiodj.net/blog User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) Cancel-Lock: sha1:9SuI0TiyhhKMX7tQsm58R/Qpr/0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161830 Archived-At: On Thursday, July 11 2013, Andreas Schwab wrote: > Sergio Durigan Junior writes: > >> + (if (not (null gdb-continuation)) > > (not (null ...)) is a no-op in this context. Ops, thanks. Fixed in this version. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 2c4d6a0..87c5f98 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1759,6 +1759,9 @@ static char *magick[] = { As long as GDB is in the recursive reading loop, it does not expect commands to be prefixed by \"-interpreter-exec console\".") +(defun gdb-strip-string-backslash (string) + (replace-regexp-in-string "\\\\$" "" string)) + (defun gdb-send (proc string) "A comint send filter for gdb." (with-current-buffer gud-comint-buffer @@ -1766,8 +1769,13 @@ commands to be prefixed by \"-interpreter-exec console\".") (remove-text-properties (point-min) (point-max) '(face)))) ;; mimic key to repeat previous command in GDB (if (not (string= "" string)) - (setq gdb-last-command string) - (if gdb-last-command (setq string gdb-last-command))) + (if gdb-continuation + (setq gdb-last-command (concat gdb-continuation + (gdb-strip-string-backslash string) + " ")) + (setq gdb-last-command (gdb-strip-string-backslash string))) + (if gdb-last-command (setq string gdb-last-command)) + (setq gdb-continuation nil)) (if (or (string-match "^-" string) (> gdb-control-level 0)) ;; Either MI command or we are feeding GDB's recursive reading loop. @@ -1779,10 +1787,13 @@ commands to be prefixed by \"-interpreter-exec console\".") (setq gdb-control-level (1- gdb-control-level)))) ;; CLI command (if (string-match "\\\\$" string) - (setq gdb-continuation (concat gdb-continuation string "\n")) + (setq gdb-continuation + (concat gdb-continuation (gdb-strip-string-backslash + string) + " ")) (setq gdb-first-done-or-error t) (let ((to-send (concat "-interpreter-exec console " - (gdb-mi-quote string) + (gdb-mi-quote (concat gdb-continuation string " ")) "\n"))) (if gdb-enable-debug (push (cons 'mi-send to-send) gdb-debug-log))