Merge changes from emacs-23 branch.
[bpt/emacs.git] / doc / misc / viper.texi
index f547508..2100e65 100644 (file)
@@ -8,11 +8,11 @@
 
 @copying
 Copyright @copyright{} 1995, 1996, 1997, 2001, 2002, 2003, 2004,
-2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
+under the terms of the GNU Free Documentation License, Version 1.3 or
 any later version published by the Free Software Foundation; with no
 Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
 and with the Back-Cover Texts as in (a) below.  A copy of the license
@@ -26,9 +26,9 @@ developing GNU and promoting software freedom.''
 
 @dircategory Emacs
 @direntry
-* VIPER: (viper).       The newest Emacs VI-emulation mode.
-                          (also, A VI Plan for Emacs Rescue
-                           or the VI PERil.)
+* VIPER: (viper).               The newest Emacs VI-emulation mode.
+                                  (also, A VI Plan for Emacs Rescue
+                                  or the VI PERil.)
 @end direntry
 
 @finalout
@@ -36,7 +36,7 @@ developing GNU and promoting software freedom.''
 @titlepage
 @title Viper Is a Package for Emacs Rebels
 @subtitle a Vi emulator for Emacs
-@subtitle April 2007, Viper Version 3.13.1
+@subtitle November 2008, Viper Version 3.11.2
 
 @author Michael Kifer (Viper)
 @author Aamod Sane (VIP 4.4)
@@ -47,6 +47,8 @@ developing GNU and promoting software freedom.''
 @insertcopying
 @end titlepage
 
+@contents
+
 @ifnottex
 @node Top, Overview,, (DIR)
 
@@ -93,6 +95,7 @@ Comments and bug reports are welcome.
 @code{kifer@@cs.stonybrook.edu} is the current address for Viper bug reports.
 Please use the Ex command @kbd{:submitReport} for this purpose.@refill
 
+@insertcopying
 @end ifnottex
 
 @menu
@@ -258,8 +261,8 @@ you see @samp{%%} at the beginning of the mode line, it means that the file
 associated with the buffer is write protected.  The mode line will also
 show the buffer name and current major and minor modes (see below).
 A special buffer called @dfn{Minibuffer} is displayed as the last line
-in a Minibuffer window.  The Minibuffer window is used for command input
-output.  Viper uses Minibuffer window for @kbd{/} and @kbd{:}
+in a minibuffer window.  The minibuffer window is used for command input
+output.  Viper uses minibuffer window for @kbd{/} and @kbd{:}
 commands.@refill
 
 @cindex mode
@@ -650,7 +653,7 @@ last history element is the default that can be invoked simply by typing
 easy to override valuable data in another file.  Reconstructing the full
 command, @kbd{:w!@: foo}, from the history is still not that hard, since Viper
 has a separate history for file names.  By typing @kbd{: M-p}, you will get
-@kbd{:w!} in the Minibuffer.  Then, repeated @kbd{M-p} will get you through
+@kbd{:w!} in the minibuffer.  Then, repeated @kbd{M-p} will get you through
 the file history, inserting one file name after another.
 
 In contrast to @kbd{:w!@: foo}, if the command were @kbd{:r foo}, the entire
@@ -660,7 +663,7 @@ argument.
 @refill
 @end table
 @noindent
-As Vi, Viper's destructive commands can be re-executed by typing `@kbd{.}'.
+As in Vi, Viper's destructive commands can be re-executed by typing `@kbd{.}'.
 However, in addition, Viper keeps track of the history of such commands.  This
 history can be perused by typing @kbd{C-c M-p} and @kbd{C-c M-n}.
 Having found the appropriate command, it can be then executed by typing
@@ -764,7 +767,7 @@ region.
 
 @cindex Minibuffer
 
-The Minibuffer is where commands are entered in.  Editing can be done
+The minibuffer is where commands are entered in.  Editing can be done
 by commands from Insert state, namely:
 
 @table @kbd
