diff options
| author | Richard M. Stallman | 1994-04-21 06:42:24 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-21 06:42:24 +0000 |
| commit | a9a6f83ff3b4db87187e7f79f0a4e31d9663062a (patch) | |
| tree | cb9eea6177914b2c54d5a4f4ba8ae366ff0e1637 | |
| parent | f54877b282db437bc90b793b68923e72794493c7 (diff) | |
| download | emacs-a9a6f83ff3b4db87187e7f79f0a4e31d9663062a.tar.gz emacs-a9a6f83ff3b4db87187e7f79f0a4e31d9663062a.zip | |
(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.
| -rw-r--r-- | lisp/comint.el | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 29e73f13e12..a5b0cfe5b33 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -346,8 +346,10 @@ Entry to this mode runs the hooks on `comint-mode-hook'." | |||
| 346 | (use-local-map comint-mode-map) | 346 | (use-local-map comint-mode-map) |
| 347 | (make-local-variable 'comint-last-input-start) | 347 | (make-local-variable 'comint-last-input-start) |
| 348 | (setq comint-last-input-start (make-marker)) | 348 | (setq comint-last-input-start (make-marker)) |
| 349 | (set-marker comint-last-input-start (point-min)) | ||
| 349 | (make-local-variable 'comint-last-input-end) | 350 | (make-local-variable 'comint-last-input-end) |
| 350 | (setq comint-last-input-end (make-marker)) | 351 | (setq comint-last-input-end (make-marker)) |
| 352 | (set-marker comint-last-input-end (point-min)) | ||
| 351 | (make-local-variable 'comint-last-output-start) | 353 | (make-local-variable 'comint-last-output-start) |
| 352 | (setq comint-last-output-start (make-marker)) | 354 | (setq comint-last-output-start (make-marker)) |
| 353 | (make-local-variable 'comint-prompt-regexp) ; Don't set; default | 355 | (make-local-variable 'comint-prompt-regexp) ; Don't set; default |
| @@ -1130,13 +1132,7 @@ Similarly for Soar, Scheme, etc." | |||
| 1130 | (set-marker comint-last-input-start pmark) | 1132 | (set-marker comint-last-input-start pmark) |
| 1131 | (set-marker comint-last-input-end (point)) | 1133 | (set-marker comint-last-input-end (point)) |
| 1132 | (set-marker (process-mark proc) (point)) | 1134 | (set-marker (process-mark proc) (point)) |
| 1133 | ;; A kludge to prevent the delay between insert and process output | 1135 | (comint-output-filter proc ""))))) |
| 1134 | ;; affecting the display. A case for a comint-send-input-hook? | ||
| 1135 | (if (eq (process-filter proc) 'comint-output-filter) | ||
| 1136 | (let ((functions comint-output-filter-functions)) | ||
| 1137 | (while functions | ||
| 1138 | (funcall (car functions) (concat input "\n")) | ||
| 1139 | (setq functions (cdr functions))))))))) | ||
| 1140 | 1136 | ||
| 1141 | ;; The purpose of using this filter for comint processes | 1137 | ;; The purpose of using this filter for comint processes |
| 1142 | ;; is to keep comint-last-input-end from moving forward | 1138 | ;; is to keep comint-last-input-end from moving forward |
| @@ -1421,14 +1417,19 @@ your process from hanging on long inputs. See `comint-send-string'." | |||
| 1421 | "Kill all output from interpreter since last input. | 1417 | "Kill all output from interpreter since last input. |
| 1422 | Does not delete the prompt." | 1418 | Does not delete the prompt." |
| 1423 | (interactive) | 1419 | (interactive) |
| 1424 | (let ((pmark (progn (goto-char | 1420 | (let ((proc (get-buffer-process (current-buffer))) |
| 1425 | (process-mark (get-buffer-process (current-buffer)))) | 1421 | (replacement nil)) |
| 1426 | (beginning-of-line nil) | 1422 | (save-excursion |
| 1427 | (point-marker)))) | 1423 | (let ((pmark (progn (goto-char (process-mark proc)) |
| 1428 | (kill-region comint-last-input-end pmark) | 1424 | (beginning-of-line nil) |
| 1429 | (insert "*** output flushed ***\n") | 1425 | (point-marker)))) |
| 1430 | (comint-skip-prompt) | 1426 | (delete-region comint-last-input-end pmark) |
| 1431 | (set-marker pmark (point)))) | 1427 | (comint-skip-prompt) |
| 1428 | (setq replacement (concat "*** output flushed ***\n" | ||
| 1429 | (buffer-substring pmark (point)))) | ||
| 1430 | (delete-region pmark (point)))) | ||
| 1431 | ;; Output message and put back prompt | ||
| 1432 | (comint-output-filter proc replacement))) | ||
| 1432 | 1433 | ||
| 1433 | (defun comint-show-output () | 1434 | (defun comint-show-output () |
| 1434 | "Display start of this batch of interpreter output at top of window. | 1435 | "Display start of this batch of interpreter output at top of window. |