changeset 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 8671036bedc4
children 63ea0805c417
files lisp/ChangeLog lisp/progmodes/gud.el
diffstat 2 files changed, 20 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Nov 27 17:27:04 2009 +0000
+++ b/lisp/ChangeLog	Fri Nov 27 19:31:57 2009 +0000
@@ -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.
 
--- 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."