]> code.delx.au - gnu-emacs/blobdiff - man/misc.texi
(Display Vars): Note that `mode-line-inverse-video' is deprecated.
[gnu-emacs] / man / misc.texi
index 39babf7833cd8d391cbdda85bb1bb0011ab19155..b540cae5a6dd1315f746246a26ddf1ef26ceefa7 100644 (file)
@@ -306,8 +306,12 @@ Send an article to a newsgroup.@*
 @cindex shell commands
 
   Emacs has commands for passing single command lines to inferior shell
-processes; it can also run a shell interactively with input and output to
-an Emacs buffer named @samp{*shell*}.
+processes; it can also run a shell interactively with input and output
+to an Emacs buffer named @samp{*shell*} or run s shell inside a terminal
+emulator window.
+
+There is a shell implemented entirely in Emacs, documented in a separate
+manual.  @xref{, ,Eshell , eshell, Eshell: The Emacs Shell}.
 
 @table @kbd
 @item M-! @var{cmd} @key{RET}
@@ -324,6 +328,9 @@ You can then give commands interactively.
 Run a subshell with input and output through an Emacs buffer.
 You can then give commands interactively.
 Full terminal emulation is available.
+@item M-x eshell
+@findex eshell
+Start the Emacs shell.
 @end table
 
 @menu
@@ -492,11 +499,13 @@ of the special key bindings of Shell mode:
 @item @key{RET}
 @kindex RET @r{(Shell mode)}
 @findex comint-send-input
+@vindex comint-use-prompt-regexp-instead-of-fields
+@cindex prompt, shell
 At end of buffer send line as input; otherwise, copy current line to end
 of buffer and send it (@code{comint-send-input}).  When a line is
-copied, any text at the beginning of the line that matches the variable
-@code{shell-prompt-pattern} is left out; this variable's value should be
-a regexp string that matches the prompts that your shell uses.
+copied, any prompt is left out (where the prompt is the part of the line
+that was not input by the user; see also
+@code{comint-use-prompt-regexp-instead-of-fields}).
 
 @item @key{TAB}
 @kindex TAB @r{(Shell mode)}
@@ -578,10 +587,19 @@ pending in the shell buffer and not yet sent.
 
 @item C-c C-o
 @kindex C-c C-o @r{(Shell mode)}
-@findex comint-kill-output
-Kill the last batch of output from a shell command
-(@code{comint-kill-output}).  This is useful if a shell command spews
-out lots of output that just gets in the way.
+@findex comint-delete-output
+Delete the last batch of output from a shell command
+(@code{comint-delete-output}).  This is useful if a shell command spews
+out lots of output that just gets in the way.  This command used to be
+called @code{comint-kill-output}.
+
+@item C-c C-s
+@kindex C-c C-s @r{(Shell mode)}
+@findex comint-write-output
+Write the last batch of output from a shell command to a file
+(@code{comint-write-output}).  With a prefix argument, the file is
+appended to instead.  Any prompt at the end of the output is not
+written.
 
 @item C-c C-r
 @itemx C-M-l
@@ -677,9 +695,8 @@ command plus the output that follows it in the buffer.
   Shell mode is a derivative of Comint mode, a general-purpose mode for
 communicating with interactive subprocesses.  Most of the features of
 Shell mode actually come from Comint mode, as you can see from the
-command names listed above.  The special features of Shell mode in
-particular include the choice of regular expression for detecting
-prompts, the directory tracking feature, and a few user commands.
+command names listed above.  The special features of Shell mode include
+the directory tracking feature, and a few user commands.
 
   Other Emacs features that use variants of Comint mode include GUD
 (@pxref{Debuggers}) and @kbd{M-x run-lisp} (@pxref{External Lisp}).
@@ -822,12 +839,17 @@ then resubmit the command to the shell by typing @key{RET}.
 
 @vindex shell-prompt-pattern
 @vindex comint-prompt-regexp
+@vindex comint-use-prompt-regexp-instead-of-fields
+@cindex prompt, shell
   History references take effect only following a shell prompt.  The
+prompt is defined to be any text not input by the user, unless the
+variable @code{comint-use-prompt-regexp-instead-of-fields} is
+non-@code{nil} (the default value is @code{nil}).  When
+@code{comint-use-prompt-regexp-instead-of-fields} is non-@code{nil}, the
 variable @code{shell-prompt-pattern} specifies how to recognize a shell
-prompt.  Comint modes in general use the variable
-@code{comint-prompt-regexp} to specify how to find a prompt; Shell mode
-uses @code{shell-prompt-pattern} to set up the local value of
-@code{comint-prompt-regexp}.
+prompt, and comint modes in general use the variable
+@code{comint-prompt-regexp} (shell mode uses @code{shell-prompt-pattern}
+to set up the local value of @code{comint-prompt-regexp}).
 
 @vindex comint-input-autoexpand
   Shell mode can optionally expand history references in the buffer when
@@ -1174,9 +1196,21 @@ you finish with the file.  Use the variable
 this sense; its value should be a regular expression that matches file
 names that are temporary.
 
+@vindex server-kill-new-buffers
+  If the variable @code{server-kill-new-buffers} is set to non-nil,
+buffers which still have a client are killed when you are done with
+them, unless they were already present before Emacs Server visited
+them.  This overrides the effect of the @code{server-temp-file-regexp}
+variable.  By default, @code{server-kill-new-buffers} has a non-nil
+value; set it to nil if you want the old behavior governed by
+@code{server-temp-file-regexp}.
+
   If you run @code{emacsclient} with the option @samp{--no-wait}, it
 returns immediately without waiting for you to ``finish'' the buffer in
-Emacs.
+Emacs.  Note that it this case, buffers for temporary files will not be
+killed automatically with the default value of
+@code{server-kill-new-buffers}, since those buffers will not have a
+client.
 
   If you have forgotten to start Emacs, then the option
 @samp{--alternate-editor=@var{command}} may be useful.  It specifies a
@@ -1692,6 +1726,7 @@ the one not current when you type @kbd{@key{F2} d}, is empty,
 @cindex Hexl mode
 @cindex mode, Hexl
 @cindex editing binary files
+@cindex hex editing
   There is a special major mode for editing binary files: Hexl mode.  To
 use it, use @kbd{M-x hexl-find-file} instead of @kbd{C-x C-f} to visit
 the file.  This command converts the file's contents to hexadecimal and
@@ -1735,6 +1770,11 @@ Leave Hexl mode, going back to the major mode this buffer had before you
 invoked @code{hexl-mode}.
 @end table
 
+@noindent
+Other Hexl commands let you insert strings (sequences) of binary bytes,
+move by short's or int's, etc.; type @kbd{C-h a hexl- RET} for details.
+
+
 @node Saving Emacs Sessions, Recursive Edit, Editing Binary Files, Top
 @section Saving Emacs Sessions
 @cindex saving sessions
@@ -1786,7 +1826,7 @@ saving, set @code{desktop-files-not-to-save} to @code{"^$"}.
 There is a simpler mechanism provided by Saveplace library which records
 your position in each file when you kill its buffer (or kill Emacs), and
 jumps to the same position when you visit the file again (even in
-another Emacs session).  Use @key{M-x toggle-save-place} to turn on
+another Emacs session).  Use @kbd{M-x toggle-save-place} to turn on
 place-saving in a given file.  Customize the option @code{save-place} to
 turn it on for all files in each session.
 
@@ -1934,6 +1974,7 @@ move.  The copy, cut and paste functions (as in many other programs)
 operate on the active region, bound to @kbd{C-insert}, @kbd{S-delete}
 and @kbd{S-insert} respectively.
 
+@cindex s-region package
 The @code{s-region} package provides similar, but less complete,
 facilities.