File: comint.el.html

This file defines a general command-interpreter-in-a-buffer package
(comint mode). The idea is that you can build specific process-in-a-buffer
modes on top of comint mode -- e.g., Lisp, shell, scheme, T, soar, .... This way, all these specific packages share a common base functionality, and a common set of bindings, which makes them easier to use (and saves code, implementation time, etc., etc.).

Several packages are already defined using comint mode:
- shell.el defines a shell-in-a-buffer mode.
- cmulisp.el defines a simple lisp-in-a-buffer mode.

- The file cmuscheme.el defines a scheme-in-a-buffer mode.
- The file tea.el tunes scheme and inferior-scheme modes for T.
- The file soar.el tunes Lisp and inferior-lisp modes for Soar.
- cmutex.el defines TeX and LaTeX modes that invoke TeX, LaTeX, BibTeX,
  previewers, and printers from within Emacs.
- background.el allows csh-like job control inside Emacs.
It is pretty easy to make new derived modes for other processes.

For documentation on the functionality provided by Comint mode, and the hooks available for customizing it, see the comments below. For further information on the standard derived modes (shell, inferior-lisp, inferior-scheme, ...), see the relevant source files.

For hints on converting existing process modes (e.g., tex-mode, background, dbx, gdb, kermit, prolog, telnet) to use comint-mode instead of shell-mode, see the notes at the end of this file.

Defined variables (70)

comint--prompt-rear-nonstickyText properties we set on the prompt and don’t want to leak past it.
comint-accum-markerNon-nil if you are accumulating input lines to send as input together.
comint-buffer-maximum-sizeThe maximum size in lines for Comint buffers.
comint-completion-addsuffixIf non-nil, add ‘ ’ to file names.
comint-completion-autolistIf non-nil, automatically list possibilities on partial completion.
comint-completion-fignoreList of suffixes to be disregarded during file completion.
comint-completion-recexactIf non-nil, use shortest completion if characters cannot be added.
comint-delimiter-argument-listList of characters to recognize as separate arguments in input.
comint-dynamic-complete-functionsList of functions called to perform completion.
comint-eol-on-sendNon-nil means go to the end of the line before sending input.
comint-exec-hookHook run each time a process is exec’d by ‘comint-exec’.
comint-file-name-charsString of characters valid in a file name.
comint-file-name-prefixPrefix prepended to absolute file names taken from process input.
comint-file-name-quote-listList of characters to quote with ‘\’ when in a file name.
comint-get-old-inputFunction that returns old text in Comint mode.
comint-highlight-inputIf non-nil, highlight input with ‘comint-highlight-input’ face.
comint-history-isearchNon-nil to Isearch in input history only, not in comint buffer output.
comint-inhibit-carriage-motionIf nil, Comint will interpret ‘carriage control’ characters in output.
comint-input-autoexpandIf non-nil, expand input command history references on completion.
comint-input-filterPredicate for filtering additions to input history.
comint-input-filter-functionsAbnormal hook run before input is sent to the process.
comint-input-history-ignoreRegexp for history entries that should be ignored when Comint initializes.
comint-input-ignoredupsIf non-nil, don’t add input matching the last on the input ring.
comint-input-ring-file-nameIf non-nil, name of the file to read/write input history.
comint-input-ring-file-prefixThe prefix to skip when parsing the input ring file.
comint-input-ring-indexIndex of last matched history element.
comint-input-ring-separatorSeparator between commands in the history file.
comint-input-ring-sizeSize of the input history ring in ‘comint-mode’.
comint-input-senderFunction to actually send to PROCESS the STRING submitted by user.
comint-input-sender-no-newlineNon-nil directs the ‘comint-input-sender’ function not to send a newline.
comint-insert-previous-argument-from-endIf non-nil, ‘comint-insert-previous-argument’ counts args from the end.
comint-last-promptMarkers pointing to the last prompt.
comint-matching-input-from-input-stringInput previously used to match input history.
comint-max-line-lengthMaximum line length, in bytes, accepted by the inferior process.
comint-mode-abbrev-tableAbbrev table for ‘comint-mode’.
comint-mode-hookHook run upon entry to ‘comint-mode’.
comint-mode-mapKeymap for ‘comint-mode’.
comint-mode-syntax-tableSyntax table for ‘comint-mode’.
comint-move-point-for-matching-inputControls where to place point after matching input.
comint-move-point-for-outputControls whether interpreter output moves point to the end of the output.
comint-osc-handlersAlist of handlers for OSC escape sequences.
comint-osc-hyperlink-mapKeymap used by OSC 8 hyperlink buttons.
comint-output-filter-functionsFunctions to call after output is inserted into the buffer.
comint-password-functionAbnormal hook run when prompted for a password.
comint-password-prompt-regexpRegexp matching prompts for passwords in the inferior process.
comint-preoutput-filter-functionsList of functions to call before inserting Comint output into the buffer.
comint-process-echoesIf non-nil, assume that the subprocess echoes any input.
comint-prompt-read-onlyIf non-nil, the comint prompt is read only.
comint-prompt-regexpRegexp to recognize prompts in the inferior process.
comint-ptypNon-nil if communications via pty; false if by pipe. Buffer local.
comint-redirect-completedNon-nil if redirection has completed in the current buffer.
comint-redirect-echo-inputNon-nil means echo input in the process buffer even during redirection.
comint-redirect-filter-functionsList of functions to call before inserting redirected process output.
comint-redirect-finished-regexpRegular expression that determines when to stop redirection in Comint.
comint-redirect-insert-matching-regexpIf non-nil, the text that ends a redirection is included in it.
comint-redirect-original-mode-line-processOriginal mode line for redirected process.
comint-redirect-output-bufferThe buffer or list of buffers to put output into.
comint-redirect-perform-sanity-checkIf non-nil, check that redirection is likely to complete successfully.
comint-redirect-previous-input-stringLast redirected line of text.
comint-redirect-subvert-readonlyNon-nil means ‘comint-redirect’ can insert into read-only buffers.
comint-redirect-verboseIf non-nil, print messages each time the redirection filter is invoked.
comint-requote-functionFunction to use for completion of quoted data.
comint-save-input-ring-indexLast input ring index which you copied.
comint-scroll-show-maximum-outputControls how to scroll due to interpreter output.
comint-scroll-to-bottom-on-inputControls whether input to interpreter causes window to scroll.
comint-scroll-to-bottom-on-outputControls whether interpreter output moves point to the end of the output.
comint-stored-incomplete-inputStored input for history cycling.
comint-terminfo-terminalValue to use for TERM when the system uses terminfo.
comint-unquote-functionFunction to use for completion of quoted data.
comint-use-prompt-regexpIf non-nil, use ‘comint-prompt-regexp’ to recognize prompts.

