Subject: Re: bug#5061: I have found the location of this bug...

From: Stefan Monnier <[email-masked]>
Date: Fri, 27 Nov 2009 14:33:06 -0500

> This bug is due to the Stefan Monnier's commit on 2009-10-31.  In
> particular, reverting the following diff solves this problem:

Great, I've installed the fix below which should do it right.

        Stefan

--- lisp/progmodes/gud.el	11 Nov 2009 05:49:14 -0000	1.174
+++ lisp/progmodes/gud.el	27 Nov 2009 19:29:54 -0000
@@ -2832,6 +2832,7 @@
     (or proc (error "Current buffer has no process"))
     ;; Arrange for the current prompt to get deleted.
     (with-current-buffer gud-comint-buffer
+      (save-excursion
       (save-restriction
 	(widen)
 	(if (marker-position gud-delete-prompt-marker)
@@ -2843,7 +2844,7 @@
 	    (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")))))))
+            (process-send-string proc (concat command "\n"))))))))
 
 (defun gud-refresh (&optional arg)
   "Fix up a possibly garbled display, and redraw the arrow."