Commit 867102f2 authored by Miles Bader's avatar Miles Bader
Browse files

(comint-output-filter): Doc fixes & misc code cleanup.

parent af718538
2000-08-10 Miles Bader <>
* comint.el (comint-output-filter): Doc fixes & misc code cleanup.
2000-08-10 Eli Zaretskii <>
* info.el (Info-file-list-for-emacs): More elements for the
......@@ -1487,20 +1487,25 @@ This variable is permanent-local.")
;; First check for killed buffer or no input.
(when (and string oprocbuf (buffer-name oprocbuf))
(with-current-buffer oprocbuf
;; Run preoutput filters
(let ((functions comint-preoutput-filter-functions))
(while (and functions string)
(setq string (funcall (car functions) string))
(setq functions (cdr functions))))
(let (opoint obeg oend)
(setq opoint (point))
(setq obeg (point-min))
(setq oend (point-max))
(let ((buffer-read-only nil)
;; Do insertion. We don't use save-restriction because it has a
;; bug, so we fake it by saving any current restriction, and
;; then later restoring it.
(let ((opoint (point))
(obeg (point-min))
(oend (point-max))
(buffer-read-only nil)
(nchars (length string))
(ostart nil))
(ostart (process-mark process)))
(goto-char (process-mark process))
(setq ostart (point))
(goto-char ostart)
;; Adjust buffer positions to account for about-to-be-inserted text
(if (<= (point) opoint)
(setq opoint (+ opoint nchars)))
;; Insert after old_begv, but before old_zv.
......@@ -1512,10 +1517,8 @@ This variable is permanent-local.")
(insert string)
(unless comint-use-prompt-regexp-instead-of-fields
;; We check to see if the last overlay used for output has
;; already been extended to include STRING (because it was
;; inserted with insert-before-markers?), and only make
;; a new overlay if it hasn't.
;; We check to see if the last overlay used for output is
;; adjacent to the new input, and if so, just extend it.
(if (and comint-last-output-overlay
(equal (overlay-end comint-last-output-overlay) ostart))
;; Extend comint-last-output-overlay to include the
......@@ -1557,13 +1560,16 @@ This variable is permanent-local.")
(if (and comint-last-input-end
(marker-buffer comint-last-input-end)
(= (point) comint-last-input-end))
(set-marker comint-last-input-end (- comint-last-input-end nchars)))
(set-marker comint-last-input-end
(- comint-last-input-end nchars)))
(set-marker comint-last-output-start ostart)
(set-marker (process-mark process) (point))
;; Restore our saved restriction, and the point
(narrow-to-region obeg oend)
(goto-char opoint)
(run-hook-with-args 'comint-output-filter-functions string))))))
(defun comint-preinput-scroll-to-bottom ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment