diff lisp/progmodes/gud.el @ 106291:df75422e3816

(gud-basic-call): Don't only save the buffer but the excursion as well.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 27 Nov 2009 19:31:57 +0000
parents a0f778f4a995
children 3a8fd7717b30
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Fri Nov 27 17:27:04 2009 +0000
+++ b/lisp/progmodes/gud.el	Fri Nov 27 19:31:57 2009 +0000
@@ -2832,18 +2832,19 @@
     (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."