From c5269f1cd5bb589342127015860890e03e8bdf96 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 27 Nov 2009 19:31:57 +0000 Subject: [PATCH] (gud-basic-call): Don't only save the buffer but the excursion as well. --- lisp/ChangeLog | 8 +++++++- lisp/progmodes/gud.el | 25 +++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6e719cfe520..579ae1e7af1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-11-27 Stefan Monnier + + * progmodes/gud.el (gud-basic-call): Don't only save the buffer but + the excursion as well. + 2009-11-27 Michael Albinus * eshell/em-unix.el (eshell/su, eshell/sudo): New defuns, @@ -17,7 +22,8 @@ * man.el (Man-completion-table): Trim a terminating "(". Remove the space between name page a section. Add the command's description on the `help-echo' property. - Remove `process-connection-type' binding since it's unused by call-process. + Remove `process-connection-type' binding since it's unused by + call-process. Provide completion for the "
" format as well. (Man-default-man-entry): Remove spurious var shadowing the argument. diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index cbb0f46bdca..9b8947a616a 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2832,18 +2832,19 @@ Obeying it means displaying in another window the specified file and line." (or proc (error "Current buffer has no process")) ;; Arrange for the current prompt to get deleted. (with-current-buffer gud-comint-buffer - (save-restriction - (widen) - (if (marker-position gud-delete-prompt-marker) - ;; We get here when printing an expression. - (goto-char gud-delete-prompt-marker) - (goto-char (process-mark proc)) - (forward-line 0)) - (if (looking-at comint-prompt-regexp) - (set-marker gud-delete-prompt-marker (point))) - (if (eq gud-minor-mode 'gdbmi) - (apply comint-input-sender (list proc command)) - (process-send-string proc (concat command "\n"))))))) + (save-excursion + (save-restriction + (widen) + (if (marker-position gud-delete-prompt-marker) + ;; We get here when printing an expression. + (goto-char gud-delete-prompt-marker) + (goto-char (process-mark proc)) + (forward-line 0)) + (if (looking-at comint-prompt-regexp) + (set-marker gud-delete-prompt-marker (point))) + (if (eq gud-minor-mode 'gdbmi) + (apply comint-input-sender (list proc command)) + (process-send-string proc (concat command "\n")))))))) (defun gud-refresh (&optional arg) "Fix up a possibly garbled display, and redraw the arrow." -- 2.11.4.GIT