From: Sergio Durigan Junior <sergiodj@riseup.net>
To: emacs-devel@gnu.org
Subject: Re: [PATCH] Fix gdb-mi.el to recognize backslashes as quotes
Date: Fri, 12 Jul 2013 00:41:42 -0300 [thread overview]
Message-ID: <8738rksavd.fsf@riseup.net> (raw)
In-Reply-To: mvmip0hqzol.fsf@hawking.suse.de
On Thursday, July 11 2013, Andreas Schwab wrote:
> Sergio Durigan Junior <sergiodj@riseup.net> 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 <RET> 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))
next prev parent reply other threads:[~2013-07-12 3:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-11 5:33 [PATCH] Fix gdb-mi.el to recognize backslashes as quotes Sergio Durigan Junior
2013-07-11 8:16 ` Andreas Schwab
2013-07-12 3:41 ` Sergio Durigan Junior [this message]
2013-07-11 23:35 ` Stefan Monnier
2013-07-12 3:42 ` Sergio Durigan Junior
2013-07-12 5:10 ` Sergio Durigan Junior
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=8738rksavd.fsf@riseup.net \
--to=sergiodj@riseup.net \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.