@@ -785,23 +788,28 @@ explanation.
 These keys are bound to functions that peruse minibuffer history.  The
 precise history to be perused depends on the context.  It may be the history
 of search strings, Ex commands, file names, etc.
+@item C-s
+If the minibuffer is entered via the Viper search commands @kbd{/} or
+@kbd{?}, then this key inserts the last search string used by the
+Emacs incremental search command
+(which is bound to @kbd{C-s} everywhere except in this case).
 @end table
 
-Most of the Emacs keys are functional in the Minibuffer.  While in the
-Minibuffer, Viper tries to make editing resemble Vi's behavior when the
+Most of the Emacs keys are functional in the minibuffer.  While in the
+minibuffer, Viper tries to make editing resemble Vi's behavior when the
 latter is waiting for the user to type an Ex command.  In particular, you
-can use the regular Vi commands to edit the Minibuffer.  You can switch
+can use the regular Vi commands to edit the minibuffer.  You can switch
 between the Vi state and Insert state at will, and even use the replace mode.
-Initially, the Minibuffer comes up in Insert state.
+Initially, the minibuffer comes up in Insert state.
 
-Some users prefer plain Emacs bindings in the Minibuffer.  To this end, set
+Some users prefer plain Emacs bindings in the minibuffer.  To this end, set
 @code{viper-vi-style-in-minibuffer} to @code{nil} in @file{.viper}.
 @xref{Customization}, to learn how to do this.
 
-When the Minibuffer changes Viper states, you will notice that the appearance
-of the text there changes as well.  This is useful because the Minibuffer
+When the minibuffer changes Viper states, you will notice that the appearance
+of the text there changes as well.  This is useful because the minibuffer
 has no mode line to tell which Vi state it is in.
-The appearance of the text in the Minibuffer can be changed.
+The appearance of the text in the minibuffer can be changed.
 @xref{Viper Specials}, for more details.
 
 @node Multiple Files in Viper,Unimplemented Features,The Minibuffer,Overview
@@ -856,7 +864,7 @@ The current directory name for a file is automatically prepended to the
 file name in any
 @kbd{:e}, @kbd{:r}, @kbd{:w}, etc., command (in Emacs, each buffer has a
 current directory).
-This directory is inserted in the Minibuffer once you type space after
+This directory is inserted in the minibuffer once you type space after
 @kbd{:e, r}, etc.  Viper also supports completion of file names and Ex
 commands (@key{TAB}), and it keeps track of
 command and file history (@kbd{M-p}, @kbd{M-n}).
@@ -1041,7 +1049,7 @@ destructive commands in Vi state.  These are
 useful for fixing those small typos that screw up searches and @kbd{:s},
 and for eliminating routine associated with repeated typing of file names
 or pieces of text that need to be inserted frequently.
-At the @kbd{:} or @kbd{/} prompts in the Minibuffer, you can do the following:
+At the @kbd{:} or @kbd{/} prompts in the minibuffer, you can do the following:
 
 @table @kbd
 @item M-p and M-n
@@ -1167,7 +1175,7 @@ Search,emacs,The GNU Emacs Manual} @refill
 @cindex query replace
 
 Viper also provides a query replace function that prompts through the
-Minibuffer.  It is invoked by the @kbd{Q} key in Vi state.
+minibuffer.  It is invoked by the @kbd{Q} key in Vi state.
 
 @cindex mouse search
 
@@ -1329,7 +1337,7 @@ that @kbd{:se nomagic} turns Regexps off completely, unlike Vi).
 @kindex @kbd{V}
 @kindex @kbd{C-v}
 These keys are used to visit files.  @kbd{v} will switch to a buffer
-visiting file whose name can be entered in the Minibuffer.  @kbd{V} is
+visiting file whose name can be entered in the minibuffer.  @kbd{V} is
 similar, but will use a window different from the current window.
 @kbd{C-v} is like @kbd{V}, except that a new frame (X window) will be used
 instead of a new Emacs window.
