+@node Shell Prompts
+@subsection Shell Prompts
+
+@vindex shell-prompt-pattern
+@vindex comint-prompt-regexp
+@vindex comint-use-prompt-regexp
+@cindex prompt, shell
+ A prompt is text output by a program to show that it is ready to
+accept new user input. Normally, Comint mode (and thus Shell mode)
+considers the prompt to be any text output by a program at the
+beginning of an input line. However, if the variable
+@code{comint-use-prompt-regexp} is non-@code{nil}, then Comint mode
+uses a regular expression to recognize prompts. In Shell mode,
+@code{shell-prompt-pattern} specifies the regular expression.
+
+ The value of @code{comint-use-prompt-regexp} also affects many
+motion and paragraph commands. If the value is non-@code{nil}, the
+general Emacs motion commands behave as they normally do in buffers
+without special text properties. However, if the value is @code{nil},
+the default, then Comint mode divides the buffer into two types of
+``fields'' (ranges of consecutive characters having the same
+@code{field} text property): input and output. Prompts are part of
+the output. Most Emacs motion commands do not cross field boundaries,
+unless they move over multiple lines. For instance, when point is in
+input on the same line as a prompt, @kbd{C-a} puts point at the
+beginning of the input if @code{comint-use-prompt-regexp} is
+@code{nil} and at the beginning of the line otherwise.
+
+ In Shell mode, only shell prompts start new paragraphs. Thus, a
+paragraph consists of a prompt and the input and output that follow
+it. However, if @code{comint-use-prompt-regexp} is @code{nil}, the
+default, most paragraph commands do not cross field boundaries. This
+means that prompts, ranges of input, and ranges of non-prompt output
+behave mostly like separate paragraphs; with this setting, numeric
+arguments to most paragraph commands yield essentially undefined
+behavior. For the purpose of finding paragraph boundaries, Shell mode
+uses @code{shell-prompt-pattern}, regardless of
+@code{comint-use-prompt-regexp}.
+