is available which provides for a consistent user interface across many
different programs.
-The end-user using programs written with the History library has the
-benifit of a consistent user interface, with a set of well-known
+When you use programs written with the History library, you have the
+benefit of a consistent user interface, with a set of well-known
commands for manipulating the text of previous lines and using that text
in new commands. The basic history manipulation commands are similar to
the history substitution used by Csh.
-If the programmer desires, he can use the Readline library, which
-includes history manipulation by default, and has the added advantage of
-Emacs style command line editing.
+GNU programs often also use the Readline library, which includes history
+manipulation by default, and has the added advantage of Emacs style
+command line editing.
@node History Interaction, , Introduction to History, Top
@appendixsec History Interaction
current one. The line selected from the previous history is called the
@dfn{event}, and the portions of that line that are acted upon are
called @dfn{words}. The line is broken into words in the same fashion
-that the Bash shell does, so that several English (or Unix) words
-surrounded by quotes are considered as one word.
+used by the Bash shell, so that several words surrounded by quotes are
+treated as if they were a single word.
@menu
* Event Designators:: How to specify which history line to use. *
@item @code{!}
Start a history subsititution, except when followed by a space, tab, or
-the end of the line... @kbd{=} or @kbd{(}.
+the end of the line; or by @samp{=} or @samp{(}.
@item @code{!!}
Refer to the previous command. This is a synonym for @code{!-1}.
-@item @code{!n}
+@item @code{!@var{n}}
Refer to command line @var{n}.
-@item @code{!-n}
+@item @code{!-@var{n}}
Refer to the command line @var{n} lines back.
-@item @code{!string}
+@item @code{!@var{string}}
Refer to the most recent command starting with @var{string}.
-@item @code{!?string}[@code{?}]
+@item @code{!?@var{string}}[@code{?}]
Refer to the most recent command containing @var{string}.
@end table
@node Word Designators, Modifiers, Event Designators, History Interaction
@appendixsubsec Word Designators
-A @kbd{:} separates the event specification from the word designator. It
-can be omitted if the word designator begins with a @kbd{^}, @kbd{$},
-@kbd{*} or @kbd{%}. Words are numbered from the beginning of the line,
+A @samp{:} separates the event specification from the word designator. It
+can be omitted if the word designator begins with a @samp{^}, @samp{$},
+@samp{*} or @samp{%}. Words are numbered from the beginning of the line,
with the first word being denoted by a 0 (zero).
@table @code
The last argument.
@item %
-The word matched by the most recent @code{?string?} search.
+The word matched by the most recent @code{?@var{string}?} search.
-@item x-y
-A range of words; @code{-@var{y}} Abbreviates @code{0-@var{y}}.
+@item @var{x}-@var{y}
+A range of words; @code{-@var{y}} abbreviates @code{0-@var{y}}.
@item *
-All of the words, excepting the zero'th. This is a synonym for @code{1-$}.
-It is not an error to use @kbd{*} if there is just one word in the event.
+All of the words, excepting the zero'th. This is a synonym for @samp{1-$}.
+It is not an error to use @samp{*} if there is just one word in the event.
The empty string is returned in that case.
@end table
@appendixsubsec Modifiers
After the optional word designator, you can add a sequence of one or more
-of the following modifiers, each preceded by a @kbd{:}.
+of the following modifiers, each preceded by a @samp{:}.
@table @code
Remove a trailing pathname component, leaving only the head.
@item r
-Remove a trailing suffix of the form @samp{.}@var{suffix}, leaving the basename.
+Remove a trailing suffix of the form @samp{.@var{suffix}}, leaving the basename.
@item e
Remove all but the suffix.
which contains both end-user and programmer documentation for the GNU
Readline Library.
-Copyright (C) 1988 Free Software Foundation, Inc.
+Copyright (C) 1988, 1991 Free Software Foundation, Inc.
-Authored by Brian Fox.
+Written by Brian Fox.
Permission is granted to process this file through Tex and print the
results, provided the printed document carries copying permission notice
@appendix Command Line Editing
This appendix describes GNU's command line editing interface.
+Often during an interactive session you will type in a long line of
+text, only to notice that the first word on the line is misspelled. The
+Readline library gives you a set of commands for manipulating the text
+as you type it in, allowing you to just fix your typo, and not forcing
+you to retype the majority of the line. Using these editing commands,
+you move the cursor to the place that needs correction, and delete or
+insert the text of the corrections. Then, when you are satisfied with
+the line, you simply press @key{RETURN}. You do not have to be at the
+end of the line to press @key{RETURN}; the entire line will be accepted
+in any case.
@menu
-* Introduction and Notation:: Notation used in this appendix.
+* Conventions:: Notation used in this appendix.
* Basic Line Editing:: The minimum set of commands for editing a line.
* Movement Commands:: Commands for moving the cursor about the line.
* Cutting and Pasting:: Deletion and copying of text sections.
the full text.
@end menu
-@node Introduction and Notation, Basic Line Editing, Command Line Editing, Command Line Editing
-@appendixsec Introduction to Line Editing
+@node Conventions, Basic Line Editing, Command Line Editing, Command Line Editing
+@appendixsec Conventions on Notation
-In this appendix a the following notation is used to describe
+In this Appendix, the following notation is used to describe
keystrokes.
The text @kbd{C-k} is read as `Control-K' and describes the character
@appendixsec Readline Interaction
@cindex interaction, readline
-Often during an interactive session you will type in a long line of
-text, only to notice that the first word on the line is misspelled. The
-Readline library gives you a set of commands for manipulating the text
-as you type it in, allowing you to just fix your typo, and not forcing
-you to retype the majority of the line. Using these editing commands,
-you move the cursor to the place that needs correction, and delete or
-insert the text of the corrections. Then, when you are satisfied with
-the line, you simply press @key{RETURN}. You do not have to be at the
-end of the line to press @key{RETURN}; the entire line will be accepted
-in any case.
-
@menu
* Readline Bare Essentials:: The least you need to know about Readline.
* Readline Movement Commands:: Moving about the input line.
Delete the character to the left of the cursor.
@item @kbd{C-d}
Delete the character underneath the cursor.
-@item @w{Printing characters}
-Insert itself into the line at the cursor.
+@item @var{c}
+Insert an ordinary printing character @var{c} into the line at the cursor.
@item @kbd{C-_}
Undo the last thing that you did. You can undo all the way back to an
empty line.
words, to the end of the next word.
@item M-@key{DEL}
-Kill fromthe cursor the start ofthe previous word, or if between words, to the start of the previous word.
+Kill from the cursor the start ofthe previous word, or if between words, to the start of the previous word.
@item C-w
Kill from the cursor to the previous whitespace. This is different than
commands in an @dfn{init} file in your home directory. The name of this
file is @file{~/.inputrc}.
-When a program which uses the Readline library starts up, the
-@file{~/.inputrc} file is read, and the keybindings are set.
+When a program which uses the Readline library starts up, it reads the file
+@file{~/.inputrc}, and sets the keybindings.
@menu
* Readline Init Syntax:: Syntax for the commands in @file{~/.inputrc}.
@code{set editing-mode vi}
@end example
+@noindent
in your @file{~/.inputrc} file.
You can have Readline use a single line for display, scrolling the input
Insert a tab character.
@item self-insert (a, b, A, 1, !, ...)
-Insert yourself.
+Insert an ordinary printing character into the line.
@item transpose-chars (C-t)
Drag the character before point forward over the character at point.
Kill the word behind the cursor.
@item unix-line-discard (C-u)
-Do what C-u used to do in Unix line input. We save the killed text on
-the kill-ring, though.
+Kill the entire line. This is similar to the use of the Unix kill
+character (often also @key{C-u}), save that here the killed text can be
+retrieved later (since it goes on the kill-ring).
@item unix-word-rubout (C-w)
-Do what C-w used to do in Unix line input. The killed text is saved
-on the kill-ring. This is different than @code{backward-kill-word} because
-the word boundaries differ.
+Kill the current word, like the Unix word erase character. The killed
+text goes on the kill-ring. This is different than
+@code{backward-kill-word} because the word boundaries differ.
@item yank (C-y)
Yank the top of the kill ring into the buffer at point.
argument. @kbd{M--} starts a negative argument.
@item universal-argument ()
-Do what C-u does in emacs. By default, this is not bound.
+Do what @key{C-u} does in emacs. By default, this is not bound to any keys.
@end table
@table @code
@item abort (@kbd{C-g})
-Ding! Stops things.
+The line editing commands @code{reverse-search-history} (@kbd{C-r}) and
+@code{forward-search-history} (@kbd{C-s} go into a separate input mode;
+you can abort the search, and return to normal input mode, by using the
+@code{abort} (@kbd{C-g}) command.
@item do-uppercase-version (@kbd{M-a}, @kbd{M-b}, @dots)
Run the command that is bound to your uppercase brother.
command enough times to get back to the beginning.
@end table
-@node Readline Vi Mode, , Readline Init Syntax, Readline Init File
-@appendixsubsec Readline Vi Mode
+@node Readline vi Mode, , Readline Init Syntax, Readline Init File
+@appendixsubsec Readline @code{vi} Mode
-While the Readline library does not have a full set of Vi editing
+While the Readline library does not have a full set of @code{vi} editing
functions, it does contain enough to allow simple editing of the line.
-In order to switch interactively between Emacs and Vi editing modes, use
-the command M-C-j (toggle-editing-mode).
+In order to switch interactively between Emacs and @code{vi} editing modes, use
+the command @kbd{M-C-j} (@code{toggle-editing-mode}).
-When you enter a line in Vi mode, you are already placed in `insertion'
-mode, as if you had typed an `i'. Pressing @key{ESC} switches you into
-`edit' mode, where you can edit the text of the line with the standard
-Vi movement keys, move to previous history lines with `k', and following
-lines with `j', and so forth.
+When you enter a line in @code{vi} mode, you are already in
+``insertion'' mode, as if you had typed an @kbd{i}. Pressing @key{ESC}
+switches you into ``edit'' mode, where you can edit the text of the line
+with the standard @code{vi} movement keys, move to previous history
+lines with @kbd{k}, to following lines with @kbd{j}, and so forth.