@@ -1429,9 +1437,16 @@ this function.
 @item M-p and M-n
 @kindex @kbd{M-p}
 @kindex @kbd{M-n}
-In the Minibuffer, these commands navigate through the minibuffer
+In the minibuffer, these commands navigate through the minibuffer
 histories, such as the history of search strings, Ex commands, etc.
 
+@item C-s
+@kindex @kbd{C-s}
+If the minibuffer is entered via a Viper search commands @kbd{/} or @kbd{?},
+then typing this key inserts the last search string used by the
+Emacs incremental search command (that is bound to @kbd{C-s} everywhere
+except in this case).
+
 @item C-c M-p and C-c M-n
 @kindex @kbd{C-c M-p}
 @kindex @kbd{C-c M-n}
@@ -1713,23 +1728,14 @@ If not @code{nil}, @kbd{C-h} is bound to @code{help-command};
 otherwise, @kbd{C-h} is bound as usual in Vi.
 @item viper-vi-style-in-minibuffer t
 If not @code{nil}, Viper provides a high degree of compatibility with Vi
-insert mode when you type text in the Minibuffer; if @code{nil}, typing in
-the Minibuffer feels like plain Emacs.
+insert mode when you type text in the minibuffer; if @code{nil}, typing in
+the minibuffer feels like plain Emacs.
 @item viper-no-multiple-ESC t
 If you set this to @code{nil}, you can use @key{ESC} as Meta in Vi state.
 Normally, this is not necessary, since graphical displays have separate
 Meta keys (usually on each side of the space bar).  On a dumb terminal, Viper
 sets this variable to @code{twice}, which is almost like @code{nil}, except
 that double @key{ESC} beeps.  This, too, lets @key{ESC} to be used as a Meta.