Defined functions (138)

comint--complete-file-name-data()
comint--match-partial-filename()
comint--requote-argument(UPOS QSTR)
comint--unquote&expand-filename(STR)
comint--unquote&requote-argument(QSTR &optional UPOS)
comint--unquote-argument(STR)
comint-accumulate()
comint-add-to-input-history(CMD)
comint-adjust-point(SELECTED)
comint-adjust-window-point(WINDOW PROCESS)
comint-after-pmark-p()
comint-append-output-to-file(FILENAME)
comint-args(STRING BEGIN END)
comint-arguments(STRING NTH MTH)
comint-backward-matching-input(REGEXP N)
comint-bol(&optional ARG)
comint-bol-or-process-mark()
comint-c-a-p-replace-by-expanded-history(&optional SILENT START)
comint-carriage-motion(START END)
comint-check-proc(BUFFER)
comint-check-source(FNAME)
comint-clear-buffer()
comint-completion-file-name-table(STRING PRED ACTION)
comint-continue-subjob()
comint-copy-old-input()
comint-delchar-or-maybe-eof(ARG)
comint-delete-input()
comint-delete-output(&optional KILL)
comint-delim-arg(ARG)
comint-directory(DIRECTORY)
comint-dynamic-complete()
comint-dynamic-complete-as-filename()
comint-dynamic-complete-filename()
comint-dynamic-list-completions(COMPLETIONS &optional COMMON-SUBSTRING)
comint-dynamic-list-filename-completions()
comint-dynamic-list-input-ring()
comint-dynamic-list-input-ring-select()
comint-dynamic-simple-complete(STUB CANDIDATES)
comint-exec(BUFFER NAME COMMAND STARTFILE SWITCHES)
comint-exec-1(NAME BUFFER COMMAND SWITCHES)
comint-extract-string()
comint-filename-completion()
comint-forward-matching-input(REGEXP N)
comint-get-next-from-history()
comint-get-old-input-default()
comint-get-source(PROMPT PREV-DIR/FILE SOURCE-MODES MUSTMATCH-P)
comint-goto-input(POS)
comint-goto-process-mark()
comint-history-isearch-backward()
comint-history-isearch-backward-regexp()
comint-history-isearch-end()
comint-history-isearch-message(&optional C-Q-HACK ELLIPSIS)
comint-history-isearch-pop-state(CMD HIST-POS)
comint-history-isearch-push-state()
comint-history-isearch-search()
comint-history-isearch-setup()
comint-history-isearch-wrap()
comint-how-many-region(REGEXP BEG END)
comint-insert-input(EVENT)
comint-insert-previous-argument(INDEX)
comint-interrupt-subjob()
comint-kill-input()
comint-kill-region(BEG END)
comint-kill-subjob()
comint-kill-whole-line(&optional COUNT)
comint-line-beginning-position()
comint-magic-space(ARG)
comint-match-partial-filename()
comint-mode()
comint-next-input(ARG)
comint-next-matching-input(REGEXP N)
comint-next-matching-input-from-input(N)
comint-next-prompt(N)
comint-nonblank-p(STR)
comint-osc-directory-tracker(_ TEXT)
comint-osc-hyperlink-handler(_ TEXT)
comint-osc-process-output(_)
comint-output-filter(PROCESS STRING)
comint-postoutput-scroll-to-bottom(STRING)
comint-preinput-scroll-to-bottom()
comint-previous-input(ARG)
comint-previous-input-string(ARG)
comint-previous-matching-input(REGEXP N &optional RESTORE)
comint-previous-matching-input-from-input(N)
comint-previous-matching-input-string(REGEXP ARG)
comint-previous-matching-input-string-position(REGEXP ARG &optional START)
comint-previous-prompt(N)
comint-proc-query(PROC STR)
comint-quit-subjob()
comint-quote-filename(FILENAME)
comint-read-input-ring(&optional SILENT)
comint-read-noecho(PROMPT &optional IGNORE)
comint-redirect-cleanup()
comint-redirect-filter(ORIG-FILTER PROCESS INPUT-STRING)
comint-redirect-preoutput-filter(INPUT-STRING)
comint-redirect-remove-redirection()
comint-redirect-results-list(COMMAND REGEXP REGEXP-GROUP)
comint-redirect-results-list-from-process(PROCESS COMMAND REGEXP REGEXP-GROUP)
comint-redirect-send-command(COMMAND OUTPUT-BUFFER ECHO &optional NO-DISPLAY)
comint-redirect-send-command-to-process(COMMAND OUTPUT-BUFFER PROCESS ECHO &optional NO-DISPLAY)
comint-redirect-setup(OUTPUT-BUFFER COMINT-BUFFER FINISHED-REGEXP &optional ECHO-INPUT)
comint-regexp-arg(PROMPT)
comint-replace-by-expanded-filename()
comint-replace-by-expanded-history(&optional SILENT START)
comint-replace-by-expanded-history-before-point(SILENT &optional START DRY-RUN)
comint-restore-input()
comint-run(PROGRAM &optional SWITCHES)
comint-search-arg(ARG)
comint-search-start(ARG)
comint-send-eof()
comint-send-input(&optional NO-NEWLINE ARTIFICIAL)
comint-send-invisible(&optional PROMPT)
comint-send-region(PROCESS START END)
comint-send-string(PROCESS STRING)
comint-set-process-mark()
comint-show-maximum-output()
comint-show-output()
comint-simple-send(PROC STRING)
comint-skip-input()
comint-skip-prompt()
comint-snapshot-last-prompt()
comint-source-default(PREVIOUS-DIR/FILE SOURCE-MODES)
comint-stop-subjob()
comint-strip-ctrl-m(&optional STRING INTERACTIVE)
comint-substitute-in-file-name(FILENAME)
comint-term-environment()
comint-truncate-buffer(&optional STRING)
comint-unquote-filename(FILENAME)
comint-update-fence()
comint-watch-for-password-prompt(STRING)
comint-within-quotes(BEG END)
comint-word(WORD-CHARS)
comint-write-input-ring()
comint-write-output(FILENAME &optional APPEND MUSTBENEW)
make-comint(NAME PROGRAM &optional STARTFILE &rest SWITCHES)
make-comint-in-buffer(NAME BUFFER PROGRAM &optional STARTFILE &rest SWITCHES)
send-invisible(&optional PROMPT)
shell-strip-ctrl-m(&optional STRING INTERACTIVE)

Defined faces (2)

comint-highlight-inputFace to use to highlight user input.
comint-highlight-promptFace to use to highlight prompts.