diff options
author | Gerd Moellmann <[email protected]> | 1999-10-25 13:44:12 +0000 |
---|---|---|
committer | Gerd Moellmann <[email protected]> | 1999-10-25 13:44:12 +0000 |
commit | 2c8e62112a59fa48e6f43b3cb289ce8d3672afc9 (patch) | |
tree | f2b800841b1ae69771f2022d78d799e17c4d4c68 | |
parent | bd3c545deb43a9622c850b47d172d5e593f24bc6 (diff) |
(comint-output-filter): Make the Comint buffer current
for the comint-preoutput-filter-functions.
-rw-r--r-- | lisp/ChangeLog | 3 | ||||
-rw-r--r-- | lisp/comint.el | 20 |
2 files changed, 12 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7018a1a31a..5dd15efef8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -10,6 +10,9 @@ * indent.el (indent-region): Doc fix. + * comint.el (comint-output-filter): Make the Comint buffer current + for the comint-preoutput-filter-functions. + 1999-10-24 Stephen Eglen <[email protected]> * progmodes/octave-mod.el (octave-auto-indent): Remove :version so diff --git a/lisp/comint.el b/lisp/comint.el index 1e7c0ee3c2..48c60003b7 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1349,16 +1349,15 @@ This variable is buffer-local.") ;; is to keep comint-last-input-end from moving forward ;; when output is inserted. (defun comint-output-filter (process string) - ;; First check for killed buffer (let ((oprocbuf (process-buffer process))) - (let ((functions comint-preoutput-filter-functions)) - (while (and functions string) - (setq string (funcall (car functions) string)) - (setq functions (cdr functions)))) - (if (and string oprocbuf (buffer-name oprocbuf)) - (let ((obuf (current-buffer)) - (opoint nil) (obeg nil) (oend nil)) - (set-buffer oprocbuf) + ;; First check for killed buffer or no input. + (when (and string oprocbuf (buffer-name oprocbuf)) + (with-current-buffer oprocbuf + (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)) @@ -1389,8 +1388,7 @@ This variable is buffer-local.") (narrow-to-region obeg oend) (goto-char opoint) - (run-hook-with-args 'comint-output-filter-functions string) - (set-buffer obuf))))) + (run-hook-with-args 'comint-output-filter-functions string)))))) (defun comint-preinput-scroll-to-bottom () "Go to the end of buffer in all windows showing it. |