-@item viper-ESC-keyseq-timeout 200 on tty, 0 on windowing display
-Escape key sequences separated by this much delay (in milliseconds) are
-interpreted as command, ignoring the special meaning of @key{ESC} in
-VI.  The default is suitable for most terminals.  However, if your terminal
-is extremely slow, you might want to increase this slightly.  You will know
-if your terminal is slow if the @key{ESC} key sequences emitted by the
-arrow keys are interpreted as separately typed characters (and thus the
-arrow keys won't work).  Making this value too large will slow you down, so
-exercise restraint.
 @item viper-fast-keyseq-timeout 200
 Key sequences separated by this many milliseconds are treated as Vi-style
 keyboard macros.  If the key sequence is defined as such a macro, it will be
@@ -1737,20 +1743,6 @@ executed.  Otherwise, it is processed as an ordinary sequence of typed keys.
 
 Setting this variable too high may slow down your typing.  Setting it too
 low may make it hard to type macros quickly enough.
-@item viper-translate-all-ESC-keysequences @code{t} on tty, @code{nil} on windowing display
-Normally, Viper lets Emacs translate only those ESC key sequences that are
-defined in the low-level @code{input-decode-map}, @code{key-translation-map}
-or @code{function-key-map}, such as those
-emitted by the arrow and function keys. Other sequences, e.g., @kbd{\\e/}, are
-treated as @kbd{ESC} command followed by a @kbd{/}. This is good for people
-who type fast and tend to hit other characters right after they hit
-ESC. Other people like Emacs to translate @kbd{ESC} sequences all the time.
-The default is to translate all sequences only when using a dumb terminal.
-This permits you to use @kbd{ESC} as a meta key in insert mode. For instance,
-hitting @kbd{ESC x} fast would have the effect of typing @kbd{M-x}.
-If your dumb terminal is not so dumb and understands the meta key, then you
-probably will be better off setting this variable to @code{nil}. Try and see which
-way suits you best.
 @item viper-ex-style-motion t
 Set this to @code{nil}, if you want @kbd{l,h} to cross
 lines, etc.  @xref{Movement and Markers}, for more info.
@@ -1896,10 +1888,6 @@ changed interactively after Viper is loaded.
 In Insert state, this key acts as a temporary escape to Vi state, i.e., it
 will set Viper up so that the very next command will be executed as if it
 were typed in Vi state.
-@item viper-ESC-key "\e"
-Specifies the key used to escape from Insert/Replace states to Vi.
-Must be set in @file{.viper}.  This variable cannot be
-changed interactively after Viper is loaded.
 @item viper-buffer-search-char nil
 Key used for buffer search.  @xref{Viper Specials}, for details.
 @item viper-surrounding-word-function 'viper-surrounding-word
@@ -1946,7 +1934,6 @@ can include a line like this in your @file{.viper} file:
 @vindex @code{viper-vi-style-in-minibuffer}
 @vindex @code{viper-no-multiple-ESC}
 @vindex @code{viper-always}
-@vindex @code{viper-ESC-keyseq-timeout}
 @vindex @code{viper-fast-keyseq-timeout}
 @vindex @code{viper-ex-style-motion}
 @vindex @code{viper-ex-style-editing}
@@ -1965,7 +1952,6 @@ can include a line like this in your @file{.viper} file:
 @vindex @code{viper-replace-region-start-symbol}
 @vindex @code{viper-allow-multiline-replace-regions}
 @vindex @code{viper-toggle-key}
-@vindex @code{viper-ESC-key}
 @vindex @code{viper-buffer-search-char}
 @vindex @code{viper-surrounding-word-function}
 @vindex @code{viper-vi-state-hook}
@@ -2481,7 +2467,7 @@ direction, you can either bind an unused key to
 @kbd{f31}.
 
 One should not bind the above functions to @kbd{M-p} or @kbd{M-n}, since
-this will interfere with the Minibuffer histories and, possibly, other
+this will interfere with the minibuffer histories and, possibly, other
 major modes.
 
 @item viper-command-ring-size  14
@@ -2511,7 +2497,7 @@ direction, you can either bind an unused key to
 @code{viper-next-destructive-command} or hit any digit (1 to 9) then @kbd{f31}.
 
 One should not bind the above functions to @kbd{M-p} or @kbd{M-n}, since
-this will interfere with the Minibuffer histories and, possibly, other
+this will interfere with the minibuffer histories and, possibly, other
 major modes.
 
 @item viper-minibuffer-vi-face  'viper-minibuffer-vi-face
@@ -2527,7 +2513,7 @@ subgroup of the @emph{Editing} group.  All Viper faces are grouped together
 in Viper's @emph{Highlighting} customization subgroup.
 
 Note that only the text you type in is affected by the above faces.
-Prompts and Minibuffer messages are not affected.
+Prompts and minibuffer messages are not affected.
 
 Purists who do not like adornments in the minibuffer can always zap them by
 putting
@@ -2986,7 +2972,7 @@ Since Viper macros are much more powerful than Vi's it is impossible to
 detect such loops.  In practice, this is not really a limitation but,
 rather, a feature.
 
-We should also note that Vi macros are disabled in the Minibuffer, which
+We should also note that Vi macros are disabled in the minibuffer, which
 helps keep some potential troubles away.
 
 The rate at which the user must type keys in order for them to be
@@ -3018,14 +3004,14 @@ reference created by @* @samp{maart@@cs.vu.nl} and others.  It can be
 found on the Vi archives.  This reference has been adapted for Viper.@refill
 
 @menu
-* Groundwork::                 Textual Conventions and Viper basics
-* Text Handling::              Moving, Editing, Undoing.
-* Display::                    Scrolling.
-* File and Buffer Handling::   Editing, Writing and Quitting.
-* Mapping::                    Mapping Keys, Keyboard Macros
-* Shell Commands::             Accessing Shell Commands, Processing Text
-* Options::                    Ex options, the @kbd{:set} commands
-* Emacs Related Commands::     Meta Keys, Windows
+* Groundwork::                  Textual Conventions and Viper basics
+* Text Handling::               Moving, Editing, Undoing.
+* Display::                     Scrolling.
+* File and Buffer Handling::    Editing, Writing and Quitting.
+* Mapping::                     Mapping Keys, Keyboard Macros
+* Shell Commands::              Accessing Shell Commands, Processing Text
+* Options::                     Ex options, the @kbd{:set} commands
+* Emacs Related Commands::      Meta Keys, Windows
 * Mouse-bound Commands::        Search and insertion of text
 @end menu
 
@@ -3244,15 +3230,15 @@ inserts them automatically in front of the Ex command.
 @section Text Handling
 
 @menu
-* Move Commands::              Moving, Searching
-* Marking::                    Textmarkers in Viper and the Emacs Mark.
-* Appending Text::             Text insertion, Shifting, Putting
-* Editing in Insert State::    Autoindent, Quoting etc.
-* Deleting Text::              Deleting
-* Changing Text::              Changing, Replacement, Joining
-* Search and Replace::         Searches, Query Replace, Pattern Commands
-* Yanking::                    Yanking, Viewing Registers
-* Undoing::                    Multiple Undo, Backups
+* Move Commands::               Moving, Searching
+* Marking::                     Textmarkers in Viper and the Emacs Mark.
+* Appending Text::              Text insertion, Shifting, Putting
+* Editing in Insert State::     Autoindent, Quoting etc.
+* Deleting Text::               Deleting
+* Changing Text::               Changing, Replacement, Joining
+* Search and Replace::          Searches, Query Replace, Pattern Commands
+* Yanking::                     Yanking, Viewing Registers
+* Undoing::                     Multiple Undo, Backups
 @end menu
 
 @node Move Commands,Marking,,Text Handling
@@ -3560,7 +3546,7 @@ these commands help peruse the history of Vi's destructive commands.
 Successive typing of @kbd{C-c M-p} causes Viper to search the history in
 the direction
 of older commands, while hitting @kbd{C-c M-n} does so in reverse
-order.  Each command in the history is displayed in the Minibuffer.  The
+order.  Each command in the history is displayed in the minibuffer.  The
 displayed command can
 then be executed by typing `@kbd{.}'.
 
@@ -3590,7 +3576,7 @@ functions doing the perusing can be bound to unused keyboard keys in the
 
 Minibuffer can be edited similarly to Insert state, and you can switch
 between Insert/Replace/Vi states at will.
-Some users prefer plain Emacs feel in the Minibuffer.  To this end, set
+Some users prefer plain Emacs feel in the minibuffer.  To this end, set
 @var{viper-vi-style-in-minibuffer} to @code{nil}.
 
 @cindex Insert state
@@ -3780,6 +3766,11 @@ Viper does not parse search patterns and does not expand special symbols
 found there (e.g., @samp{~} is not expanded to the result of the previous
 substitution).
 
+After typing @kbd{/} or @kbd{?} all the usual Emacs minibuffer commands, such as
+@kbd{M-p} and @kbd{M-n} are available. In addition, typing @kbd{C-s} will
+insert the last search string used by the Emacs incremental search command
+(which is bound to @kbd{C-s} everywhere except in this case).
+
 @item <count>  ?<string>
 To the <count>th previous occurrence of <string>.
 @item <count>  g<move>
@@ -4083,7 +4074,7 @@ Like @kbd{:b}, but the meaning of @var{ex-cycle-other-window} is reversed.
 Read the file <name> into the buffer after the line <address>.
 @item v, V, C-v
 Edit a file in current or another window, or in another frame.  File name
-is typed in Minibuffer.  File completion and history are supported.
+is typed in minibuffer.  File completion and history are supported.
 @end table
 @kindex @kbd{v}
 @kindex @kbd{V}
@@ -4566,8 +4557,6 @@ zapman@@cc.gatech.edu (Jason Zapman II),
 
 @printindex cp
 
-@setchapternewpage odd
-@contents
 @bye
 
 @ignore