# HG changeset patch # User Richard M. Stallman # Date 766910544 0 # Node ID 40163ff9fc7c6f39fc17070a6b63df2f18d87f58 # Parent efca3097415735748ae9dd3808d6df95962f3fb4 (comint-mode): Set comint-last-input-start and comint-last-input-end to valid markers. (comint-send-input): Use comint-output-filter to run functions on comint-output-filter-functions. (comint-kill-output): Use delete-region to remove, and comint-output-filter to insert. diff -r efca30974157 -r 40163ff9fc7c lisp/comint.el --- a/lisp/comint.el Thu Apr 21 06:24:36 1994 +0000 +++ b/lisp/comint.el Thu Apr 21 06:42:24 1994 +0000 @@ -346,8 +346,10 @@ (use-local-map comint-mode-map) (make-local-variable 'comint-last-input-start) (setq comint-last-input-start (make-marker)) + (set-marker comint-last-input-start (point-min)) (make-local-variable 'comint-last-input-end) (setq comint-last-input-end (make-marker)) + (set-marker comint-last-input-end (point-min)) (make-local-variable 'comint-last-output-start) (setq comint-last-output-start (make-marker)) (make-local-variable 'comint-prompt-regexp) ; Don't set; default @@ -1130,13 +1132,7 @@ (set-marker comint-last-input-start pmark) (set-marker comint-last-input-end (point)) (set-marker (process-mark proc) (point)) - ;; A kludge to prevent the delay between insert and process output - ;; affecting the display. A case for a comint-send-input-hook? - (if (eq (process-filter proc) 'comint-output-filter) - (let ((functions comint-output-filter-functions)) - (while functions - (funcall (car functions) (concat input "\n")) - (setq functions (cdr functions))))))))) + (comint-output-filter proc ""))))) ;; The purpose of using this filter for comint processes ;; is to keep comint-last-input-end from moving forward @@ -1421,14 +1417,19 @@ "Kill all output from interpreter since last input. Does not delete the prompt." (interactive) - (let ((pmark (progn (goto-char - (process-mark (get-buffer-process (current-buffer)))) - (beginning-of-line nil) - (point-marker)))) - (kill-region comint-last-input-end pmark) - (insert "*** output flushed ***\n") - (comint-skip-prompt) - (set-marker pmark (point)))) + (let ((proc (get-buffer-process (current-buffer))) + (replacement nil)) + (save-excursion + (let ((pmark (progn (goto-char (process-mark proc)) + (beginning-of-line nil) + (point-marker)))) + (delete-region comint-last-input-end pmark) + (comint-skip-prompt) + (setq replacement (concat "*** output flushed ***\n" + (buffer-substring pmark (point)))) + (delete-region pmark (point)))) + ;; Output message and put back prompt + (comint-output-filter proc replacement))) (defun comint-show-output () "Display start of this batch of interpreter output at top of window.