From 136b4eda878f450163e70dd1ed56980d35d6d742 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 19 Aug 2000 01:59:21 +0000 Subject: [PATCH] (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. --- lisp/ChangeLog | 19 +++++++++++++++++++ lisp/gud.el | 41 +++++++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 899a5a50406..93a1e633fb3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2000-08-19 Miles Bader + + * emacs-lisp/bytecomp.el (byte-compile-beginning-of-line): + Compiler macro removed; beginning-of-line is no longer always + equivalent to forward-line, in the presence of fields. + + * comint.el (comint-output-filter): Remove ad-hoc saving of + restriction, and just use save-restriction, now that it works + correctly. Don't adjust comint-last-input-start to account for + our insertion; it shouldn't have moved because we don't use + insert-before-markers anymore. Comment out call to + `force-mode-line-update'; why is it here? + + * gud.el (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. + 2000-08-18 Stefan Monnier * textmodes/ispell.el (ispell-menu-map-needed): Put back the boundp diff --git a/lisp/gud.el b/lisp/gud.el index 688346f1953..13a8a101118 100644 --- a/lisp/gud.el +++ b/lisp/gud.el @@ -2184,20 +2184,23 @@ It is saved for when this flag is not set.") (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 @@ Obeying it means displaying in another window the specified file and line." ;; 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) -- 2.39.2