aboutsummaryrefslogtreecommitdiff
path: root/readline/doc
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-05-11 23:38:44 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-05-11 23:38:44 +0000
commitcc88a640ca1d0356c5feb40bb48869bab5a2bdce (patch)
tree2b845ec3c6b554e4fe702a48844fe13330c0f58c /readline/doc
parent4cab4add34b167b3902b1cb2873738914103f6ff (diff)
downloadgdb-cc88a640ca1d0356c5feb40bb48869bab5a2bdce.zip
gdb-cc88a640ca1d0356c5feb40bb48869bab5a2bdce.tar.gz
gdb-cc88a640ca1d0356c5feb40bb48869bab5a2bdce.tar.bz2
Imported readline 6.2, and upstream patch 001.
[patch 0/3] readline-6.2 rebase http://sourceware.org/ml/gdb-patches/2011-05/msg00003.html [patch 1/3] readline-6.2: Merge of already posted patches http://sourceware.org/ml/gdb-patches/2011-05/msg00004.html = [Bug-readline] [RFC/readline] bind.c, rl_function_dumper, Free allocated http://lists.gnu.org/archive/html/bug-readline/2011-03/msg00000.html [Bug-readline] [patch] Fix underquotation in readline/examples/rlfe/conf http://lists.gnu.org/archive/html/bug-readline/2011-04/msg00001.html [Bug-readline] [patch] Makefile.in htm<->html http://lists.gnu.org/archive/html/bug-readline/2011-04/msg00002.html Re: [Bug-readline] [patch] Makefile.in dependency: callback.o: xmalloc.h http://lists.gnu.org/archive/html/bug-readline/2011-04/msg00004.html [Bug-readline] [patch] Remove . from the VPATH directive http://lists.gnu.org/archive/html/bug-readline/2011-04/msg00005.html Eli Zaretskii's __MSDOS__ / __GO32__ / __MINGW32__ / __DJGPP__ stuff: http://sourceware.org/ml/gdb/2011-04/msg00002.html Jan Kratochvil's patch for FSF GDB tree local-specific changes: http://sourceware.org/ml/gdb/2011-04/msg00006.html Preservation of existing ChangeLog.gdb files, their updates. [patch 2/3] readline-6.2: Workaround "ask" regression http://sourceware.org/ml/gdb-patches/2011-05/msg00005.html [patch 3/3] readline-6.2: Revert 5.x compat., apply 6.x compat. http://sourceware.org/ml/gdb-patches/2011-05/msg00006.html [patch 4/3] readline-6.2: Substitute inc-hist.texinfo http://sourceware.org/ml/gdb-patches/2011-05/msg00010.html readline/ Workaround gdb.base/completion.exp regression on readline-6.2. * complete.c (get_y_or_n): Disable the return on RL_STATE_CALLBACK. Imported readline 6.2, and upstream patch 001. * configure: Regenerate. readline/doc/ * hsuser.texi (Using History Interactively): Disable !BashFeatures @defcodeindex. Make the `Programming with GNU History' reference external. * inc-hist.texinfo: Remove. Imported readline 6.2, and upstream patch 001. readline/examples/ Imported readline 6.2, and upstream patch 001. readline/examples/rlfe/ Imported readline 6.2, and upstream patch 001. gdb/ * config.in: Regenerate. * configure: Regenerate. * configure.ac <--with-system-readline> (for readline_echoing_p): Remove the test. * tui/tui-io.c (tui_old_readline_echoing_p): Rename to ... (tui_old_rl_echoing_p): ... here. (tui_setup_io): Rename extern declaration readline_echoing_p to _rl_echoing_p. Adjust assignments for the both renames. gdb/doc/ * Makefile.in (GDB_DOC_SOURCE_INCLUDES): Rename inc-hist.texinfo to hsuser.texi. * gdb.texinfo <!SYSTEM_READLINE>: Rename inc-hist.texinfo inclusion and comment to hsuser.texi. Change rluser.texi name in the comment.
Diffstat (limited to 'readline/doc')
-rw-r--r--readline/doc/ChangeLog.gdb11
-rw-r--r--readline/doc/Makefile.in41
-rw-r--r--readline/doc/fdl.texi96
-rw-r--r--readline/doc/history.325
-rw-r--r--readline/doc/history.texi27
-rw-r--r--readline/doc/hstech.texi6
-rw-r--r--readline/doc/hsuser.texi38
-rw-r--r--readline/doc/inc-hist.texinfo457
-rw-r--r--readline/doc/readline.3111
-rw-r--r--readline/doc/rlman.texi26
-rw-r--r--readline/doc/rltech.texi243
-rw-r--r--readline/doc/rluser.texi283
-rw-r--r--readline/doc/rluserman.texi27
-rwxr-xr-xreadline/doc/texi2dvi22
-rwxr-xr-xreadline/doc/texi2html25
-rw-r--r--readline/doc/version.texi12
16 files changed, 739 insertions, 711 deletions
diff --git a/readline/doc/ChangeLog.gdb b/readline/doc/ChangeLog.gdb
index 14d32f6..5830e1b 100644
--- a/readline/doc/ChangeLog.gdb
+++ b/readline/doc/ChangeLog.gdb
@@ -1,3 +1,14 @@
+2011-05-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * hsuser.texi (Using History Interactively): Disable !BashFeatures
+ @defcodeindex. Make the `Programming with GNU History' reference
+ external.
+ * inc-hist.texinfo: Remove.
+
+2011-05-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Imported readline 6.2, and upstream patch 001.
+
2006-04-24 Daniel Jacobowitz <dan@codesourcery.com>
Imported readline 5.1, and upstream patches 001-004.
diff --git a/readline/doc/Makefile.in b/readline/doc/Makefile.in
index 096f440..89d8b47 100644
--- a/readline/doc/Makefile.in
+++ b/readline/doc/Makefile.in
@@ -1,25 +1,24 @@
# This makefile for Readline library documentation is in -*- text -*- mode.
# Emacs likes it that way.
-# Copyright (C) 1996-2004 Free Software Foundation, Inc.
+# Copyright (C) 1996-2009 Free Software Foundation, Inc.
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
topdir = @top_srcdir@
srcdir = @srcdir@
-VPATH = .:@srcdir@
+VPATH = @srcdir@
prefix = @prefix@
@@ -64,9 +63,9 @@ PSPDF = gs -sPAPERSIZE=${PAPERSIZE} -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -s
RLSRC = $(srcdir)/rlman.texi $(srcdir)/rluser.texi \
$(srcdir)/rltech.texi $(srcdir)/version.texi \
- $(srcdir)/rluserman.texi
+ $(srcdir)/rluserman.texi $(srcdir)/fdl.texi
HISTSRC = $(srcdir)/history.texi $(srcdir)/hsuser.texi \
- $(srcdir)/hstech.texi $(srcdir)/version.texi
+ $(srcdir)/hstech.texi $(srcdir)/version.texi $(srcdir)/fdl.texi
# This should be a program that converts troff to an ascii-readable format
NROFF = groff -Tascii
@@ -83,7 +82,7 @@ PDFOBJ = readline.pdf history.pdf rluserman.pdf
INTERMEDIATE_OBJ = rlman.dvi
-DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ) $(INFOOBJ) $(TEXTOBJ)
+DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ) $(INFOOBJ) $(TEXTOBJ) $(PDFOBJ)
.SUFFIXES: .0 .3 .ps .txt .dvi .html .pdf
@@ -99,9 +98,11 @@ DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ) $(INFOOBJ) $(TEXTOBJ)
$(RM) $@
-${DVIPDF} $<
-all: info dvi html ps text
+all: info dvi html ps text pdf
nodvi: info html text
+xdist: $(DIST_DOCS)
+
info: $(INFOOBJ)
dvi: $(DVIOBJ)
ps: $(PSOBJ)
@@ -156,13 +157,13 @@ history.html: ${HISTSRC}
readline.0: readline.3
-readline_3.ps: readline.3
+readline_3.ps: $(srcdir)/readline.3
${RM} $@
${GROFF} -man < $(srcdir)/readline.3 > $@
history.0: history.3
-history_3.ps: history.3
+history_3.ps: $(srcdir)/history.3
${RM} $@
${GROFF} -man < $(srcdir)/history.3 > $@
@@ -182,7 +183,7 @@ distclean: clean maybe-clean
$(RM) Makefile
maybe-clean:
- -if test "X$(topdir)" != "X$(BUILD_DIR)"; then \
+ -if test "X$(topdir)" != "X.." && test "X$(topdir)" != "X$(BUILD_DIR)"; then \
$(RM) $(DIST_DOCS); \
fi
diff --git a/readline/doc/fdl.texi b/readline/doc/fdl.texi
index 47ead9f..8805f1a 100644
--- a/readline/doc/fdl.texi
+++ b/readline/doc/fdl.texi
@@ -1,13 +1,12 @@
+@c The GNU Free Documentation License.
+@center Version 1.3, 3 November 2008
-@node GNU Free Documentation License
-@appendixsec GNU Free Documentation License
-
-@cindex FDL, GNU Free Documentation License
-@center Version 1.2, November 2002
+@c This file is intended to be included within another document,
+@c hence no sectioning command or @node.
@display
-Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -112,6 +111,9 @@ formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
+The ``publisher'' means any person or entity that distributes copies
+of the Document to the public.
+
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
@@ -344,7 +346,7 @@ and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
-When the Document is included an aggregate, this License does not
+When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
@@ -380,13 +382,30 @@ title.
@item
TERMINATION
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
@item
FUTURE REVISIONS OF THIS LICENSE
@@ -404,11 +423,46 @@ following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
+as a draft) by the Free Software Foundation. If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+@item
+RELICENSING
+
+``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works. A
+public wiki that anybody can edit is an example of such a server. A
+``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
+site means any set of copyrightable works thus published on the MMC
+site.
+
+``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+``Incorporate'' means to publish or republish a Document, in whole or
+in part, as part of another Document.
+
+An MMC is ``eligible for relicensing'' if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole
+or in part into the MMC, (1) had no cover texts or invariant sections,
+and (2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
@end enumerate
@page
-@appendixsubsec ADDENDUM: How to use this License for your documents
+@heading ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
@@ -418,16 +472,16 @@ license notices just after the title page:
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.2
+ 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, no Front-Cover Texts, and no Back-Cover Texts.
- A copy of the license is included in the section entitled ``GNU
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with...Texts.'' line with this:
+replace the ``with@dots{}Texts.'' line with this:
@smallexample
@group
diff --git a/readline/doc/history.3 b/readline/doc/history.3
index 3ade839..4eb159c 100644
--- a/readline/doc/history.3
+++ b/readline/doc/history.3
@@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
-.\" Last Change: Thu Jul 31 08:46:08 EDT 2003
+.\" Last Change: Thu Aug 12 22:24:41 EDT 2010
.\"
-.TH HISTORY 3 "2003 July 31" "GNU History 5.0"
+.TH HISTORY 3 "2010 August 12" "GNU History 6.2"
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@@ -40,8 +40,8 @@
.SH NAME
history \- GNU History Library
.SH COPYRIGHT
-.if t The GNU History Library is Copyright \(co 1989-2002 by the Free Software Foundation, Inc.
-.if n The GNU History Library is Copyright (C) 1989-2002 by the Free Software Foundation, Inc.
+.if t The GNU History Library is Copyright \(co 1989-2011 by the Free Software Foundation, Inc.
+.if n The GNU History Library is Copyright (C) 1989-2011 by the Free Software Foundation, Inc.
.SH DESCRIPTION
Many programs read input from the user a line at a time. The GNU
History library is able to keep track of those lines, associate arbitrary
@@ -83,6 +83,8 @@ the history expansion character.
.PP
An event designator is a reference to a command line entry in the
history list.
+Unless the reference is absolute, events are relative to the current
+position in the history list.
.PP
.PD 0
.TP
@@ -96,18 +98,22 @@ Refer to command line
.IR n .
.TP
.B !\-\fIn\fR
-Refer to the current command line minus
+Refer to the current command minus
.IR n .
.TP
.B !!
Refer to the previous command. This is a synonym for `!\-1'.
.TP
.B !\fIstring\fR
-Refer to the most recent command starting with
+Refer to the most recent command
+preceding the current position in the history list
+starting with
.IR string .
.TP
.B !?\fIstring\fR\fB[?]\fR
-Refer to the most recent command containing
+Refer to the most recent command
+preceding the current postition in the history list
+containing
.IR string .
The trailing \fB?\fP may be omitted if
.I string
@@ -569,10 +575,13 @@ The number of entries currently stored in the history list.
The maximum number of history entries. This must be changed using
\fBstifle_history()\fP.
-.Vb int history_write_timestamps
+.Vb int history_wite_timestamps
If non-zero, timestamps are written to the history file, so they can be
preserved between sessions. The default value is 0, meaning that
timestamps are not saved.
+The current timestamp format uses the value of \fIhistory_comment_char\fP
+to delimit timestamp entries in the history file. If that variable does
+not have a value (the default), timestamps will not be written.
.Vb char history_expansion_char
The character that introduces a history event. The default is \fB!\fP.
diff --git a/readline/doc/history.texi b/readline/doc/history.texi
index f6a3d20..64945d8 100644
--- a/readline/doc/history.texi
+++ b/readline/doc/history.texi
@@ -4,8 +4,6 @@
@settitle GNU History Library
@c %**end of header (This is for running Texinfo on a region.)
-@setchapternewpage odd
-
@include version.texi
@copying
@@ -14,7 +12,7 @@ This document describes the GNU History library
a programming tool that provides a consistent user interface for
recalling lines of previously typed input.
-Copyright @copyright{} 1988-2004 Free Software Foundation, Inc.
+Copyright @copyright{} 1988--2011 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -22,15 +20,16 @@ are preserved on all copies.
@quotation
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 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,''
+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 is
-included in the section entitled ``GNU Free Documentation License.''
+included in the section entitled ``GNU Free Documentation License''.
+
+(a) The FSF's Back-Cover Text is: You are free to copy and modify
+this GNU manual. Buying copies from GNU Press supports the FSF in
+developing GNU and promoting software freedom.''
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software. Copies published by the Free
-Software Foundation raise funds for GNU development.''
@end quotation
@end copying
@@ -72,7 +71,7 @@ typed input.
@menu
* Using History Interactively:: GNU History User's Manual.
* Programming with GNU History:: GNU History Programmer's Manual.
-* Copying This Manual:: Copying This Manual.
+* GNU Free Documentation License:: License for copying this manual.
* Concept Index:: Index of concepts described in this manual.
* Function and Variable Index:: Index of externally visible functions
and variables.
@@ -84,12 +83,8 @@ typed input.
@include hsuser.texi
@include hstech.texi
-@node Copying This Manual
-@appendix Copying This Manual
-
-@menu
-* GNU Free Documentation License:: License for copying this manual.
-@end menu
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
@include fdl.texi
diff --git a/readline/doc/hstech.texi b/readline/doc/hstech.texi
index 4fdda5f..4fc9e8e 100644
--- a/readline/doc/hstech.texi
+++ b/readline/doc/hstech.texi
@@ -1,7 +1,7 @@
@ignore
This file documents the user interface to the GNU History library.
-Copyright (C) 1988-2002 Free Software Foundation, Inc.
+Copyright (C) 1988-2011 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
Permission is granted to make and distribute verbatim copies of this manual
@@ -426,6 +426,10 @@ The maximum number of history entries. This must be changed using
If non-zero, timestamps are written to the history file, so they can be
preserved between sessions. The default value is 0, meaning that
timestamps are not saved.
+
+The current timestamp format uses the value of @var{history_comment_char}
+to delimit timestamp entries in the history file. If that variable does
+not have a value (the default), timestamps will not be written.
@end deftypevar
@deftypevar char history_expansion_char
diff --git a/readline/doc/hsuser.texi b/readline/doc/hsuser.texi
index 6c89183..9aa6c35 100644
--- a/readline/doc/hsuser.texi
+++ b/readline/doc/hsuser.texi
@@ -1,7 +1,7 @@
@ignore
This file documents the user interface to the GNU History library.
-Copyright (C) 1988-2002 Free Software Foundation, Inc.
+Copyright (C) 1988--2011 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
Permission is granted to make and distribute verbatim copies of this manual
@@ -26,9 +26,10 @@ into another language, under the above conditions for modified versions.
@node Using History Interactively
@chapter Using History Interactively
-@ifclear BashFeatures
-@defcodeindex bt
-@end ifclear
+@c GDB bundling modification:
+@c @ifclear BashFeatures
+@c @defcodeindex bt
+@c @end ifclear
@ifset BashFeatures
This chapter describes how to use the @sc{gnu} History Library
@@ -41,7 +42,8 @@ see the @sc{gnu} Readline Library Manual.
This chapter describes how to use the @sc{gnu} History Library interactively,
from a user's standpoint. It should be considered a user's guide. For
information on using the @sc{gnu} History Library in your own programs,
-@pxref{Programming with GNU History}.
+@c GDB bundling modification:
+@pxref{Programming with GNU History, , , history, GNU History Library}.
@end ifclear
@ifset BashFeatures
@@ -97,7 +99,11 @@ to contain no more than @env{$HISTFILESIZE}
lines. If @env{HISTFILESIZE} is not set, no truncation is performed.
If the @env{HISTTIMEFORMAT} is set, the time stamp information
-associated with each history entry is written to the history file.
+associated with each history entry is written to the history file,
+marked with the history comment character.
+When the history file is read, lines beginning with the history
+comment character followed immediately by a digit are interpreted
+as timestamps for the previous history line.
The builtin command @code{fc} may be used to list or edit and re-execute
a portion of the history list.
@@ -133,7 +139,7 @@ history list and history file.
@item fc
@btindex fc
@example
-@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
+@code{fc [-e @var{ename}] [-lnr] [@var{first}] [@var{last}]}
@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
@end example
@@ -277,7 +283,10 @@ them, so that they are available for subsequent recall.
This is most useful in conjunction with Readline.
The shell allows control of the various characters used by the
-history expansion mechanism with the @code{histchars} variable.
+history expansion mechanism with the @code{histchars} variable,
+as explained above (@pxref{Bash Variables}). The shell uses
+the history comment character to mark history timestamps when
+writing the history file.
@end ifset
@menu
@@ -292,6 +301,8 @@ history expansion mechanism with the @code{histchars} variable.
An event designator is a reference to a command line entry in the
history list.
+Unless the reference is absolute, events are relative to the current
+position in the history list.
@cindex history events
@table @asis
@@ -317,10 +328,15 @@ Refer to the command @var{n} lines back.
Refer to the previous command. This is a synonym for @samp{!-1}.
@item @code{!@var{string}}
-Refer to the most recent command starting with @var{string}.
+Refer to the most recent command
+preceding the current position in the history list
+starting with @var{string}.
@item @code{!?@var{string}[?]}
-Refer to the most recent command containing @var{string}. The trailing
+Refer to the most recent command
+preceding the current position in the history list
+containing @var{string}.
+The trailing
@samp{?} may be omitted if the @var{string} is followed immediately by
a newline.
@@ -412,7 +428,7 @@ of the following modifiers, each preceded by a @samp{:}.
Remove a trailing pathname component, leaving only the head.
@item t
-Remove all leading pathname components, leaving the tail.
+Remove all leading pathname components, leaving the tail.
@item r
Remove a trailing suffix of the form @samp{.@var{suffix}}, leaving
diff --git a/readline/doc/inc-hist.texinfo b/readline/doc/inc-hist.texinfo
deleted file mode 100644
index b5ed3cb..0000000
--- a/readline/doc/inc-hist.texinfo
+++ /dev/null
@@ -1,457 +0,0 @@
-@ignore
-This file documents the user interface to the GNU History library.
-
-Copyright (C) 1988-2002 Free Software Foundation, Inc.
-Authored by Brian Fox and Chet Ramey.
-
-Permission is granted to make and distribute verbatim copies of this manual
-provided the copyright notice and this permission notice are preserved on
-all copies.
-
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission notice
-identical to this one except for the removal of this paragraph (this
-paragraph not being relevant to the printed manual).
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-GNU Copyright statement is available to the distributee, and provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end ignore
-
-@node Using History Interactively
-@chapter Using History Interactively
-
-@c @ifclear BashFeatures
-@c @defcodeindex bt
-@c @end ifclear
-
-@ifset BashFeatures
-This chapter describes how to use the @sc{gnu} History Library
-interactively, from a user's standpoint.
-It should be considered a user's guide.
-For information on using the @sc{gnu} History Library in other programs,
-see the @sc{gnu} Readline Library Manual.
-@end ifset
-@ifclear BashFeatures
-This chapter describes how to use the @sc{gnu} History Library interactively,
-from a user's standpoint. It should be considered a user's guide.
-For information on using the @sc{gnu} History Library in other programs,
-see the @sc{gnu} Readline Library Manual.
-@end ifclear
-
-@ifset BashFeatures
-@menu
-* Bash History Facilities:: How Bash lets you manipulate your command
- history.
-* Bash History Builtins:: The Bash builtin commands that manipulate
- the command history.
-* History Interaction:: What it feels like using History as a user.
-@end menu
-@end ifset
-@ifclear BashFeatures
-@menu
-* History Interaction:: What it feels like using History as a user.
-@end menu
-@end ifclear
-
-@ifset BashFeatures
-@node Bash History Facilities
-@section Bash History Facilities
-@cindex command history
-@cindex history list
-
-When the @option{-o history} option to the @code{set} builtin
-is enabled (@pxref{The Set Builtin}),
-the shell provides access to the @dfn{command history},
-the list of commands previously typed.
-The value of the @env{HISTSIZE} shell variable is used as the
-number of commands to save in a history list.
-The text of the last @env{$HISTSIZE}
-commands (default 500) is saved.
-The shell stores each command in the history list prior to
-parameter and variable expansion
-but after history expansion is performed, subject to the
-values of the shell variables
-@env{HISTIGNORE} and @env{HISTCONTROL}.
-
-When the shell starts up, the history is initialized from the
-file named by the @env{HISTFILE} variable (default @file{~/.bash_history}).
-The file named by the value of @env{HISTFILE} is truncated, if
-necessary, to contain no more than the number of lines specified by
-the value of the @env{HISTFILESIZE} variable.
-When an interactive shell exits, the last
-@env{$HISTSIZE} lines are copied from the history list to the file
-named by @env{$HISTFILE}.
-If the @code{histappend} shell option is set (@pxref{Bash Builtins}),
-the lines are appended to the history file,
-otherwise the history file is overwritten.
-If @env{HISTFILE}
-is unset, or if the history file is unwritable, the history is
-not saved. After saving the history, the history file is truncated
-to contain no more than @env{$HISTFILESIZE}
-lines. If @env{HISTFILESIZE} is not set, no truncation is performed.
-
-If the @env{HISTTIMEFORMAT} is set, the time stamp information
-associated with each history entry is written to the history file.
-
-The builtin command @code{fc} may be used to list or edit and re-execute
-a portion of the history list.
-The @code{history} builtin may be used to display or modify the history
-list and manipulate the history file.
-When using command-line editing, search commands
-are available in each editing mode that provide access to the
-history list (@pxref{Commands For History}).
-
-The shell allows control over which commands are saved on the history
-list. The @env{HISTCONTROL} and @env{HISTIGNORE}
-variables may be set to cause the shell to save only a subset of the
-commands entered.
-The @code{cmdhist}
-shell option, if enabled, causes the shell to attempt to save each
-line of a multi-line command in the same history entry, adding
-semicolons where necessary to preserve syntactic correctness.
-The @code{lithist}
-shell option causes the shell to save the command with embedded newlines
-instead of semicolons.
-The @code{shopt} builtin is used to set these options.
-@xref{Bash Builtins}, for a description of @code{shopt}.
-
-@node Bash History Builtins
-@section Bash History Builtins
-@cindex history builtins
-
-Bash provides two builtin commands which manipulate the
-history list and history file.
-
-@table @code
-
-@item fc
-@btindex fc
-@example
-@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
-@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
-@end example
-
-Fix Command. In the first form, a range of commands from @var{first} to
-@var{last} is selected from the history list. Both @var{first} and
-@var{last} may be specified as a string (to locate the most recent
-command beginning with that string) or as a number (an index into the
-history list, where a negative number is used as an offset from the
-current command number). If @var{last} is not specified it is set to
-@var{first}. If @var{first} is not specified it is set to the previous
-command for editing and @minus{}16 for listing. If the @option{-l} flag is
-given, the commands are listed on standard output. The @option{-n} flag
-suppresses the command numbers when listing. The @option{-r} flag
-reverses the order of the listing. Otherwise, the editor given by
-@var{ename} is invoked on a file containing those commands. If
-@var{ename} is not given, the value of the following variable expansion
-is used: @code{$@{FCEDIT:-$@{EDITOR:-vi@}@}}. This says to use the
-value of the @env{FCEDIT} variable if set, or the value of the
-@env{EDITOR} variable if that is set, or @code{vi} if neither is set.
-When editing is complete, the edited commands are echoed and executed.
-
-In the second form, @var{command} is re-executed after each instance
-of @var{pat} in the selected command is replaced by @var{rep}.
-
-A useful alias to use with the @code{fc} command is @code{r='fc -s'}, so
-that typing @samp{r cc} runs the last command beginning with @code{cc}
-and typing @samp{r} re-executes the last command (@pxref{Aliases}).
-
-@item history
-@btindex history
-@example
-history [@var{n}]
-history -c
-history -d @var{offset}
-history [-anrw] [@var{filename}]
-history -ps @var{arg}
-@end example
-
-With no options, display the history list with line numbers.
-Lines prefixed with a @samp{*} have been modified.
-An argument of @var{n} lists only the last @var{n} lines.
-If the shell variable @env{HISTTIMEFORMAT} is set and not null,
-it is used as a format string for @var{strftime} to display
-the time stamp associated with each displayed history entry.
-No intervening blank is printed between the formatted time stamp
-and the history line.
-
-Options, if supplied, have the following meanings:
-
-@table @code
-@item -c
-Clear the history list. This may be combined
-with the other options to replace the history list completely.
-
-@item -d @var{offset}
-Delete the history entry at position @var{offset}.
-@var{offset} should be specified as it appears when the history is
-displayed.
-
-@item -a
-Append the new
-history lines (history lines entered since the beginning of the
-current Bash session) to the history file.
-
-@item -n
-Append the history lines not already read from the history file
-to the current history list. These are lines appended to the history
-file since the beginning of the current Bash session.
-
-@item -r
-Read the current history file and append its contents to
-the history list.
-
-@item -w
-Write out the current history to the history file.
-
-@item -p
-Perform history substitution on the @var{arg}s and display the result
-on the standard output, without storing the results in the history list.
-
-@item -s
-The @var{arg}s are added to the end of
-the history list as a single entry.
-
-@end table
-
-When any of the @option{-w}, @option{-r}, @option{-a}, or @option{-n} options is
-used, if @var{filename}
-is given, then it is used as the history file. If not, then
-the value of the @env{HISTFILE} variable is used.
-
-@end table
-@end ifset
-
-@node History Interaction
-@section History Expansion
-@cindex history expansion
-
-The History library provides a history expansion feature that is similar
-to the history expansion provided by @code{csh}. This section
-describes the syntax used to manipulate the history information.
-
-History expansions introduce words from the history list into
-the input stream, making it easy to repeat commands, insert the
-arguments to a previous command into the current input line, or
-fix errors in previous commands quickly.
-
-History expansion takes place in two parts. The first is to determine
-which line from the history list should be used during substitution.
-The second is to select portions of that line for inclusion into the
-current one. The line selected from the history is called the
-@dfn{event}, and the portions of that line that are acted upon are
-called @dfn{words}. Various @dfn{modifiers} are available to manipulate
-the selected words. The line is broken into words in the same fashion
-that Bash does, so that several words
-surrounded by quotes are considered one word.
-History expansions are introduced by the appearance of the
-history expansion character, which is @samp{!} by default.
-@ifset BashFeatures
-Only @samp{\} and @samp{'} may be used to escape the history expansion
-character.
-@end ifset
-
-@ifset BashFeatures
-Several shell options settable with the @code{shopt}
-builtin (@pxref{Bash Builtins}) may be used to tailor
-the behavior of history expansion. If the
-@code{histverify} shell option is enabled, and Readline
-is being used, history substitutions are not immediately passed to
-the shell parser.
-Instead, the expanded line is reloaded into the Readline
-editing buffer for further modification.
-If Readline is being used, and the @code{histreedit}
-shell option is enabled, a failed history expansion will be
-reloaded into the Readline editing buffer for correction.
-The @option{-p} option to the @code{history} builtin command
-may be used to see what a history expansion will do before using it.
-The @option{-s} option to the @code{history} builtin may be used to
-add commands to the end of the history list without actually executing
-them, so that they are available for subsequent recall.
-This is most useful in conjunction with Readline.
-
-The shell allows control of the various characters used by the
-history expansion mechanism with the @code{histchars} variable.
-@end ifset
-
-@menu
-* Event Designators:: How to specify which history line to use.
-* Word Designators:: Specifying which words are of interest.
-* Modifiers:: Modifying the results of substitution.
-@end menu
-
-@node Event Designators
-@subsection Event Designators
-@cindex event designators
-
-An event designator is a reference to a command line entry in the
-history list.
-@cindex history events
-
-@table @asis
-
-@item @code{!}
-@ifset BashFeatures
-Start a history substitution, except when followed by a space, tab,
-the end of the line, @samp{=} or @samp{(} (when the
-@code{extglob} shell option is enabled using the @code{shopt} builtin).
-@end ifset
-@ifclear BashFeatures
-Start a history substitution, except when followed by a space, tab,
-the end of the line, or @samp{=}.
-@end ifclear
-
-@item @code{!@var{n}}
-Refer to command line @var{n}.
-
-@item @code{!-@var{n}}
-Refer to the command @var{n} lines back.
-
-@item @code{!!}
-Refer to the previous command. This is a synonym for @samp{!-1}.
-
-@item @code{!@var{string}}
-Refer to the most recent command starting with @var{string}.
-
-@item @code{!?@var{string}[?]}
-Refer to the most recent command containing @var{string}. The trailing
-@samp{?} may be omitted if the @var{string} is followed immediately by
-a newline.
-
-@item @code{^@var{string1}^@var{string2}^}
-Quick Substitution. Repeat the last command, replacing @var{string1}
-with @var{string2}. Equivalent to
-@code{!!:s/@var{string1}/@var{string2}/}.
-
-@item @code{!#}
-The entire command line typed so far.
-
-@end table
-
-@node Word Designators
-@subsection Word Designators
-
-Word designators are used to select desired words from the event.
-A @samp{:} separates the event specification from the word designator. It
-may be omitted if the word designator begins with a @samp{^}, @samp{$},
-@samp{*}, @samp{-}, or @samp{%}. Words are numbered from the beginning
-of the line, with the first word being denoted by 0 (zero). Words are
-inserted into the current line separated by single spaces.
-
-@need 0.75
-For example,
-
-@table @code
-@item !!
-designates the preceding command. When you type this, the preceding
-command is repeated in toto.
-
-@item !!:$
-designates the last argument of the preceding command. This may be
-shortened to @code{!$}.
-
-@item !fi:2
-designates the second argument of the most recent command starting with
-the letters @code{fi}.
-@end table
-
-@need 0.75
-Here are the word designators:
-
-@table @code
-
-@item 0 (zero)
-The @code{0}th word. For many applications, this is the command word.
-
-@item @var{n}
-The @var{n}th word.
-
-@item ^
-The first argument; that is, word 1.
-
-@item $
-The last argument.
-
-@item %
-The word matched by the most recent @samp{?@var{string}?} search.
-
-@item @var{x}-@var{y}
-A range of words; @samp{-@var{y}} abbreviates @samp{0-@var{y}}.
-
-@item *
-All of the words, except the @code{0}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.
-
-@item @var{x}*
-Abbreviates @samp{@var{x}-$}
-
-@item @var{x}-
-Abbreviates @samp{@var{x}-$} like @samp{@var{x}*}, but omits the last word.
-
-@end table
-
-If a word designator is supplied without an event specification, the
-previous command is used as the event.
-
-@node Modifiers
-@subsection Modifiers
-
-After the optional word designator, you can add a sequence of one or more
-of the following modifiers, each preceded by a @samp{:}.
-
-@table @code
-
-@item h
-Remove a trailing pathname component, leaving only the head.
-
-@item t
-Remove all leading pathname components, leaving the tail.
-
-@item r
-Remove a trailing suffix of the form @samp{.@var{suffix}}, leaving
-the basename.
-
-@item e
-Remove all but the trailing suffix.
-
-@item p
-Print the new command but do not execute it.
-
-@ifset BashFeatures
-@item q
-Quote the substituted words, escaping further substitutions.
-
-@item x
-Quote the substituted words as with @samp{q},
-but break into words at spaces, tabs, and newlines.
-@end ifset
-
-@item s/@var{old}/@var{new}/
-Substitute @var{new} for the first occurrence of @var{old} in the
-event line. Any delimiter may be used in place of @samp{/}.
-The delimiter may be quoted in @var{old} and @var{new}
-with a single backslash. If @samp{&} appears in @var{new},
-it is replaced by @var{old}. A single backslash will quote
-the @samp{&}. The final delimiter is optional if it is the last
-character on the input line.
-
-@item &
-Repeat the previous substitution.
-
-@item g
-@itemx a
-Cause changes to be applied over the entire event line. Used in
-conjunction with @samp{s}, as in @code{gs/@var{old}/@var{new}/},
-or with @samp{&}.
-
-@item G
-Apply the following @samp{s} modifier once to each word in the event.
-
-@end table
diff --git a/readline/doc/readline.3 b/readline/doc/readline.3
index 90cd997..f79f4bb 100644
--- a/readline/doc/readline.3
+++ b/readline/doc/readline.3
@@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
-.\" Last Change: Tue Sep 13 12:07:26 EDT 2005
+.\" Last Change: Sat Aug 28 18:56:32 EDT 2010
.\"
-.TH READLINE 3 "2005 Sep 13" "GNU Readline 5.1-beta1"
+.TH READLINE 3 "2010 August 28" "GNU Readline 6.2"
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@@ -34,8 +34,8 @@ readline \- get a line from a user with editing
\fBreadline\fP (\fIconst char *prompt\fP);
.fi
.SH COPYRIGHT
-.if n Readline is Copyright (C) 1989\-2004 by the Free Software Foundation, Inc.
-.if t Readline is Copyright \(co 1989\-2004 by the Free Software Foundation, Inc.
+.if n Readline is Copyright (C) 1989\-2011 Free Software Foundation, Inc.
+.if t Readline is Copyright \(co 1989\-2011 Free Software Foundation, Inc.
.SH DESCRIPTION
.LP
.B readline
@@ -76,7 +76,7 @@ is read with a non\-empty line, it is
treated as a newline.
.SH NOTATION
.LP
-An emacs-style notation is used to denote
+An Emacs-style notation is used to denote
keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n
means Control\-N. Similarly,
.I meta
@@ -116,6 +116,8 @@ The name of this file is taken from the value of the
.B INPUTRC
environment variable. If that variable is unset, the default is
.IR ~/.inputrc .
+If that file does not exist or cannot be read, the ultimate default is
+.IR /etc/inputrc .
When a program which uses the readline library starts up, the
init file is read, and the key bindings and variables are set.
There are only a few basic constructs allowed in the
@@ -168,6 +170,8 @@ command or the text of a macro and a key sequence to which
it should be bound. The name may be specified in one of two ways:
as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP
prefixes, or as a key sequence.
+The name and key sequence are separated by a colon. There can be no
+whitespace between the name and the colon.
.PP
When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP,
.I keyname
@@ -356,11 +360,30 @@ This command is bound to
in emacs mode and to
.B #
in vi command mode.
+.TP
+.B completion\-display\-width (-1)
+The number of screen columns used to display possible matches
+when performing completion.
+The value is ignored if it is less than 0 or greater than the terminal
+screen width.
+A value of 0 will cause matches to be displayed one per line.
+The default value is -1.
.TP
.B completion\-ignore\-case (Off)
If set to \fBOn\fP, readline performs filename matching and completion
in a case\-insensitive fashion.
.TP
+.B completion\-map\-case (Off)
+If set to \fBOn\fP, and \fBcompletion\-ignore\-case\fP is enabled, readline
+treats hyphens (\fI\-\fP) and underscores (\fI_\fP) as equivalent when
+performing case\-insensitive filename matching and completion.
+.TP
+.B completion\-prefix\-display\-length (0)
+The length in characters of the common prefix of a list of possible
+completions that is displayed without modification. When set to a
+value greater than zero, common prefixes longer than this value are
+replaced with an ellipsis when displaying possible completions.
+.TP
.B completion\-query\-items (100)
This determines when the user is queried about viewing
the number of possible completions
@@ -384,27 +407,41 @@ mapped to \fBself-insert\fP.
.TP
.B editing\-mode (emacs)
Controls whether readline begins with a set of key bindings similar
-to emacs or vi.
+to \fIEmacs\fP or \fIvi\fP.
.B editing\-mode
can be set to either
.B emacs
or
.BR vi .
.TP
+.B echo\-control\-characters (On)
+When set to \fBOn\fP, on operating systems that indicate they support it,
+readline echoes a character corresponding to a signal generated from the
+keyboard.
+.TP
.B enable\-keypad (Off)
When set to \fBOn\fP, readline will try to enable the application
keypad when it is called. Some systems need this to enable the
arrow keys.
.TP
+.B enable\-meta\-key (On)
+When set to \fBOn\fP, readline will try to enable any meta modifier
+key the terminal claims to support when it is called. On many terminals,
+the meta key is used to send eight-bit characters.
+.TP
.B expand\-tilde (Off)
-If set to \fBon\fP, tilde expansion is performed when readline
+If set to \fBOn\fP, tilde expansion is performed when readline
attempts word completion.
.TP
.B history\-preserve\-point (Off)
-If set to \fBon\fP, the history code attempts to place point at the
+If set to \fBOn\fP, the history code attempts to place point at the
same location on each history line retrieved with \fBprevious-history\fP
or \fBnext-history\fP.
.TP
+.B history\-size (0)
+Set the maximum number of history entries saved in the history list. If
+set to zero, the number of entries in the history list is not limited.
+.TP
.B horizontal\-scroll\-mode (Off)
When set to \fBOn\fP, makes readline use a single line for display,
scrolling the input horizontally on a single screen line when it
@@ -451,9 +488,15 @@ have a slash appended (subject to the value of
.B match\-hidden\-files (On)
This variable, when set to \fBOn\fP, causes readline to match files whose
names begin with a `.' (hidden files) when performing filename
-completion, unless the leading `.' is
+completion.
+If set to \fBOff\fP, the leading `.' must be
supplied by the user in the filename to be completed.
.TP
+.B menu\-complete\-display\-prefix (Off)
+If set to \fBOn\fP, menu completion displays the common prefix of the
+list of possible completions (which may be empty) before cycling through
+the list.
+.TP
.B output\-meta (Off)
If set to \fBOn\fP, readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
@@ -467,10 +510,16 @@ to display a screenful of possible completions at a time.
If set to \fBOn\fP, readline will display completions with matches
sorted horizontally in alphabetical order, rather than down the screen.
.TP
+.B revert\-all\-at\-newline (Off)
+If set to \fBOn\fP, readline will undo all changes to history lines
+before returning when \fBaccept\-line\fP is executed. By default,
+history lines may be modified and retain individual undo lists across
+calls to \fBreadline\fP.
+.TP
.B show\-all\-if\-ambiguous (Off)
This alters the default behavior of the completion functions. If
set to
-.BR on ,
+.BR On ,
words which have more than one possible completion cause the
matches to be listed immediately instead of ringing the bell.
.TP
@@ -478,12 +527,20 @@ matches to be listed immediately instead of ringing the bell.
This alters the default behavior of the completion functions in
a fashion similar to \fBshow\-all\-if\-ambiguous\fP.
If set to
-.BR on ,
+.BR On ,
words which have more than one possible completion without any
possible partial completion (the possible completions don't share
a common prefix) cause the matches to be listed immediately instead
of ringing the bell.
.TP
+.B skip\-completed\-text (Off)
+If set to \fBOn\fP, this alters the default completion behavior when
+inserting a single match into the line. It's only active when
+performing completion in the middle of a word. If enabled, readline
+does not insert characters from the completion that match characters
+after point in the word being completed, so portions of the word
+following the cursor are not duplicated.
+.TP
.B visible\-stats (Off)
If set to \fBOn\fP, a character denoting a file's type as reported
by \fIstat\fP(2) is appended to the filename when listing possible
@@ -530,7 +587,7 @@ library sets the \fIapplication name\fP, and an initialization
file can test for a particular value.
This could be used to bind key sequences to functions useful for
a specific program. For instance, the following command adds a
-key sequence that quotes the current or previous word in Bash:
+key sequence that quotes the current or previous word in \fBbash\fP:
.sp 1
.RS
.nf
@@ -706,10 +763,14 @@ as if the "!\fIn\fP" history expansion had been specified.
.B
yank\-last\-arg (M\-.\^, M\-_\^)
Insert the last argument to the previous command (the last word of
-the previous history entry). With an argument,
-behave exactly like \fByank\-nth\-arg\fP.
+the previous history entry).
+With a numeric argument, behave exactly like \fByank\-nth\-arg\fP.
Successive calls to \fByank\-last\-arg\fP move back through the history
-list, inserting the last argument of each line in turn.
+list, inserting the last word (or the word specified by the argument to
+the first call) of each line in turn.
+Any numeric argument supplied to these successive calls determines
+the direction to move through the history. A negative argument switches
+the direction through the history (back or forward).
The history expansion facilities are used to extract the last argument,
as if the "!$" history expansion had been specified.
.PD
@@ -884,6 +945,12 @@ only attempts filename completion under certain circumstances.
.TP
.B possible\-completions (M\-?)
List the possible completions of the text before point.
+When displaying completions, readline sets the number of columns used
+for display to the value of \fBcompletion-display-width\fP, the value of
+the environment variable
+.SM
+.BR COLUMNS ,
+or the screen width, in that order.
.TP
.B insert\-completions (M\-*)
Insert all completions of the text before point
@@ -904,6 +971,11 @@ through the list.
This command is intended to be bound to \fBTAB\fP, but is unbound
by default.
.TP
+.B menu\-complete\-backward
+Identical to \fBmenu\-complete\fP, but moves backward through the list
+of possible completions, as if \fBmenu\-complete\fP had been given a
+negative argument. This command is unbound by default.
+.TP
.B delete\-char\-or\-list
Deletes the character under the cursor if not at the beginning or
end of the line (like \fBdelete-char\fP).
@@ -977,6 +1049,15 @@ character. A negative count searches for previous occurrences.
A character is read and point is moved to the previous occurrence of that
character. A negative count searches for subsequent occurrences.
.TP
+.B skip\-csi\-sequence
+Read enough characters to consume a multi-key sequence such as those
+defined for keys like Home and End. Such sequences begin with a
+Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is
+bound to "\e[", keys producing such sequences will have no effect
+unless explicitly bound to a readline command, instead of inserting
+stray characters into the editing buffer. This is unbound by default,
+but usually bound to ESC\-[.
+.TP
.B insert\-comment (M\-#)
Without a numeric argument, the value of the readline
.B comment\-begin
diff --git a/readline/doc/rlman.texi b/readline/doc/rlman.texi
index f834b58..1c9ac13 100644
--- a/readline/doc/rlman.texi
+++ b/readline/doc/rlman.texi
@@ -4,7 +4,6 @@
@settitle GNU Readline Library
@comment %**end of header (This is for running Texinfo on a region.)
@synindex vr fn
-@setchapternewpage odd
@include version.texi
@@ -14,7 +13,7 @@ This manual describes the GNU Readline Library
consistency of user interface across discrete programs which provide
a command line interface.
-Copyright @copyright{} 1988-2004 Free Software Foundation, Inc.
+Copyright @copyright{} 1988--2011 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -22,15 +21,16 @@ are preserved on all copies.
@quotation
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 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,''
+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 is
-included in the section entitled ``GNU Free Documentation License.''
+included in the section entitled ``GNU Free Documentation License''.
+
+(a) The FSF's Back-Cover Text is: You are free to copy and modify
+this GNU manual. Buying copies from GNU Press supports the FSF in
+developing GNU and promoting software freedom.''
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software. Copies published by the Free
-Software Foundation raise funds for GNU development.''
@end quotation
@end copying
@@ -71,7 +71,7 @@ provide a command line interface.
@menu
* Command Line Editing:: GNU Readline User's Manual.
* Programming with GNU Readline:: GNU Readline Programmer's Manual.
-* Copying This Manual:: Copying this manual.
+* GNU Free Documentation License:: License for copying this manual.
* Concept Index:: Index of concepts described in this manual.
* Function and Variable Index:: Index of externally visible functions
and variables.
@@ -81,12 +81,8 @@ provide a command line interface.
@include rluser.texi
@include rltech.texi
-@node Copying This Manual
-@appendix Copying This Manual
-
-@menu
-* GNU Free Documentation License:: License for copying this manual.
-@end menu
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
@include fdl.texi
diff --git a/readline/doc/rltech.texi b/readline/doc/rltech.texi
index 6f2e2ee..dc272a2 100644
--- a/readline/doc/rltech.texi
+++ b/readline/doc/rltech.texi
@@ -1,14 +1,13 @@
@comment %**start of header (This is for running Texinfo on a region.)
@setfilename rltech.info
@comment %**end of header (This is for running Texinfo on a region.)
-@setchapternewpage odd
@ifinfo
This document describes the GNU Readline Library, a utility for aiding
in the consistency of user interface across discrete programs that need
to provide a command line interface.
-Copyright (C) 1988-2005 Free Software Foundation, Inc.
+Copyright (C) 1988--2011 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -351,6 +350,12 @@ The @code{rl_set_prompt()} function (@pxref{Redisplay}) may
be used to modify the prompt string after calling @code{readline()}.
@end deftypevar
+@deftypevar {char *} rl_display_prompt
+The string displayed as the prompt. This is usually identical to
+@var{rl_prompt}, but may be changed temporarily by functions that
+use the prompt string as a message area, such as incremental search.
+@end deftypevar
+
@deftypevar int rl_already_prompted
If an application wishes to display the prompt itself, rather than have
Readline do it the first time @code{readline()} is called, it should set
@@ -518,6 +523,20 @@ Readline is performing word completion.
Readline is currently executing the readline signal handler.
@item RL_STATE_UNDOING
Readline is performing an undo.
+@item RL_STATE_INPUTPENDING
+Readline has input pending due to a call to @code{rl_execute_next()}.
+@item RL_STATE_TTYCSAVED
+Readline has saved the values of the terminal's special characters.
+@item RL_STATE_CALLBACK
+Readline is currently using the alternate (callback) interface
+(@pxref{Alternate Interface}).
+@item RL_STATE_VIMOTION
+Readline is reading the argument to a vi-mode "motion" command.
+@item RL_STATE_MULTIKEY
+Readline is reading a multiple-keystroke command.
+@item RL_STATE_VICMDONCE
+Readline has entered vi command (movement) mode at least one time during
+the current call to @code{readline()}.
@item RL_STATE_DONE
Readline has read a key sequence bound to @code{accept-line}
and is about to return the line to the caller.
@@ -603,7 +622,7 @@ Readline which keymap to use.
@deftypefun Keymap rl_make_bare_keymap (void)
Returns a new, empty keymap. The space for the keymap is allocated with
@code{malloc()}; the caller should free it by calling
-@code{rl_discard_keymap()} when done.
+@code{rl_free_keymap()} when done.
@end deftypefun
@deftypefun Keymap rl_copy_keymap (Keymap map)
@@ -617,7 +636,13 @@ the Meta digits bound to produce numeric arguments.
@end deftypefun
@deftypefun void rl_discard_keymap (Keymap keymap)
-Free the storage associated with @var{keymap}.
+Free the storage associated with the data in @var{keymap}.
+The caller should free @var{keymap}.
+@end deftypefun
+
+@deftypefun void rl_free_keymap (Keymap keymap)
+Free all storage associated with @var{keymap}. This calls
+@code{rl_discard_keymap} to free subordindate keymaps and macros.
@end deftypefun
Readline has several internal keymaps. These functions allow you to
@@ -793,7 +818,8 @@ Print the names of all bindable Readline functions to @code{rl_outstream}.
@deftypefun {const char **} rl_funmap_names (void)
Return a NULL terminated array of known function names. The array is
sorted. The array itself is allocated, but not the strings inside. You
-should @code{free()} the array when you are done, but not the pointers.
+should free the array, but not the pointers, using @code{free} or
+@code{rl_free} when you are done.
@end deftypefun
@deftypefun int rl_add_funmap_entry (const char *name, rl_command_func_t *function)
@@ -1033,8 +1059,10 @@ pending input has not already been read with @code{rl_read_key()}.
@deftypefun int rl_set_keyboard_input_timeout (int u)
While waiting for keyboard input in @code{rl_read_key()}, Readline will
wait for @var{u} microseconds for input before calling any function
-assigned to @code{rl_event_hook}. The default waiting period is
-one-tenth of a second. Returns the old timeout value.
+assigned to @code{rl_event_hook}. @var{u} must be greater than or equal
+to zero (a zero-length timeout is equivalent to a poll).
+The default waiting period is one-tenth of a second.
+Returns the old timeout value.
@end deftypefun
@node Terminal Management
@@ -1075,6 +1103,26 @@ environment variable is used.
@node Utility Functions
@subsection Utility Functions
+@deftypefun int rl_save_state (struct readline_state *sp)
+Save a snapshot of Readline's internal state to @var{sp}.
+The contents of the @var{readline_state} structure are documented
+in @file{readline.h}.
+The caller is responsible for allocating the structure.
+@end deftypefun
+
+@deftypefun int rl_restore_state (struct readline_state *sp)
+Restore Readline's internal state to that stored in @var{sp}, which must
+have been saved by a call to @code{rl_save_state}.
+The contents of the @var{readline_state} structure are documented
+in @file{readline.h}.
+The caller is responsible for freeing the structure.
+@end deftypefun
+
+@deftypefun void rl_free (void *mem)
+Deallocate the memory pointed to by @var{mem}. @var{mem} must have been
+allocated by @code{malloc}.
+@end deftypefun
+
@deftypefun void rl_replace_line (const char *text, int clear_undo)
Replace the contents of @code{rl_line_buffer} with @var{text}.
The point and mark are preserved, if possible.
@@ -1082,7 +1130,7 @@ If @var{clear_undo} is non-zero, the undo list associated with the
current line is cleared.
@end deftypefun
-@deftypefun int rl_extend_line_buffer (int len)
+@deftypefun void rl_extend_line_buffer (int len)
Ensure that @code{rl_line_buffer} has enough space to hold @var{len}
characters, possibly reallocating it if necessary.
@end deftypefun
@@ -1109,6 +1157,9 @@ of strings, in argv format, such as a list of completion matches.
is the length of the longest string in @code{matches}. This function uses
the setting of @code{print-completions-horizontally} to select how the
matches are displayed (@pxref{Readline Init File Syntax}).
+When displaying completions, this function sets the number of columns used
+for display to the value of @code{completion-display-width}, the value of
+the environment variable @env{COLUMNS}, or the screen width, in that order.
@end deftypefun
The following are implemented as macros, defined in @code{chardefs.h}.
@@ -1392,6 +1443,13 @@ call @code{rl_resize_terminal()} or @code{rl_set_screen_size()} to force
Readline to update its idea of the terminal size when a @code{SIGWINCH}
is received.
+@deftypefun void rl_echo_signal_char (int sig)
+If an application wishes to install its own signal handlers, but still
+have readline display characters that generate signals, calling this
+function with @var{sig} set to @code{SIGINT}, @code{SIGQUIT}, or
+@code{SIGTSTP} will display the character generating that signal.
+@end deftypefun
+
@deftypefun void rl_resize_terminal (void)
Update Readline's internal screen size by reading values from the kernel.
@end deftypefun
@@ -1659,15 +1717,49 @@ from the array must be freed.
@deftypevar {rl_icppfunc_t *} rl_directory_completion_hook
This function, if defined, is allowed to modify the directory portion
-of filenames Readline completes. It is called with the address of a
-string (the current directory name) as an argument, and may modify that string.
+of filenames Readline completes.
+It could be used to expand symbolic links or shell variables in pathnames.
+It is called with the address of a string (the current directory name) as an
+argument, and may modify that string.
If the string is replaced with a new string, the old value should be freed.
Any modified directory name should have a trailing slash.
-The modified value will be displayed as part of the completion, replacing
+The modified value will be used as part of the completion, replacing
the directory portion of the pathname the user typed.
-It returns an integer that should be non-zero if the function modifies
-its directory argument.
-It could be used to expand symbolic links or shell variables in pathnames.
+At the least, even if no other expansion is performed, this function should
+remove any quote characters from the directory name, because its result will
+be passed directly to @code{opendir()}.
+The directory completion hook returns an integer that should be non-zero if
+the function modifies its directory argument.
+The function should not modify the directory argument if it returns 0.
+@end deftypevar
+
+@ignore
+@deftypevar extern rl_icppfunc_t *rl_directory_rewrite_hook;
+If non-zero, this is the address of a function to call when completing
+a directory name. This function takes the address of the directory name
+to be modified as an argument. Unlike @code{rl_directory_completion_hook},
+it only modifies the directory name used in @code{opendir}, not what is
+displayed when the possible completions are printed or inserted. It is
+called before rl_directory_completion_hook.
+
+I'm not happy with how this works yet, so it's undocumented.
+@end deftypevar
+@end ignore
+
+@deftypevar {rl_dequote_func_t *} rl_filename_rewrite_hook
+If non-zero, this is the address of a function called when reading
+directory entries from the filesystem for completion and comparing
+them to the partial word to be completed. The function should
+perform any necesary application or system-specific conversion on
+the filename, such as converting between character sets or converting
+from a filesystem format to a character input format.
+The function takes two arguments: @var{fname}, the filename to be converted,
+and @var{fnlen}, its length in bytes.
+It must either return its first argument (if no conversion takes place)
+or the converted filename in newly-allocated memory. The converted
+form is used to compare against the word to be completed, and, if it
+matches, is added to the list of matches. Readline will free the
+allocated string.
@end deftypevar
@deftypevar {rl_compdisp_func_t *} rl_completion_display_matches_hook
@@ -1822,6 +1914,15 @@ if the application's completion function returns no matches.
It should be set only by an application's completion function.
@end deftypevar
+@deftypevar int rl_sort_completion_matches
+If an application sets this variable to 0, Readline will not sort the
+list of completions (which implies that it cannot remove any duplicate
+completions). The default value is 1, which means that Readline will
+sort the completions and, depending on the value of
+@code{rl_ignore_completion_duplicates}, will attempt to remove duplicate
+matches.
+@end deftypevar
+
@deftypevar int rl_completion_type
Set to a character describing the type of completion Readline is currently
attempting; see the description of @code{rl_complete_internal()}
@@ -1831,6 +1932,13 @@ completion function is called, allowing such functions to present
the same interface as @code{rl_complete()}.
@end deftypevar
+@deftypevar int rl_completion_invoking_key
+Set to the final character in the key sequence that invoked one of the
+completion functions that call @code{rl_complete_internal()}. This is
+set to the appropriate value before any application-specific completion
+function is called.
+@end deftypevar
+
@deftypevar int rl_inhibit_completion
If this variable is non-zero, completion is inhibited. The completion
character will be inserted as any other bound to @code{self-insert}.
@@ -1851,27 +1959,51 @@ history list.
GNU Readline library. This application interactively allows users
to manipulate files and their modes. */
-#include <stdio.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <sys/types.h>
-#include <sys/file.h>
+#ifdef HAVE_SYS_FILE_H
+# include <sys/file.h>
+#endif
#include <sys/stat.h>
-#include <sys/errno.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <errno.h>
+
+#if defined (HAVE_STRING_H)
+# include <string.h>
+#else /* !HAVE_STRING_H */
+# include <strings.h>
+#endif /* !HAVE_STRING_H */
+
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#include <time.h>
#include <readline/readline.h>
#include <readline/history.h>
-extern char *xmalloc ();
+extern char *xmalloc PARAMS((size_t));
/* The names of functions that actually do the manipulation. */
-int com_list __P((char *));
-int com_view __P((char *));
-int com_rename __P((char *));
-int com_stat __P((char *));
-int com_pwd __P((char *));
-int com_delete __P((char *));
-int com_help __P((char *));
-int com_cd __P((char *));
-int com_quit __P((char *));
+int com_list PARAMS((char *));
+int com_view PARAMS((char *));
+int com_rename PARAMS((char *));
+int com_stat PARAMS((char *));
+int com_pwd PARAMS((char *));
+int com_delete PARAMS((char *));
+int com_help PARAMS((char *));
+int com_cd PARAMS((char *));
+int com_quit PARAMS((char *));
/* A structure which contains information on the commands this program
can understand. */
@@ -1904,12 +2036,12 @@ COMMAND *find_command ();
/* The name of this program, as taken from argv[0]. */
char *progname;
-/* When non-zero, this means the user is done using this program. */
+/* When non-zero, this global means the user is done using this program. */
int done;
char *
dupstr (s)
- int s;
+ char *s;
@{
char *r;
@@ -2034,12 +2166,12 @@ stripwhite (string)
/* */
/* **************************************************************** */
-char *command_generator __P((const char *, int));
-char **fileman_completion __P((const char *, int, int));
+char *command_generator PARAMS((const char *, int));
+char **fileman_completion PARAMS((const char *, int, int));
-/* Tell the GNU Readline library how to complete. We want to try to
- complete on command names if this is the first word in the line, or
- on filenames if not. */
+/* Tell the GNU Readline library how to complete. We want to try to complete
+ on command names if this is the first word in the line, or on filenames
+ if not. */
initialize_readline ()
@{
/* Allow conditional parsing of the ~/.inputrc file. */
@@ -2049,11 +2181,11 @@ initialize_readline ()
rl_attempted_completion_function = fileman_completion;
@}
-/* Attempt to complete on the contents of TEXT. START and END
- bound the region of rl_line_buffer that contains the word to
- complete. TEXT is the word to complete. We can use the entire
- contents of rl_line_buffer in case we want to do some simple
- parsing. Returnthe array of matches, or NULL if there aren't any. */
+/* Attempt to complete on the contents of TEXT. START and END bound the
+ region of rl_line_buffer that contains the word to complete. TEXT is
+ the word to complete. We can use the entire contents of rl_line_buffer
+ in case we want to do some simple parsing. Return the array of matches,
+ or NULL if there aren't any. */
char **
fileman_completion (text, start, end)
const char *text;
@@ -2072,9 +2204,9 @@ fileman_completion (text, start, end)
return (matches);
@}
-/* Generator function for command completion. STATE lets us
- know whether to start from scratch; without any state
- (i.e. STATE == 0), then we start at the top of the list. */
+/* Generator function for command completion. STATE lets us know whether
+ to start from scratch; without any state (i.e. STATE == 0), then we
+ start at the top of the list. */
char *
command_generator (text, state)
const char *text;
@@ -2083,17 +2215,16 @@ command_generator (text, state)
static int list_index, len;
char *name;
- /* If this is a new word to complete, initialize now. This
- includes saving the length of TEXT for efficiency, and
- initializing the index variable to 0. */
+ /* If this is a new word to complete, initialize now. This includes
+ saving the length of TEXT for efficiency, and initializing the index
+ variable to 0. */
if (!state)
@{
list_index = 0;
len = strlen (text);
@}
- /* Return the next name which partially matches from the
- command list. */
+ /* Return the next name which partially matches from the command list. */
while (name = commands[list_index].name)
@{
list_index++;
@@ -2133,7 +2264,12 @@ com_view (arg)
if (!valid_argument ("view", arg))
return 1;
+#if defined (__MSDOS__)
+ /* more.com doesn't grok slashes in pathnames */
+ sprintf (syscom, "less %s", arg);
+#else
sprintf (syscom, "more %s", arg);
+#endif
return (system (syscom));
@}
@@ -2160,7 +2296,8 @@ com_stat (arg)
printf ("Statistics for `%s':\n", arg);
- printf ("%s has %d link%s, and is %d byte%s in length.\n", arg,
+ printf ("%s has %d link%s, and is %d byte%s in length.\n",
+ arg,
finfo.st_nlink,
(finfo.st_nlink == 1) ? "" : "s",
finfo.st_size,
@@ -2249,8 +2386,7 @@ com_pwd (ignore)
return 0;
@}
-/* The user wishes to quit using this program. Just set DONE
- non-zero. */
+/* The user wishes to quit using this program. Just set DONE non-zero. */
com_quit (arg)
char *arg;
@{
@@ -2263,13 +2399,12 @@ too_dangerous (caller)
char *caller;
@{
fprintf (stderr,
- "%s: Too dangerous for me to distribute.\n",
+ "%s: Too dangerous for me to distribute. Write it yourself.\n",
caller);
- fprintf (stderr, "Write it yourself.\n");
@}
-/* Return non-zero if ARG is a valid argument for CALLER,
- else print an error message and return zero. */
+/* Return non-zero if ARG is a valid argument for CALLER, else print
+ an error message and return zero. */
int
valid_argument (caller, arg)
char *caller, *arg;
diff --git a/readline/doc/rluser.texi b/readline/doc/rluser.texi
index 478b41f..8a69c99 100644
--- a/readline/doc/rluser.texi
+++ b/readline/doc/rluser.texi
@@ -1,7 +1,6 @@
@comment %**start of header (This is for running Texinfo on a region.)
@setfilename rluser.info
@comment %**end of header (This is for running Texinfo on a region.)
-@setchapternewpage odd
@ignore
This file documents the end user interface to the GNU command line
@@ -10,7 +9,7 @@ use these features. There is a document entitled "readline.texinfo"
which contains both end-user and programmer documentation for the
GNU Readline Library.
-Copyright (C) 1988-2005 Free Software Foundation, Inc.
+Copyright (C) 1988--2011 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
@@ -48,6 +47,16 @@ command line editing interface.
@ifset BashFeatures
Command line editing is provided by the Readline library, which is
used by several different programs, including Bash.
+Command line editing is enabled by default when using an interactive shell,
+unless the @option{--noediting} option is supplied at shell invocation.
+Line editing is also used when using the @option{-e} option to the
+@code{read} builtin command (@pxref{Bash Builtins}).
+By default, the line editing commands are similar to those of Emacs.
+A vi-style line editing interface is also available.
+Line editing can be enabled at any time using the @option{-o emacs} or
+@option{-o vi} options to the @code{set} builtin command
+(@pxref{The Set Builtin}), or disabled using the @option{+o emacs} or
+@option{+o vi} options to @code{set}.
@end ifset
@menu
@@ -336,7 +345,9 @@ file is taken from the value of the shell variable @env{INPUTRC}. If
@ifclear BashFeatures
file is taken from the value of the environment variable @env{INPUTRC}. If
@end ifclear
-that variable is unset, the default is @file{~/.inputrc}.
+that variable is unset, the default is @file{~/.inputrc}. If that
+file does not exist or cannot be read, the ultimate default is
+@file{/etc/inputrc}.
When a program which uses the Readline library starts up, the
init file is read, and the key bindings are set.
@@ -420,11 +431,34 @@ The string to insert at the beginning of the line when the
@code{insert-comment} command is executed. The default value
is @code{"#"}.
+@item completion-display-width
+@vindex completion-display-width
+The number of screen columns used to display possible matches
+when performing completion.
+The value is ignored if it is less than 0 or greater than the terminal
+screen width.
+A value of 0 will cause matches to be displayed one per line.
+The default value is -1.
+
@item completion-ignore-case
+@vindex completion-ignore-case
If set to @samp{on}, Readline performs filename matching and completion
in a case-insensitive fashion.
The default value is @samp{off}.
+@item completion-map-case
+@vindex completion-map-case
+If set to @samp{on}, and @var{completion-ignore-case} is enabled, Readline
+treats hyphens (@samp{-}) and underscores (@samp{_}) as equivalent when
+performing case-insensitive filename matching and completion.
+
+@item completion-prefix-display-length
+@vindex completion-prefix-display-length
+The length in characters of the common prefix of a list of possible
+completions that is displayed without modification. When set to a
+value greater than zero, common prefixes longer than this value are
+replaced with an ellipsis when displaying possible completions.
+
@item completion-query-items
@vindex completion-query-items
The number of possible completions that determines when the user is
@@ -456,12 +490,23 @@ key bindings is used. By default, Readline starts up in Emacs editing
mode, where the keystrokes are most similar to Emacs. This variable can be
set to either @samp{emacs} or @samp{vi}.
+@item echo-control-characters
+When set to @samp{on}, on operating systems that indicate they support it,
+readline echoes a character corresponding to a signal generated from the
+keyboard. The default is @samp{on}.
+
@item enable-keypad
@vindex enable-keypad
When set to @samp{on}, Readline will try to enable the application
keypad when it is called. Some systems need this to enable the
arrow keys. The default is @samp{off}.
+@item enable-meta-key
+When set to @samp{on}, Readline will try to enable any meta modifier
+key the terminal claims to support when it is called. On many terminals,
+the meta key is used to send eight-bit characters.
+The default is @samp{on}.
+
@item expand-tilde
@vindex expand-tilde
If set to @samp{on}, tilde expansion is performed when Readline
@@ -469,10 +514,16 @@ attempts word completion. The default is @samp{off}.
@item history-preserve-point
@vindex history-preserve-point
-If set to @samp{on}, the history code attempts to place point at the
+If set to @samp{on}, the history code attempts to place the point (the
+current cursor position) at the
same location on each history line retrieved with @code{previous-history}
or @code{next-history}. The default is @samp{off}.
+@item history-size
+@vindex history-size
+Set the maximum number of history entries saved in the history list. If
+set to zero, the number of entries in the history list is not limited.
+
@item horizontal-scroll-mode
@vindex horizontal-scroll-mode
This variable can be set to either @samp{on} or @samp{off}. Setting it
@@ -535,10 +586,17 @@ The default is @samp{off}.
@vindex match-hidden-files
This variable, when set to @samp{on}, causes Readline to match files whose
names begin with a @samp{.} (hidden files) when performing filename
-completion, unless the leading @samp{.} is
+completion.
+If set to @samp{off}, the leading @samp{.} must be
supplied by the user in the filename to be completed.
This variable is @samp{on} by default.
+@item menu-complete-display-prefix
+@vindex menu-complete-display-prefix
+If set to @samp{on}, menu completion displays the common prefix of the
+list of possible completions (which may be empty) before cycling through
+the list. The default is @samp{off}.
+
@item output-meta
@vindex output-meta
If set to @samp{on}, Readline will display characters with the
@@ -556,6 +614,13 @@ If set to @samp{on}, Readline will display completions with matches
sorted horizontally in alphabetical order, rather than down the screen.
The default is @samp{off}.
+@item revert-all-at-newline
+@vindex revert-all-at-newline
+If set to @samp{on}, Readline will undo all changes to history lines
+before returning when @code{accept-line} is executed. By default,
+history lines may be modified and retain individual undo lists across
+calls to @code{readline}. The default is @samp{off}.
+
@item show-all-if-ambiguous
@vindex show-all-if-ambiguous
This alters the default behavior of the completion functions. If
@@ -575,6 +640,20 @@ a common prefix) cause the matches to be listed immediately instead
of ringing the bell.
The default value is @samp{off}.
+@item skip-completed-text
+@vindex skip-completed-text
+If set to @samp{on}, this alters the default completion behavior when
+inserting a single match into the line. It's only active when
+performing completion in the middle of a word. If enabled, readline
+does not insert characters from the completion that match characters
+after point in the word being completed, so portions of the word
+following the cursor are not duplicated.
+For instance, if this is enabled, attempting completion when the cursor
+is after the @samp{e} in @samp{Makefile} will result in @samp{Makefile}
+rather than @samp{Makefilefile}, assuming there is a single possible
+completion.
+The default value is @samp{off}.
+
@item visible-stats
@vindex visible-stats
If set to @samp{on}, a character denoting a file's type
@@ -593,9 +672,11 @@ the command does.
Once you know the name of the command, simply place on a line
in the init file the name of the key
you wish to bind the command to, a colon, and then the name of the
-command. The name of the key
-can be expressed in different ways, depending on what you find most
-comfortable.
+command.
+There can be no space between the key name and the colon -- that will be
+interpreted as part of the key name.
+The name of the key can be expressed in different ways, depending on
+what you find most comfortable.
In addition to command names, readline allows keys to be bound
to a string that is inserted when the key is pressed (a @var{macro}).
@@ -937,12 +1018,22 @@ Move forward a character.
Move back a character.
@item forward-word (M-f)
-Move forward to the end of the next word. Words are composed of
-letters and digits.
+Move forward to the end of the next word.
+Words are composed of letters and digits.
@item backward-word (M-b)
-Move back to the start of the current or previous word. Words are
-composed of letters and digits.
+Move back to the start of the current or previous word.
+Words are composed of letters and digits.
+
+@ifset BashFeatures
+@item shell-forward-word ()
+Move forward to the end of the next word.
+Words are delimited by non-quoted shell metacharacters.
+
+@item shell-backward-word ()
+Move back to the start of the current or previous word.
+Words are delimited by non-quoted shell metacharacters.
+@end ifset
@item clear-screen (C-l)
Clear the screen and redraw the current line,
@@ -1029,10 +1120,14 @@ as if the @samp{!@var{n}} history expansion had been specified.
@item yank-last-arg (M-. or M-_)
Insert last argument to the previous command (the last word of the
-previous history entry). With an
-argument, behave exactly like @code{yank-nth-arg}.
+previous history entry).
+With a numeric argument, behave exactly like @code{yank-nth-arg}.
Successive calls to @code{yank-last-arg} move back through the history
-list, inserting the last argument of each line in turn.
+list, inserting the last word (or the word specified by the argument to
+the first call) of each line in turn.
+Any numeric argument supplied to these successive calls determines
+the direction to move through the history. A negative argument switches
+the direction through the history (back or forward).
The history expansion facilities are used to extract the last argument,
as if the @samp{!$} history expansion had been specified.
@@ -1138,6 +1233,17 @@ Word boundaries are the same as @code{forward-word}.
Kill the word behind point.
Word boundaries are the same as @code{backward-word}.
+@ifset BashFeatures
+@item shell-kill-word ()
+Kill from point to the end of the current word, or if between
+words, to the end of the next word.
+Word boundaries are the same as @code{shell-forward-word}.
+
+@item shell-backward-kill-word ()
+Kill the word behind point.
+Word boundaries are the same as @code{shell-backward-word}.
+@end ifset
+
@item unix-word-rubout (C-w)
Kill the word behind point, using white space as a word boundary.
The killed text is saved on the kill-ring.
@@ -1219,6 +1325,9 @@ The default is filename completion.
@item possible-completions (M-?)
List the possible completions of the text before point.
+When displaying completions, Readline sets the number of columns used
+for display to the value of @code{completion-display-width}, the value of
+the environment variable @env{COLUMNS}, or the screen width, in that order.
@item insert-completions (M-*)
Insert all completions of the text before point that would have
@@ -1238,6 +1347,11 @@ through the list.
This command is intended to be bound to @key{TAB}, but is unbound
by default.
+@item menu-complete-backward ()
+Identical to @code{menu-complete}, but moves backward through the list
+of possible completions, as if @code{menu-complete} had been given a
+negative argument.
+
@item delete-char-or-list ()
Deletes the character under the cursor if not at the beginning or
end of the line (like @code{delete-char}).
@@ -1293,6 +1407,11 @@ Attempt completion on the text before point, comparing
the text against lines from the history list for possible
completion matches.
+@item dabbrev-expand ()
+Attempt menu completion on the text before point, comparing
+the text against lines from the history list for possible
+completion matches.
+
@item complete-into-braces (M-@{)
Perform filename completion and insert the list of possible completions
enclosed within braces so the list is available to the shell
@@ -1372,6 +1491,15 @@ A character is read and point is moved to the previous occurrence
of that character. A negative count searches for subsequent
occurrences.
+@item skip-csi-sequence ()
+Read enough characters to consume a multi-key sequence such as those
+defined for keys like Home and End. Such sequences begin with a
+Control Sequence Indicator (CSI), usually ESC-[. If this sequence is
+bound to "\e[", keys producing such sequences will have no effect
+unless explicitly bound to a readline command, instead of inserting
+stray characters into the editing buffer. This is unbound by default,
+but usually bound to ESC-[.
+
@item insert-comment (M-#)
Without a numeric argument, the value of the @code{comment-begin}
variable is inserted at the beginning of the current line.
@@ -1481,7 +1609,7 @@ editing mode.
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. The Readline @code{vi} mode behaves as specified in
-the @sc{posix} 1003.2 standard.
+the @sc{posix} standard.
@ifset BashFeatures
In order to switch interactively between @code{emacs} and @code{vi}
@@ -1515,10 +1643,15 @@ the programmable completion facilities are invoked.
First, the command name is identified.
If a compspec has been defined for that command, the
compspec is used to generate the list of possible completions for the word.
+If the command word is the empty string (completion attempted at the
+beginning of an empty line), any compspec defined with
+the @option{-E} option to @code{complete} is used.
If the command word is a full pathname, a compspec for the full
pathname is searched for first.
If no compspec is found for the full pathname, an attempt is made to
find a compspec for the portion following the final slash.
+If those searches do not result in a compspec, any compspec defined with
+the @option{-D} option to @code{complete} is used as the default.
Once a compspec has been found, it is used to generate the list of
matching words.
@@ -1555,9 +1688,9 @@ completed, and the matching words become the possible completions.
After these matches have been generated, any shell function or command
specified with the @option{-F} and @option{-C} options is invoked.
-When the command or function is invoked, the @env{COMP_LINE} and
-@env{COMP_POINT} variables are assigned values as described above
-(@pxref{Bash Variables}).
+When the command or function is invoked, the @env{COMP_LINE},
+@env{COMP_POINT}, @env{COMP_KEY}, and @env{COMP_TYPE} variables are
+assigned values as described above (@pxref{Bash Variables}).
If a shell function is being invoked, the @env{COMP_WORDS} and
@env{COMP_CWORD} variables are also set.
When the function or command is invoked, the first argument is the
@@ -1570,7 +1703,7 @@ the matches.
Any function specified with @option{-F} is invoked first.
The function may use any of the shell facilities, including the
-@code{compgen} builtin described below
+@code{compgen} and @code{compopt} builtins described below
(@pxref{Programmable Completion Builtins}), to generate the matches.
It must put the possible completions in the @env{COMPREPLY} array
variable.
@@ -1622,6 +1755,30 @@ to completed names which are symbolic links to directories, subject to
the value of the @var{mark-directories} Readline variable, regardless
of the setting of the @var{mark-symlinked-directories} Readline variable.
+There is some support for dynamically modifying completions. This is
+most useful when used in combination with a default completion specified
+with @option{-D}. It's possible for shell functions executed as completion
+handlers to indicate that completion should be retried by returning an
+exit status of 124. If a shell function returns 124, and changes
+the compspec associated with the command on which completion is being
+attempted (supplied as the first argument when the function is executed),
+programmable completion restarts from the beginning, with an
+attempt to find a new compspec for that command. This allows a set of
+completions to be built dynamically as completion is attempted, rather than
+being loaded all at once.
+
+For instance, assuming that there is a library of compspecs, each kept in a
+file corresponding to the name of the command, the following default
+completion function would load completions dynamically:
+
+@example
+_completion_loader()
+@{
+ . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
+@}
+complete -D -F _completion_loader
+@end example
+
@node Programmable Completion Builtins
@section Programmable Completion Builtins
@cindex completion builtins
@@ -1657,10 +1814,10 @@ matches were generated.
@item complete
@btindex complete
@example
-@code{complete [-abcdefgjksuv] [-o @var{comp-option}] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}]
-[-P @var{prefix}] [-S @var{suffix}] [-X @var{filterpat}] [-F @var{function}]
-[-C @var{command}] @var{name} [@var{name} @dots{}]}
-@code{complete -pr [@var{name} @dots{}]}
+@code{complete [-abcdefgjksuv] [-o @var{comp-option}] [-DE] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}]
+[-F @var{function}] [-C @var{command}] [-X @var{filterpat}]
+[-P @var{prefix}] [-S @var{suffix}] @var{name} [@var{name} @dots{}]}
+@code{complete -pr [-DE] [@var{name} @dots{}]}
@end example
Specify how arguments to each @var{name} should be completed.
@@ -1670,9 +1827,16 @@ reused as input.
The @option{-r} option removes a completion specification for
each @var{name}, or, if no @var{name}s are supplied, all
completion specifications.
+The @option{-D} option indicates that the remaining options and actions should
+apply to the ``default'' command completion; that is, completion attempted
+on a command for which no completion has previously been defined.
+The @option{-E} option indicates that the remaining options and actions should
+apply to ``empty'' command completion; that is, completion attempted on a
+blank line.
The process of applying these completion specifications when word completion
-is attempted is described above (@pxref{Programmable Completion}).
+is attempted is described above (@pxref{Programmable Completion}). The
+@option{-D} option takes precedence over @option{-E}.
Other options, if specified, have the following meanings.
The arguments to the @option{-G}, @option{-W}, and @option{-X} options
@@ -1702,9 +1866,10 @@ Perform directory name completion if the compspec generates no matches.
@item filenames
Tell Readline that the compspec generates filenames, so it can perform any
-filename-specific processing (like adding a slash to directory names or
-suppressing trailing spaces). This option is intended to be used with
-shell functions specified with @option{-F}.
+filename-specific processing (like adding a slash to directory names
+quoting special characters, or suppressing trailing spaces).
+This option is intended to be used with shell functions specified
+with @option{-F}.
@item nospace
Tell Readline not to append a space (the default) to words completed at
@@ -1798,17 +1963,6 @@ User names. May also be specified as @option{-u}.
Names of all shell variables. May also be specified as @option{-v}.
@end table
-@item -G @var{globpat}
-The filename expansion pattern @var{globpat} is expanded to generate
-the possible completions.
-
-@item -W @var{wordlist}
-The @var{wordlist} is split using the characters in the
-@env{IFS} special variable as delimiters, and each resultant word
-is expanded.
-The possible completions are the members of the resultant list which
-match the word being completed.
-
@item -C @var{command}
@var{command} is executed in a subshell environment, and its output is
used as the possible completions.
@@ -1819,13 +1973,9 @@ environment.
When it finishes, the possible completions are retrieved from the value
of the @env{COMPREPLY} array variable.
-@item -X @var{filterpat}
-@var{filterpat} is a pattern as used for filename expansion.
-It is applied to the list of possible completions generated by the
-preceding options and arguments, and each completion matching
-@var{filterpat} is removed from the list.
-A leading @samp{!} in @var{filterpat} negates the pattern; in this
-case, any completion not matching @var{filterpat} is removed.
+@item -G @var{globpat}
+The filename expansion pattern @var{globpat} is expanded to generate
+the possible completions.
@item -P @var{prefix}
@var{prefix} is added at the beginning of each possible completion
@@ -1834,6 +1984,21 @@ after all other options have been applied.
@item -S @var{suffix}
@var{suffix} is appended to each possible completion
after all other options have been applied.
+
+@item -W @var{wordlist}
+The @var{wordlist} is split using the characters in the
+@env{IFS} special variable as delimiters, and each resultant word
+is expanded.
+The possible completions are the members of the resultant list which
+match the word being completed.
+
+@item -X @var{filterpat}
+@var{filterpat} is a pattern as used for filename expansion.
+It is applied to the list of possible completions generated by the
+preceding options and arguments, and each completion matching
+@var{filterpat} is removed from the list.
+A leading @samp{!} in @var{filterpat} negates the pattern; in this
+case, any completion not matching @var{filterpat} is removed.
@end table
The return value is true unless an invalid option is supplied, an option
@@ -1842,5 +2007,31 @@ argument, an attempt is made to remove a completion specification for
a @var{name} for which no specification exists, or
an error occurs adding a completion specification.
+@item compopt
+@btindex compopt
+@example
+@code{compopt} [-o @var{option}] [-DE] [+o @var{option}] [@var{name}]
+@end example
+Modify completion options for each @var{name} according to the
+@var{option}s, or for the currently-executing completion if no @var{name}s
+are supplied.
+If no @var{option}s are given, display the completion options for each
+@var{name} or the current completion.
+The possible values of @var{option} are those valid for the @code{complete}
+builtin described above.
+The @option{-D} option indicates that the remaining options should
+apply to the ``default'' command completion; that is, completion attempted
+on a command for which no completion has previously been defined.
+The @option{-E} option indicates that the remaining options should
+apply to ``empty'' command completion; that is, completion attempted on a
+blank line.
+
+The @option{-D} option takes precedence over @option{-E}.
+
+The return value is true unless an invalid option is supplied, an attempt
+is made to modify the options for a @var{name} for which no completion
+specification exists, or an output error occurs.
+
@end table
+
@end ifset
diff --git a/readline/doc/rluserman.texi b/readline/doc/rluserman.texi
index db80b31..3d54520 100644
--- a/readline/doc/rluserman.texi
+++ b/readline/doc/rluserman.texi
@@ -4,8 +4,6 @@
@settitle GNU Readline Library
@comment %**end of header (This is for running Texinfo on a region.)
-@setchapternewpage odd
-
@include version.texi
@copying
@@ -14,7 +12,7 @@ This manual describes the end user interface of the GNU Readline Library
consistency of user interface across discrete programs which provide
a command line interface.
-Copyright @copyright{} 1988-2005 Free Software Foundation, Inc.
+Copyright @copyright{} 1988--2011 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -22,15 +20,16 @@ are preserved on all copies.
@quotation
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 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,''
+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 is
-included in the section entitled ``GNU Free Documentation License.''
+included in the section entitled ``GNU Free Documentation License''.
+
+(a) The FSF's Back-Cover Text is: You are free to copy and modify
+this GNU manual. Buying copies from GNU Press supports the FSF in
+developing GNU and promoting software freedom.''
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software. Copies published by the Free
-Software Foundation raise funds for GNU development.''
@end quotation
@end copying
@@ -70,18 +69,14 @@ programs which provide a command line interface.
@menu
* Command Line Editing:: GNU Readline User's Manual.
-* Copying This Manual:: Copying This Manual.
+* GNU Free Documentation License:: License for copying this manual.
@end menu
@end ifnottex
@include rluser.texi
-@node Copying This Manual
-@appendix Copying This Manual
-
-@menu
-* GNU Free Documentation License:: License for copying this manual.
-@end menu
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
@include fdl.texi
diff --git a/readline/doc/texi2dvi b/readline/doc/texi2dvi
index c0bcc0a..a9165a5 100755
--- a/readline/doc/texi2dvi
+++ b/readline/doc/texi2dvi
@@ -5,20 +5,18 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
# 2002, 2003 Free Software Foundation, Inc.
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can either send email to this
-# program's maintainer or write to: The Free Software Foundation,
-# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Original author: Noah Friedman <friedman@gnu.org>.
#
diff --git a/readline/doc/texi2html b/readline/doc/texi2html
index 7bb8493..9f9c2eb 100755
--- a/readline/doc/texi2html
+++ b/readline/doc/texi2html
@@ -7,20 +7,19 @@
#
# Copyright (C) 1999, 2000 Free Software Foundation, Inc.
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
#-##############################################################################
# This requires perl version 5 or higher
@@ -3564,7 +3563,7 @@ INPUT_LINE: while ($_ = &next_line) {
$name = &normalise_node($name);
$level = $sec2level{$tag};
# check for index
- $first_index_chapter = $name
+ $first_index_chapter = $node
if ($level == 1 && !$first_index_chapter &&
$name =~ /index/i);
if ($in_top && /heading/){
diff --git a/readline/doc/version.texi b/readline/doc/version.texi
index 99816bf..3ee1c10 100644
--- a/readline/doc/version.texi
+++ b/readline/doc/version.texi
@@ -1,10 +1,10 @@
@ignore
-Copyright (C) 1988-2005 Free Software Foundation, Inc.
+Copyright (C) 1988-2011 Free Software Foundation, Inc.
@end ignore
-@set EDITION 5.1-beta1
-@set VERSION 5.1-beta1
-@set UPDATED 11 November 2005
-@set UPDATED-MONTH November 2005
+@set EDITION 6.2
+@set VERSION 6.2
+@set UPDATED September 6 2010
+@set UPDATED-MONTH September 2010
-@set LASTCHANGE Fri Nov 11 19:50:51 EST 2005
+@set LASTCHANGE Mon Sep 6 22:07:10 EDT 2010