# HG changeset patch # User Jim Blandy # Date 717841765 0 # Node ID 4d867d1beddacf5657a6255b681b9458ed46583d # Parent bbf7e139412b3636b814651d9aa18b93a276e889 * gud.el (gud-filter-insert): Previous changes misunderstood the arrangement of unwind-protect and the save-excursion; restored that structure. diff -r bbf7e139412b -r 4d867d1bedda lisp/gud.el --- a/lisp/gud.el Wed Sep 30 01:45:47 1992 +0000 +++ b/lisp/gud.el Wed Sep 30 08:29:25 1992 +0000 @@ -439,22 +439,25 @@ ;; Here's where the actual buffer insertion is done (save-excursion (set-buffer (process-buffer proc)) - (let ((output-after-point (< (point) (process-mark proc)))) - (goto-char (process-mark proc)) - ;; If we have been so requested, delete the debugger prompt. - (if (marker-buffer gud-delete-prompt-marker) - (progn - (delete-region (point) gud-delete-prompt-marker) - (set-marker gud-delete-prompt-marker nil))) - (insert-before-markers 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. - (if (and gud-last-frame - (not output-after-point) - (get-buffer-window (current-buffer))) - (gud-display-frame))))) + (let ((moving (= (point) (process-mark proc))) + (output-after-point (< (point) (process-mark proc)))) + (save-excursion + (goto-char (process-mark proc)) + ;; If we have been so requested, delete the debugger prompt. + (if (marker-buffer gud-delete-prompt-marker) + (progn + (delete-region (point) gud-delete-prompt-marker) + (set-marker gud-delete-prompt-marker nil))) + (insert-before-markers 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. + (if (and gud-last-frame + (not output-after-point) + (get-buffer-window (current-buffer))) + (gud-display-frame))) + (if moving (goto-char (process-mark proc)))))) (defun gud-sentinel (proc msg) (cond ((null (buffer-name (process-buffer proc)))