changeset 30959:d55632c1102b

(gud-basic-call): Temporarily widen gud comint buffer while checking for prompt to delete. Use `forward-line 0' instead of beginning-of-line. (gud-filter): Temporarily widen gud comint buffer while examining output.
author Miles Bader <miles@gnu.org>
date Sat, 19 Aug 2000 01:57:55 +0000
parents ec347dd209e8
children c598e9bfdce2
files lisp/gud.el
diffstat 1 files changed, 23 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gud.el	Sat Aug 19 01:55:40 2000 +0000
+++ b/lisp/gud.el	Sat Aug 19 01:57:55 2000 +0000
@@ -2184,20 +2184,23 @@
 
 	    (with-current-buffer (process-buffer proc)
 	      ;; If we have been so requested, delete the debugger prompt.
-	      (if (marker-buffer gud-delete-prompt-marker)
-		  (progn
-		    (delete-region (process-mark proc) gud-delete-prompt-marker)
-		    (set-marker gud-delete-prompt-marker nil)))
-	      ;; Save the process output, checking for source file markers.
-	      (setq output (gud-marker-filter string))
-	      ;; Check for a filename-and-line number.
-	      ;; Don't display the specified file
-	      ;; unless (1) point is at or after the position where output appears
-	      ;; and (2) this buffer is on the screen.
-	      (setq process-window
-		    (and gud-last-frame
-			 (>= (point) (process-mark proc))
-			 (get-buffer-window (current-buffer))))
+	      (save-restriction
+		(widen)
+		(if (marker-buffer gud-delete-prompt-marker)
+		    (progn
+		      (delete-region (process-mark proc)
+				     gud-delete-prompt-marker)
+		      (set-marker gud-delete-prompt-marker nil)))
+		;; Save the process output, checking for source file markers.
+		(setq output (gud-marker-filter string))
+		;; Check for a filename-and-line number.
+		;; Don't display the specified file
+		;; unless (1) point is at or after the position where output appears
+		;; and (2) this buffer is on the screen.
+		(setq process-window
+		      (and gud-last-frame
+			   (>= (point) (process-mark proc))
+			   (get-buffer-window (current-buffer)))))
 
 	      ;; Let the comint filter do the actual insertion.
 	      ;; That lets us inherit various comint features.
@@ -2382,10 +2385,12 @@
     ;; Arrange for the current prompt to get deleted.
     (save-excursion
       (set-buffer gud-comint-buffer)
-      (goto-char (process-mark proc))
-      (beginning-of-line)
-      (if (looking-at comint-prompt-regexp)
-	  (set-marker gud-delete-prompt-marker (point))))
+      (save-restriction
+	(widen)
+	(goto-char (process-mark proc))
+	(forward-line 0)
+	(if (looking-at comint-prompt-regexp)
+	    (set-marker gud-delete-prompt-marker (point)))))
     (process-send-string proc command)))
 
 (defun gud-refresh (&optional arg)