- As soon as the subshell is started, it is sent as input the contents
-of the file @file{~/.emacs_@var{shellname}}, if that file exists, where
-@var{shellname} is the name of the file that the shell was loaded from.
-For example, if you use bash, the file sent to it is
-@file{~/.emacs_bash}.
-
-@vindex shell-pushd-regexp
-@vindex shell-popd-regexp
-@vindex shell-cd-regexp
- @code{cd}, @code{pushd} and @code{popd} commands given to the inferior
-shell are watched by Emacs so it can keep the @samp{*shell*} buffer's
-default directory the same as the shell's working directory. These
-commands are recognized syntactically by examining lines of input that are
-sent. If you use aliases for these commands, you can tell Emacs to
-recognize them also. For example, if the value of the variable
-@code{shell-pushd-regexp} matches the beginning of a shell command line,
-that line is regarded as a @code{pushd} command. Change this variable when
-you add aliases for @samp{pushd}. Likewise, @code{shell-popd-regexp} and
-@code{shell-cd-regexp} are used to recognize commands with the meaning of
-@samp{popd} and @samp{cd}. These commands are recognized only at the
-beginning of a shell command line.@refill
-
-@vindex shell-set-directory-error-hook
- If Emacs gets an error while trying to handle what it believes is a
-@samp{cd}, @samp{pushd} or @samp{popd} command, it runs the hook
-@code{shell-set-directory-error-hook} (@pxref{Hooks}).
-
-@findex dirs
- If Emacs does not properly track changes in the current directory of
-the subshell, use the command @kbd{M-x dirs} to ask the shell what its
-current directory is. This command works for shells that support the
-most common command syntax; it may not work for unusual shells.
-
-@findex dirtrack-mode
- You can also use @kbd{M-x dirtrack-mode} to enable (or disable) an
-alternative and more aggressive method of tracking changes in the
-current directory.
-
- Emacs defines the environment variable @env{EMACS} in the subshell,
-with value @code{t}. A shell script can check this variable to
-determine whether it has been run from an Emacs subshell.