Mercurial > emacs
comparison lisp/comint.el @ 12208:d10ef5c093ce
(comint-mode): Use make-local-hook.
(comint-send-input, comint-output-filter): Use run-hook-with-args.
(comint-dynamic-complete): Use run-hook-with-args-until-success.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 13 Jun 1995 23:31:17 +0000 |
parents | 24c19691068e |
children | dd3560e3254c |
comparison
equal
deleted
inserted
replaced
12207:a2c1cc17593f | 12208:d10ef5c093ce |
---|---|
121 ;;; comint-file-name-quote-list - list ... | 121 ;;; comint-file-name-quote-list - list ... |
122 ;;; comint-get-old-input - function Hooks for specific | 122 ;;; comint-get-old-input - function Hooks for specific |
123 ;;; comint-input-filter-functions - hook process-in-a-buffer | 123 ;;; comint-input-filter-functions - hook process-in-a-buffer |
124 ;;; comint-output-filter-functions - hook function modes. | 124 ;;; comint-output-filter-functions - hook function modes. |
125 ;;; comint-input-filter - function ... | 125 ;;; comint-input-filter - function ... |
126 ;;; comint-input-send - function ... | 126 ;;; comint-input-sender - function ... |
127 ;;; comint-eol-on-send - boolean ... | 127 ;;; comint-eol-on-send - boolean ... |
128 ;;; comint-process-echoes - boolean ... | 128 ;;; comint-process-echoes - boolean ... |
129 ;;; comint-scroll-to-bottom-on-input - symbol For scroll behavior | 129 ;;; comint-scroll-to-bottom-on-input - symbol For scroll behavior |
130 ;;; comint-scroll-to-bottom-on-output - symbol ... | 130 ;;; comint-scroll-to-bottom-on-output - symbol ... |
131 ;;; comint-scroll-show-maximum-output - boolean... | 131 ;;; comint-scroll-show-maximum-output - boolean... |
374 (setq comint-input-ring-index nil)) | 374 (setq comint-input-ring-index nil)) |
375 (make-local-variable 'comint-matching-input-from-input-string) | 375 (make-local-variable 'comint-matching-input-from-input-string) |
376 (make-local-variable 'comint-input-autoexpand) | 376 (make-local-variable 'comint-input-autoexpand) |
377 (make-local-variable 'comint-input-ignoredups) | 377 (make-local-variable 'comint-input-ignoredups) |
378 (make-local-variable 'comint-delimiter-argument-list) | 378 (make-local-variable 'comint-delimiter-argument-list) |
379 (make-local-variable 'comint-dynamic-complete-functions) | 379 (make-local-hook 'comint-dynamic-complete-functions) |
380 (make-local-variable 'comint-completion-fignore) | 380 (make-local-variable 'comint-completion-fignore) |
381 (make-local-variable 'comint-get-old-input) | 381 (make-local-variable 'comint-get-old-input) |
382 (make-local-variable 'comint-input-filter-functions) | 382 (make-local-hook 'comint-input-filter-functions) |
383 (make-local-variable 'comint-input-filter) | 383 (make-local-variable 'comint-input-filter) |
384 (make-local-variable 'comint-input-sender) | 384 (make-local-variable 'comint-input-sender) |
385 (make-local-variable 'comint-eol-on-send) | 385 (make-local-variable 'comint-eol-on-send) |
386 (make-local-variable 'comint-scroll-to-bottom-on-input) | 386 (make-local-variable 'comint-scroll-to-bottom-on-input) |
387 (make-local-variable 'comint-scroll-to-bottom-on-output) | 387 (make-local-variable 'comint-scroll-to-bottom-on-output) |
388 (make-local-variable 'comint-scroll-show-maximum-output) | 388 (make-local-variable 'comint-scroll-show-maximum-output) |
389 (make-local-variable 'pre-command-hook) | 389 (make-local-variable 'pre-command-hook) |
390 (add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom) | 390 (add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom) |
391 (make-local-variable 'comint-output-filter-functions) | 391 (make-local-hook 'comint-output-filter-functions) |
392 (make-local-variable 'comint-ptyp) | 392 (make-local-variable 'comint-ptyp) |
393 (make-local-variable 'comint-exec-hook) | 393 (make-local-variable 'comint-exec-hook) |
394 (make-local-variable 'comint-process-echoes) | 394 (make-local-variable 'comint-process-echoes) |
395 (make-local-variable 'comint-file-name-quote-list) | 395 (make-local-variable 'comint-file-name-quote-list) |
396 (run-hooks 'comint-mode-hook)) | 396 (run-hooks 'comint-mode-hook)) |
1174 (not (ring-p comint-input-ring)) | 1174 (not (ring-p comint-input-ring)) |
1175 (ring-empty-p comint-input-ring) | 1175 (ring-empty-p comint-input-ring) |
1176 (not (string-equal (ring-ref comint-input-ring 0) | 1176 (not (string-equal (ring-ref comint-input-ring 0) |
1177 history)))) | 1177 history)))) |
1178 (ring-insert comint-input-ring history)) | 1178 (ring-insert comint-input-ring history)) |
1179 (let ((functions comint-input-filter-functions)) | 1179 (run-hook-with-args 'comint-input-filter-functions |
1180 (while functions | 1180 (concat input "\n")) |
1181 (funcall (car functions) (concat input "\n")) | |
1182 (setq functions (cdr functions)))) | |
1183 (setq comint-input-ring-index nil) | 1181 (setq comint-input-ring-index nil) |
1184 ;; Update the markers before we send the input | 1182 ;; Update the markers before we send the input |
1185 ;; in case we get output amidst sending the input. | 1183 ;; in case we get output amidst sending the input. |
1186 (set-marker comint-last-input-start pmark) | 1184 (set-marker comint-last-input-start pmark) |
1187 (set-marker comint-last-input-end (point)) | 1185 (set-marker comint-last-input-end (point)) |
1227 (set-marker (process-mark process) (point)) | 1225 (set-marker (process-mark process) (point)) |
1228 (force-mode-line-update)) | 1226 (force-mode-line-update)) |
1229 | 1227 |
1230 (narrow-to-region obeg oend) | 1228 (narrow-to-region obeg oend) |
1231 (goto-char opoint) | 1229 (goto-char opoint) |
1232 (let ((functions comint-output-filter-functions)) | 1230 (run-hook-with-args 'comint-output-filter-functions string) |
1233 (while functions | |
1234 (funcall (car functions) string) | |
1235 (setq functions (cdr functions)))) | |
1236 (set-buffer obuf))))) | 1231 (set-buffer obuf))))) |
1237 | 1232 |
1238 (defun comint-preinput-scroll-to-bottom () | 1233 (defun comint-preinput-scroll-to-bottom () |
1239 "Go to the end of buffer in all windows showing it. | 1234 "Go to the end of buffer in all windows showing it. |
1240 Movement occurs if point in the selected window is not after the process mark, | 1235 Movement occurs if point in the selected window is not after the process mark, |
1893 "Dynamically perform completion at point. | 1888 "Dynamically perform completion at point. |
1894 Calls the functions in `comint-dynamic-complete-functions' to perform | 1889 Calls the functions in `comint-dynamic-complete-functions' to perform |
1895 completion until a function returns non-nil, at which point completion is | 1890 completion until a function returns non-nil, at which point completion is |
1896 assumed to have occurred." | 1891 assumed to have occurred." |
1897 (interactive) | 1892 (interactive) |
1898 (let ((functions comint-dynamic-complete-functions)) | 1893 (run-hook-with-args-until-success 'comint-dynamic-complete-functions)) |
1899 (while (and functions (null (funcall (car functions)))) | |
1900 (setq functions (cdr functions))))) | |
1901 | 1894 |
1902 | 1895 |
1903 (defun comint-dynamic-complete-filename () | 1896 (defun comint-dynamic-complete-filename () |
1904 "Dynamically complete the filename at point. | 1897 "Dynamically complete the filename at point. |
1905 Completes if after a filename. See `comint-match-partial-filename' and | 1898 Completes if after a filename. See `comint-match-partial-filename' and |