diff options
| author | Gerd Moellmann | 1999-10-25 13:44:12 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-10-25 13:44:12 +0000 |
| commit | 2c8e62112a59fa48e6f43b3cb289ce8d3672afc9 (patch) | |
| tree | f2b800841b1ae69771f2022d78d799e17c4d4c68 | |
| parent | bd3c545deb43a9622c850b47d172d5e593f24bc6 (diff) | |
| download | emacs-2c8e62112a59fa48e6f43b3cb289ce8d3672afc9.tar.gz emacs-2c8e62112a59fa48e6f43b3cb289ce8d3672afc9.zip | |
(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 7018a1a31a4..5dd15efef82 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -10,6 +10,9 @@ | |||
| 10 | 10 | ||
| 11 | * indent.el (indent-region): Doc fix. | 11 | * indent.el (indent-region): Doc fix. |
| 12 | 12 | ||
| 13 | * comint.el (comint-output-filter): Make the Comint buffer current | ||
| 14 | for the comint-preoutput-filter-functions. | ||
| 15 | |||
| 13 | 1999-10-24 Stephen Eglen <stephen@gnu.org> | 16 | 1999-10-24 Stephen Eglen <stephen@gnu.org> |
| 14 | 17 | ||
| 15 | * progmodes/octave-mod.el (octave-auto-indent): Remove :version so | 18 | * progmodes/octave-mod.el (octave-auto-indent): Remove :version so |
diff --git a/lisp/comint.el b/lisp/comint.el index 1e7c0ee3c27..48c60003b7d 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -1349,16 +1349,15 @@ This variable is buffer-local.") | |||
| 1349 | ;; is to keep comint-last-input-end from moving forward | 1349 | ;; is to keep comint-last-input-end from moving forward |
| 1350 | ;; when output is inserted. | 1350 | ;; when output is inserted. |
| 1351 | (defun comint-output-filter (process string) | 1351 | (defun comint-output-filter (process string) |
| 1352 | ;; First check for killed buffer | ||
| 1353 | (let ((oprocbuf (process-buffer process))) | 1352 | (let ((oprocbuf (process-buffer process))) |
| 1354 | (let ((functions comint-preoutput-filter-functions)) | 1353 | ;; First check for killed buffer or no input. |
| 1355 | (while (and functions string) | 1354 | (when (and string oprocbuf (buffer-name oprocbuf)) |
| 1356 | (setq string (funcall (car functions) string)) | 1355 | (with-current-buffer oprocbuf |
| 1357 | (setq functions (cdr functions)))) | 1356 | (let ((functions comint-preoutput-filter-functions)) |
| 1358 | (if (and string oprocbuf (buffer-name oprocbuf)) | 1357 | (while (and functions string) |
| 1359 | (let ((obuf (current-buffer)) | 1358 | (setq string (funcall (car functions) string)) |
| 1360 | (opoint nil) (obeg nil) (oend nil)) | 1359 | (setq functions (cdr functions)))) |
| 1361 | (set-buffer oprocbuf) | 1360 | (let (opoint obeg oend) |
| 1362 | (setq opoint (point)) | 1361 | (setq opoint (point)) |
| 1363 | (setq obeg (point-min)) | 1362 | (setq obeg (point-min)) |
| 1364 | (setq oend (point-max)) | 1363 | (setq oend (point-max)) |
| @@ -1389,8 +1388,7 @@ This variable is buffer-local.") | |||
| 1389 | 1388 | ||
| 1390 | (narrow-to-region obeg oend) | 1389 | (narrow-to-region obeg oend) |
| 1391 | (goto-char opoint) | 1390 | (goto-char opoint) |
| 1392 | (run-hook-with-args 'comint-output-filter-functions string) | 1391 | (run-hook-with-args 'comint-output-filter-functions string)))))) |
| 1393 | (set-buffer obuf))))) | ||
| 1394 | 1392 | ||
| 1395 | (defun comint-preinput-scroll-to-bottom () | 1393 | (defun comint-preinput-scroll-to-bottom () |
| 1396 | "Go to the end of buffer in all windows showing it. | 1394 | "Go to the end of buffer in all windows showing it. |