File: shell.el.html

This file defines a shell-in-a-buffer package (shell mode) built on top of comint mode.

Since this mode is built on top of the general command-interpreter-in- a-buffer mode (comint mode), it shares a common base functionality, and a common set of bindings, with all modes derived from comint mode. This makes these modes easier to use.

For documentation on the functionality provided by comint mode, and the hooks available for customizing it, see the file comint.el. For further information on shell mode, see the comments below.

Needs fixin: When sending text from a source file to a subprocess, the process-mark can move off the window, so you can lose sight of the process interactions. Maybe I should ensure the process mark is in the window when I send text to the process? Switch selectable?

YOUR .EMACS FILE
=============================================================================
Some suggestions for your init file.

;; Define M-# to run some strange command:
(eval-after-load "shell"
 '(define-key shell-mode-map "\\M-#" 'shells-dynamic-spell))

Brief Command Documentation:
============================================================================
Comint Mode Commands: (common to shell and all comint-derived modes)

m-p comint-previous-input Cycle backwards in input history
m-n comint-next-input Cycle forwards
m-r comint-previous-matching-input Previous input matching a regexp
m-s comint-next-matching-input Next input that matches
m-c-l comint-show-output Show last batch of process output
return comint-send-input
c-d comint-delchar-or-maybe-eof Delete char unless at end of buff.
c-c c-a comint-bol Beginning of line; skip prompt
c-c c-u comint-kill-input ^u
c-c c-w backward-kill-word ^w
c-c c-c comint-interrupt-subjob ^c
c-c c-z comint-stop-subjob ^z
c-c c-\ comint-quit-subjob ^\
c-c c-o comint-delete-output Delete last batch of process output
c-c c-r comint-show-output Show last batch of process output
c-c c-l comint-dynamic-list-input-ring List input history
        comint-send-invisible Read line w/o echo & send to proc
        comint-continue-subjob Useful if you accidentally suspend
                                        top-level job
comint-mode-hook is the comint mode hook.

Shell Mode Commands:
        shell Fires up the shell process
tab completion-at-point Complete filename/command/history
m-? comint-dynamic-list-filename-completions
List completions in help buffer
c-c c-f shell-forward-command Forward a shell command
c-c c-b shell-backward-command Backward a shell command
dirs Resync the buffer's dir stack
shell-dirtrack-mode Turn dir tracking on/off
        comint-strip-ctrl-m Remove trailing ^Ms from output

The shell mode hook is shell-mode-hook comint-prompt-regexp is initialized to shell-prompt-pattern, for backwards compatibility.

Read the rest of this file for more information.

Defined variables (35)

explicit-bash-argsArgs passed to inferior shell by M-x shell, if the shell is bash.
explicit-csh-argsArgs passed to inferior shell by M-x shell, if the shell is csh.
explicit-shell-file-nameIf non-nil, the file name to use for explicitly requested inferior shells.
shell--start-progShell file name started in ‘shell’.
shell-cd-regexpRegexp to match subshell commands equivalent to cd.
shell-chdrive-regexpIf non-nil, is regexp used to track drive changes.
shell-command-regexpRegexp to match a single command within a pipeline.
shell-command-separator-regexpRegexp to match a single command within a pipeline.
shell-completion-execonlyIf non-nil, use executable files only for completion candidates.
shell-completion-fignoreList of suffixes to be disregarded during file/command completion.
shell-delimiter-argument-listList of characters to recognize as separate arguments.
shell-dirstackList of directories saved by pushd in this buffer’s shell.
shell-dirstack-queryCommand used by ‘shell-resync-dirs’ to query the shell.
shell-dirtrack-modeNon-nil if Shell-Dirtrack mode is enabled.
shell-dirtrack-mode-hookHook run after entering or leaving ‘shell-dirtrack-mode’.
shell-dirtrack-verboseIf non-nil, show the directory stack following directory change.
shell-dirtrackpNon-nil in a shell buffer means directory tracking is enabled.
shell-dumb-shell-regexpRegexp to match shells that don’t save their command history, and
shell-dynamic-complete-functionsList of functions called to perform completion.
shell-file-name-charsString of characters valid in a file name.
shell-file-name-quote-listList of characters to quote when in a file name.
shell-font-lock-keywordsAdditional expressions to highlight in Shell mode.
shell-has-auto-cdIf non-nil, ‘shell-mode’ handles implicit "cd" commands.
shell-input-autoexpandIf non-nil, expand input command history references on completion.
shell-last-dirKeep track of last directory for ksh ‘cd -’ command.
shell-mode-abbrev-tableAbbrev table for ‘shell-mode’.
shell-mode-hookHook for customizing Shell mode.
shell-mode-mapKeymap for ‘shell-mode’.
shell-mode-syntax-tableSyntax table for ‘shell-mode’.
shell-popd-regexpRegexp to match subshell commands equivalent to popd.
shell-prompt-patternRegexp to match prompts in the inferior shell.
shell-pushd-dextractIf non-nil, make "pushd +n" pop the nth dir to the stack top.
shell-pushd-duniqueIf non-nil, make pushd only add unique directories to the stack.
shell-pushd-regexpRegexp to match subshell commands equivalent to pushd.
shell-pushd-tohomeIf non-nil, make pushd with no arg behave as "pushd ~" (like cd).

Defined functions (38)

dirs()
shell(&optional BUFFER)
shell--command-completion-data()
shell--parse-pcomplete-arguments()
shell--requote-argument(UPOS QSTR)
shell--unquote&requote-argument(QSTR &optional UPOS)
shell--unquote-argument(STR)
shell-apply-ansi-color(BEG END FACE)
shell-backward-command(&optional ARG)
shell-c-a-p-replace-by-expanded-directory()
shell-cd(DIR)
shell-command-completion()
shell-command-completion-function()
shell-completion-vars()
shell-copy-environment-variable(VARIABLE)
shell-directory-tracker(STR)
shell-dirtrack-mode(&optional ARG)
shell-dynamic-complete-command()
shell-dynamic-complete-environment-variable()
shell-dynamic-complete-filename()
shell-environment-variable-completion()
shell-extract-num(STR)
shell-filename-completion()
shell-filter-ctrl-a-ctrl-b(STRING)
shell-forward-command(&optional ARG)
shell-match-partial-variable()
shell-narrow-to-prompt()
shell-prefixed-directory-name(DIR)
shell-process-cd(ARG)
shell-process-popd(ARG)
shell-process-pushd(ARG)
shell-reapply-ansi-color()
shell-replace-by-expanded-directory()
shell-resync-dirs()
shell-snarf-envar(VAR)
shell-unquote-argument(STRING)
shell-write-history-on-exit(PROCESS EVENT)
split-string-shell-command(STRING)

Defined faces (0)