(gud-basic-call): Don't only save the buffer but the excursion as well.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 27 Nov 2009 19:31:57 +0000 (19:31 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 27 Nov 2009 19:31:57 +0000 (19:31 +0000)
lisp/ChangeLog
lisp/progmodes/gud.el

index 6e719cf..579ae1e 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/gud.el (gud-basic-call): Don't only save the buffer but
+       the excursion as well.
+
 2009-11-27  Michael Albinus  <michael.albinus@gmx.de>
 
        * 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 "<section> <name>" format as well.
        (Man-default-man-entry): Remove spurious var shadowing the argument.
 
index cbb0f46..9b8947a 100644 (file)
@@ -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."