summaryrefslogtreecommitdiff
path: root/readline/doc
diff options
context:
space:
mode:
Diffstat (limited to 'readline/doc')
-rw-r--r--readline/doc/Makefile.in25
-rw-r--r--readline/doc/hist.texinfo19
-rw-r--r--readline/doc/hsuser.texinfo4
-rw-r--r--readline/doc/manvers.texinfo6
-rw-r--r--readline/doc/readline.0514
-rw-r--r--readline/doc/readline.343
-rw-r--r--readline/doc/rlman.texinfo19
-rw-r--r--readline/doc/rltech.texinfo163
-rw-r--r--readline/doc/rluser.texinfo50
-rwxr-xr-xreadline/doc/texi2dvi463
-rwxr-xr-xreadline/doc/texi2html144
11 files changed, 933 insertions, 517 deletions
diff --git a/readline/doc/Makefile.in b/readline/doc/Makefile.in
index 2eabb410833..103147292d9 100644
--- a/readline/doc/Makefile.in
+++ b/readline/doc/Makefile.in
@@ -10,6 +10,7 @@ infodir = @infodir@
mandir = @mandir@
man3dir = $(mandir)/man3
+SHELL = @MAKE_SHELL@
RM = rm -f
TEXINPUTDIR = $(srcdir)
@@ -25,9 +26,9 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
RLSRC = $(srcdir)/rlman.texinfo $(srcdir)/rluser.texinfo \
- $(srcdir)/rltech.texinfo
+ $(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo
HISTSRC = $(srcdir)/hist.texinfo $(srcdir)/hsuser.texinfo \
- $(srcdir)/hstech.texinfo
+ $(srcdir)/hstech.texinfo $(srcdir)/manvers.texinfo
# This should be a program that converts troff to an ascii-readable format
NROFF = groff -Tascii
@@ -42,6 +43,8 @@ HTMLOBJ = readline.html history.html
HTMLTOC = readline_toc.html history_toc.html
TEXTOBJ = readline.0
+INTERMEDIATE_OBJ = rlman.dvi hist.dvi
+
CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(HTMLTOC) $(TEXTOBJ)
.SUFFIXES: .0 .3 .ps .txt .dvi
@@ -76,16 +79,14 @@ history.ps: history.dvi
$(DVIPS) history.dvi
readline.html: ${RLSRC}
- $(TEXI2HTML) -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo
- sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman.html > readline.html
- sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman_toc.html > readline_toc.html
- $(RM) rlman.html rlman_toc.html
+ $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo
+ sed -e 's:rlman.html:readline.html:' rlman.html > readline.html
+ $(RM) rlman.html
history.html: ${HISTSRC}
- $(TEXI2HTML) -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo
- sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist.html > history.html
- sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist_toc.html > history_toc.html
- $(RM) hist.html hist_toc.html
+ $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo
+ sed -e 's:hist.html:history.html:' hist.html > history.html
+ $(RM) hist.html
info: $(INFOOBJ)
dvi: $(DVIOBJ)
@@ -101,18 +102,20 @@ clean:
distclean: clean
$(RM) $(CREATED_DOCS)
+ $(RM) $(INTERMEDIATE_OBJ)
$(RM) Makefile
mostlyclean: clean
maintainer-clean: clean
$(RM) $(CREATED_DOCS)
+ $(RM) $(INTERMEDIATE_OBJ)
$(RM) Makefile
installdirs: $(top_srcdir)/support/mkdirs
-$(SHELL) $(top_srcdir)/support/mkdirs $(infodir) $(man3dir)
-install: installdirs info
+install: installdirs
if test -f readline.info; then \
${INSTALL_DATA} readline.info $(infodir)/readline.info; \
else \
diff --git a/readline/doc/hist.texinfo b/readline/doc/hist.texinfo
index be8742f5e66..31a0ba0ae72 100644
--- a/readline/doc/hist.texinfo
+++ b/readline/doc/hist.texinfo
@@ -6,26 +6,19 @@
@setchapternewpage odd
-@ignore
-last change: Thu Apr 2 14:38:22 EST 1998
-@end ignore
-
-@set EDITION 2.2
-@set VERSION 2.2
-@set UPDATED 2 April 1998
-@set UPDATE-MONTH April 1998
+@include manvers.texinfo
+@ifinfo
@dircategory Libraries
@direntry
* History: (history). The GNU history library API
@end direntry
-@ifinfo
This document describes the GNU History library, a programming tool that
provides a consistent user interface for recalling lines of previously
typed input.
-Copyright (C) 1988, 1991, 1993, 1995, 1996, 1998 Free Software Foundation, Inc.
+Copyright (C) 1988-1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -46,7 +39,7 @@ 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,
except that this permission notice may be stated in a translation approved
-by the Foundation.
+by the Free Software Foundation.
@end ifinfo
@titlepage
@@ -77,10 +70,10 @@ 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,
except that this permission notice may be stated in a translation approved
-by the Foundation.
+by the Free Software Foundation.
@vskip 0pt plus 1filll
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+Copyright @copyright{} 1988-1999 Free Software Foundation, Inc.
@end titlepage
@ifinfo
diff --git a/readline/doc/hsuser.texinfo b/readline/doc/hsuser.texinfo
index 7c4582d2ace..76cb63b1eee 100644
--- a/readline/doc/hsuser.texinfo
+++ b/readline/doc/hsuser.texinfo
@@ -117,7 +117,7 @@ history list and history file.
@table @code
@item fc
-@comment btindex fc
+@btindex fc
@example
@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
@@ -149,7 +149,7 @@ 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
-@comment btindex history
+@btindex history
@example
history [-c] [@var{n}]
history [-anrw] [@var{filename}]
diff --git a/readline/doc/manvers.texinfo b/readline/doc/manvers.texinfo
new file mode 100644
index 00000000000..63924e3801d
--- /dev/null
+++ b/readline/doc/manvers.texinfo
@@ -0,0 +1,6 @@
+@set EDITION 4.0
+@set VERSION 4.0
+@set UPDATED 31 December 1998
+@set UPDATE-MONTH December 1998
+
+@set LASTCHANGE Thu Dec 31 10:17:05 EST 1998
diff --git a/readline/doc/readline.0 b/readline/doc/readline.0
index c925d529cb5..970d8c6d0c7 100644
--- a/readline/doc/readline.0
+++ b/readline/doc/readline.0
@@ -8,6 +8,7 @@ NNAAMMEE
readline - get a line from a user with editing
SSYYNNOOPPSSIISS
+ ##iinncclluuddee <<ssttddiioo..hh>>
##iinncclluuddee <<rreeaaddlliinnee..hh>>
##iinncclluuddee <<hhiissttoorryy..hh>>
@@ -57,11 +58,10 @@ NNOOTTAATTIIOONN
ments deviates from this are noted.
When a command is described as _k_i_l_l_i_n_g text, the text
- deleted is saved for possible future retrieval (_y_a_n_k_i_n_g).
-GNU 1998 Feb 19 1
+GNU 1998 Dec 31 1
@@ -70,6 +70,7 @@ GNU 1998 Feb 19 1
READLINE(3) READLINE(3)
+ deleted is saved for possible future retrieval (_y_a_n_k_i_n_g).
The killed text is saved in a _k_i_l_l _r_i_n_g. Consecutive
kills cause the text to be accumulated into one unit,
which can be yanked all at once. Commands which do not
@@ -126,8 +127,7 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
-
-GNU 1998 Feb 19 2
+GNU 1998 Dec 31 2
@@ -193,7 +193,7 @@ READLINE(3) READLINE(3)
-GNU 1998 Feb 19 3
+GNU 1998 Dec 31 3
@@ -259,7 +259,7 @@ READLINE(3) READLINE(3)
-GNU 1998 Feb 19 4
+GNU 1998 Dec 31 4
@@ -274,6 +274,18 @@ READLINE(3) READLINE(3)
for display, scrolling the input horizontally on a
single screen line when it becomes longer than the
screen width rather than wrapping to a new line.
+ iinnppuutt--mmeettaa ((OOffff))
+ If set to OOnn, readline will enable eight-bit input
+ (that is, it will not strip the high bit from the
+ characters it reads), regardless of what the termi-
+ nal claims it can support. The name mmeettaa--ffllaagg is a
+ synonym for this variable.
+ iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[CC--JJ''''))
+ The string of characters that should terminate an
+ incremental search without subsequently executing
+ the character as a command. If this variable has
+ not been given a value, the characters _E_S_C and _C_-_J
+ will terminate an incremental search.
kkeeyymmaapp ((eemmaaccss))
Set the current readline keymap. The set of legal
keymap names is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_,
@@ -288,44 +300,32 @@ READLINE(3) READLINE(3)
mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff))
If set to OOnn, history lines that have been modified
are displayed with a preceding asterisk (**).
- mmeettaa--ffllaagg ((OOffff))
- If set to OOnn, readline will enable eight-bit input
- (that is, it will not strip the high bit from the
- characters it reads), regardless of what the termi-
- nal claims it can support.
oouuttppuutt--mmeettaa ((OOffff))
If set to OOnn, readline will display characters with
- the eighth bit set directly rather than as a meta-
+ the eighth bit set directly rather than as a meta-
prefixed escape sequence.
pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff))
- If set to OOnn, readline will display completions
- with matches sorted horizontally in alphabetical
+ If set to OOnn, readline will display completions
+ with matches sorted horizontally in alphabetical
order, rather than down the screen.
sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff))
- This alters the default behavior of the completion
- functions. If set to oonn, words which have more
- than one possible completion cause the matches to
- be listed immediately instead of ringing the bell.
+ This alters the default behavior of the completion
+ functions. If set to oonn, words which have more
+ than one possible completion cause the matches to
+ be listed immediately instead of ringing the bell.
vviissiibbllee--ssttaattss ((OOffff))
If set to OOnn, a character denoting a file's type as
- reported by ssttaatt(2) is appended to the filename
+ reported by ssttaatt(2) is appended to the filename
when listing possible completions.
CCoonnddiittiioonnaall CCoonnssttrruuccttss
- Readline implements a facility similar in spirit to the
- conditional compilation features of the C preprocessor
- which allows key bindings and variable settings to be per-
- formed as the result of tests. There are four parser
- directives used.
-
- $$iiff The $$iiff construct allows bindings to be made based
- on the editing mode, the terminal being used, or
- the application using readline. The text of the
- test extends to the end of the line; no characters
+ Readline implements a facility similar in spirit to the
+ conditional compilation features of the C preprocessor
+ which allows key bindings and variable settings to be
-GNU 1998 Feb 19 5
+GNU 1998 Dec 31 5
@@ -334,21 +334,28 @@ GNU 1998 Feb 19 5
READLINE(3) READLINE(3)
+ performed as the result of tests. There are four parser
+ directives used.
+
+ $$iiff The $$iiff construct allows bindings to be made based
+ on the editing mode, the terminal being used, or
+ the application using readline. The text of the
+ test extends to the end of the line; no characters
are required to isolate it.
- mmooddee The mmooddee== form of the $$iiff directive is used
- to test whether readline is in emacs or vi
- mode. This may be used in conjunction with
+ mmooddee The mmooddee== form of the $$iiff directive is used
+ to test whether readline is in emacs or vi
+ mode. This may be used in conjunction with
the sseett kkeeyymmaapp command, for instance, to set
- bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and _e_m_a_c_s_-
- _c_t_l_x keymaps only if readline is starting
+ bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and _e_m_a_c_s_-
+ _c_t_l_x keymaps only if readline is starting
out in emacs mode.
tteerrmm The tteerrmm== form may be used to include termi-
- nal-specific key bindings, perhaps to bind
- the key sequences output by the terminal's
- function keys. The word on the right side
- of the == is tested against the full name of
+ nal-specific key bindings, perhaps to bind
+ the key sequences output by the terminal's
+ function keys. The word on the right side
+ of the == is tested against the full name of
the terminal and the portion of the terminal
name before the first --. This allows _s_u_n to
match both _s_u_n and _s_u_n_-_c_m_d, for instance.
@@ -357,12 +364,12 @@ READLINE(3) READLINE(3)
The aapppplliiccaattiioonn construct is used to include
application-specific settings. Each program
using the readline library sets the _a_p_p_l_i_c_a_-
- _t_i_o_n _n_a_m_e, and an initialization file can
- test for a particular value. This could be
+ _t_i_o_n _n_a_m_e, and an initialization file can
+ test for a particular value. This could be
used to bind key sequences to functions use-
- ful for a specific program. For instance,
- the following command adds a key sequence
- that quotes the current or previous word in
+ ful for a specific program. For instance,
+ the following command adds a key sequence
+ that quotes the current or previous word in
Bash:
$$iiff bash
@@ -373,25 +380,18 @@ READLINE(3) READLINE(3)
$$eennddiiff This command, as seen in the previous example, ter-
minates an $$iiff command.
- $$eellssee Commands in this branch of the $$iiff directive are
+ $$eellssee Commands in this branch of the $$iiff directive are
executed if the test fails.
$$iinncclluuddee
- This directive takes a single filename as an argu-
- ment and reads commands and bindings from that
- file. For example, the following directive would
+ This directive takes a single filename as an argu-
+ ment and reads commands and bindings from that
+ file. For example, the following directive would
read _/_e_t_c_/_i_n_p_u_t_r_c:
- $$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c
-
-SSEEAARRCCHHIINNGG
- Readline provides commands for searching through the com-
- mand history for lines containing a specified string.
- There are two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-
-
-GNU 1998 Feb 19 6
+GNU 1998 Dec 31 6
@@ -400,36 +400,44 @@ GNU 1998 Feb 19 6
READLINE(3) READLINE(3)
- _i_n_c_r_e_m_e_n_t_a_l.
+ $$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c
+
+SSEEAARRCCHHIINNGG
+ Readline provides commands for searching through the com-
+ mand history for lines containing a specified string.
+ There are two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-_i_n_c_r_e_m_e_n_-
+ _t_a_l.
- Incremental searches begin before the user has finished
+ Incremental searches begin before the user has finished
typing the search string. As each character of the search
string is typed, readline displays the next entry from the
- history matching the string typed so far. An incremental
- search requires only as many characters as needed to find
- the desired history entry. The Escape character is used
- to terminate an incremental search. Control-J will also
- terminate the search. Control-G will abort an incremental
- search and restore the original line. When the search is
- terminated, the history entry containing the search string
- becomes the current line. To find other matching entries
- in the history list, type Control-S or Control-R as appro-
- priate. This will search backward or forward in the his-
- tory for the next line matching the search string typed so
- far. Any other key sequence bound to a readline command
- will terminate the search and execute that command. For
- instance, a _n_e_w_l_i_n_e will terminate the search and accept
- the line, thereby executing the command from the history
- list.
-
- Non-incremental searches read the entire search string
+ history matching the string typed so far. An incremental
+ search requires only as many characters as needed to find
+ the desired history entry. The characters present in the
+ value of the _i_s_e_a_r_c_h_-_t_e_r_m_i_n_a_t_o_r_s variable are used to ter-
+ minate an incremental search. If that variable has not
+ been assigned a value the Escape and Control-J characters
+ will terminate an incremental search. Control-G will
+ abort an incremental search and restore the original line.
+ When the search is terminated, the history entry contain-
+ ing the search string becomes the current line. To find
+ other matching entries in the history list, type Control-S
+ or Control-R as appropriate. This will search backward or
+ forward in the history for the next line matching the
+ search string typed so far. Any other key sequence bound
+ to a readline command will terminate the search and exe-
+ cute that command. For instance, a _n_e_w_l_i_n_e will terminate
+ the search and accept the line, thereby executing the com-
+ mand from the history list.
+
+ Non-incremental searches read the entire search string
before starting to search for matching history lines. The
- search string may be typed by the user or be part of the
+ search string may be typed by the user or be part of the
contents of the current line.
EEDDIITTIINNGG CCOOMMMMAANNDDSS
- The following is a list of the names of the commands and
- the default key sequences to which they are bound. Com-
+ The following is a list of the names of the commands and
+ the default key sequences to which they are bound. Com-
mand names without an accompanying key sequence are
unbound by default.
@@ -443,21 +451,13 @@ EEDDIITTIINNGG CCOOMMMMAANNDDSS
bbaacckkwwaarrdd--cchhaarr ((CC--bb))
Move back a character.
ffoorrwwaarrdd--wwoorrdd ((MM--ff))
- Move forward to the end of the next word. Words
- are composed of alphanumeric characters (letters
+ Move forward to the end of the next word. Words
+ are composed of alphanumeric characters (letters
and digits).
- bbaacckkwwaarrdd--wwoorrdd ((MM--bb))
- Move back to the start of this, or the previous,
- word. Words are composed of alphanumeric charac-
- ters (letters and digits).
- cclleeaarr--ssccrreeeenn ((CC--ll))
- Clear the screen leaving the current line at the
- top of the screen. With an argument, refresh the
- current line without clearing the screen.
-GNU 1998 Feb 19 7
+GNU 1998 Dec 31 7
@@ -466,64 +466,64 @@ GNU 1998 Feb 19 7
READLINE(3) READLINE(3)
+ bbaacckkwwaarrdd--wwoorrdd ((MM--bb))
+ Move back to the start of this, or the previous,
+ word. Words are composed of alphanumeric charac-
+ ters (letters and digits).
+ cclleeaarr--ssccrreeeenn ((CC--ll))
+ Clear the screen leaving the current line at the
+ top of the screen. With an argument, refresh the
+ current line without clearing the screen.
rreeddrraaww--ccuurrrreenntt--lliinnee
Refresh the current line.
CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy
aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn))
- Accept the line regardless of where the cursor is.
- If this line is non-empty, add it to the history
- list. If the line is a modified history line, then
+ Accept the line regardless of where the cursor is.
+ If this line is non-empty, add it to the history
+ list. If the line is a modified history line, then
restore the history line to its original state.
pprreevviioouuss--hhiissttoorryy ((CC--pp))
- Fetch the previous command from the history list,
+ Fetch the previous command from the history list,
moving back in the list.
nneexxtt--hhiissttoorryy ((CC--nn))
- Fetch the next command from the history list, mov-
+ Fetch the next command from the history list, mov-
ing forward in the list.
bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<))
Move to the first line in the history.
eenndd--ooff--hhiissttoorryy ((MM-->>))
- Move to the end of the input history, i.e., the
+ Move to the end of the input history, i.e., the
line currently being entered.
rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr))
- Search backward starting at the current line and
+ Search backward starting at the current line and
moving `up' through the history as necessary. This
is an incremental search.
ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss))
- Search forward starting at the current line and
- moving `down' through the history as necessary.
+ Search forward starting at the current line and
+ moving `down' through the history as necessary.
This is an incremental search.
nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp))
Search backward through the history starting at the
- current line using a non-incremental search for a
+ current line using a non-incremental search for a
string supplied by the user.
nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn))
- Search forward through the history using a non-
- incremental search for a string supplied by the
+ Search forward through the history using a non-
+ incremental search for a string supplied by the
user.
hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd
- Search forward through the history for the string
+ Search forward through the history for the string
of characters between the start of the current line
- and the current cursor position (the _p_o_i_n_t). This
+ and the current cursor position (the _p_o_i_n_t). This
is a non-incremental search.
hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd
- Search backward through the history for the string
+ Search backward through the history for the string
of characters between the start of the current line
and the point. This is a non-incremental search.
- yyaannkk--nntthh--aarrgg ((MM--CC--yy))
- Insert the first argument to the previous command
- (usually the second word on the previous line) at
- point (the current cursor position). With an argu-
- ment _n, insert the _nth word from the previous com-
- mand (the words in the previous command begin with
- word 0). A negative argument inserts the _nth word
- from the end of the previous command.
-GNU 1998 Feb 19 8
+GNU 1998 Dec 31 8
@@ -532,24 +532,37 @@ GNU 1998 Feb 19 8
READLINE(3) READLINE(3)
+ yyaannkk--nntthh--aarrgg ((MM--CC--yy))
+ Insert the first argument to the previous command
+ (usually the second word on the previous line) at
+ point (the current cursor position). With an argu-
+ ment _n, insert the _nth word from the previous com-
+ mand (the words in the previous command begin with
+ word 0). A negative argument inserts the _nth word
+ from the end of the previous command.
yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__))
- Insert the last argument to the previous command
- (the last word of the previous history entry).
+ Insert the last argument to the previous command
+ (the last word of the previous history entry).
With an argument, behave exactly like yyaannkk--nntthh--aarrgg.
Successive calls to yyaannkk--llaasstt--aarrgg move back through
- the history list, inserting the last argument of
+ the history list, inserting the last argument of
each line in turn.
CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt
ddeelleettee--cchhaarr ((CC--dd))
Delete the character under the cursor. If point is
- at the beginning of the line, there are no charac-
- ters in the line, and the last character typed was
+ at the beginning of the line, there are no charac-
+ ters in the line, and the last character typed was
not bound to BBddeelleettee--cchhaarr, then return EEOOFF.
bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt))
Delete the character behind the cursor. When given
- a numeric argument, save the deleted text on the
+ a numeric argument, save the deleted text on the
kill ring.
+ ffoorrwwaarrdd--bbaacckkwwaarrdd--ddeelleettee--cchhaarr
+ Delete the character under the cursor, unless the
+ cursor is at the end of the line, in which case the
+ character behind the cursor is deleted. By
+ default, this is not bound to a key.
qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv))
Add the next character that you type to the line
verbatim. This is how to insert characters like
@@ -572,6 +585,19 @@ READLINE(3) READLINE(3)
Uppercase the current (or following) word. With a
negative argument, uppercase the previous word, but
do not move point.
+
+
+
+
+GNU 1998 Dec 31 9
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
ddoowwnnccaassee--wwoorrdd ((MM--ll))
Lowercase the current (or following) word. With a
negative argument, lowercase the previous word, but
@@ -585,19 +611,6 @@ READLINE(3) READLINE(3)
kkiillll--lliinnee ((CC--kk))
Kill the text from the current cursor position to
the end of the line.
-
-
-
-
-GNU 1998 Feb 19 9
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt))
Kill backward to the beginning of the line.
uunniixx--lliinnee--ddiissccaarrdd ((CC--uu))
@@ -639,6 +652,18 @@ READLINE(3) READLINE(3)
Rotate the kill ring, and yank the new top. Only
works following yyaannkk or yyaannkk--ppoopp.
+
+
+
+GNU 1998 Dec 31 10
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
NNuummeerriicc AArrgguummeennttss
ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----))
Add this digit to the argument already accumulat-
@@ -651,20 +676,8 @@ READLINE(3) READLINE(3)
define the argument. If the command is followed by
digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the
numeric argument, but is otherwise ignored. As a
- special case, if this command is immediately
-
-
-
-GNU 1998 Feb 19 10
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- followed by a character that is neither a digit or
+ special case, if this command is immediately fol-
+ lowed by a character that is neither a digit or
minus sign, the argument count for the next command
is multiplied by four. The argument count is ini-
tially one, so executing this function the first
@@ -705,30 +718,36 @@ READLINE(3) READLINE(3)
the list. This command is intended to be bound to
TTAABB, but is unbound by default.
- KKeeyybbooaarrdd MMaaccrrooss
- ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (())
- Begin saving the characters typed into the current
- keyboard macro.
- eenndd--kkbbdd--mmaaccrroo ((CC--xx ))))
- Stop saving the characters typed into the current
- keyboard macro and store the definition.
- ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee))
- Re-execute the last keyboard macro defined, by mak-
- ing the characters in the macro appear as if typed
- at the keyboard.
+GNU 1998 Dec 31 11
-GNU 1998 Feb 19 11
+READLINE(3) READLINE(3)
-READLINE(3) READLINE(3)
+ ddeelleettee--cchhaarr--oorr--lliisstt
+ Deletes the character under the cursor if not at
+ the beginning or end of the line (like ddeelleettee--
+ cchhaarr). If at the end of the line, behaves identi-
+ cally to ppoossssiibbllee--ccoommpplleettiioonnss. This command is
+ unbound by default.
+ KKeeyybbooaarrdd MMaaccrrooss
+ ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (())
+ Begin saving the characters typed into the current
+ keyboard macro.
+ eenndd--kkbbdd--mmaaccrroo ((CC--xx ))))
+ Stop saving the characters typed into the current
+ keyboard macro and store the definition.
+ ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee))
+ Re-execute the last keyboard macro defined, by mak-
+ ing the characters in the macro appear as if typed
+ at the keyboard.
MMiisscceellllaanneeoouuss
rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr))
@@ -753,7 +772,7 @@ READLINE(3) READLINE(3)
Undo all changes made to this line. This is like
executing the uunnddoo command enough times to return
the line to its initial state.
- ttiillddee--eexxppaanndd ((MM--~~))
+ ttiillddee--eexxppaanndd ((MM--&&))
Perform tilde expansion on the current word.
sseett--mmaarrkk ((CC--@@,, MM--<<ssppaaccee>>))
Set the mark to the current point. If a numeric
@@ -765,6 +784,18 @@ READLINE(3) READLINE(3)
cursor position is saved as the mark.
cchhaarraacctteerr--sseeaarrcchh ((CC--]]))
A character is read and point is moved to the next
+
+
+
+GNU 1998 Dec 31 12
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
occurrence of that character. A negative count
searches for previous occurrences.
cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]]))
@@ -783,20 +814,8 @@ READLINE(3) READLINE(3)
ment is supplied, the output is formatted in such a
way that it can be made part of an _i_n_p_u_t_r_c file.
dduummpp--vvaarriiaabblleess
- Print all of the settable variables and their
-
-
-
-GNU 1998 Feb 19 12
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- values to the readline output stream. If a numeric
+ Print all of the settable variables and their val-
+ ues to the readline output stream. If a numeric
argument is supplied, the output is formatted in
such a way that it can be made part of an _i_n_p_u_t_r_c
file.
@@ -830,6 +849,19 @@ DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS
the bell (subject to the setting of the bbeellll--ssttyyllee vari-
able).
+
+
+
+
+GNU 1998 Dec 31 13
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
EEmmaaccss MMooddee
Emacs Standard bindings
@@ -850,18 +882,6 @@ DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS
"C-P" previous-history
"C-Q" quoted-insert
"C-R" reverse-search-history
-
-
-
-GNU 1998 Feb 19 13
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
"C-S" forward-search-history
"C-T" transpose-chars
"C-U" unix-line-discard
@@ -896,6 +916,18 @@ READLINE(3) READLINE(3)
"M-1" digit-argument
"M-2" digit-argument
"M-3" digit-argument
+
+
+
+GNU 1998 Dec 31 14
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
"M-4" digit-argument
"M-5" digit-argument
"M-6" digit-argument
@@ -916,18 +948,6 @@ READLINE(3) READLINE(3)
"M-R" revert-line
"M-T" transpose-words
"M-U" upcase-word
-
-
-
-GNU 1998 Feb 19 14
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
"M-Y" yank-pop
"M-\" delete-horizontal-space
"M-~" tilde-expand
@@ -962,6 +982,18 @@ READLINE(3) READLINE(3)
"C-W" unix-word-rubout
"C-Y" yank
"C-[" vi-movement-mode
+
+
+
+GNU 1998 Dec 31 15
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
"C-_" undo
" " to "~" self-insert
"C-?" backward-delete-char
@@ -982,18 +1014,6 @@ READLINE(3) READLINE(3)
"C-R" reverse-search-history
"C-S" forward-search-history
"C-T" transpose-chars
-
-
-
-GNU 1998 Feb 19 15
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
"C-U" unix-line-discard
"C-V" quoted-insert
"C-W" unix-word-rubout
@@ -1028,6 +1048,18 @@ READLINE(3) READLINE(3)
"S" vi-subst
"T" vi-char-search
"U" revert-line
+
+
+
+GNU 1998 Dec 31 16
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
"W" vi-next-word
"X" backward-delete-char
"Y" vi-yank-to
@@ -1048,18 +1080,6 @@ READLINE(3) READLINE(3)
"l" forward-char
"m" vi-set-mark
"n" vi-search-again
-
-
-
-GNU 1998 Feb 19 16
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
"p" vi-put
"r" vi-change-char
"s" vi-subst
@@ -1094,6 +1114,18 @@ BBUUGG RREEPPOORRTTSS
library that you have.
Once you have determined that a bug actually exists, mail
+
+
+
+GNU 1998 Dec 31 17
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
a bug report to _b_u_g_-_r_e_a_d_l_i_n_e@_g_n_u_._o_r_g. If you have a fix,
you are welcome to mail that as well! Suggestions and
`philosophical' bug reports may be mailed to _b_u_g_-_r_e_a_d_-
@@ -1117,6 +1149,40 @@ BBUUGGSS
-GNU 1998 Feb 19 17
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+GNU 1998 Dec 31 18
diff --git a/readline/doc/readline.3 b/readline/doc/readline.3
index bb9f7590258..6b36f2f5695 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: Thu Feb 19 10:26:47 EST 1998
+.\" Last Change: Thu Dec 31 10:16:30 EST 1998
.\"
-.TH READLINE 3 "1998 Feb 19" GNU
+.TH READLINE 3 "1998 Dec 31" GNU
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@@ -22,6 +22,7 @@ readline \- get a line from a user with editing
.LP
.nf
.ft B
+#include <stdio.h>
#include <readline.h>
#include <history.h>
.ft
@@ -380,6 +381,19 @@ When set to \fBOn\fP, makes readline use a single line for display,
scrolling the input horizontally on a single screen line when it
becomes longer than the screen width rather than wrapping to a new line.
.TP
+.B input\-meta (Off)
+If set to \fBOn\fP, readline will enable eight-bit input (that is,
+it will not strip the high bit from the characters it reads),
+regardless of what the terminal claims it can support. The name
+.B meta\-flag
+is a synonym for this variable.
+.TP
+.B isearch\-terminators (``C\-[C\-J'')
+The string of characters that should terminate an incremental
+search without subsequently executing the character as a command.
+If this variable has not been given a value, the characters
+\fIESC\fP and \fIC\-J\fP will terminate an incremental search.
+.TP
.B keymap (emacs)
Set the current readline keymap. The set of legal keymap names is
\fIemacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,
@@ -400,11 +414,6 @@ appended.
If set to \fBOn\fP, history lines that have been modified are displayed
with a preceding asterisk (\fB*\fP).
.TP
-.B meta\-flag (Off)
-If set to \fBOn\fP, readline will enable eight-bit input (that is,
-it will not strip the high bit from the characters it reads),
-regardless of what the terminal claims it can support.
-.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
@@ -509,8 +518,10 @@ As each character of the search string is typed, readline displays
the next entry from the history matching the string typed so far.
An incremental search requires only as many characters as needed to
find the desired history entry.
-The Escape character is used to terminate an incremental search.
-Control-J will also terminate the search.
+The characters present in the value of the \fIisearch-terminators\fP
+variable are used to terminate an incremental search.
+If that variable has not been assigned a value the Escape and
+Control-J characters will terminate an incremental search.
Control-G will abort an incremental search and restore the original
line.
When the search is terminated, the history entry containing the
@@ -647,6 +658,11 @@ the last character typed was not bound to \fBBdelete\-char\fP, then return
Delete the character behind the cursor. When given a numeric argument,
save the deleted text on the kill ring.
.TP
+.B forward\-backward\-delete\-char
+Delete the character under the cursor, unless the cursor is at the
+end of the line, in which case the character behind the cursor is
+deleted. By default, this is not bound to a key.
+.TP
.B quoted\-insert (C\-q, C\-v)
Add the next character that you type to the line verbatim. This is
how to insert characters like \fBC\-q\fP, for example.
@@ -798,6 +814,13 @@ of matches; a negative argument may be used to move backward
through the list.
This command is intended to be bound to \fBTAB\fP, but 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).
+If at the end of the line, behaves identically to
+\fBpossible-completions\fP.
+This command is unbound by default.
.PD
.SS Keyboard Macros
.PP
@@ -847,7 +870,7 @@ Undo all changes made to this line. This is like executing the
.B undo
command enough times to return the line to its initial state.
.TP
-.B tilde\-expand (M\-~)
+.B tilde\-expand (M\-&)
Perform tilde expansion on the current word.
.TP
.B set\-mark (C\-@, M-<space>)
diff --git a/readline/doc/rlman.texinfo b/readline/doc/rlman.texinfo
index dd6478af5a2..41bafbf501b 100644
--- a/readline/doc/rlman.texinfo
+++ b/readline/doc/rlman.texinfo
@@ -6,26 +6,19 @@
@synindex vr fn
@setchapternewpage odd
-@ignore
-last change: Thu Apr 2 14:39:03 EST 1998
-@end ignore
-
-@set EDITION 2.2
-@set VERSION 2.2
-@set UPDATED 2 April 1998
-@set UPDATE-MONTH April 1998
+@include manvers.texinfo
+@ifinfo
@dircategory Libraries
@direntry
* Readline: (readline). The GNU readline library API
@end direntry
-@ifinfo
This document describes the GNU Readline Library, a utility which aids
in the consistency of user interface across discrete programs that need
to provide a command line interface.
-Copyright (C) 1988, 1991, 1993, 1996, 1998 Free Software Foundation, Inc.
+Copyright (C) 1988-1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -46,7 +39,7 @@ 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,
except that this permission notice may be stated in a translation approved
-by the Foundation.
+by the Free Software Foundation.
@end ifinfo
@titlepage
@@ -77,10 +70,10 @@ 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,
except that this permission notice may be stated in a translation approved
-by the Foundation.
+by the Free Software Foundation.
@vskip 0pt plus 1filll
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+Copyright @copyright{} 1988-1999 Free Software Foundation, Inc.
@end titlepage
@ifinfo
diff --git a/readline/doc/rltech.texinfo b/readline/doc/rltech.texinfo
index bce508717ac..ea8d7f8c5e5 100644
--- a/readline/doc/rltech.texinfo
+++ b/readline/doc/rltech.texinfo
@@ -8,7 +8,7 @@ This document describes the GNU Readline Library, a utility for aiding
in the consitency of user interface across discrete programs that need
to provide a command line interface.
-Copyright (C) 1988, 1994, 1996 Free Software Foundation, Inc.
+Copyright (C) 1988, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -47,7 +47,9 @@ in your own programs, this section is for you.
* Readline Variables:: Variables accessible to custom
functions.
* Readline Convenience Functions:: Functions which Readline supplies to
- aid in writing your own
+ aid in writing your own custom
+ functions.
+* Readline Signal Handling:: How Readline behaves when it receives signals.
* Custom Completers:: Supplanting or supplementing Readline's
completion functions.
@end menu
@@ -268,6 +270,13 @@ Setting this to a value makes it the next keystroke read. This is a
way to stuff a single character into the input stream.
@end deftypevar
+@deftypevar int rl_erase_empty_line
+Setting this to a non-zero value causes Readline to completely erase
+the current line, including any prompt, any time a newline is typed as
+the only character on an otherwise-empty line. The cursor is moved to
+the beginning of the newly-blank line.
+@end deftypevar
+
@deftypevar {char *} rl_prompt
The prompt Readline uses. This is set from the argument to
@code{readline ()}, and should not be assigned to directly.
@@ -300,6 +309,12 @@ If non-zero, this is the address of a function to call just
before @code{readline} prints the first prompt.
@end deftypevar
+@deftypevar {Function *} rl_pre_input_hook
+If non-zero, this is the address of a function to call after
+the first prompt has been printed and just before @code{readline}
+starts reading input characters.
+@end deftypevar
+
@deftypevar {Function *} rl_event_hook
If non-zero, this is the address of a function to call periodically
when readline is waiting for terminal input.
@@ -619,6 +634,16 @@ is also used to display numeric arguments and search strings.
Clear the message in the echo area.
@end deftypefun
+@deftypefun void rl_save_prompt ()
+Save the local Readline prompt display state in preparation for
+displaying a new message in the message area with @code{rl_message}.
+@end deftypefun
+
+@deftypefun void rl_restore_prompt ()
+Restore the local Readline prompt display state saved by the most
+recent call to @code{rl_save_prompt}.
+@end deftypefun
+
@node Modifying Text
@subsection Modifying Text
@@ -689,6 +714,16 @@ Return 1 if @var{c} is a numeric character.
Ring the terminal bell, obeying the setting of @code{bell-style}.
@end deftypefun
+@deftypefun void rl_display_match_list (char **matches, int len, int max)
+A convenience function for displaying a list of strings in
+columnar format on Readline's output stream. @code{matches} is the list
+of strings, in argv format, such as a list of completion matches.
+@code{len} is the number of strings in @code{matches}, and @code{max}
+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}).
+@end deftypefun
+
The following are implemented as macros, defined in @code{chartypes.h}.
@deftypefun int uppercase_p (int c)
@@ -814,6 +849,116 @@ invert_case_line (count, key)
@}
@end example
+@node Readline Signal Handling
+@section Readline Signal Handling
+
+Signals are asynchronous events sent to a process by the Unix kernel,
+sometimes on behalf of another process. They are intended to indicate
+exceptional events, like a user pressing the interrupt key on his
+terminal, or a network connection being broken. There is a class of
+signals that can be sent to the process currently reading input from
+the keyboard. Since Readline changes the terminal attributes when it
+is called, it needs to perform special processing when a signal is
+received to restore the terminal to a sane state, or provide application
+writers with functions to do so manually.
+
+Readline contains an internal signal handler that is installed for a
+number of signals (@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM},
+@code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}).
+When one of these signals is received, the signal handler
+will reset the terminal attributes to those that were in effect before
+@code{readline ()} was called, reset the signal handling to what it was
+before @code{readline ()} was called, and resend the signal to the calling
+application.
+If and when the calling application's signal handler returns, Readline
+will reinitialize the terminal and continue to accept input.
+When a @code{SIGINT} is received, the Readline signal handler performs
+some additional work, which will cause any partially-entered line to be
+aborted (see the description of @code{rl_free_line_state ()}).
+
+There is an additional Readline signal handler, for @code{SIGWINCH}, which
+the kernel sends to a process whenever the terminal's size changes (for
+example, if a user resizes an @code{xterm}). The Readline @code{SIGWINCH}
+handler updates Readline's internal screen size state, and then calls any
+@code{SIGWINCH} signal handler the calling application has installed.
+Readline calls the application's @code{SIGWINCH} signal handler without
+resetting the terminal to its original state. If the application's signal
+handler does more than update its idea of the terminal size and return (for
+example, a @code{longjmp} back to a main processing loop), it @emph{must}
+call @code{rl_cleanup_after_signal ()} (described below), to restore the
+terminal state.
+
+Readline provides two variables that allow application writers to
+control whether or not it will catch certain signals and act on them
+when they are received. It is important that applications change the
+values of these variables only when calling @code{readline ()}, not in
+a signal handler, so Readline's internal signal state is not corrupted.
+
+@deftypevar int rl_catch_signals
+If this variable is non-zero, Readline will install signal handlers for
+@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM}, @code{SIGALRM},
+@code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}.
+
+The default value of @code{rl_catch_signals} is 1.
+@end deftypevar
+
+@deftypevar int rl_catch_sigwinch
+If this variable is non-zero, Readline will install a signal handler for
+@code{SIGWINCH}.
+
+The default value of @code{rl_catch_sigwinch} is 1.
+@end deftypevar
+
+If an application does not wish to have Readline catch any signals, or
+to handle signals other than those Readline catches (@code{SIGHUP},
+for example),
+Readline provides convenience functions to do the necessary terminal
+and internal state cleanup upon receipt of a signal.
+
+@deftypefun void rl_cleanup_after_signal (void)
+This function will reset the state of the terminal to what it was before
+@code{readline ()} was called, and remove the Readline signal handlers for
+all signals, depending on the values of @code{rl_catch_signals} and
+@code{rl_catch_sigwinch}.
+@end deftypefun
+
+@deftypefun void rl_free_line_state (void)
+This will free any partial state associated with the current input line
+(undo information, any partial history entry, any partially-entered
+keyboard macro, and any partially-entered numeric argument). This
+should be called before @code{rl_cleanup_after_signal ()}. The
+Readline signal handler for @code{SIGINT} calls this to abort the
+current input line.
+@end deftypefun
+
+@deftypefun void rl_reset_after_signal (void)
+This will reinitialize the terminal and reinstall any Readline signal
+handlers, depending on the values of @code{rl_catch_signals} and
+@code{rl_catch_sigwinch}.
+@end deftypefun
+
+If an application does not wish Readline to catch @code{SIGWINCH}, it may
+call @code{rl_resize_terminal ()} to force Readline to update its idea of
+the terminal size when a @code{SIGWINCH} is received.
+
+@deftypefun void rl_resize_terminal (void)
+Update Readline's internal screen size.
+@end deftypefun
+
+The following functions install and remove Readline's signal handlers.
+
+@deftypefun int rl_set_signals (void)
+Install Readline's signal handler for @code{SIGINT}, @code{SIGQUIT},
+@code{SIGTERM}, @code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN},
+@code{SIGTTOU}, and @code{SIGWINCH}, depending on the values of
+@code{rl_catch_signals} and @code{rl_catch_sigwinch}.
+@end deftypefun
+
+@deftypefun int rl_clear_signals (void)
+Remove all of the Readline signal handlers installed by
+@code{rl_set_signals ()}.
+@end deftypefun
+
@node Custom Completers
@section Custom Completers
@@ -1108,6 +1253,20 @@ string (the current directory name) as an argument. It could be used
to expand symbolic links or shell variables in pathnames.
@end deftypevar
+@deftypevar {VFunction *} rl_completion_display_matches_hook
+If non-zero, then this is the address of a function to call when
+completing a word would normally display the list of possible matches.
+This function is called in lieu of Readline displaying the list.
+It takes three arguments:
+(@code{char **}@var{matches}, @code{int} @var{num_matches}, @code{int} @var{max_length})
+where @var{matches} is the array of matching strings,
+@var{num_matches} is the number of strings in that array, and
+@var{max_length} is the length of the longest string in that array.
+Readline provides a convenience function, @code{rl_display_match_list},
+that takes care of doing the display to Readline's output stream. That
+function may be called from this hook.
+@end deftypevar
+
@node A Short Completion Example
@subsection A Short Completion Example
diff --git a/readline/doc/rluser.texinfo b/readline/doc/rluser.texinfo
index b2fd060366a..755f7ca3a35 100644
--- a/readline/doc/rluser.texinfo
+++ b/readline/doc/rluser.texinfo
@@ -97,7 +97,7 @@ regardless of the location of the cursor within the line.
* Readline Killing Commands:: How to delete text, and how to get it back!
* Readline Arguments:: Giving numeric arguments to commands.
* Searching:: Searching through previous lines.
- @end menu
+@end menu
@node Readline Bare Essentials
@subsection Readline Bare Essentials
@@ -252,8 +252,10 @@ As each character of the search string is typed, Readline displays
the next entry from the history matching the string typed so far.
An incremental search requires only as many characters as needed to
find the desired history entry.
-The @key{ESC} character is used to terminate an incremental search.
-@key{C-j} will also terminate the search.
+The characters present in the value of the @var{isearch-terminators} variable
+are used to terminate an incremental search.
+If that variable has not been assigned a value, the @key{ESC} and
+@key{C-J} characters will terminate an incremental search.
@key{C-g} will abort an incremental search and restore the original line.
When the search is terminated, the history entry containing the
search string becomes the current line.
@@ -396,6 +398,22 @@ horizontally on a single screen line when they are longer than the width
of the screen, instead of wrapping onto a new screen line. By default,
this variable is set to @samp{off}.
+@item input-meta
+@vindex input-meta
+@vindex meta-flag
+If set to @samp{on}, Readline will enable eight-bit input (it
+will not strip the eighth bit from the characters it reads),
+regardless of what the terminal claims it can support. The
+default value is @samp{off}. The name @code{meta-flag} is a
+synonym for this variable.
+
+@item isearch-terminators
+@vindex isearch-terminators
+The string of characters that should terminate an incremental search without
+subsequently executing the character as a command (@pxref{Searching}).
+If this variable has not been given a value, the characters @key{ESC} and
+@key{C-J} will terminate an incremental search.
+
@item keymap
@vindex keymap
Sets Readline's idea of the current keymap for key binding commands.
@@ -422,15 +440,6 @@ This variable, when set to @samp{on}, causes Readline to display an
asterisk (@samp{*}) at the start of history lines which have been modified.
This variable is @samp{off} by default.
-@item input-meta
-@vindex input-meta
-@vindex meta-flag
-If set to @samp{on}, Readline will enable eight-bit input (it
-will not strip the eighth bit from the characters it reads),
-regardless of what the terminal claims it can support. The
-default value is @samp{off}. The name @code{meta-flag} is a
-synonym for this variable.
-
@item output-meta
@vindex output-meta
If set to @samp{on}, Readline will display characters with the
@@ -876,6 +885,11 @@ return @code{EOF}.
Delete the character behind the cursor. A numeric argument means
to kill the characters instead of deleting them.
+@item forward-backward-delete-char ()
+Delete the character under the cursor, unless the cursor is at the
+end of the line, in which case the character behind the cursor is
+deleted. By default, this is not bound to a key.
+
@item quoted-insert (C-q, C-v)
Add the next character typed to the line verbatim. This is
how to insert key sequences like @key{C-q}, for example.
@@ -1039,6 +1053,13 @@ through the list.
This command is intended to be bound to @code{TAB}, but is unbound
by default.
+@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}).
+If at the end of the line, behaves identically to
+@code{possible-completions}.
+This command is unbound by default.
+
@ifset BashFeatures
@item complete-filename (M-/)
Attempt filename completion on the text before point.
@@ -1141,7 +1162,12 @@ Incremental undo, separately remembered for each line.
Undo all changes made to this line. This is like executing the @code{undo}
command enough times to get back to the beginning.
+@ifset BashFeatures
+@item tilde-expand (M-&)
+@end ifset
+@ifclear BashFeatures
@item tilde-expand (M-~)
+@end ifclear
Perform tilde expansion on the current word.
@item set-mark (C-@@)
diff --git a/readline/doc/texi2dvi b/readline/doc/texi2dvi
index 00e154d0fe8..3d7134d6d92 100755
--- a/readline/doc/texi2dvi
+++ b/readline/doc/texi2dvi
@@ -1,10 +1,9 @@
#! /bin/sh
# texi2dvi --- smartly produce DVI files from texinfo sources
-
-# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
-
# $Id$
-
+#
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 98 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)
@@ -19,28 +18,27 @@
# 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.
-
+#
# Commentary:
-
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-
-# Please send bug reports, etc. to bug-texinfo@prep.ai.mit.edu
+#
+# Author: Noah Friedman <friedman@gnu.org>
+#
+# Please send bug reports, etc. to bug-texinfo@gnu.org.
# If possible, please send a copy of the output of the script called with
# the `--debug' option when making a bug report.
-
+#
# In the interest of general portability, some common bourne shell
# constructs were avoided because they weren't guaranteed to be available
# in some earlier implementations. I've tried to make this program as
# portable as possible. Welcome to unix, where the lowest common
# denominator is rapidly diminishing.
#
-# Among the more interesting lossages I noticed with some bourne shells
-# are:
+# Among the more interesting lossages I noticed among Bourne shells:
# * No shell functions.
# * No `unset' builtin.
# * `shift' cannot take a numeric argument, and signals an error if
# there are no arguments to shift.
-
+#
# Code:
# Name by which this script was invoked.
@@ -54,30 +52,39 @@ version=`set - $rcs_revision; echo $2`
bq='`'
eq="'"
-usage="Usage: $progname {options} [file1] {file2 {...}}
-(version $version)
+usage="Usage: $0 [OPTION]... FILE...
+Run a Texinfo document through TeX.
-Options are:
+Options:
+-b, --batch No interaction (\nonstopmode in TeX).
+-c, --clean Remove all auxiliary files.
-D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq).
--h, --help You're looking at it.
--v, --version Print version number.
+-t, --texinfo CMD Insert CMD after @setfilename before running TeX.
+--verbose Report on what is done.
+-h, --help Display this help and exit.
+-v, --version Display version information and exit.
-Arguments in brackets are required. Those in braces are optional.
-"
+The values of the TEX, TEXINDEX, and MAKEINFO environment variables are
+used to run those commands, if they are set.
+
+Email bug reports to bug-texinfo@gnu.org."
# Initialize variables.
# Don't use `unset' since old bourne shells don't have this command.
# Instead, assign them an empty value.
-# Some of these, like TEX and TEXINDEX, may be inherited from the environment
-backup_extension=.bak
+# Some of these, like TEX and TEXINDEX, may be inherited from the environment.
+backup_extension=.bak # these files get deleted if all goes well.
+batch=
+clean=
debug=
orig_pwd="`pwd`"
-verbose=
+textra=
+verbose=false
+makeinfo="${MAKEINFO-makeinfo}"
texindex="${TEXINDEX-texindex}"
tex="${TEX-tex}"
-# Save this so we can construct a new TEXINPUTS path for each file to be
-# processed.
+# Save this so we can construct a new TEXINPUTS path for each file.
TEXINPUTS_orig="$TEXINPUTS"
export TEXINPUTS
@@ -86,190 +93,270 @@ export TEXINPUTS
# It's a good idea to document the full long option name in each case.
# Long options which take arguments will need a `*' appended to the
# canonical name to match the value appended after the `=' character.
-while : ; do
- case $# in 0) break ;; esac
+while :; do
+ test $# -eq 0 && break
+
case "$1" in
- -D | --debug | --d* )
- debug=t
- shift
- ;;
- -h | --help | --h* )
- echo "$usage" 1>&2
- exit 0
- ;;
- -v | --version | --v* )
- echo "texi2dvi version $version" 1>&2
- exit 0
- ;;
+ -b | --batch | --b* ) batch=t; shift ;;
+ -c | --clean | --c* ) clean=t; shift ;;
+ -D | --debug | --d* ) debug=t; shift ;;
+ -h | --help | --h* ) echo "$usage"; exit 0 ;;
+ # OK, we should do real option parsing here, but be lazy for now.
+ -t | --texinfo | --t*) shift; textra="$textra $1"; shift ;;
+ -v | --vers* )
+ echo "$progname (GNU Texinfo 3.12) $version"
+ echo "Copyright (C) 1998 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+ exit 0 ;;
+ --verb* ) verbose=echo; shift ;;
-- ) # Stop option processing
shift
- break
- ;;
+ break ;;
-* )
case "$1" in
--*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
* ) arg="$1" ;;
esac
exec 1>&2
- echo "$progname: unknown or ambiguous option $bq$arg$eq"
- echo "$progname: Use $bq--help$eq for a list of options."
- exit 1
- ;;
- * )
- break
- ;;
+ echo "$progname: Unknown or ambiguous option $bq$arg$eq."
+ echo "$progname: Try $bq--help$eq for more information."
+ exit 1 ;;
+ * ) break ;;
esac
done
# See if there are any command line args left (which will be interpreted as
-# filename arguments)
-case $# in
- 0 )
- exec 1>&2
- echo "$progname: at least one file name is required as an argument."
- echo "$progname: Use $bq--help$eq for a description of command syntax."
- exit 2
- ;;
-esac
-
-case "$debug" in t ) set -x ;; esac
+# filename arguments).
+if test $# -eq 0; then
+ exec 1>&2
+ echo "$progname: At least one file name is required as an argument."
+ echo "$progname: Try $bq--help$eq for more information."
+ exit 2
+fi
+
+test "$debug" = t && set -x
# Texify files
-for command_line_filename in ${1+"$@"} ; do
- # Roughly equivalent to `dirname ...`, but more portable
- directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
- filename_texi="`basename ${command_line_filename}`"
- # Strip off the last extension part (probably .texinfo or .texi)
- filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
-
- # If directory and file are the same, then it's probably because there's
- # no pathname component. Set dirname to `.', the current directory.
- if test "z${directory}" = "z${command_line_filename}" ; then
- directory="."
- fi
-
- # Source file might @include additional texinfo sources. Put `.' and
- # directory where source file(s) reside in TEXINPUTS before anything
- # else. `.' goes first to ensure that any old .aux, .cps, etc. files in
- # ${directory} don't get used in preference to fresher files in `.'.
- TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
-
- # "Unset" variables that might have values from previous iterations and
- # which won't be completely reset later.
- definite_index_files=""
-
- # See if file exists here. If it doesn't we're in trouble since, even
- # though the user may be able to reenter a valid filename at the tex
- # prompt (assuming they're attending the terminal), this script won't be
- # able to find the right index files and so forth.
- if test ! -r "${command_line_filename}" ; then
- echo "${progname}: ${command_line_filename}: No such file or permission denied." 1>&2
- continue;
- fi
-
- # Find all files having root filename with a two-letter extension,
- # determine whether they're really index files, and save them. Foo.aux
- # is actually the cross-references file, but we need to keep track of
- # that too.
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files} ; do
+for command_line_filename in ${1+"$@"}; do
+ $verbose "Processing $command_line_filename ..."
+
+ # See if file exists. If it doesn't we're in trouble since, even
+ # though the user may be able to reenter a valid filename at the tex
+ # prompt (assuming they're attending the terminal), this script won't
+ # be able to find the right index files and so forth.
+ if test ! -r "${command_line_filename}"; then
+ echo "$0: Could not read ${command_line_filename}." >&2
+ continue
+ fi
+
+ # Roughly equivalent to `dirname ...`, but more portable
+ directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
+ filename_texi="`basename ${command_line_filename}`"
+ # Strip off the last extension part (probably .texinfo or .texi)
+ filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
+
+ # Use same basename since we want to generate aux files with the same
+ # basename as the manual. Use extension .texi for the temp file so
+ # that TeX will ignore it. Thus, we must use a subdirectory.
+ #
+ # Output the macro-expanded file to here. The vastly abbreviated
+ # temporary directory name is so we don't have collisions on 8.3 or
+ # 14-character filesystems.
+ tmp_dir=${TMPDIR-/tmp}/txi2d.$$
+ filename_tmp=$tmp_dir/$filename_noext.texi
+ # Output the file with the user's extra commands to here.
+ tmp_dir2=${tmp_dir}.2
+ filename_tmp2=$tmp_dir2/$filename_noext.texi
+ mkdir $tmp_dir $tmp_dir2
+ # Always remove the temporary directories.
+ trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15
+
+ # If directory and file are the same, then it's probably because there's
+ # no pathname component. Set dirname to `.', the current directory.
+ if test "z${directory}" = "z${command_line_filename}"; then
+ directory=.
+ fi
+
+ # Source file might @include additional texinfo sources. Put `.' and
+ # directory where source file(s) reside in TEXINPUTS before anything
+ # else. `.' goes first to ensure that any old .aux, .cps, etc. files in
+ # ${directory} don't get used in preference to fresher files in `.'.
+ TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
+
+ # Expand macro commands in the original source file using Makeinfo;
+ # the macro syntax bfox implemented is impossible to implement in TeX.
+ # Always use `end' footnote style, since the `separate' style
+ # generates different output (arguably this is a bug in -E).
+ # Discard main info output, the user asked to run TeX, not makeinfo.
+ # Redirect output to /dev/null to throw away `Making info file...' msg.
+ $verbose "Macro-expanding $command_line_filename to $filename_tmp ..."
+ $makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \
+ $command_line_filename >/dev/null
+
+ # But if there were no macros, or makeinfo failed for some reason,
+ # just use the original file. (It shouldn't make any difference, but
+ # let's be safe.)
+ if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
+ $verbose "Reverting to $command_line_filename ..."
+ cp -p $command_line_filename $filename_tmp
+ fi
+ filename_input=$filename_tmp
+ dirname_input=$tmp_dir
+
+ # Used most commonly for @finalout, @smallbook, etc.
+ if test -n "$textra"; then
+ $verbose "Inserting extra commands: $textra."
+ sed '/^@setfilename/a\
+'"$textra" $filename_input >$filename_tmp2
+ filename_input=$filename_tmp2
+ dirname_input=$tmp_dir2
+ fi
+
+ # If clean mode was specified, then move to the temporary directory.
+ if test "$clean" = t; then
+ $verbose "cd $dirname_input"
+ cd $dirname_input || exit 1
+ filename_input=`basename $filename_input`
+ fi
+
+ while true; do # will break out of loop below
+ # "Unset" variables that might have values from previous iterations and
+ # which won't be completely reset later.
+ definite_index_files=
+
+ # Find all files having root filename with a two-letter extension,
+ # determine whether they're really index files, and save them. Foo.aux
+ # is actually the cross-references file, but we need to keep track of
+ # that too.
+ possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
+ for this_file in ${possible_index_files}; do
# If file is empty, forget it.
- if test ! -s "${this_file}" ; then
- continue;
- fi
+ test -s "${this_file}" || continue
- # Examine first character of file. If it's not a backslash or
- # single quote, then it's definitely not an index or xref file.
+ # Examine first character of file. If it's not suitable to be an
+ # index or xref file, don't process it.
first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then
- definite_index_files="${definite_index_files} ${this_file}"
+ if test "x${first_character}" = "x\\" \
+ || test "x${first_character}" = "x'"; then
+ definite_index_files="${definite_index_files} ${this_file}"
fi
- done
- orig_index_files="${definite_index_files}"
- orig_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # Now save copies of original index files so we have some means of
- # comparison later.
- for index_file_to_save in ${orig_index_files} ; do
- cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
- done
-
- # Run texindex on current index files. If they already exist, and
- # after running TeX a first time the index files don't change, then
- # there's no reason to run TeX again. But we won't know that if the
- # index files are out of date or nonexistent.
- if test "${orig_index_files_sans_aux}" ; then
+ done
+ orig_index_files="${definite_index_files}"
+ orig_index_files_sans_aux="`echo ${definite_index_files} \
+ | sed 's/'${filename_noext}'\.aux//;
+ s/^[ ]*//;s/[ ]*$//;'`"
+
+ # Now save copies of original index files so we have some means of
+ # comparison later.
+ $verbose "Backing up current index files: $orig_index_files ..."
+ for index_file_to_save in ${orig_index_files}; do
+ cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
+ done
+
+ # Run texindex on current index files. If they already exist, and
+ # after running TeX a first time the index files don't change, then
+ # there's no reason to run TeX again. But we won't know that if the
+ # index files are out of date or nonexistent.
+ if test -n "${orig_index_files_sans_aux}"; then
+ $verbose "Running $texindex $orig_index_files_sans_aux ..."
${texindex} ${orig_index_files_sans_aux}
- fi
-
- if ${tex} ${command_line_filename} ; then # TeX run first time
- definite_index_files=""
- # Get list of new index files
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files} ; do
- # If file is empty, forget it.
- if test ! -s ${this_file} ; then
- continue;
- fi
-
- # Examine first character of file. If it's not a backslash or
- # single quote, then it's definitely not an index or xref file.
- first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then
- definite_index_files="${definite_index_files} ${this_file}"
- fi
+ fi
+
+ # Finally, run TeX.
+ if test "$batch" = t; then
+ tex_mode='\nonstopmode'
+ else
+ tex_mode=
+ fi
+ $verbose "Running $tex $filename_input ..."
+ cmd="$tex $tex_mode \\input $filename_input"
+ $cmd
+
+ # Check if index files changed.
+ #
+ definite_index_files=
+ # Get list of new index files.
+ possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
+ for this_file in ${possible_index_files}; do
+ # If file is empty, forget it.
+ test -s "${this_file}" || continue
+
+ # Examine first character of file. If it's not a backslash or
+ # single quote, then it's definitely not an index or xref file.
+ # (Will have to check for @ when we switch to Texinfo syntax in
+ # all these files...)
+ first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
+ if test "x${first_character}" = "x\\" \
+ || test "x${first_character}" = "x'"; then
+ definite_index_files="${definite_index_files} ${this_file}"
+ fi
+ done
+ new_index_files="${definite_index_files}"
+ new_index_files_sans_aux="`echo ${definite_index_files} \
+ | sed 's/'${filename_noext}'\.aux//;
+ s/^[ ]*//;s/[ ]*$//;'`"
+
+ # If old and new list don't at least have the same file list, then one
+ # file or another has definitely changed.
+ $verbose "Original index files =$orig_index_files"
+ $verbose "New index files =$new_index_files"
+ if test "z${orig_index_files}" != "z${new_index_files}"; then
+ index_files_changed_p=t
+ else
+ # File list is the same. We must compare each file until we find a
+ # difference.
+ index_files_changed_p=
+ for this_file in ${new_index_files}; do
+ $verbose "Comparing index file $this_file ..."
+ # cmp -s will return nonzero exit status if files differ.
+ cmp -s "${this_file}" "${this_file}${backup_extension}"
+ if test $? -ne 0; then
+ # We only need to keep comparing until we find *one* that
+ # differs, because we'll have to run texindex & tex no
+ # matter what.
+ index_files_changed_p=t
+ $verbose "Index file $this_file differed:"
+ test $verbose = echo \
+ && diff -c "${this_file}${backup_extension}" "${this_file}"
+ break
+ fi
done
- new_index_files="${definite_index_files}"
- new_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # If old and new list don't at least have the same file list, then one
- # file or another has definitely changed.
- if test "${orig_index_files}" != "${new_index_files}" ; then
- index_files_changed_p=t
- else
- # File list is the same. We must compare each file until we find a
- # difference.
- index_files_changed_p=""
- for this_file in ${new_index_files} ; do
- # cmp -s will return nonzero exit status if files differ.
- cmp -s "${this_file}" "${this_file}${backup_extension}"
- if test $? -ne 0 ; then
- # We only need to keep comparing until we find *one* that
- # differs, because we'll have to run texindex & tex no
- # matter what.
- index_files_changed_p=t
- break
- fi
- done
- fi
+ fi
- # If index files have changed since TeX has been run, or if the aux
- # file wasn't present originally, run texindex and TeX again.
- if test "${index_files_changed_p}" ; then
- retval=0
- if test "${new_index_files_sans_aux}" ; then
- ${texindex} ${new_index_files_sans_aux}
- retval=$?
- fi
- if test ${retval} -eq 0 ; then
- ${tex} "${command_line_filename}"
- fi
- fi
- fi
-
- # Generate list of files to delete, then call rm once with the entire
- # list. This is significantly faster than multiple executions of rm.
- file_list=""
- for file in ${orig_index_files} ; do
- file_list="${file_list} ${file}${backup_extension}"
- done
- if test "${file_list}" ; then
- rm -f ${file_list}
- fi
+ # If index files have changed since TeX has been run, or if the aux
+ # file wasn't present originally, run texindex and TeX again.
+ if test "${index_files_changed_p}"; then :; else
+ # Nothing changed. We're done with TeX.
+ break
+ fi
+ done
+
+ # If we were in clean mode, compilation was in a tmp directory.
+ # Copy the DVI file into the directory where the compilation
+ # has been done. (The temp dir is about to get removed anyway.)
+ # We also return to the original directory so that
+ # - the next file is processed in correct conditions
+ # - the temporary file can be removed
+ if test -n "$clean"; then
+ $verbose "Copying DVI file from `pwd` to $orig_pwd"
+ cp -p $filename_noext.dvi $orig_pwd
+ cd $orig_pwd || exit 1
+ fi
+
+ # Generate list of files to delete, then call rm once with the entire
+ # list. This is significantly faster than multiple executions of rm.
+ file_list=
+ for file in ${orig_index_files}; do
+ file_list="${file_list} ${file}${backup_extension}"
+ done
+ if test -n "${file_list}"; then
+ $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
+ rm -f ${file_list}
+ rm -rf $tmp_dir $tmp_dir2
+ fi
done
-# texi2dvi ends here
+$verbose "$0 done."
+true # exit successfully.
diff --git a/readline/doc/texi2html b/readline/doc/texi2html
index cc751785493..4beec01b341 100755
--- a/readline/doc/texi2html
+++ b/readline/doc/texi2html
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/local/bin/perl
'di ';
'ig 00 ';
#+##############################################################################
@@ -9,7 +9,7 @@
# #
#-##############################################################################
-# @(#)texi2html 1.51 09/10/96 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
+# @(#)texi2html 1.52 01/05/98 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
# The man page for this program is included at the end of this file and can be
# viewed using the command 'nroff -man texi2html'.
@@ -29,7 +29,7 @@ $DEBUG_DEF = 16;
$DEBUG_HTML = 32;
$DEBUG_USER = 64;
-$BIBRE = '\[[\w\/]+\]'; # RE for a bibliography reference
+$BIBRE = '\[[\w\/-]+\]'; # RE for a bibliography reference
$FILERE = '[\/\w.+-]+'; # RE for a file name
$VARRE = '[^\s\{\}]+'; # RE for a variable name
$NODERE = '[^@{}:\'`",]+'; # RE for a node name
@@ -37,8 +37,8 @@ $NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names
$XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE)
$ERROR = "***"; # prefix for errors and warnings
-$THISPROG = "texi2html 1.51"; # program name and version
-$HOMEPAGE = "http://wwwcn.cern.ch/dci/texi2html/"; # program home page
+$THISPROG = "texi2html 1.52"; # program name and version
+$HOMEPAGE = "http://wwwinfo.cern.ch/dis/texi2html/"; # program home page
$TODAY = &pretty_date; # like "20 September 1993"
$SPLITTAG = "<!-- SPLIT HERE -->\n"; # tag to know where to split
$PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections
@@ -129,6 +129,7 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
"!", "!",
"?", "?",
".", ".",
+ "-", "",
);
#
@@ -159,19 +160,23 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
'cite', 'CITE',
'code', 'CODE',
'ctrl', '&do_ctrl', # special case
- 'dfn', 'STRONG', # DFN tag is illegal in the standard
+ 'dfn', 'EM', # DFN tag is illegal in the standard
'dmn', '', # useless
+ 'email', '&do_email', # insert a clickable email address
'emph', 'EM',
'file', '"TT', # will put quotes, cf. &apply_style
'i', 'I',
'kbd', 'KBD',
'key', 'KBD',
+ 'math', 'EM',
'r', '', # unsupported
'samp', '"SAMP', # will put quotes, cf. &apply_style
'sc', '&do_sc', # special case
'strong', 'STRONG',
't', 'TT',
'titlefont', '', # useless
+ 'uref', '&do_uref', # insert a clickable URL
+ 'url', '&do_url', # insert a clickable URL
'var', 'VAR',
'w', '', # unsupported
);
@@ -270,6 +275,7 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
'smallbook', 1,
'vskip', 1,
'filbreak', 1,
+ 'paragraphindent', 1,
# unsupported formats
'cartouche', 1,
'end cartouche', 1,
@@ -283,6 +289,8 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
# #
#---############################################################################
+%value = (); # hold texinfo variables, see also -D
+
$use_bibliography = 1;
$use_acc = 0;
$debug = 0;
@@ -306,6 +314,7 @@ To convert a Texinfo file to HMTL: $0 [options] file
-expandinfo : use \@ifinfo sections, not \@iftex
-glossary : handle a glossary
-invisible name: use 'name' as an invisible anchor
+ -Dname : define name like with \@set
-I dir : search also for files in 'dir'
-menu : handle menus
-monolithic : output only one file including ToC
@@ -317,7 +326,7 @@ To convert a Texinfo file to HMTL: $0 [options] file
To check converted files: $0 -check [-verbose] files
EOT
-while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) {
+while (@ARGV && $ARGV[0] =~ /^-/) {
$_ = shift(@ARGV);
if (/^-acc$/) { $use_acc = 1; next; }
if (/^-d(ebug)?(\d+)?$/) { $debug = $2 || shift(@ARGV); next; }
@@ -327,6 +336,7 @@ while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) {
if (/^-g(lossary)?$/) { $use_glossary = 1; next; }
if (/^-i(nvisible)?$/) { $invisible_mark = shift(@ARGV); next; }
if (/^-iso$/) { $use_iso = 1; next; }
+ if (/^-D(.+)?$/) { $value{$1 || shift(@ARGV)} = 1; next; }
if (/^-I(.+)?$/) { push(@include_dirs, $1 || shift(@ARGV)); next; }
if (/^-m(enu)?$/) { $show_menu = 1; next; }
if (/^-mono(lithic)?$/) { $monolithic = 1; next; }
@@ -383,9 +393,8 @@ if ($monolithic) {
#
# variables
#
-%value = (); # hold texinfo variables
$value{'html'} = 1; # predefine html (the output format)
-$value{'texi2html'} = '1.51'; # predefine texi2html (the translator)
+$value{'texi2html'} = '1.52'; # predefine texi2html (the translator)
# _foo: internal to track @foo
foreach ('_author', '_title', '_subtitle',
'_settitle', '_setfilename') {
@@ -453,7 +462,7 @@ $toplevel = 0; # top level seen in hierarchy
$curlevel = 0; # current level in TOC
$node = ''; # current node name
$in_table = 0; # am I inside a table
-$table_type = ''; # type of table ('', 'f', 'v')
+$table_type = ''; # type of table ('', 'f', 'v', 'multi')
@tables = (); # nested table support
$in_bibliography = 0; # am I inside a bibliography
$in_glossary = 0; # am I inside a glossary
@@ -554,9 +563,11 @@ while ($_ = &next_line) {
#
s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/;
# non-@ substitutions cf. texinfmt.el
- s/``/\"/g;
- s/''/\"/g;
- s/([\w ])---([\w ])/$1--$2/g;
+ unless ($in_pre) {
+ s/``/\"/g;
+ s/''/\"/g;
+ s/([\w ])---([\w ])/$1--$2/g;
+ }
#
# analyze the tag
#
@@ -570,14 +581,9 @@ while ($_ = &next_line) {
}
&skip_until($tag), next if $tag eq 'tex';
# handle special tables
- if ($tag eq 'table') {
- $table_type = '';
- } elsif ($tag eq 'ftable') {
+ if ($tag =~ /^(|f|v|multi)table$/) {
+ $table_type = $1;
$tag = 'table';
- $table_type = 'f';
- } elsif ($tag eq 'vtable') {
- $tag = 'table';
- $table_type = 'v';
}
# special cases
if ($tag eq 'top' || ($tag eq 'node' && /^\@node\s+top\s*,/i)) {
@@ -647,11 +653,16 @@ while ($_ = &next_line) {
push(@lines, &debug("<$format_map{$tag}>\n", __LINE__));
next;
} elsif ($tag eq 'table') {
- if (/^\@[fv]?table\s+\@(\w+)\s*$/) {
- $in_table = $1;
+ if (/^\@(|f|v|multi)table\s+\@(\w+)/) {
+ $in_table = $2;
unshift(@tables, join($;, $table_type, $in_table));
- push(@lines, &debug("<DL COMPACT>\n", __LINE__));
- &html_push_if('DL');
+ if ($table_type eq "multi") {
+ push(@lines, &debug("<TABLE BORDER>\n", __LINE__));
+ &html_push_if('TABLE');
+ } else {
+ push(@lines, &debug("<DL COMPACT>\n", __LINE__));
+ &html_push_if('DL');
+ }
push(@lines, &html_debug("\n", __LINE__));
} else {
warn "$ERROR Bad table line: $_";
@@ -776,18 +787,29 @@ while ($_ = &next_line) {
&html_pop_if();
push(@lines, &debug("</$format_map{$end_tag}>\n", __LINE__));
push(@lines, &html_debug("\n", __LINE__));
- } elsif ($end_tag eq 'table' ||
- $end_tag eq 'ftable' ||
- $end_tag eq 'vtable') {
- shift(@tables);
+ } elsif ($end_tag =~ /^(|f|v|multi)table$/) {
+ unless (@tables) {
+ warn "$ERROR \@end $end_tag without \@*table\n";
+ next;
+ }
+ ($table_type, $in_table) = split($;, shift(@tables));
+ unless ($1 eq $table_type) {
+ warn "$ERROR \@end $end_tag without matching \@$end_tag\n";
+ next;
+ }
+ if ($table_type eq "multi") {
+ push(@lines, "</TR></TABLE>\n");
+ &html_pop_if('TR');
+ } else {
+ push(@lines, "</DL>\n");
+ &html_pop_if('DD');
+ }
+ &html_pop_if();
if (@tables) {
($table_type, $in_table) = split($;, $tables[0]);
} else {
$in_table = 0;
}
- push(@lines, "</DL>\n");
- &html_pop_if('DD');
- &html_pop_if();
} elsif (defined($def_map{$end_tag})) {
push(@lines, &debug("</DL>\n", __LINE__));
} elsif ($end_tag eq 'menu') {
@@ -986,6 +1008,12 @@ EOC
if ($table_type) { # add also an index
unshift(@input_spool, "\@${table_type}index $what\n");
}
+ } elsif ($html_element eq 'TABLE') {
+ push(@lines, &debug("<TR><TD>$what</TD>\n", __LINE__));
+ &html_push('TR');
+ } elsif ($html_element eq 'TR') {
+ push(@lines, &debug("</TR>\n", __LINE__));
+ push(@lines, &debug("<TR><TD>$what</TD>\n", __LINE__));
} else {
push(@lines, &debug("<LI>$what\n", __LINE__));
&html_push('LI') unless $html_element eq 'LI';
@@ -996,6 +1024,9 @@ EOC
$deferred_ref = '';
}
next;
+ } elsif (/^\@tab\s+(.*)$/) {
+ push(@lines, "<TD>$1</TD>\n");
+ next;
}
}
}
@@ -1088,13 +1119,25 @@ while (@lines) {
print "# index $key sorted as $_\n"
if $key ne $_ && $debug & $DEBUG_INDEX;
}
+ push(@lines2, "Jump to:\n");
+ $last_letter = undef;
+ foreach $key (sort byalpha @keys) {
+ $letter = substr($key2alpha{$key}, 0, 1);
+ $letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
+ if (!defined($last_letter) || $letter ne $last_letter) {
+ push(@lines2, "-\n") if defined($last_letter);
+ push(@lines2, "<A HREF=\"#$index\_$letter\">" . &protect_html($letter) . "</A>\n");
+ $last_letter = $letter;
+ }
+ }
+ push(@lines2, "<P>\n");
$last_letter = undef;
foreach $key (sort byalpha @keys) {
$letter = substr($key2alpha{$key}, 0, 1);
$letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
if (!defined($last_letter) || $letter ne $last_letter) {
push(@lines2, "</DIR>\n") if defined($last_letter);
- push(@lines2, "<H2>" . &protect_html($letter) . "</H2>\n");
+ push(@lines2, "<H2><A NAME=\"$index\_$letter\">" . &protect_html($letter) . "</A></H2>\n");
push(@lines2, "<DIR>\n");
$last_letter = $letter;
}
@@ -1657,8 +1700,24 @@ sub menu_entry {
sub do_ctrl { "^$_[0]" }
+sub do_email {
+ local($addr, $text) = split(/,\s*/, $_[0]);
+
+ $text = $addr unless $text;
+ &anchor('', "mailto:$addr", $text);
+}
+
sub do_sc { "\U$_[0]\E" }
+sub do_uref {
+ local($url, $text) = split(/,\s*/, $_[0]);
+
+ $text = $url unless $text;
+ &anchor('', $url, $text);
+}
+
+sub do_url { &anchor('', $_[0], $_[0]) }
+
sub apply_style {
local($texi_style, $text) = @_;
local($style);
@@ -1822,7 +1881,7 @@ sub print_toplevel_footer {
print FILE <<EOT;
This document was generated on $TODAY using the
<A HREF=\"$HOMEPAGE\">texi2html</A>
-translator version 1.51.</P>
+translator version 1.52.</P>
EOT
&print_footer;
}
@@ -1879,7 +1938,7 @@ sub byalpha {
.nr nl 0-1 \" fake up transition to first page again
.nr % 0 \" start at page 1
'; __END__ ############# From here on it's a standard manual page ############
-.TH TEXI2HTML 1 "09/10/96"
+.TH TEXI2HTML 1 "01/05/98"
.AT 3
.SH NAME
texi2html \- a Texinfo to HTML converter
@@ -1924,8 +1983,9 @@ Use the section named 'Glossary' to build a list of terms and put links in the H
document from each term toward its definition.
.TP
.B \-invisible \fIname\fP
-Use \fIname\fP to create invisible destination anchors for index links. This is a workaround
-for a known bug of many WWW browsers, including xmosaic.
+Use \fIname\fP to create invisible destination anchors for index links
+(you can for instance use the invisible.xbm file shipped with this program).
+This is a workaround for a known bug of many WWW browsers, including netscape.
.TP
.B \-I \fIdir\fP
Look also in \fIdir\fP to find included files.
@@ -1985,21 +2045,21 @@ option, it creates only one file:
predefines the following variables: \fBhtml\fP, \fBtexi2html\fP.
.SH ADDITIONAL COMMANDS
.I texi2html
-implements the following non-Texinfo commands:
+implements the following non-Texinfo commands (maybe they are in Texinfo now...):
.TP 16
.B @ifhtml
This indicates the start of an HTML section, this section will passed through
-without any modofication.
+without any modification.
.TP
.B @end ifhtml
-This indcates the end of an HTML section.
+This indicates the end of an HTML section.
.SH VERSION
-This is \fItexi2html\fP version 1.51, 09/10/96.
+This is \fItexi2html\fP version 1.52, 01/05/98.
.PP
The latest version of \fItexi2html\fP can be found in WWW, cf. URL
-http://wwwcn.cern.ch/dci/texi2html/
+http://wwwinfo.cern.ch/dis/texi2html/
.SH AUTHOR
-The main author is Lionel Cons, CERN CN/DCI/UWS, Lionel.Cons@cern.ch.
+The main author is Lionel Cons, CERN IT/DIS/OSE, Lionel.Cons@cern.ch.
Many other people around the net contributed to this program.
.SH COPYRIGHT
This program is the intellectual property of the European