aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2001-04-06 19:14:31 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:53 +0000
commit28ef6c316f1aff914bb95ac09787a3c83c1815fd (patch)
tree2812fe7ffc9beec4f99856906ddfcafda54cf16a /doc
parentbb70624e964126b7ac4ff085ba163a9c35ffa18f (diff)
downloadandroid_external_bash-28ef6c316f1aff914bb95ac09787a3c83c1815fd.tar.gz
android_external_bash-28ef6c316f1aff914bb95ac09787a3c83c1815fd.tar.bz2
android_external_bash-28ef6c316f1aff914bb95ac09787a3c83c1815fd.zip
Imported from ../bash-2.05.tar.gz.
Diffstat (limited to 'doc')
-rw-r--r--doc/FAQ220
-rw-r--r--doc/Makefile.in13
-rw-r--r--doc/bash.1161
-rw-r--r--doc/bashref.info1272
-rw-r--r--doc/bashref.texi668
-rw-r--r--doc/readline.31205
-rw-r--r--doc/texinfo.tex4146
7 files changed, 4075 insertions, 3610 deletions
diff --git a/doc/FAQ b/doc/FAQ
index 5c678e9..1fafa6d 100644
--- a/doc/FAQ
+++ b/doc/FAQ
@@ -1,4 +1,4 @@
-This is the Bash FAQ, version 3.7, for Bash version 2.04.
+This is the Bash FAQ, version 3.11, for Bash version 2.05.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@@ -36,8 +36,8 @@ A10) What is the bash `posix mode'?
Section B: The latest version
-B1) What's new in version 2.04?
-B2) Are there any user-visible incompatibilities between bash-2.04 and
+B1) What's new in version 2.05?
+B2) Are there any user-visible incompatibilities between bash-2.05 and
bash-1.14.7?
Section C: Differences from other Unix shells
@@ -70,6 +70,10 @@ E5) I have a bunch of shell scripts that use backslash-escaped characters
in arguments to `echo'. Bash doesn't interpret these characters. Why
not, and how can I make it understand them?
E6) Why doesn't a while or for loop get suspended when I type ^Z?
+E7) What about empty for loops in Makefiles?
+E8) Why does the arithmetic evaluation code complain about `08'?
+E9) Why does the pattern matching expression [A-Z]* match files beginning
+ with every letter except `z'?
Section F: Things to watch out for on certain Unix versions
@@ -130,22 +134,22 @@ of Case Western Reserve University.
A2) What's the latest version?
-The latest version is 2.04, first made available on Friday, 17 March 2000.
+The latest version is 2.05, first made available on Monday, 9 April 2001.
A3) Where can I get it?
Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors. The
latest version is also available for FTP from ftp.cwru.edu.
-The following URLs tell how to get version 2.04:
+The following URLs tell how to get version 2.05:
-ftp://ftp.gnu.org/pub/gnu/bash/bash-2.04.tar.gz
-ftp://ftp.cwru.edu/pub/bash/bash-2.04.tar.gz
+ftp://ftp.gnu.org/pub/gnu/bash/bash-2.05.tar.gz
+ftp://ftp.cwru.edu/pub/bash/bash-2.05.tar.gz
Formatted versions of the documentation are available with the URLs:
-ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.04.tar.gz
-ftp://ftp.cwru.edu/pub/bash/bash-doc-2.04.tar.gz
+ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.05.tar.gz
+ftp://ftp.cwru.edu/pub/bash/bash-doc-2.05.tar.gz
A4) On what machines will bash run?
@@ -160,7 +164,7 @@ More information appears in the file `INSTALL' in the distribution.
A5) Will bash run on operating systems other than Unix?
Configuration specifics for Unix-like systems such as QNX and
-LynxOS are included in the distribution. Bash-2.04 should
+LynxOS are included in the distribution. Bash-2.05 should
compile and run on Minix 2.0 (patches were contributed), but I
don't believe anyone has built bash-2.x on earlier Minix versions
yet.
@@ -168,16 +172,17 @@ yet.
Bash has been ported to versions of Windows implementing the Win32
programming interface. This includes Windows 95 and Windows NT.
The port was done by Cygnus Solutions as part of their CYGWIN
-project. For more information about the project, look at the URL
+project. For more information about the project, look at the URLs
-http:/sourceware.cygnus.com/cygwin
+http://www.cygwin.com/
+http://sourceware.cygnus.com/cygwin
Cygnus originally ported bash-1.14.7, and that port was part of their
early GNU-Win32 (the original name) releases. Cygnus has also done a
-port of bash-2.02.1 to the CYGWIN environment, and it is available as
-part of their current release. (They may have upgraded by now.)
+port of bash-2.04 to the CYGWIN environment, and it is available as
+part of their current release.
-Bash-2.04 should require no local Cygnus changes to build and run under
+Bash-2.05 should require no local Cygnus changes to build and run under
CYGWIN.
The Cygnus port works only on Intel machines. There is a port of bash
@@ -185,25 +190,13 @@ The Cygnus port works only on Intel machines. There is a port of bash
ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz
-Softway Systems has ported bash-2.01 to their Interix (nee OpenNT)
-system, a Unix subsystem for NT that replaces the Microsoft POSIX
-subsystem. Check out http://www.interix.com for more information.
-Some support for Interix has been incorporated into bash, beginning
-with Bash-2.03. It should be easier to build bash on Interix now,
-but Interix users should fetch
-
-ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz
-
-and read the README.OpenNT file in that archive. It will detail the
-arguments `configure' needs to build on Interix. A configure cache
-file for Interix is in the bash distribution in cross-build/opennt.cache;
-copy that to `config.cache' before starting configure.
-
-D. J. Delorie has ported bash-1.14.7 to run under MS-DOS, as part of
-the DJGPP project. For more information on the project, see
+DJ Delorie has a port of bash-1.14.7 which runs under MS-DOS, as part
+of the DJGPP project. For more information on the project, see
http://www.delorie.com/djgpp/
+I have been told that the original DJGPP port was done by Daisuke Aoyama.
+
I picked up a binary of bash-1.14.7 that is purported to work with
the DJGPP V2 environment from
@@ -374,18 +367,45 @@ Reference Manual.
Section B: The latest version
-B1) What's new in version 2.04?
+B1) What's new in version 2.05?
-Bash-2.04 contains the following new features (see the manual page for
-complete descriptions and the CHANGES and NEWS files in the bash-2.04
+Bash-2.05 contains the following new features (see the manual page for
+complete descriptions and the CHANGES and NEWS files in the bash-2.05
distribution):
+o This version has once again reverted to using locales and strcoll(3) when
+ processing pattern matching bracket expressions, as POSIX requires.
+o Added a new `--init-file' invocation argument as a synonym for `--rcfile',
+ per the new GNU coding standards.
+o The /dev/tcp and /dev/udp redirections now accept service names as well as
+ port numbers.
+o `complete' and `compgen' now take a `-o value' option, which controls some
+ of the aspects of that compspec. Valid values are:
+
+ default - perform bash default completion if programmable
+ completion produces no matches
+ dirnames - perform directory name completion if programmable
+ completion produces no matches
+ filenames - tell readline that the compspec produces filenames,
+ so it can do things like append slashes to
+ directory names and suppress trailing spaces
+o A new loadable builtin, realpath, which canonicalizes and expands symlinks
+ in pathname arguments.
+o When `set' is called without options, it prints function defintions in a
+ way that allows them to be reused as input. This affects `declare' and
+ `declare -p' as well. This only happens when the shell is not in POSIX
+ mode, since POSIX.2 forbids this behavior.
+
+A short feature history dating from bash-2.0:
+
+Bash-2.04 introduced the following new features:
+
o Programmable word completion with the new `complete' and `compgen' builtins;
examples are provided in examples/complete/complete-examples
o `history' has a new `-d' option to delete a history entry
o `bind' has a new `-x' option to bind key sequences to shell commands
o The prompt expansion code has new `\j' and `\l' escape sequences
-o The `no_empty_command_completion' shell option, if enabled, inhibits
+o The `no_empty_cmd_completion' shell option, if enabled, inhibits
command completion when TAB is typed on an empty line
o `help' has a new `-s' option to print a usage synopsis
o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma)
@@ -405,7 +425,7 @@ o A new shopt `xpg_echo' variable, to control the behavior of echo with
respect to backslash-escape sequences at runtime
o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned
-The version of Readline released with Bash-2.04, Readline-4.1, has several
+The version of Readline released with Bash-2.04, Readline-4.1, had several
new features as well:
o Parentheses matching is always compiled into readline, and controllable
@@ -417,8 +437,6 @@ o A new function for applications: rl_on_new_line_with_prompt()
o New variables for applications: rl_already_prompted, and rl_gnu_readline_p
-A short feature history dating from bash-2.0:
-
Bash-2.03 had very few new features, in keeping with the convention
that odd-numbered releases provide mainly bug fixes. A number of new
features were added to Readline, mostly at the request of the Cygnus
@@ -505,11 +523,11 @@ grammar tighter and smaller (66 reduce-reduce conflicts gone)
lots of code now smaller and faster
test suite greatly expanded
-B2) Are there any user-visible incompatibilities between bash-2.04 and
+B2) Are there any user-visible incompatibilities between bash-2.05 and
bash-1.14.7?
-There are a few incompatibilities between version 1.14.7 and version 2.04.
-They are detailed in the file COMPAT in the bash-2.04 distribution.
+There are a few incompatibilities between version 1.14.7 and version 2.05.
+They are detailed in the file COMPAT in the bash-2.05 distribution.
Section C: Differences from other Unix shells
@@ -660,6 +678,7 @@ Things bash has or uses that ksh88 does not:
Things ksh88 has or uses that bash does not:
tracked aliases
variables: ERRNO, FPATH, EDITOR, VISUAL
+ trap on ERR
co-processes (|&, >&p, <&p)
weirdly-scoped functions
typeset +f to list all function names without definitions
@@ -678,7 +697,7 @@ Implementation differences:
C3) Which new features in ksh-93 are not in bash, and which are?
-New things in ksh-93 not in bash-2.04:
+New things in ksh-93 not in bash-2.05:
associative arrays
floating point arithmetic
math library functions
@@ -824,15 +843,15 @@ D4) How can I make my csh aliases work when I convert to bash?
Bash uses a different syntax to support aliases than csh does.
The details can be found in the documentation. We have provided
a shell script which does most of the work of conversion for you;
-this script can be found in ./examples/misc/alias-conv.sh. Here is
+this script can be found in ./examples/misc/aliasconv.sh. Here is
how you use it:
Start csh in the normal way for you. (e.g., `csh')
-Pipe the output of `alias' through `alias-conv.sh', saving the
+Pipe the output of `alias' through `aliasconv.sh', saving the
results into `bash_aliases':
- alias | alias-conv.sh >bash_aliases
+ alias | bash aliasconv.sh >bash_aliases
Edit `bash_aliases', carefully reading through any created
functions. You will need to change the names of some csh specific
@@ -967,7 +986,10 @@ E4) If I pipe the output of a command into `read variable', why doesn't
the output show up in $variable when the read command finishes?
This has to do with the parent-child relationship between Unix
-processes.
+processes. It affects all commands run in pipelines, not just
+simple calls to `read'. For example, piping a command's output
+into a `while' loop that repeatedly calls `read' will result in
+the same behavior.
Each element of a pipeline runs in a separate process, a child of
the shell running the pipeline. A subprocess cannot affect its
@@ -1058,6 +1080,100 @@ If you want to be able to stop the entire loop, you need to put it
within parentheses, which will force the loop into a subshell that
may be stopped (and subsequently restarted) as a single unit.
+E7) What about empty for loops in Makefiles?
+
+It's fairly common to see constructs like this in automatically-generated
+Makefiles:
+
+SUBDIRS = @SUBDIRS@
+
+ ...
+
+subdirs-clean:
+ for d in ${SUBDIRS}; do \
+ ( cd $$d && ${MAKE} ${MFLAGS} clean ) \
+ done
+
+When SUBDIRS is empty, this results in a command like this being passed to
+bash:
+
+ for d in ; do
+ ( cd $d && ${MAKE} ${MFLAGS} clean )
+ done
+
+This is a syntax error. If the reserved word `in' is present, a word must
+follow it before the semicolon or newline. The language in the manual page
+referring to the list of words being empty refers to the list after it is
+expanded. There must be at least one word following the `in' when the
+construct is parsed.
+
+The idiomatic Makefile solution is something like:
+
+SUBDIRS = @SUBDIRS@
+
+subdirs-clean:
+ subdirs=$SUBDIRS ; for d in $$subdirs; do \
+ ( cd $$d && ${MAKE} ${MFLAGS} clean ) \
+ done
+
+
+The POSIX.2 interpretation committee has considered this issue and declared
+that the bash implemenation is correct, according to the standard:
+
+http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-169.html
+
+E8) Why does the arithmetic evaluation code complain about `08'?
+
+The bash arithmetic evaluation code (used for `let', $(()), (()), and in
+other places), interprets a leading `0' in numeric constants as denoting
+an octal number, and a leading `0x' as denoting hexadecimal. This is
+in accordance with the POSIX.2 spec, section 2.9.2.1, which states that
+arithmetic constants should be handled as signed long integers as defined
+by the ANSI/ISO C standard.
+
+The POSIX.2 interpretation committee has confirmed this:
+
+http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html
+
+E9) Why does the pattern matching expression [A-Z]* match files beginning
+ with every letter except `z'?
+
+Bash-2.05 and later versions have reverted to the bash-2.03 behavior of
+honoring the current locale setting when processing ranges within pattern
+matching bracket expressions ([A-Z]). This is what POSIX.2 and SUSv2/XPG5
+specify.
+
+The behavior of the matcher in bash-2.05 depends on the current LC_COLLATE
+setting. Setting this variable to `C' or `POSIX' will result in the
+traditional behavior ([A-Z] matches all uppercase ASCII characters).
+Many other locales, including the en_US locale (the default on many US
+versions of Linux) collate the upper and lower case letters like this:
+
+ AaBb...Zz
+
+which means that [A-Z] matches every letter except `z'.
+
+The portable way to specify upper case letters is [:upper:] instead of
+A-Z; lower case may be specified as [:lower:] instead of a-z.
+
+Look at the manual pages for setlocale(3), strcoll(3), and, if it is
+present, locale(1). If you have locale(1), you can use it to find
+your current locale information even if you do not have any of the
+LC_ variables set.
+
+My advice is to put
+
+ export LC_COLLATE=C
+
+into /etc/profile and inspect any shell scripts run from cron for
+constructs like [A-Z]. This will prevent things like
+
+ rm [A-Z]*
+
+from removing every file in the current directory except those beginning
+with `z' and still allow individual users to change the collation order.
+Users may put the above command into their own profiles as well, of course.
+
Section F: Things to watch out for on certain Unix versions
F1) Why can't I use command line editing in my `cmdtool'?
@@ -1163,7 +1279,7 @@ comp.unix.shell). While most commands of the form
can be converted to `< file command', shell control structures such as
loops and subshells require `command < file'.
-The file CWRU/sh-redir-hack in the bash-2.04 distribution is an
+The file CWRU/sh-redir-hack in the bash-2.05 distribution is an
(unofficial) patch to parse.y that will modify the grammar to
support this construct. It will not apply with `patch'; you must
modify parse.y by hand. Note that if you apply this, you must
@@ -1410,8 +1526,12 @@ H3) What's coming in future versions?
These are features I plan to include in a future version of bash.
-a bash debugger (a minimally-tested version is included with bash-2.04)
+a bash debugger (a minimally-tested version is included with bash-2.05)
associative arrays
+changes to the DEBUG trap to be compatible with ksh93 (which runs the
+trap before each simple command, instead of after each one like previous
+versions)
+an implementation of the ksh-like ERR trap
H4) What's on the bash `wish list' for future versions?
@@ -1428,11 +1548,11 @@ a better loadable interface to perl with access to the shell builtins and
H5) When will the next release appear?
-The next version will appear sometime in 2000 or 2001. Never make
+The next version will appear sometime in 2001 or 2002. Never make
predictions.
-This document is Copyright 1995-2000 by Chester Ramey.
+This document is Copyright 1995-2001 by Chester Ramey.
Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 9d00643..ab46f0c 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -110,10 +110,10 @@ RLUSER = $(RL_LIBDIR)/doc/rluser.texinfo
all: ps info dvi text html
nodvi: ps info text html
-PSFILES = bash.ps bashbug.ps readline.ps article.ps builtins.ps rbash.ps
+PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps
DVIFILES = bashref.dvi bashref.ps
INFOFILES = bashref.info
-MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0 readline.0
+MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0
HTMLFILES = bashref.html bash.html
ps: ${PSFILES}
@@ -162,8 +162,6 @@ bash.0: bash.1
bashbug.0: bashbug.1
builtins.0: builtins.1 bash.1
rbash.0: rbash.1 bash.1
-readline.0: readline.3
-readline.ps: readline.3
article.ps: article.ms
$(MAN2HTML): ${topdir}/support/man2html.c
@@ -212,8 +210,6 @@ maintainer-clean: clean
installdirs:
-test -d $(man1dir) || $(SHELL) ${MKDIRS} $(man1dir)
-# uncomment the next line to create the directory for the readline man page
-# -test -d $(man3dir) || $(SHELL) ${MKDIRS} $(man3dir)
-test -d $(infodir) || $(SHELL) ${MKDIRS} $(infodir)
-if [ -n "$(htmldir)" ]; then \
test -d $(htmldir) || $(SHELL) ${MKDIRS} $(htmldir) ; \
@@ -222,8 +218,6 @@ installdirs:
install: info installdirs
-$(INSTALL_DATA) $(srcdir)/bash.1 $(man1dir)/bash.${man1ext}
-$(INSTALL_DATA) $(srcdir)/bashbug.1 $(man1dir)/bashbug.${man1ext}
-# uncomment the next line to install the readline man page
-# -$(INSTALL_DATA) $(srcdir)/readline.3 $(man3dir)/readline.${man3ext}
# uncomment the next line to install the builtins man page
# $(INSTALL_DATA) $(srcdir)/builtins.1 $(man1dir)/bash_builtins.${man1ext}
-$(INSTALL_DATA) $(srcdir)/bashref.info $(infodir)/bash.info
@@ -239,7 +233,6 @@ install: info installdirs
uninstall:
-$(RM) $(man1dir)/bash.${man1ext} $(man1dir)/bashbug.${man1ext}
- -$(RM) $(man3dir)/readline.${man3ext}
$(RM) $(infodir)/bash.info
-if [ -n "$(htmldir)" ]; then \
$(RM) $(htmldir)/bash.html ; \
@@ -256,3 +249,5 @@ posix: bashref.texi
$(SHELL) ./mkposix
cmp -s POSIX.NOTES ../CWRU/POSIX.NOTES || mv POSIX.NOTES ../CWRU/POSIX.NOTES
$(RM) POSIX.NOTES
+
+xdist: inst posix
diff --git a/doc/bash.1 b/doc/bash.1
index d1dd752..8809816 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -6,12 +6,12 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
-.\" Last Change: Tue Mar 14 11:36:43 EST 2000
+.\" Last Change: Mon Mar 5 10:19:14 EST 2001
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
-.TH BASH 1 "2000 Mar 14" "GNU Bash-2.04"
+.TH BASH 1 "2001 Mar 5" "GNU Bash-2.05"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -51,8 +51,8 @@ bash \- GNU Bourne-Again SHell
[options]
[file]
.SH COPYRIGHT
-.if n Bash is Copyright (C) 1989-1999 by the Free Software Foundation, Inc.
-.if t Bash is Copyright \(co 1989-1999 by the Free Software Foundation, Inc.
+.if n Bash is Copyright (C) 1989-2001 by the Free Software Foundation, Inc.
+.if t Bash is Copyright \(co 1989-2001 by the Free Software Foundation, Inc.
.SH DESCRIPTION
.B Bash
is an \fBsh\fR-compatible command language interpreter that
@@ -110,7 +110,7 @@ A list of all double-quoted strings preceded by \fB$\fP
is printed on the standard ouput.
These are the strings that
are subject to language translation when the current locale
-is not C or POSIX.
+is not \fBC\fP or \fBPOSIX\fP.
This implies the \fB\-n\fP option; no commands will be executed.
.TP
.B \-\-
@@ -141,6 +141,20 @@ Equivalent to \fB\-D\fP.
.B \-\-help
Display a usage message on standard output and exit successfully.
.TP
+.PD 0
+\fB\-\-init\-file\fP \fIfile\fP
+.TP
+\fB\-\-rcfile\fP \fIfile\fP
+.PD
+Execute commands from
+.I file
+instead of the standard personal initialization file
+.I ~/.bashrc
+if the shell is interactive (see
+.SM
+.B INVOCATION
+below).
+.TP
.B \-\-login
Make
.B bash
@@ -178,17 +192,7 @@ This option is on by default if the shell is invoked as
.TP
.B \-\-posix
Change the behavior of \fBbash\fP where the default operation differs
-from the POSIX 1003.2 standard to match the standard.
-.TP
-\fB\-\-rcfile\fP \fIfile\fP
-Execute commands from
-.I file
-instead of the standard personal initialization file
-.I ~/.bashrc
-if the shell is interactive (see
-.SM
-.B INVOCATION
-below).
+from the POSIX 1003.2 standard to match the standard (\fIposix mode\fP).
.TP
.B \-\-restricted
The shell becomes restricted (see
@@ -303,7 +307,8 @@ expanded value as the name of a file to read and execute.
behaves as if the following command were executed:
.sp .5
.RS
-\f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP
+.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP
+.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
.RE
.sp .5
but the value of the
@@ -1119,7 +1124,7 @@ user is a member.
Assignments to
.SM
.B GROUPS
-have no effect and are silently discarded.
+have no effect and return an error status.
If
.SM
.B GROUPS
@@ -1223,7 +1228,7 @@ This variable exists only when a shell function is executing.
Assignments to
.SM
.B FUNCNAME
-have no effect and are silently discarded.
+have no effect and return an error status.
If
.SM
.B FUNCNAME
@@ -1376,7 +1381,9 @@ the shell looks for commands (see
below). The default path is system-dependent,
and is set by the administrator who installs
.BR bash .
-A common value is ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''.
+A common value is
+.if t \f(CW/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.\fP.
+.if n ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''.
.TP
.B HOME
The home directory of the current user; the default argument for the
@@ -1421,7 +1428,8 @@ often (in seconds)
.B bash
checks for mail. The default is 60 seconds. When it is time to check
for mail, the shell does so before displaying the primary prompt.
-If this variable is unset, the shell disables mail checking.
+If this variable is unset, or set to a value that is not a number
+greater than or equal to zero, the shell disables mail checking.
.TP
.B MAILPATH
A colon-separated list of file names to be checked for mail.
@@ -1578,6 +1586,14 @@ strings preceded by a \fB$\fP.
.B LC_NUMERIC
This variable determines the locale category used for number formatting.
.TP
+.B LINES
+Used by the \fBselect\fP builtin command to determine the column length
+for printing selection lists. Automatically set upon receipt of a SIGWINCH.
+.TP
+.B COLUMNS
+Used by the \fBselect\fP builtin command to determine the terminal width
+when printing selection lists. Automatically set upon receipt of a SIGWINCH.
+.TP
.B PROMPT_COMMAND
If set, the value is executed as a command prior to issuing each primary
prompt.
@@ -2502,9 +2518,10 @@ Matches any single character.
.TP
.B [...]
Matches any one of the enclosed characters. A pair of characters
-separated by a minus sign denotes a
-.IR range ;
-any character lexically between those two characters, inclusive,
+separated by a hyphen denotes a
+\fIrange expression\fP;
+any character that sorts between those two characters, inclusive,
+using the current locale's collating sequence and character set,
is matched. If the first character following the
.B [
is a
@@ -2512,6 +2529,9 @@ is a
or a
.B ^
then any character not enclosed is matched.
+The sorting order of characters in range expressions is determined by
+the current locale and the value of the \fBLC_COLLATE\fP shell variable,
+if set.
A
.B \-
may be matched by including it as the first or last character
@@ -3990,6 +4010,7 @@ 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.
+.PP
When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP,
.I keyname
is the name of a key spelled out in English. For example:
@@ -4013,7 +4034,8 @@ and
.I C\-o
is bound to run the macro
expressed on the right hand side (that is, to insert the text
-.I "> output"
+.if t \f(CW> output\fP
+.if n ``> output''
into the line).
.PP
In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP,
@@ -4023,7 +4045,8 @@ differs from
above in that strings denoting
an entire key sequence may be specified by placing the sequence
within double quotes. Some GNU Emacs style key escapes can be
-used, as in the following example.
+used, as in the following example, but the symbolic character names
+are not recognized.
.sp
.RS
"\eC\-u": universal\-argument
@@ -4043,7 +4066,9 @@ is bound to the function
and
.I "ESC [ 1 1 ~"
is bound to insert the text
-.BR "Function Key 1" .
+.if t \f(CWFunction Key 1\fP.
+.if n ``Function Key 1''.
+.PP
The full set of GNU Emacs style escape sequences is
.RS
.PD 0
@@ -4467,8 +4492,8 @@ This is a non-incremental search.
.TP
.B yank\-nth\-arg (M\-C\-y)
Insert the first argument to the previous command (usually
-the second word on the previous line) at point (the current
-cursor position). With an argument
+the second word on the previous line) at point.
+With an argument
.IR n ,
insert the \fIn\fPth word from the previous command (the words
in the previous command begin with word 0). A negative argument
@@ -4527,7 +4552,7 @@ argument is ignored.
.PD 0
.TP
.B delete\-char (C\-d)
-Delete the character under the cursor. If point is at the
+Delete the character at point. If point is at the
beginning of the line, there are no characters in the line, and
the last character typed was not bound to \fBdelete\-char\fP,
then return
@@ -4554,15 +4579,15 @@ Insert a tab character.
Insert the character typed.
.TP
.B transpose\-chars (C\-t)
-Drag the character before point forward over the character at point.
-Point moves forward as well.
-If point is at the end of the line, then transpose the two characters
-before point.
+Drag the character before point forward over the character at point,
+moving point forward as well.
+If point is at the end of the line, then this transposes
+the two characters before point.
Negative arguments have no effect.
.TP
.B transpose\-words (M\-t)
Drag the word before point past the word after point,
-moving the point over that word as well.
+moving point over that word as well.
.TP
.B upcase\-word (M\-u)
Uppercase the current (or following) word. With a negative argument,
@@ -4605,7 +4630,6 @@ Word boundaries are the same as those used by \fBbackward\-word\fP.
.TP
.B unix\-word\-rubout (C\-w)
Kill the word behind point, using white space as a word boundary.
-The word boundaries are different from \fBbackward\-kill\-word\fP.
The killed text is saved on the kill-ring.
.TP
.B delete\-horizontal\-space (M\-\e)
@@ -4626,7 +4650,7 @@ Copy the word following point to the kill buffer.
The word boundaries are the same as \fBforward\-word\fP.
.TP
.B yank (C\-y)
-Yank the top of the kill ring into the buffer at the cursor.
+Yank the top of the kill ring into the buffer at point.
.TP
.B yank\-pop (M\-y)
Rotate the kill ring, and yank the new top. Only works following
@@ -4682,8 +4706,9 @@ Similar to \fBcomplete\fP, but replaces the word to be completed
with a single match from the list of possible completions.
Repeated execution of \fBmenu\-complete\fP steps through the list
of possible completions, inserting each match in turn.
-At the end of the list of completions, the bell is rung and the
-original text is restored.
+At the end of the list of completions, the bell is rung
+(subject to the setting of \Bbell\-style\fP)
+and the original text is restored.
An argument of \fIn\fP moves \fIn\fP positions forward in the list
of matches; a negative argument may be used to move backward
through the list.
@@ -4802,7 +4827,7 @@ command enough times to return the line to its initial state.
Perform tilde expansion on the current word.
.TP
.B set\-mark (C\-@, M\-<space>)
-Set the mark to the current point. If a
+Set the mark to the point. If a
numeric argument is supplied, the mark is set to that position.
.TP
.B exchange\-point\-and\-mark (C\-x C\-x)
@@ -4975,10 +5000,17 @@ options are added to each member of the completion list, and the result is
returned to the readline completion code as the list of possible
completions.
.PP
-If a compspec is found, whatever it generates is returned to the completion
-code as the full set of possible completions.
+If the previously-applied actions do not generate any matches, and the
+\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the
+compspec was defined, directory name completion is attempted.
+.PP
+By default, if a compspec is found, whatever it generates is returned
+to the completion code as the full set of possible completions.
The default \fBbash\fP completions are not attempted, and the readline
default of filename completion is disabled.
+If the \fB-o default\fP option was supplied to \fBcomplete\fP when the
+compspec was defined, readline's default completion will be performed
+if the compspec generates no matches.
.SH HISTORY
When the
.B \-o history
@@ -5377,7 +5409,8 @@ are used to find the directory containing
The file searched for in
.SM
.B PATH
-need not be executable. The current directory is
+need not be executable.
+When \fBbash\fP is not in \fIposix mode\fP, the current directory is
searched if no file is found in
.SM
.BR PATH .
@@ -5454,7 +5487,7 @@ Acceptable
.I keymap
names are
\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi,
-vi\-command\fP, and
+vi\-move, vi\-command\fP, and
.IR vi\-insert .
\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is
equivalent to \fIemacs\-standard\fP.
@@ -5639,7 +5672,7 @@ The return value is true unless an invalid option is supplied, or no
matches were generated.
.TP
.PD 0
-\fBcomplete\fP [\fB\-abcdefjkvu\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP]
+\fBcomplete\fP [\fB\-abcdefjkvu\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP]
.br
[\fB\-X\fP \fIfilterpat\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] \fIname\fP [\fIname ...\fP]
.TP
@@ -5665,6 +5698,24 @@ builtin is invoked.
.RS
.PD 0
.TP 8
+\fB\-o\fP \fIcomp-option\fP
+The \fIcomp-option\fP controls several aspects of the compspec's behavior
+beyond the simple generation of completions.
+\fIcomp-option\fP may be one of:
+.RS
+.TP 8
+.B default
+Use readline's default completion if the compspec generates no matches.
+.TP 8
+.B dirnames
+Perform directory name completion if the compspec generates no matches.
+.TP 8
+.B 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). Intended to be used with shell functions.
+.RE
+.TP 8
\fB\-A\fP \fIaction\fP
The \fIaction\fP may be one of the following to generate a list of possible
completions:
@@ -5964,7 +6015,7 @@ the following backslash-escaped characters is enabled. The
.B \-E
option disables the interpretation of these escape characters,
even on systems where they are interpreted by default.
-The \fBxpg_echo\fP shell option to the may be used to
+The \fBxpg_echo\fP shell option may be used to
dynamically determine whether or not \fBecho\fP expands these
escape characters by default.
.B echo
@@ -6029,7 +6080,8 @@ binary found via the
.SM
.B PATH
instead of the shell builtin version, run
-\f(CWenable -n test\fP.
+.if t \f(CWenable -n test\fP.
+.if n ``enable -n test''.
The
.B \-f
option means to load the new builtin command
@@ -6885,8 +6937,8 @@ Options, if specified, have the following meanings:
.PD 0
.TP 8
.B \-a
-Automatically mark variables which are modified or created for export
-to the environment of subsequent commands.
+Automatically mark variables and functions which are modified or created
+for export to the environment of subsequent commands.
.TP 8
.B \-b
Report the status of terminated background jobs
@@ -6978,7 +7030,10 @@ Enable command history, as described above under
This option is on by default in interactive shells.
.TP 8
.B ignoreeof
-The effect is as if the shell command \f(CWIGNOREEOF=10\fP had been executed
+The effect is as if the shell command
+.if t \f(CWIGNOREEOF=10\fP
+.if n ``IGNOREEOF=10''
+had been executed
(see
.B Shell Variables
above).
@@ -7023,7 +7078,7 @@ Same as
Change the behavior of
.B bash
where the default operation differs
-from the POSIX 1003.2 standard to match the standard.
+from the POSIX 1003.2 standard to match the standard (\fIposix mode\fP).
.TP 8
.B privileged
Same as
@@ -7621,7 +7676,9 @@ either returns the name of the disk file
that would be executed if
.I name
were specified as a command name,
-or nothing if \f(CWtype -t name\fP
+or nothing if
+.if t \f(CWtype -t name\fP
+.if n ``type -t name''
would not return
.IR file .
If a command is hashed,
diff --git a/doc/bashref.info b/doc/bashref.info
index 3b2b6da..f4ee48a 100644
--- a/doc/bashref.info
+++ b/doc/bashref.info
@@ -1,5 +1,5 @@
-This is Info file bashref.info, produced by Makeinfo version 1.68 from
-the input file /usr/homes/chet/src/bash/src/doc/bashref.texi.
+This is bashref.info, produced by makeinfo version 4.0 from
+/usr/homes/chet/src/bash/src/doc/bashref.texi.
INFO-DIR-SECTION Utilities
START-INFO-DIR-ENTRY
@@ -9,9 +9,9 @@ END-INFO-DIR-ENTRY
This text is a brief description of the features that are present in
the Bash shell.
-This is Edition 2.4, last updated 14 March 2000,
+This is Edition 2.5, last updated 28 Mar 2001,
of `The GNU Bash Reference Manual',
-for `Bash', Version 2.04.
+for `Bash', Version 2.05.
Copyright (C) 1991-1999 Free Software Foundation, Inc.
@@ -38,8 +38,8 @@ Bash Features
This text is a brief description of the features that are present in
the Bash shell.
- This is Edition 2.4, last updated 14 March 2000, of `The GNU Bash
-Reference Manual', for `Bash', Version 2.04.
+ This is Edition 2.5, last updated 28 Mar 2001, of `The GNU Bash
+Reference Manual', for `Bash', Version 2.05.
Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
@@ -332,30 +332,30 @@ Shell Operation
The following is a brief description of the shell's operation when it
reads and executes a command. Basically, the shell does the following:
- 1. Reads its input from a file (*note Shell Scripts::.), from a string
+ 1. Reads its input from a file (*note Shell Scripts::), from a string
supplied as an argument to the `-c' invocation option (*note
- Invoking Bash::.), or from the user's terminal.
+ Invoking Bash::), or from the user's terminal.
2. Breaks the input into words and operators, obeying the quoting
rules described in *Note Quoting::. These tokens are separated by
`metacharacters'. Alias expansion is performed by this step
- (*note Aliases::.).
+ (*note Aliases::).
3. Parses the tokens into simple and compound commands (*note Shell
- Commands::.).
+ Commands::).
- 4. Performs the various shell expansions (*note Shell Expansions::.),
+ 4. Performs the various shell expansions (*note Shell Expansions::),
breaking the expanded tokens into lists of filenames (*note
- Filename Expansion::.) and commands and arguments.
+ Filename Expansion::) and commands and arguments.
- 5. Performs any necessary redirections (*note Redirections::.) and
+ 5. Performs any necessary redirections (*note Redirections::) and
removes the redirection operators and their operands from the
argument list.
- 6. Executes the command (*note Executing Commands::.).
+ 6. Executes the command (*note Executing Commands::).
7. Optionally waits for the command to complete and collects its exit
- status (*note Exit Status::.).
+ status (*note Exit Status::).

@@ -381,11 +381,11 @@ or words to the shell. Quoting can be used to disable special
treatment for special characters, to prevent reserved words from being
recognized as such, and to prevent parameter expansion.
- Each of the shell metacharacters (*note Definitions::.) has special
+ Each of the shell metacharacters (*note Definitions::) has special
meaning to the shell and must be quoted if it is to represent itself.
When the command history expansion facilities are being used, the
HISTORY EXPANSION character, usually `!', must be quoted to prevent
-history expansion. *Note Bash History Facilities:: for more details
+history expansion. *Note Bash History Facilities::, for more details
concerning history expansion. There are three quoting mechanisms: the
ESCAPE CHARACTER, single quotes, and double quotes.
@@ -421,8 +421,8 @@ Double Quotes
Enclosing characters in double quotes (`"') preserves the literal
value of all characters within the quotes, with the exception of `$',
``', and `\'. The characters `$' and ``' retain their special meaning
-within double quotes (*note Shell Expansions::.). The backslash
-retains its special meaning only when followed by one of the following
+within double quotes (*note Shell Expansions::). The backslash retains
+its special meaning only when followed by one of the following
characters: `$', ``', `"', `\', or `newline'. Within double quotes,
backslashes that are followed by one of these characters are removed.
Backslashes preceding characters without a special meaning are left
@@ -430,7 +430,7 @@ unmodified. A double quote may be quoted within double quotes by
preceding it with a backslash.
The special parameters `*' and `@' have special meaning when in
-double quotes (*note Shell Parameter Expansion::.).
+double quotes (*note Shell Parameter Expansion::).

File: bashref.info, Node: ANSI-C Quoting, Next: Locale Translation, Prev: Double Quotes, Up: Quoting
@@ -440,7 +440,7 @@ ANSI-C Quoting
Words of the form `$'STRING'' are treated specially. The word
expands to STRING, with backslash-escaped characters replaced as
-specifed by the ANSI C standard. Backslash escape sequences, if
+specified by the ANSI C standard. Backslash escape sequences, if
present, are decoded as follows:
`\a'
@@ -495,6 +495,12 @@ the string to be translated according to the current locale. If the
current locale is `C' or `POSIX', the dollar sign is ignored. If the
string is translated and replaced, the replacement is double-quoted.
+ Some systems use the message catalog selected by the `LC_MESSAGES'
+shell variable. Others create the name of the message catalog from the
+value of the `TEXTDOMAIN' shell variable, possibly adding a suffix of
+`.mo'. If you use the `TEXTDOMAIN' variable, you may need to set the
+`TEXTDOMAINDIR' variable to the location of the message catalog files.
+

File: bashref.info, Node: Comments, Prev: Quoting, Up: Shell Syntax
@@ -503,7 +509,7 @@ Comments
In a non-interactive shell, or an interactive shell in which the
`interactive_comments' option to the `shopt' builtin is enabled (*note
-Bash Builtins::.), a word beginning with `#' causes that word and all
+Bash Builtins::), a word beginning with `#' causes that word and all
remaining characters on that line to be ignored. An interactive shell
without the `interactive_comments' option enabled does not allow
comments. The `interactive_comments' option is on by default in
@@ -542,11 +548,11 @@ Simple Commands
A simple command is the kind of command encountered most often.
It's just a sequence of words separated by `blank's, terminated by one
-of the shell's control operators (*note Definitions::.). The first
-word generally specifies a command to be executed, with the rest of the
+of the shell's control operators (*note Definitions::). The first word
+generally specifies a command to be executed, with the rest of the
words being that command's arguments.
- The return status (*note Exit Status::.) of a simple command is its
+ The return status (*note Exit Status::) of a simple command is its
exit status as provided by the POSIX 1003.1 `waitpid' function, or
128+N if the command was terminated by signal N.
@@ -576,14 +582,14 @@ The use of `time' as a reserved word permits the timing of shell
builtins, shell functions, and pipelines. An external `time' command
cannot time these easily.
- If the pipeline is not executed asynchronously (*note Lists::.), the
+ If the pipeline is not executed asynchronously (*note Lists::), the
shell waits for all commands in the pipeline to complete.
Each command in a pipeline is executed in its own subshell (*note
-Command Execution Environment::.). The exit status of a pipeline is
-the exit status of the last command in the pipeline. If the reserved
-word `!' precedes the pipeline, the exit status is the logical negation
-of the exit status of the last command.
+Command Execution Environment::). The exit status of a pipeline is the
+exit status of the last command in the pipeline. If the reserved word
+`!' precedes the pipeline, the exit status is the logical negation of
+the exit status of the last command.

File: bashref.info, Node: Lists, Next: Looping Constructs, Prev: Pipelines, Up: Shell Commands
@@ -602,7 +608,7 @@ followed by `;' and `&', which have equal precedence.
executes the command asynchronously in a subshell. This is known as
executing the command in the BACKGROUND. The shell does not wait for
the command to finish, and the return status is 0 (true). When job
-control is not active (*note Job Control::.), the standard input for
+control is not active (*note Job Control::), the standard input for
asynchronous commands, in the absence of any explicit redirections, is
redirected from `/dev/null'.
@@ -662,7 +668,7 @@ syntax, it may be replaced with one or more newlines.
resultant list, with NAME bound to the current member. If `in
WORDS' is not present, the `for' command executes the COMMANDS
once for each positional parameter that is set, as if `in "$@"'
- had been specified (*note Special Parameters::.). The return
+ had been specified (*note Special Parameters::). The return
status is the exit status of the last command that executes. If
there are no items in the expansion of WORDS, no commands are
executed, and the return status is zero.
@@ -671,7 +677,7 @@ syntax, it may be replaced with one or more newlines.
for (( EXPR1 ; EXPR2 ; EXPR3 )) ; do COMMANDS ; done
First, the arithmetic expression EXPR1 is evaluated according to
- the rules described below (*note Shell Arithmetic::.). The
+ the rules described below (*note Shell Arithmetic::). The
arithmetic expression EXPR2 is then evaluated repeatedly until it
evaluates to zero. Each time EXPR2 evaluates to a non-zero value,
COMMANDS are executed and the arithmetic expression EXPR3 is
@@ -680,7 +686,7 @@ syntax, it may be replaced with one or more newlines.
command in LIST that is executed, or false if any of the
expressions is invalid.
- The `break' and `continue' builtins (*note Bourne Shell Builtins::.)
+ The `break' and `continue' builtins (*note Bourne Shell Builtins::)
may be used to control loop execution.

@@ -782,7 +788,7 @@ Conditional Constructs
(( EXPRESSION ))
The arithmetic EXPRESSION is evaluated according to the rules
- described below (*note Shell Arithmetic::.). If the value of the
+ described below (*note Shell Arithmetic::). If the value of the
expression is non-zero, the return status is 0; otherwise the
return status is 1. This is exactly equivalent to
let "EXPRESSION"
@@ -895,7 +901,7 @@ COMMAND-LIST must be terminated with a semicolon or a newline.
When a function is executed, the arguments to the function become
the positional parameters during its execution (*note Positional
-Parameters::.). The special parameter `#' that expands to the number of
+Parameters::). The special parameter `#' that expands to the number of
positional parameters is updated to reflect the change. Positional
parameter `0' is unchanged. The `FUNCNAME' variable is set to the name
of the function while the function is executing.
@@ -944,7 +950,7 @@ command substitution, arithmetic expansion, and quote removal (detailed
below). If the variable has its `integer' attribute set (see the
description of the `declare' builtin in *Note Bash Builtins::), then
VALUE is subject to arithmetic expansion even if the `$((...))'
-expansion is not used (*note Arithmetic Expansion::.). Word splitting
+expansion is not used (*note Arithmetic Expansion::). Word splitting
is not performed, with the exception of `"$@"' as explained below.
Filename expansion is not performed.
@@ -961,8 +967,8 @@ using the `set' builtin command. Positional parameter `N' may be
referenced as `${N}', or as `$N' when `N' consists of a single digit.
Positional parameters may not be assigned to with assignment statements.
The `set' and `shift' builtins are used to set and unset them (*note
-Shell Builtin Commands::.). The positional parameters are temporarily
-replaced when a shell function is executed (*note Shell Functions::.).
+Shell Builtin Commands::). The positional parameters are temporarily
+replaced when a shell function is executed (*note Shell Functions::).
When a positional parameter consisting of more than a single digit
is expanded, it must be enclosed in braces.
@@ -1016,11 +1022,11 @@ only be referenced; assignment to them is not allowed.
`0'
Expands to the name of the shell or shell script. This is set at
shell initialization. If Bash is invoked with a file of commands
- (*note Shell Scripts::.), `$0' is set to the name of that file.
- If Bash is started with the `-c' option (*note Invoking Bash::.),
- then `$0' is set to the first argument after the string to be
- executed, if one is present. Otherwise, it is set to the filename
- used to invoke Bash, as given by argument zero.
+ (*note Shell Scripts::), `$0' is set to the name of that file. If
+ Bash is started with the `-c' option (*note Invoking Bash::), then
+ `$0' is set to the first argument after the string to be executed,
+ if one is present. Otherwise, it is set to the filename used to
+ invoke Bash, as given by argument zero.
`_'
(An underscore.) At shell startup, set to the absolute filename
@@ -1080,10 +1086,10 @@ parameter, variable, and arithmetic expansion and command substitution.
Only brace expansion, word splitting, and filename expansion can
change the number of words of the expansion; other expansions expand a
single word to a single word. The only exceptions to this are the
-expansions of `"$@"' (*note Special Parameters::.) and `"${NAME[@]}"'
-(*note Arrays::.).
+expansions of `"$@"' (*note Special Parameters::) and `"${NAME[@]}"'
+(*note Arrays::).
- After all expansions, `quote removal' (*note Quote Removal::.) is
+ After all expansions, `quote removal' (*note Quote Removal::) is
performed.

@@ -1094,7 +1100,7 @@ Brace Expansion
Brace expansion is a mechanism by which arbitrary strings may be
generated. This mechanism is similar to FILENAME EXPANSION (*note
-Filename Expansion::.), but the file names generated need not exist.
+Filename Expansion::), but the file names generated need not exist.
Patterns to be brace expanded take the form of an optional PREAMBLE,
followed by a series of comma-separated strings between a pair of
braces, followed by an optional POSTSCRIPT. The preamble is prefixed
@@ -1149,7 +1155,7 @@ a number N, optionally prefixed by a `+' or a `-', the tilde-prefix is
replaced with the corresponding element from the directory stack, as it
would be displayed by the `dirs' builtin invoked with the characters
following tilde in the tilde-prefix as an argument (*note The Directory
-Stack::.). If the tilde-prefix, sans the tilde, consists of a number
+Stack::). If the tilde-prefix, sans the tilde, consists of a number
without a leading `+' or `-', `+' is assumed.
If the login name is invalid, or the tilde expansion fails, the word
@@ -1253,7 +1259,7 @@ if the colon is omitted, the operator tests only for existence.
character specified by OFFSET. If LENGTH is omitted, expands to
the substring of PARAMETER starting at the character specified by
OFFSET. LENGTH and OFFSET are arithmetic expressions (*note Shell
- Arithmetic::.). This is referred to as Substring Expansion.
+ Arithmetic::). This is referred to as Substring Expansion.
LENGTH must evaluate to a number greater than or equal to zero.
If OFFSET evaluates to a number less than zero, the value is used
@@ -1279,7 +1285,7 @@ if the colon is omitted, the operator tests only for existence.
`${PARAMETER#WORD}'
`${PARAMETER##WORD}'
The WORD is expanded to produce a pattern just as in filename
- expansion (*note Filename Expansion::.). If the pattern matches
+ expansion (*note Filename Expansion::). If the pattern matches
the beginning of the expanded value of PARAMETER, then the result
of the expansion is the expanded value of PARAMETER with the
shortest matching pattern (the `#' case) or the longest matching
@@ -1373,7 +1379,7 @@ substitution, and quote removal. Arithmetic substitutions may be
nested.
The evaluation is performed according to the rules listed below
-(*note Shell Arithmetic::.). If the expression is invalid, Bash prints
+(*note Shell Arithmetic::). If the expression is invalid, Bash prints
a message indicating failure to the standard error and no substitution
occurs.
@@ -1445,7 +1451,7 @@ Filename Expansion
* Pattern Matching:: How the shell matches patterns.
After word splitting, unless the `-f' option has been set (*note The
-Set Builtin::.), Bash scans each word for the characters `*', `?', and
+Set Builtin::), Bash scans each word for the characters `*', `?', and
`['. If one of these characters appears, then the word is regarded as
a PATTERN, and replaced with an alphabetically sorted list of file
names matching the pattern. If no matching file names are found, and
@@ -1454,8 +1460,8 @@ If the `nullglob' option is set, and no matches are found, the word is
removed. If the shell option `nocaseglob' is enabled, the match is
performed without regard to the case of alphabetic characters.
- When a pattern is used for filename generation, the character `.'
-at the start of a filename or immediately following a slash must be
+ When a pattern is used for filename generation, the character `.' at
+the start of a filename or immediately following a slash must be
matched explicitly, unless the shell option `dotglob' is set. When
matching a file name, the slash character must always be matched
explicitly. In other cases, the `.' character is not treated specially.
@@ -1466,7 +1472,7 @@ description of the `nocaseglob', `nullglob', and `dotglob' options.
The `GLOBIGNORE' shell variable may be used to restrict the set of
filenames matching a pattern. If `GLOBIGNORE' is set, each matching
filename that also matches one of the patterns in `GLOBIGNORE' is
-removed from the list of matches. The filenames `.' and `..' are
+removed from the list of matches. The filenames `.' and `..' are
always ignored, even when `GLOBIGNORE' is set. However, setting
`GLOBIGNORE' has the effect of enabling the `dotglob' shell option, so
all other filenames beginning with a `.' will match. To get the old
@@ -1494,12 +1500,25 @@ quoted if they are to be matched literally.
`[...]'
Matches any one of the enclosed characters. A pair of characters
- separated by a minus sign denotes a RANGE; any character lexically
- between those two characters, inclusive, is matched. If the first
- character following the `[' is a `!' or a `^' then any character
- not enclosed is matched. A `-' may be matched by including it as
- the first or last character in the set. A `]' may be matched by
- including it as the first character in the set.
+ separated by a hyphen denotes a RANGE EXPRESSION; any character
+ that sorts between those two characters, inclusive, using the
+ current locale's collating sequence and character set, is matched.
+ If the first character following the `[' is a `!' or a `^' then
+ any character not enclosed is matched. A `-' may be matched by
+ including it as the first or last character in the set. A `]' may
+ be matched by including it as the first character in the set. The
+ sorting order of characters in range expressions is determined by
+ the current locale and the value of the `LC_COLLATE' shell
+ variable, if set.
+
+ For example, in the default C locale, `[a-dx-z]' is equivalent to
+ `[abcdxyz]'. Many locales sort characters in dictionary order,
+ and in these locales `[a-dx-z]' is typically not equivalent to
+ `[abcdxyz]'; it might be equivalent to `[aBbCcDdxXyYz]', for
+ example. To obtain the traditional interpretation of ranges in
+ bracket expressions, you can force the use of the C locale by
+ setting the `LC_COLLATE' or `LC_ALL' environment variable to the
+ value `C'.
Within `[' and `]', CHARACTER CLASSES can be specified using the
syntax `[:'CLASS`:]', where CLASS is one of the following classes
@@ -1514,7 +1533,7 @@ quoted if they are to be matched literally.
collation weight (as defined by the current locale) as the
character C.
- Within `[' and `]', the syntax `[.'SYMBOL`.]' matches the
+ Within `[' and `]', the syntax `[.'SYMBOL`.]' matches the
collating symbol SYMBOL.
If the `extglob' shell option is enabled using the `shopt' builtin,
@@ -1769,12 +1788,12 @@ expansions, assignments, and redirections, from left to right.
processing.
2. The words that are not variable assignments or redirections are
- expanded (*note Shell Expansions::.). If any words remain after
+ expanded (*note Shell Expansions::). If any words remain after
expansion, the first word is taken to be the name of the command
and the remaining words are the arguments.
3. Redirections are performed as described above (*note
- Redirections::.).
+ Redirections::).
4. The text after the `=' in each variable assignment undergoes tilde
expansion, parameter expansion, command substitution, arithmetic
@@ -1872,10 +1891,11 @@ following:
* options enabled by `shopt'
- * shell aliases defined with `alias' (*note Aliases::.)
+ * shell aliases defined with `alias' (*note Aliases::)
* various process IDs, including those of background jobs (*note
- Lists::.), the value of `$$', and the value of `$PPID'
+ Lists::), the value of `$$', and the value of `$PPID'
+
When a simple command other than a builtin or shell function is to
be executed, it is invoked in a separate execution environment that
@@ -1890,11 +1910,12 @@ inherited from the shell.
* the file creation mode mask
* shell variables marked for export, along with variables exported
- for the command, passed in the environment (*note Environment::.)
+ for the command, passed in the environment (*note Environment::)
* traps caught by the shell are reset to the values inherited from
the shell's parent, and traps ignored by the shell are ignored
+
A command invoked in this separate environment cannot affect the
shell's execution environment.
@@ -1934,7 +1955,7 @@ temporarily by prefixing it with parameter assignments, as described in
*Note Shell Parameters::. These assignment statements affect only the
environment seen by that command.
- If the `-k' option is set (*note The Set Builtin::.), then all
+ If the `-k' option is set (*note The Set Builtin::), then all
parameter assignments are placed in the environment for a command, not
just those that precede the command name.
@@ -1963,8 +1984,8 @@ the return status is 126.
redirection, the exit status is greater than zero.
The exit status is used by the Bash conditional commands (*note
-Conditional Constructs::.) and some of the list constructs (*note
-Lists::.).
+Conditional Constructs::) and some of the list constructs (*note
+Lists::).
All of the Bash builtins return an exit status of zero if they
succeed and a non-zero status on failure, so they may be used by the
@@ -1982,7 +2003,7 @@ Signals
`SIGINT' is caught and handled (so that the `wait' builtin is
interruptible). When Bash receives a `SIGINT', it breaks out of any
executing loops. In all cases, Bash ignores `SIGQUIT'. If job control
-is in effect (*note Job Control::.), Bash ignores `SIGTTIN', `SIGTTOU',
+is in effect (*note Job Control::), Bash ignores `SIGTTIN', `SIGTTOU',
and `SIGTSTP'.
Commands started by Bash have signal handlers set to the values
@@ -1997,12 +2018,12 @@ exiting, it resends the `SIGHUP' to all jobs, running or stopped.
Stopped jobs are sent `SIGCONT' to ensure that they receive the
`SIGHUP'. To prevent the shell from sending the `SIGHUP' signal to a
particular job, it should be removed from the jobs table with the
-`disown' builtin (*note Job Control Builtins::.) or marked to not
+`disown' builtin (*note Job Control Builtins::) or marked to not
receive `SIGHUP' using `disown -h'.
If the `huponexit' shell option has been set with `shopt' (*note
-Bash Builtins::.), Bash sends a `SIGHUP' to all jobs when an
-interactive login shell exits.
+Bash Builtins::), Bash sends a `SIGHUP' to all jobs when an interactive
+login shell exits.
When Bash receives a signal for which a trap has been set while
waiting for a command to complete, the trap will not be executed until
@@ -2020,7 +2041,7 @@ Shell Scripts
A shell script is a text file containing shell commands. When such
a file is used as the first non-option argument when invoking Bash, and
-neither the `-c' nor `-s' option is supplied (*note Invoking Bash::.),
+neither the `-c' nor `-s' option is supplied (*note Invoking Bash::),
Bash reads and executes commands from the file, then exits. This mode
of operation creates a non-interactive shell. When Bash runs a shell
script, it sets the special parameter `0' to the name of the file,
@@ -2079,7 +2100,7 @@ Shell Builtin Commands
Builtin commands are contained within the shell itself. When the
name of a builtin command is used as the first word of a simple command
-(*note Simple Commands::.), the shell executes the command directly,
+(*note Simple Commands::), the shell executes the command directly,
without invoking another program. Builtin commands are necessary to
implement functionality impossible or inconvenient to obtain with
separate utilities.
@@ -2090,10 +2111,10 @@ have been extended in Bash.
Several builtin commands are described in other chapters: builtin
commands which provide the Bash interface to the job control facilities
-(*note Job Control Builtins::.), the directory stack (*note Directory
-Stack Builtins::.), the command history (*note Bash History
-Builtins::.), and the programmable completion facilities (*note
-Programmable Completion Builtins::.).
+(*note Job Control Builtins::), the directory stack (*note Directory
+Stack Builtins::), the command history (*note Bash History Builtins::),
+and the programmable completion facilities (*note Programmable
+Completion Builtins::).
Many of the builtins have been extended by POSIX or Bash.
@@ -2116,14 +2137,14 @@ standard.
. FILENAME [ARGUMENTS]
Read and execute commands from the FILENAME argument in the
current shell context. If FILENAME does not contain a slash, the
- `PATH' variable is used to find FILENAME. The current directory
- is searched if FILENAME is not found in `$PATH'. If any ARGUMENTS
- are supplied, they become the positional parameters when FILENAME
- is executed. Otherwise the positional parameters are unchanged.
- The return status is the exit status of the last command executed,
- or zero if no commands are executed. If FILENAME is not found, or
- cannot be read, the return status is non-zero. This builtin is
- equivalent to `source'.
+ `PATH' variable is used to find FILENAME. When Bash is not in
+ POSIX mode, the current directory is searched if FILENAME is not
+ found in `$PATH'. If any ARGUMENTS are supplied, they become the
+ positional parameters when FILENAME is executed. Otherwise the
+ positional parameters are unchanged. The return status is the
+ exit status of the last command executed, or zero if no commands
+ are executed. If FILENAME is not found, or cannot be read, the
+ return status is non-zero. This builtin is equivalent to `source'.
`break'
break [N]
@@ -2327,13 +2348,13 @@ standard.
If the first argument is `!', the expression is true if and
only if the second argument is null. If the first argument
is one of the unary conditional operators (*note Bash
- Conditional Expressions::.), the expression is true if the
+ Conditional Expressions::), the expression is true if the
unary test is true. If the first argument is not a valid
unary operator, the expression is false.
3 arguments
If the second argument is one of the binary conditional
- operators (*note Bash Conditional Expressions::.), the result
+ operators (*note Bash Conditional Expressions::), the result
of the expression is the result of the binary test using the
first and third arguments as operands. If the first argument
is `!', the value is the negation of the two-argument test
@@ -2437,10 +2458,10 @@ POSIX 1003.2 standard.
bind [-m KEYMAP] -x KEYSEQ:SHELL-COMMAND
bind [-m KEYMAP] KEYSEQ:FUNCTION-NAME
- Display current Readline (*note Command Line Editing::.) key and
+ Display current Readline (*note Command Line Editing::) key and
function bindings, or bind a key sequence to a Readline function
or macro. The binding syntax accepted is identical to that of a
- Readline initialization file (*note Readline Init File::.), but
+ Readline initialization file (*note Readline Init File::), but
each binding must be passed as a separate argument: e.g.,
`"\C-x\C-r":re-read-init-file'. Options, if supplied, have the
following meanings:
@@ -2448,7 +2469,7 @@ POSIX 1003.2 standard.
`-m KEYMAP'
Use KEYMAP as the keymap to be affected by the subsequent
bindings. Acceptable KEYMAP names are `emacs',
- `emacs-standard', `emacs-meta', `emacs-ctlx', `vi',
+ `emacs-standard', `emacs-meta', `emacs-ctlx', `vi', `vi-move',
`vi-command', and `vi-insert'. `vi' is equivalent to
`vi-command'; `emacs' is equivalent to `emacs-standard'.
@@ -2514,7 +2535,7 @@ POSIX 1003.2 standard.
named `ls', running `command ls' within the function will execute
the external command `ls' instead of calling the function
recursively. The `-p' option means to use a default value for
- `$PATH' that is guaranteed to find all of the standard utilities.
+ `PATH' that is guaranteed to find all of the standard utilities.
The return status in this case is 127 if COMMAND cannot be found
or an error occurred, and the exit status of COMMAND otherwise.
@@ -2539,14 +2560,14 @@ POSIX 1003.2 standard.
the specified attributes or to give variables attributes:
`-a'
- Each NAME is an array variable (*note Arrays::.).
+ Each NAME is an array variable (*note Arrays::).
`-f'
Use function names only.
`-i'
The variable is to be treated as an integer; arithmetic
- evaluation (*note Shell Arithmetic::.) is performed when the
+ evaluation (*note Shell Arithmetic::) is performed when the
variable is assigned a value.
`-r'
@@ -2565,7 +2586,7 @@ POSIX 1003.2 standard.
an attempt is made to define a function using `-f foo=bar', an
attempt is made to assign a value to a readonly variable, an
attempt is made to assign a value to an array variable without
- using the compound assignment syntax (*note Arrays::.), one of the
+ using the compound assignment syntax (*note Arrays::), one of the
NAMES is not a valid shell variable name, an attempt is made to
turn off readonly status for a readonly variable, an attempt is
made to turn off array status for an array variable, or an attempt
@@ -2643,7 +2664,7 @@ POSIX 1003.2 standard.
If there are no options, a list of the shell builtins is displayed.
The `-s' option restricts `enable' to the POSIX special builtins.
If `-s' is used with `-f', the new builtin becomes a special
- builtin (*note Special Builtins::.).
+ builtin (*note Special Builtins::).
The return status is zero unless a NAME is not a shell builtin or
there is an error loading a new builtin from a shared object.
@@ -2724,8 +2745,8 @@ POSIX 1003.2 standard.
line, rather than newline.
`-e'
- Readline (*note Command Line Editing::.) is used to obtain
- the line.
+ Readline (*note Command Line Editing::) is used to obtain the
+ line.
`-n NCHARS'
`read' returns after reading NCHARS characters rather than
@@ -2774,7 +2795,7 @@ POSIX 1003.2 standard.
`-o'
Restricts the values of OPTNAME to be those defined for the
- `-o' option to the `set' builtin (*note The Set Builtin::.).
+ `-o' option to the `set' builtin (*note The Set Builtin::).
If either `-s' or `-u' is used with no OPTNAME arguments, the
display is limited to those options which are set or unset,
@@ -2833,7 +2854,7 @@ POSIX 1003.2 standard.
`extglob'
If set, the extended pattern matching features described above
- (*note Pattern Matching::.) are enabled.
+ (*note Pattern Matching::) are enabled.
`histappend'
If set, the history list is appended to the file named by the
@@ -2853,12 +2874,12 @@ POSIX 1003.2 standard.
`hostcomplete'
If set, and Readline is being used, Bash will attempt to
perform hostname completion when a word containing a `@' is
- being completed (*note Commands For Completion::.). This
+ being completed (*note Commands For Completion::). This
option is enabled by default.
`huponexit'
If set, Bash will send `SIGHUP' to all jobs when an
- interactive login shell exits (*note Signals::.).
+ interactive login shell exits (*note Signals::).
`interactive_comments'
Allow a word beginning with `#' to cause that word and all
@@ -2890,20 +2911,20 @@ POSIX 1003.2 standard.
`progcomp'
If set, the programmable completion facilities (*note
- Programmable Completion::.) are enabled. This option is
+ Programmable Completion::) are enabled. This option is
enabled by default.
`promptvars'
If set, prompt strings undergo variable and parameter
- expansion after being expanded (*note Printing a Prompt::.).
+ expansion after being expanded (*note Printing a Prompt::).
This option is enabled by default.
`restricted_shell'
The shell sets this option if it is started in restricted mode
- (*note The Restricted Shell::.). The value may not be
- changed. This is not reset when the startup files are
- executed, allowing the startup files to discover whether or
- not a shell is restricted.
+ (*note The Restricted Shell::). The value may not be changed.
+ This is not reset when the startup files are executed,
+ allowing the startup files to discover whether or not a shell
+ is restricted.
`shift_verbose'
If this is set, the `shift' builtin prints an error message
@@ -2926,7 +2947,7 @@ POSIX 1003.2 standard.
`source'
source FILENAME
- A synonym for `.' (*note Bourne Shell Builtins::.).
+ A synonym for `.' (*note Bourne Shell Builtins::).
`type'
type [-atp] [NAME ...]
@@ -3041,7 +3062,8 @@ The Set Builtin
Options, if specified, have the following meanings:
`-a'
- Mark variables which are modified or created for export.
+ Mark variables and function which are modified or created for
+ export to the environment of subsequent commands.
`-b'
Cause the status of terminated background jobs to be reported
@@ -3050,7 +3072,7 @@ The Set Builtin
`-e'
Exit immediately if a simple command (*note Simple
- Commands::.) exits with a non-zero status, unless the command
+ Commands::) exits with a non-zero status, unless the command
that fails is part of an `until' or `while' loop, part of an
`if' statement, part of a `&&' or `||' list, or if the
command's return status is being inverted using `!'.
@@ -3068,7 +3090,7 @@ The Set Builtin
the command name.
`-m'
- Job control is enabled (*note Job Control::.).
+ Job control is enabled (*note Job Control::).
`-n'
Read commands but do not execute them; this may be used to
@@ -3086,7 +3108,7 @@ The Set Builtin
`emacs'
Use an `emacs'-style line editing interface (*note
- Command Line Editing::.).
+ Command Line Editing::).
`errexit'
Same as `-e'.
@@ -3135,9 +3157,8 @@ The Set Builtin
`posix'
Change the behavior of Bash where the default operation
differs from the POSIX 1003.2 standard to match the
- standard (*note Bash POSIX Mode::.). This is intended
- to make Bash behave as a strict superset of that
- standard.
+ standard (*note Bash POSIX Mode::). This is intended to
+ make Bash behave as a strict superset of that standard.
`privileged'
Same as `-p'.
@@ -3181,7 +3202,7 @@ The Set Builtin
`-B'
The shell will perform brace expansion (*note Brace
- Expansion::.). This option is on by default.
+ Expansion::). This option is on by default.
`-C'
Prevent output redirection using `>', `>&', and `<>' from
@@ -3189,8 +3210,8 @@ The Set Builtin
`-H'
Enable `!' style history substitution (*note History
- Interaction::.). This option is on by default for
- interactive shells.
+ Interaction::). This option is on by default for interactive
+ shells.
`-P'
If set, do not follow symbolic links when performing commands
@@ -3242,7 +3263,7 @@ Special Builtins
================
For historical reasons, the POSIX 1003.2 standard has classified
-several builtin commands as *special*. When Bash is executing in POSIX
+several builtin commands as _special_. When Bash is executing in POSIX
mode, the special builtins differ from other builtin commands in three
respects:
@@ -3294,7 +3315,7 @@ shell. In some cases, Bash assigns a default value to the variable.
`HOME'
The current user's home directory; the default for the `cd' builtin
command. The value of this variable is also used by tilde
- expansion (*note Tilde Expansion::.).
+ expansion (*note Tilde Expansion::).
`IFS'
A list of characters that separate fields; used when the shell
@@ -3343,7 +3364,7 @@ normally treat them specially.
A few variables used by Bash are described in different chapters:
variables for controlling the job control facilities (*note Job Control
-Variables::.).
+Variables::).
`BASH'
The full pathname used to execute the current instance of Bash.
@@ -3358,7 +3379,7 @@ Variables::.).
The version number of the current instance of Bash.
`BASH_VERSINFO'
- A readonly array variable (*note Arrays::.) whose members hold
+ A readonly array variable (*note Arrays::) whose members hold
version information for this instance of Bash. The values
assigned to the array members are as follows:
@@ -3384,18 +3405,18 @@ Variables::.).
An array variable consisting of the individual words in the
current command line. This variable is available only in shell
functions invoked by the programmable completion facilities (*note
- Programmable Completion::.).
+ Programmable Completion::).
`COMP_CWORD'
An index into `${COMP_WORDS}' of the word containing the current
cursor position. This variable is available only in shell
functions invoked by the programmable completion facilities (*note
- Programmable Completion::.).
+ Programmable Completion::).
`COMP_LINE'
The current command line. This variable is available only in
shell functions and external commands invoked by the programmable
- completion facilities (*note Programmable Completion::.).
+ completion facilities (*note Programmable Completion::).
`COMP_POINT'
The index of the current cursor position relative to the beginning
@@ -3403,12 +3424,12 @@ Variables::.).
end of the current command, the value of this variable is equal to
`${#COMP_LINE}'. This variable is available only in shell
functions and external commands invoked by the programmable
- completion facilities (*note Programmable Completion::.).
+ completion facilities (*note Programmable Completion::).
`COMPREPLY'
An array variable from which Bash reads the possible completions
generated by a shell function invoked by the programmable
- completion facility (*note Programmable Completion::.).
+ completion facility (*note Programmable Completion::).
`DIRSTACK'
An array variable containing the current contents of the directory
@@ -3443,14 +3464,14 @@ Variables::.).
`GROUPS'
An array variable containing the list of groups of which the
current user is a member. Assignments to `GROUPS' have no effect
- and are silently discarded. If `GROUPS' is unset, it loses its
+ and return an error status. If `GROUPS' is unset, it loses its
special properties, even if it is subsequently reset.
`histchars'
Up to three characters which control history expansion, quick
- substitution, and tokenization (*note History Interaction::.).
- The first character is the HISTORY EXPANSION character, that is,
- the character which signifies the start of a history expansion,
+ substitution, and tokenization (*note History Interaction::). The
+ first character is the HISTORY EXPANSION character, that is, the
+ character which signifies the start of a history expansion,
normally `!'. The second character is the character which
signifies `quick substitution' when seen as the first character on
a line, normally `^'. The optional third character is the
@@ -3469,7 +3490,7 @@ Variables::.).
`FUNCNAME'
The name of any currently-executing shell function. This variable
exists only when a shell function is executing. Assignments to
- `FUNCNAME' have no effect and are silently discarded. If
+ `FUNCNAME' have no effect and return an error status. If
`FUNCNAME' is unset, it loses its special properties, even if it
is subsequently reset.
@@ -3561,21 +3582,31 @@ Variables::.).
results of filename expansion, and determines the behavior of
range expressions, equivalence classes, and collating sequences
within filename expansion and pattern matching (*note Filename
- Expansion::.).
+ Expansion::).
`LC_CTYPE'
This variable determines the interpretation of characters and the
behavior of character classes within filename expansion and pattern
- matching (*note Filename Expansion::.).
+ matching (*note Filename Expansion::).
`LC_MESSAGES'
This variable determines the locale used to translate double-quoted
- strings preceded by a `$' (*note Locale Translation::.).
+ strings preceded by a `$' (*note Locale Translation::).
`LC_NUMERIC'
This variable determines the locale category used for number
formatting.
+`LINES'
+ Used by the `select' builtin command to determine the column length
+ for printing selection lists. Automatically set upon receipt of a
+ `SIGWINCH'.
+
+`COLUMNS'
+ Used by the `select' builtin command to determine the terminal
+ width when printing selection lists. Automatically set upon
+ receipt of a `SIGWINCH'.
+
`LINENO'
The line number in the script or shell function currently
executing.
@@ -3586,7 +3617,11 @@ Variables::.).
`MAILCHECK'
How often (in seconds) that the shell should check for mail in the
- files specified in the `MAILPATH' or `MAIL' variables.
+ files specified in the `MAILPATH' or `MAIL' variables. The
+ default is 60 seconds. When it is time to check for mail, the
+ shell does so before displaying the primary prompt. If this
+ variable is unset, or set to a value that is not a number greater
+ than or equal to zero, the shell disables mail checking.
`OLDPWD'
The previous working directory as set by the `cd' builtin.
@@ -3599,7 +3634,7 @@ Variables::.).
A string describing the operating system Bash is running on.
`PIPESTATUS'
- An array variable (*note Arrays::.) containing a list of exit
+ An array variable (*note Arrays::) containing a list of exit
status values from the processes in the most-recently-executed
foreground pipeline (which may contain only a single command).
@@ -3618,7 +3653,7 @@ Variables::.).
`PS4'
The value is the prompt printed before the command line is echoed
- when the `-x' option is set (*note The Set Builtin::.). The first
+ when the `-x' option is set (*note The Set Builtin::). The first
character of `PS4' is replicated multiple times, as necessary, to
indicate multiple levels of indirection. The default is `+ '.
@@ -3642,7 +3677,7 @@ Variables::.).
`SHELLOPTS'
A colon-separated list of enabled shell options. Each word in the
list is a valid argument for the `-o' option to the `set' builtin
- command (*note The Set Builtin::.). The options appearing in
+ command (*note The Set Builtin::). The options appearing in
`SHELLOPTS' are those reported as `on' by `set -o'. If this
variable is in the environment when Bash starts up, each shell
option in the list will be enabled before reading any startup
@@ -3737,7 +3772,7 @@ Invoking Bash
bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION] [ARGUMENT ...]
In addition to the single-character shell command-line options
-(*note The Set Builtin::.), there are several multi-character options
+(*note The Set Builtin::), there are several multi-character options
that you can use. These options must appear on the command line before
the single-character options in order for them to be recognized.
@@ -3752,16 +3787,22 @@ the single-character options in order for them to be recognized.
`--help'
Display a usage message on standard output and exit sucessfully.
+`--init-file FILENAME'
+`--rcfile FILENAME'
+ Execute commands from FILENAME (instead of `~/.bashrc') in an
+ interactive shell.
+
`--login'
- Make this shell act as if it were directly invoked by login. This
- is equivalent to `exec -l bash' but can be issued from another
- shell, such as `csh'. `exec bash --login' will replace the
- current shell with a Bash login shell. *Note Bash Startup
- Files::, for a description of the special behavior of a login
- shell.
+ Make this shell act as if it had been directly invoked by login.
+ When the shell is interactive, this is equivalent to starting a
+ login shell with `exec -l bash'. When the shell is not
+ interactive, the login shell startup files will be executed.
+ `exec bash --login' will replace the current shell with a Bash
+ login shell. *Note Bash Startup Files::, for a description of the
+ special behavior of a login shell.
`--noediting'
- Do not use the GNU Readline library (*note Command Line Editing::.)
+ Do not use the GNU Readline library (*note Command Line Editing::)
to read command lines when the shell is interactive.
`--noprofile'
@@ -3781,12 +3822,8 @@ the single-character options in order for them to be recognized.
standard. *Note Bash POSIX Mode::, for a description of the Bash
POSIX mode.
-`--rcfile FILENAME'
- Execute commands from FILENAME (instead of `~/.bashrc') in an
- interactive shell.
-
`--restricted'
- Make the shell a restricted shell (*note The Restricted Shell::.).
+ Make the shell a restricted shell (*note The Restricted Shell::).
`--verbose'
Equivalent to `-v'. Print shell input lines as they're read.
@@ -3808,7 +3845,7 @@ invocation which are not available with the `set' builtin.
described in *Note Interactive Shells::.
`-r'
- Make the shell a restricted shell (*note The Restricted Shell::.).
+ Make the shell a restricted shell (*note The Restricted Shell::).
`-s'
If this option is present, or if no arguments remain after option
@@ -3820,7 +3857,7 @@ invocation which are not available with the `set' builtin.
A list of all double-quoted strings preceded by `$' is printed on
the standard ouput. These are the strings that are subject to
language translation when the current locale is not `C' or `POSIX'
- (*note Locale Translation::.). This implies the `-n' option; no
+ (*note Locale Translation::). This implies the `-n' option; no
commands will be executed.
`--'
@@ -3828,21 +3865,20 @@ invocation which are not available with the `set' builtin.
processing. Any arguments after the `--' are treated as filenames
and arguments.
- An *interactive* shell is one started without non-option arguments,
+ An _interactive_ shell is one started without non-option arguments,
unless `-s' is specified, without specifying the `-c' option, and whose
input and output are both connected to terminals (as determined by
`isatty(3)'), or one started with the `-i' option. *Note Interactive
-Shells:: for more information.
+Shells::, for more information.
If arguments remain after option processing, and neither the `-c'
nor the `-s' option has been supplied, the first argument is assumed to
-be the name of a file containing shell commands (*note Shell
-Scripts::.). When Bash is invoked in this fashion, `$0' is set to the
-name of the file, and the positional parameters are set to the
-remaining arguments. Bash reads and executes commands from this file,
-then exits. Bash's exit status is the exit status of the last command
-executed in the script. If no commands are executed, the exit status
-is 0.
+be the name of a file containing shell commands (*note Shell Scripts::).
+When Bash is invoked in this fashion, `$0' is set to the name of the
+file, and the positional parameters are set to the remaining arguments.
+Bash reads and executes commands from this file, then exits. Bash's
+exit status is the exit status of the last command executed in the
+script. If no commands are executed, the exit status is 0.

File: bashref.info, Node: Bash Startup Files, Next: Interactive Shells, Prev: Invoking Bash, Up: Bash Features
@@ -3853,7 +3889,7 @@ Bash Startup Files
This section describs how Bash executes its startup files. If any
of the files exist but cannot be read, Bash reports an error. Tildes
are expanded in file names as described above under Tilde Expansion
-(*note Tilde Expansion::.).
+(*note Tilde Expansion::).
Interactive shells are described in *Note Interactive Shells::.
@@ -3899,6 +3935,10 @@ following command were executed:
but the value of the `PATH' variable is not used to search for the file
name.
+ As noted above, if a non-interactive shell is invoked with the
+`--login' option, Bash attempts to read and execute commands from the
+login shell startup files.
+
Invoked with name `sh'
......................
@@ -3997,9 +4037,8 @@ contains `i' when the shell is interactive. For example:
*) echo This shell is not interactive ;;
esac
- Alternatively, startup scripts may examine the variable `$PS1'; it
-is unset in non-interactive shells, and set in interactive shells.
-Thus:
+ Alternatively, startup scripts may examine the variable `PS1'; it is
+unset in non-interactive shells, and set in interactive shells. Thus:
if [ -z "$PS1" ]; then
echo This shell is not interactive
@@ -4019,64 +4058,64 @@ several ways.
1. Startup files are read and executed as described in *Note Bash
Startup Files::.
- 2. Job Control (*note Job Control::.) is enabled by default. When job
+ 2. Job Control (*note Job Control::) is enabled by default. When job
control is in effect, Bash ignores the keyboard-generated job
control signals `SIGTTIN', `SIGTTOU', and `SIGTSTP'.
- 3. Bash expands and displays `$PS1' before reading the first line of
- a command, and expands and displays `$PS2' before reading the
- second and subsequent lines of a multi-line command.
+ 3. Bash expands and displays `PS1' before reading the first line of a
+ command, and expands and displays `PS2' before reading the second
+ and subsequent lines of a multi-line command.
4. Bash executes the value of the `PROMPT_COMMAND' variable as a
command before printing the primary prompt, `$PS1' (*note Bash
- Variables::.).
+ Variables::).
- 5. Readline (*note Command Line Editing::.) is used to read commands
+ 5. Readline (*note Command Line Editing::) is used to read commands
from the user's terminal.
6. Bash inspects the value of the `ignoreeof' option to `set -o'
instead of exiting immediately when it receives an `EOF' on its
- standard input when reading a command (*note The Set Builtin::.).
+ standard input when reading a command (*note The Set Builtin::).
- 7. Command history (*note Bash History Facilities::.) and history
- expansion (*note History Interaction::.) are enabled by default.
+ 7. Command history (*note Bash History Facilities::) and history
+ expansion (*note History Interaction::) are enabled by default.
Bash will save the command history to the file named by `$HISTFILE'
when an interactive shell exits.
- 8. Alias expansion (*note Aliases::.) is performed by default.
+ 8. Alias expansion (*note Aliases::) is performed by default.
9. In the absence of any traps, Bash ignores `SIGTERM' (*note
- Signals::.).
+ Signals::).
10. In the absence of any traps, `SIGINT' is caught and handled
- ((*note Signals::.). `SIGINT' will interrupt some shell builtins.
+ ((*note Signals::). `SIGINT' will interrupt some shell builtins.
11. An interactive login shell sends a `SIGHUP' to all jobs on exit if
- the `hupoxexit' shell option has been enabled (*note Signals::.).
+ the `hupoxexit' shell option has been enabled (*note Signals::).
12. The `-n' invocation option is ignored, and `set -n' has no effect
- (*note The Set Builtin::.).
+ (*note The Set Builtin::).
13. Bash will check for mail periodically, depending on the values of
the `MAIL', `MAILPATH', and `MAILCHECK' shell variables (*note
- Bash Variables::.).
+ Bash Variables::).
14. Expansion errors due to references to unbound shell variables after
`set -u' has been enabled will not cause the shell to exit (*note
- The Set Builtin::.).
+ The Set Builtin::).
15. The shell will not exit on expansion errors caused by VAR being
unset or null in `${VAR:?WORD}' expansions (*note Shell Parameter
- Expansion::.).
+ Expansion::).
16. Redirection errors encountered by shell builtins will not cause the
shell to exit.
17. When running in POSIX mode, a special builtin returning an error
- status will not cause the shell to exit (*note Bash POSIX Mode::.).
+ status will not cause the shell to exit (*note Bash POSIX Mode::).
18. A failed `exec' will not cause the shell to exit (*note Bourne
- Shell Builtins::.).
+ Shell Builtins::).
19. Parser syntax errors will not cause the shell to exit.
@@ -4086,7 +4125,7 @@ several ways.
21. The shell will check the value of the `TMOUT' variable and exit if
a command is not read within the specified number of seconds after
- printing `$PS1' (*note Bash Variables::.).
+ printing `$PS1' (*note Bash Variables::).

@@ -4181,7 +4220,7 @@ checked. If the FILE argument to one of the primaries is one of
`-o OPTNAME'
True if shell option OPTNAME is enabled. The list of options
appears in the description of the `-o' option to the `set' builtin
- (*note The Set Builtin::.).
+ (*note The Set Builtin::).
`-z STRING'
True if the length of STRING is zero.
@@ -4330,11 +4369,11 @@ with the `unalias' command.
There is no mechanism for using arguments in the replacement text,
as in `csh'. If arguments are needed, a shell function should be used
-(*note Shell Functions::.).
+(*note Shell Functions::).
Aliases are not expanded when the shell is not interactive, unless
the `expand_aliases' shell option is set using `shopt' (*note Bash
-Builtins::.).
+Builtins::).
The rules concerning the definition and use of aliases are somewhat
confusing. Bash always reads at least one complete line of input
@@ -4616,12 +4655,12 @@ which can appear in the prompt variables:
The command number and the history number are usually different: the
history number of a command is its position in the history list, which
may include commands restored from the history file (*note Bash History
-Facilities::.), while the command number is the position in the
-sequence of commands executed during the current shell session.
+Facilities::), while the command number is the position in the sequence
+of commands executed during the current shell session.
After the string is decoded, it is expanded via parameter expansion,
command substitution, arithmetic expansion, and quote removal, subject
-to the value of the `promptvars' shell option (*note Bash Builtins::.).
+to the value of the `promptvars' shell option (*note Bash Builtins::).

File: bashref.info, Node: The Restricted Shell, Next: Bash POSIX Mode, Prev: Printing a Prompt, Up: Bash Features
@@ -4682,10 +4721,12 @@ that specified by POSIX in areas where the Bash default differs.
re-search `$PATH' to find the new location. This is also
available with `shopt -s checkhash'.
- 2. The `>&' redirection does not redirect stdout and stderr.
+ 2. The message printed by the job control code and builtins when a job
+ exits with a non-zero status is `Done(status)'.
3. The message printed by the job control code and builtins when a job
- exits with a non-zero status is `Done(status)'.
+ is stopped is `Stopped(SIGNAME)', where SIGNAME is, for example,
+ `SIGTSTP'.
4. Reserved words may not be aliased.
@@ -4739,7 +4780,7 @@ that specified by POSIX in areas where the Bash default differs.
`$CDPATH', the value it assigns to the `PWD' variable does not
contain any symbolic links, as if `cd -P' had been executed.
- 19. If `$CDPATH' is set, the `cd' builtin will not implicitly append
+ 19. If `CDPATH' is set, the `cd' builtin will not implicitly append
the current directory to it. This means that `cd' will fail if no
valid directory name can be constructed from any of the entries in
`$CDPATH', even if the a directory with the same name as the name
@@ -4759,9 +4800,27 @@ that specified by POSIX in areas where the Bash default differs.
23. Assignment statements preceding POSIX 1003.2 special builtins
persist in the shell environment after the builtin completes.
- 24. The `export' and `readonly' builtin commands display their output
+ 24. Assignment statements preceding shell function calls persist in the
+ shell environment after the function returns, as if a POSIX
+ special builtin command had been executed.
+
+ 25. The `export' and `readonly' builtin commands display their output
in the format required by POSIX 1003.2.
+ 26. The `trap' builtin displays signal names without the leading `SIG'.
+
+ 27. The `.' and `source' builtins do not search the current directory
+ for the filename argument if it is not found by searching `PATH'.
+
+ 28. Subshells spawned to execute command substitutions inherit the
+ value of the `-e' option from the parent shell. When not in POSIX
+ mode, Bash clears the `-e' option in such subshells.
+
+ 29. Alias expansion is always enabled, even in non-interactive shells.
+
+ 30. When the `set' builtin is invoked without options, it does not
+ display shell function names and definitions.
+
There is other POSIX 1003.2 behavior that Bash does not implement.
Specifically:
@@ -4769,6 +4828,16 @@ Specifically:
1. Assignment statements affect the execution environment of all
builtins, not just special ones.
+ 2. When a subshell is created to execute a shell script with execute
+ permission, but without a leading `#!', Bash sets `$0' to the full
+ pathname of the script as found by searching `$PATH', rather than
+ the command as typed by the user.
+
+ 3. When using `.' to source a shell script found in `$PATH', bash
+ checks execute permission bits rather than read permission bits,
+ just as if it were searching for a command.
+
+

File: bashref.info, Node: Job Control, Next: Using History Interactively, Prev: Bash Features, Up: Top
@@ -4860,7 +4929,7 @@ equivalent to `bg %1'
Normally, Bash waits until it is about to print a prompt before
reporting changes in a job's status so as to not interrupt any other
output. If the the `-b' option to the `set' builtin is enabled, Bash
-reports such changes immediately (*note The Set Builtin::.).
+reports such changes immediately (*note The Set Builtin::).
If an attempt to exit Bash is while jobs are stopped, the shell
prints a message warning that there are stopped jobs. The `jobs'
@@ -4989,8 +5058,8 @@ Job Control Variables
`substring', the string supplied needs to match a substring of the
name of a stopped job. The `substring' value provides
functionality analogous to the `%?' job ID (*note Job Control
- Basics::.). If set to any other value, the supplied string must
- be a prefix of a stopped job's name; this provides functionality
+ Basics::). If set to any other value, the supplied string must be
+ a prefix of a stopped job's name; this provides functionality
analogous to the `%' job ID.

@@ -5027,10 +5096,10 @@ Introduction to Line Editing
The following paragraphs describe the notation used to represent
keystrokes.
- The text <C-k> is read as `Control-K' and describes the character
+ The text `C-k' is read as `Control-K' and describes the character
produced when the <k> key is pressed while the Control key is depressed.
- The text <M-k> is read as `Meta-K' and describes the character
+ The text `M-k' is read as `Meta-K' and describes the character
produced when the Meta key (if you have one) is depressed, and the <k>
key is pressed. The Meta key is labeled <ALT> on many keyboards. On
keyboards with two keys labeled <ALT> (usually to either side of the
@@ -5041,18 +5110,18 @@ Compose key for typing accented characters.
If you do not have a Meta or <ALT> key, or another key working as a
Meta key, the identical keystroke can be generated by typing <ESC>
-first, and then typing <k>. Either process is known as "metafying" the
-<k> key.
+_first_, and then typing <k>. Either process is known as "metafying"
+the <k> key.
- The text <M-C-k> is read as `Meta-Control-k' and describes the
-character produced by "metafying" <C-k>.
+ The text `M-C-k' is read as `Meta-Control-k' and describes the
+character produced by "metafying" `C-k'.
In addition, several keys have their own names. Specifically,
<DEL>, <ESC>, <LFD>, <SPC>, <RET>, and <TAB> all stand for themselves
-when seen in this text, or in an init file (*note Readline Init
-File::.). If your keyboard lacks a <LFD> key, typing <C-j> will
-produce the desired character. The <RET> key may be labeled <Return>
-or <Enter> on some keyboards.
+when seen in this text, or in an init file (*note Readline Init File::).
+If your keyboard lacks a <LFD> key, typing <C-j> will produce the
+desired character. The <RET> key may be labeled <Return> or <Enter> on
+some keyboards.

File: bashref.info, Node: Readline Interaction, Next: Readline Init File, Prev: Introduction and Notation, Up: Command Line Editing
@@ -5067,9 +5136,9 @@ as you type it in, allowing you to just fix your typo, and not forcing
you to retype the majority of the line. Using these editing commands,
you move the cursor to the place that needs correction, and delete or
insert the text of the corrections. Then, when you are satisfied with
-the line, you simply press <RETURN>. You do not have to be at the end
-of the line to press <RETURN>; the entire line is accepted regardless
-of the location of the cursor within the line.
+the line, you simply press <RET>. You do not have to be at the end of
+the line to press <RET>; the entire line is accepted regardless of the
+location of the cursor within the line.
* Menu:
@@ -5092,8 +5161,8 @@ erase character to back up and delete the mistyped character.
Sometimes you may mistype a character, and not notice the error
until you have typed several other characters. In that case, you can
-type <C-b> to move the cursor to the left, and then correct your
-mistake. Afterwards, you can move the cursor to the right with <C-f>.
+type `C-b' to move the cursor to the left, and then correct your
+mistake. Afterwards, you can move the cursor to the right with `C-f'.
When you add text in the middle of a line, you will notice that
characters to the right of the cursor are `pushed over' to make room
@@ -5103,28 +5172,28 @@ back' to fill in the blank space created by the removal of the text. A
list of the bare essentials for editing the text of an input line
follows.
-<C-b>
+`C-b'
Move back one character.
-<C-f>
+`C-f'
Move forward one character.
<DEL> or <Backspace>
Delete the character to the left of the cursor.
-<C-d>
+`C-d'
Delete the character underneath the cursor.
Printing characters
Insert the character into the line at the cursor.
-<C-_> or <C-x C-u>
+`C-_' or `C-x C-u'
Undo the last editing command. You can undo all the way back to an
empty line.
(Depending on your configuration, the <Backspace> key be set to delete
the character to the left of the cursor and the <DEL> key set to delete
-the character underneath the cursor, like <C-d>, rather than the
+the character underneath the cursor, like `C-d', rather than the
character to the left of the cursor.)

@@ -5135,26 +5204,26 @@ Readline Movement Commands
The above table describes the most basic keystrokes that you need in
order to do editing of the input line. For your convenience, many
-other commands have been added in addition to <C-b>, <C-f>, <C-d>, and
+other commands have been added in addition to `C-b', `C-f', `C-d', and
<DEL>. Here are some commands for moving more rapidly about the line.
-<C-a>
+`C-a'
Move to the start of the line.
-<C-e>
+`C-e'
Move to the end of the line.
-<M-f>
+`M-f'
Move forward a word, where a word is composed of letters and
digits.
-<M-b>
+`M-b'
Move backward a word.
-<C-l>
+`C-l'
Clear the screen, reprinting the current line at the top.
- Notice how <C-f> moves forward a character, while <M-f> moves
+ Notice how `C-f' moves forward a character, while `M-f' moves
forward a word. It is a loose convention that control keystrokes
operate on characters while meta keystrokes operate on words.
@@ -5181,34 +5250,34 @@ available to be yanked back later, when you are typing another line.
Here is the list of commands for killing text.
-<C-k>
+`C-k'
Kill the text from the current cursor position to the end of the
line.
-<M-d>
+`M-d'
Kill from the cursor to the end of the current word, or, if between
words, to the end of the next word. Word boundaries are the same
- as those used by <M-f>.
+ as those used by `M-f'.
-<M-DEL>
+`M-<DEL>'
Kill from the cursor the start of the previous word, or, if between
words, to the start of the previous word. Word boundaries are the
- same as those used by <M-b>.
+ same as those used by `M-b'.
-<C-w>
+`C-w'
Kill from the cursor to the previous whitespace. This is
- different than <M-DEL> because the word boundaries differ.
+ different than `M-<DEL>' because the word boundaries differ.
Here is how to "yank" the text back into the line. Yanking means to
copy the most-recently-killed text from the kill buffer.
-<C-y>
+`C-y'
Yank the most recently killed text back into the buffer at the
cursor.
-<M-y>
+`M-y'
Rotate the kill-ring, and yank the new top. You can only do this
- if the prior command is <C-y> or <M-y>.
+ if the prior command is `C-y' or `M-y'.

File: bashref.info, Node: Readline Arguments, Next: Searching, Prev: Readline Killing Commands, Up: Readline Interaction
@@ -5228,7 +5297,8 @@ meta digits before the command. If the first `digit' typed is a minus
sign (`-'), then the sign of the argument will be negative. Once you
have typed one meta digit to get the argument started, you can type the
remainder of the digits, and then the command. For example, to give
-the <C-d> command an argument of 10, you could type `M-1 0 C-d'.
+the `C-d' command an argument of 10, you could type `M-1 0 C-d', which
+will delete the next ten characters on the input line.

File: bashref.info, Node: Searching, Prev: Readline Arguments, Up: Readline Interaction
@@ -5237,30 +5307,32 @@ Searching for Commands in the History
-------------------------------------
Readline provides commands for searching through the command history
-(*note Bash History Facilities::.) for lines containing a specified
-string. There are two search modes: INCREMENTAL and NON-INCREMENTAL.
+(*note Bash History Facilities::) for lines containing a specified
+string. There are two search modes: "incremental" and
+"non-incremental".
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. To search backward in the
-history for a particular string, type <C-r>. Typing <C-s> searches
+history for a particular string, type `C-r'. Typing `C-s' searches
forward through the history. The characters present in the value of
the `isearch-terminators' variable are used to terminate an incremental
search. If that variable has not been assigned a value, the <ESC> and
-<C-J> characters will terminate an incremental search. <C-g> will
+`C-J' characters will terminate an incremental search. `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.
- To find other matching entries in the history list, type <C-r> or
-<C-s> as appropriate. This will search backward or forward in the
+ To find other matching entries in the history list, type `C-r' or
+`C-s' as appropriate. This will search backward or forward in the
history for the next entry 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 <RET> will terminate
the search and accept the line, thereby executing the command from the
-history list.
+history list. A movement command will terminate the search, make the
+last line found the current line, and begin editing.
Non-incremental searches read the entire search string before
starting to search for matching history lines. The search string may be
@@ -5303,17 +5375,24 @@ Readline Init File Syntax
There are only a few basic constructs allowed in the Readline init
file. Blank lines are ignored. Lines beginning with a `#' are
comments. Lines beginning with a `$' indicate conditional constructs
-(*note Conditional Init Constructs::.). Other lines denote variable
+(*note Conditional Init Constructs::). Other lines denote variable
settings and key bindings.
Variable Settings
You can modify the run-time behavior of Readline by altering the
values of variables in Readline using the `set' command within the
- init file. Here is how to change from the default Emacs-like key
- binding to use `vi' line editing commands:
+ init file. The syntax is simple:
+
+ set VARIABLE VALUE
+
+ Here, for example, is how to change from the default Emacs-like
+ key binding to use `vi' line editing commands:
set editing-mode vi
+ Variable names and values, where appropriate, are recognized
+ without regard to case.
+
The `bind -V' command lists the current Readline variable names
and values. *Note Bash Builtins::.
@@ -5343,7 +5422,8 @@ Variable Settings
possibilities. If the number of possible completions is
greater than this value, Readline will ask the user whether
or not he wishes to view them; otherwise, they are simply
- listed. The default limit is `100'.
+ listed. This variable must be set to an integer value
+ greater than or equal to 0. The default limit is `100'.
`convert-meta'
If set to `on', Readline will convert characters with the
@@ -5380,7 +5460,7 @@ Variable Settings
`input-meta'
If set to `on', Readline will enable eight-bit input (it will
- not strip the eighth bit from the characters it reads),
+ not clear the eighth bit in the characters it reads),
regardless of what the terminal claims it can support. The
default value is `off'. The name `meta-flag' is a synonym
for this variable.
@@ -5388,14 +5468,14 @@ Variable Settings
`isearch-terminators'
The string of characters that should terminate an incremental
search without subsequently executing the character as a
- command (*note Searching::.). If this variable has not been
- given a value, the characters <ESC> and <C-J> will terminate
+ command (*note Searching::). If this variable has not been
+ given a value, the characters <ESC> and `C-J' will terminate
an incremental search.
`keymap'
Sets Readline's idea of the current keymap for key binding
commands. Acceptable `keymap' names are `emacs',
- `emacs-standard', `emacs-meta', `emacs-ctlx', `vi',
+ `emacs-standard', `emacs-meta', `emacs-ctlx', `vi', `vi-move',
`vi-command', and `vi-insert'. `vi' is equivalent to
`vi-command'; `emacs' is equivalent to `emacs-standard'. The
default value is `emacs'. The value of the `editing-mode'
@@ -5438,11 +5518,14 @@ Key Bindings
command name, the default keybinding, if any, and a short
description of what the command does.
- Once you know the name of the command, simply place the name of
- the key you wish to bind the command to, a colon, and then the
- name of the command on a line in the init file. The name of the
- key can be expressed in different ways, depending on which is most
- comfortable for you.
+ 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.
+
+ In addition to command names, readline allows keys to be bound to
+ a string that is inserted when the key is pressed (a MACRO).
The `bind -p' command displays Readline function names and
bindings in a format that can put directly into an initialization
@@ -5455,11 +5538,16 @@ Key Bindings
Meta-Rubout: backward-kill-word
Control-o: "> output"
- In the above example, <C-u> is bound to the function
- `universal-argument', and <C-o> is bound to run the macro
+ In the above example, `C-u' is bound to the function
+ `universal-argument', `M-DEL' is bound to the function
+ `backward-kill-word', and `C-o' is bound to run the macro
expressed on the right hand side (that is, to insert the text
`> output' into the line).
+ A number of symbolic character names are recognized while
+ processing this key binding syntax: DEL, ESC, ESCAPE, LFD,
+ NEWLINE, RET, RETURN, RUBOUT, SPACE, SPC, and TAB.
+
"KEYSEQ": FUNCTION-NAME or MACRO
KEYSEQ differs from KEYNAME above in that strings denoting an
entire key sequence can be specified, by placing the key
@@ -5471,11 +5559,11 @@ Key Bindings
"\C-x\C-r": re-read-init-file
"\e[11~": "Function Key 1"
- In the above example, <C-u> is bound to the function
+ In the above example, `C-u' is again bound to the function
`universal-argument' (just as it was in the first example),
- `<C-x> <C-r>' is bound to the function `re-read-init-file',
- and `<ESC> <[> <1> <1> <~>' is bound to insert the text
- `Function Key 1'.
+ `C-x C-r' is bound to the function `re-read-init-file', and
+ `<ESC> <[> <1> <1> <~>' is bound to insert the text `Function
+ Key 1'.
The following GNU Emacs style escape sequences are available when
specifying key sequences:
@@ -5526,11 +5614,11 @@ Key Bindings
vertical tab
`\NNN'
- the character whose `ASCII' code is the octal value NNN (one
- to three digits)
+ the character whose ASCII code is the octal value NNN (one to
+ three digits)
`\xNNN'
- the character whose `ASCII' code is the hexadecimal value NNN
+ the character whose ASCII code is the hexadecimal value NNN
(one to three digits)
When entering the text of a macro, single or double quotes must be
@@ -5579,10 +5667,10 @@ are four parser directives used.
The APPLICATION construct is used to include
application-specific settings. Each program using the
Readline library sets the APPLICATION NAME, and you can test
- for it. 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:
+ 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:
$if Bash
# Quote the current or previous word
"\C-xq": "\eb\"\ef\""
@@ -5598,7 +5686,8 @@ are four parser directives used.
`$include'
This directive takes a single filename as an argument and reads
- commands and bindings from that file.
+ commands and bindings from that file. For example, the following
+ directive reads from `/etc/inputrc':
$include /etc/inputrc

@@ -5607,7 +5696,7 @@ File: bashref.info, Node: Sample Init File, Prev: Conditional Init Constructs,
Sample Init File
----------------
- Here is an example of an inputrc file. This illustrates key
+ Here is an example of an INPUTRC file. This illustrates key
binding, variable assignment, and conditional syntax.
@@ -5729,13 +5818,13 @@ Bindable Readline Commands
This section describes Readline commands that may be bound to key
sequences. You can list your key bindings by executing `bind -P' or,
for a more terse format, suitable for an INPUTRC file, `bind -p'.
-(*Note Bash Builtins::.)
+(*Note Bash Builtins::.) Command names without an accompanying key
+sequence are unbound by default.
- Command names without an accompanying key sequence are unbound by
-default. In the following descriptions, POINT refers to the current
-cursor position, and MARK refers to a cursor position saved by the
+ In the following descriptions, "point" refers to the current cursor
+position, and "mark" refers to a cursor position saved by the
`set-mark' command. The text between the point and mark is referred to
-as the REGION.
+as the "region".

File: bashref.info, Node: Commands For Moving, Next: Commands For History, Up: Bindable Readline Commands
@@ -5776,17 +5865,19 @@ File: bashref.info, Node: Commands For History, Next: Commands For Text, Prev
Commands For Manipulating The History
-------------------------------------
-`accept-line (Newline, Return)'
+`accept-line (Newline or Return)'
Accept the line regardless of where the cursor is. If this line is
non-empty, add it to the history list according to the setting of
- the `HISTCONTROL' and `HISTIGNORE' variables. If this line was a
- history line, then restore the history line to its original state.
+ the `HISTCONTROL' and `HISTIGNORE' variables. If this line is a
+ modified history line, then restore the history line to its
+ original state.
`previous-history (C-p)'
- Move `up' through the history list.
+ Move `back' through the history list, fetching the previous
+ command.
`next-history (C-n)'
- Move `down' through the history list.
+ Move `forward' through the history list, fetching the next command.
`beginning-of-history (M-<)'
Move to the first line in the history.
@@ -5826,12 +5917,12 @@ Commands For Manipulating The History
`yank-nth-arg (M-C-y)'
Insert the first argument to the previous command (usually the
- second word on the previous line). With an argument N, insert the
- Nth word from the previous command (the words in the previous
- command begin with word 0). A negative argument inserts the Nth
- word from the end of the previous command.
+ second word on the previous line) at point. With an argument N,
+ insert the Nth word from the previous command (the words in the
+ previous command begin with word 0). A negative argument inserts
+ the Nth word from the end of the previous command.
-`yank-last-arg (M-., M-_)'
+`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
`yank-nth-arg'. Successive calls to `yank-last-arg' move back
@@ -5845,10 +5936,9 @@ Commands For Changing Text
--------------------------
`delete-char (C-d)'
- Delete the character under the cursor. If the cursor is at the
- beginning of the line, there are no characters in the line, and
- the last character typed was not bound to `delete-char', then
- return `EOF'.
+ Delete the character at point. If point is at the beginning of
+ the line, there are no characters in the line, and the last
+ character typed was not bound to `delete-char', then return EOF.
`backward-delete-char (Rubout)'
Delete the character behind the cursor. A numeric argument means
@@ -5859,9 +5949,9 @@ Commands For Changing Text
end of the line, in which case the character behind the cursor is
deleted. By default, this is not bound to a key.
-`quoted-insert (C-q, C-v)'
+`quoted-insert (C-q or C-v)'
Add the next character typed to the line verbatim. This is how to
- insert key sequences like <C-q>, for example.
+ insert key sequences like `C-q', for example.
`self-insert (a, b, A, 1, !, ...)'
Insert yourself.
@@ -5904,15 +5994,15 @@ Killing And Yanking
Kill backward from the cursor to the beginning of the current line.
`kill-whole-line ()'
- Kill all characters on the current line, no matter point is. By
- default, this is unbound.
+ Kill all characters on the current line, no matter where point is.
+ By default, this is unbound.
`kill-word (M-d)'
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 `forward-word'.
-`backward-kill-word (M-DEL)'
+`backward-kill-word (M-<DEL>)'
Kill the word behind point. Word boundaries are the same as
`backward-word'.
@@ -5943,12 +6033,11 @@ Killing And Yanking
command is unbound.
`yank (C-y)'
- Yank the top of the kill ring into the buffer at the current
- cursor position.
+ Yank the top of the kill ring into the buffer at point.
`yank-pop (M-y)'
Rotate the kill-ring, and yank the new top. You can only do this
- if the prior command is yank or yank-pop.
+ if the prior command is `yank' or `yank-pop'.

File: bashref.info, Node: Numeric Arguments, Next: Commands For Completion, Prev: Commands For Killing, Up: Bindable Readline Commands
@@ -5958,7 +6047,7 @@ Specifying Numeric Arguments
`digit-argument (M-0, M-1, ... M--)'
Add this digit to the argument already accumulating, or start a new
- argument. <M-> starts a negative argument.
+ argument. `M--' starts a negative argument.
`universal-argument ()'
This is another way to specify an argument. If this command is
@@ -5979,21 +6068,17 @@ File: bashref.info, Node: Commands For Completion, Next: Keyboard Macros, Pre
Letting Readline Type For You
-----------------------------
-`complete (TAB)'
- Attempt to do completion on the text before the cursor. This is
- application-specific. Generally, if you are typing a filename
- argument, you can do filename completion; if you are typing a
- command, you can do command completion; if you are typing in a
- symbol to GDB, you can do symbol name completion; if you are
- typing in a variable to Bash, you can do variable name completion,
- and so on. Bash attempts completion treating the text as a
- variable (if the text begins with `$'), username (if the text
- begins with `~'), hostname (if the text begins with `@'), or
- command (including aliases and functions) in turn. If none of
- these produces a match, filename completion is attempted.
+`complete (<TAB>)'
+ Attempt to perform completion on the text before point. The
+ actual completion performed is application-specific. Bash
+ attempts completion treating the text as a variable (if the text
+ begins with `$'), username (if the text begins with `~'), hostname
+ (if the text begins with `@'), or command (including aliases and
+ functions) in turn. If none of these produces a match, filename
+ completion is attempted.
`possible-completions (M-?)'
- List the possible completions of the text before the cursor.
+ List the possible completions of the text before point.
`insert-completions (M-*)'
Insert all completions of the text before point that would have
@@ -6004,10 +6089,11 @@ Letting Readline Type For You
a single match from the list of possible completions. Repeated
execution of `menu-complete' steps through the list of possible
completions, inserting each match in turn. At the end of the list
- of completions, the bell is rung and the original text is restored.
- An argument of N moves N positions forward in the list of matches;
- a negative argument may be used to move backward through the list.
- This command is intended to be bound to `TAB', but is unbound by
+ of completions, the bell is rung (subject to the setting of
+ `bell-style') and the original text is restored. An argument of N
+ moves N positions forward in the list of matches; a negative
+ argument may be used to move backward through the list. This
+ command is intended to be bound to <TAB>, but is unbound by
default.
`delete-char-or-list ()'
@@ -6057,7 +6143,7 @@ Letting Readline Type For You
List the possible completions of the text before point, treating
it as a command name.
-`dynamic-complete-history (M-TAB)'
+`dynamic-complete-history (M-<TAB>)'
Attempt completion on the text before point, comparing the text
against lines from the history list for possible completion
matches.
@@ -6065,7 +6151,7 @@ Letting Readline Type For You
`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 (*note Brace Expansion::.).
+ shell (*note Brace Expansion::).

File: bashref.info, Node: Keyboard Macros, Next: Miscellaneous Commands, Prev: Commands For Completion, Up: Bindable Readline Commands
@@ -6102,11 +6188,11 @@ Some Miscellaneous Commands
If the metafied character X is lowercase, run the command that is
bound to the corresponding uppercase character.
-`prefix-meta (ESC)'
- Make the next character typed be metafied. This is for keyboards
- without a meta key. Typing `ESC f' is equivalent to typing `M-f'.
+`prefix-meta (<ESC>)'
+ Metafy the next character typed. This is for keyboards without a
+ meta key. Typing `<ESC> f' is equivalent to typing `M-f'.
-`undo (C-_, C-x C-u)'
+`undo (C-_ or C-x C-u)'
Incremental undo, separately remembered for each line.
`revert-line (M-r)'
@@ -6117,8 +6203,8 @@ Some Miscellaneous Commands
Perform tilde expansion on the current word.
`set-mark (C-@)'
- Set the mark to the current point. If a numeric argument is
- supplied, the mark is set to that position.
+ Set the mark to the point. If a numeric argument is supplied, the
+ mark is set to that position.
`exchange-point-and-mark (C-x C-x)'
Swap the point with the mark. The current cursor position is set
@@ -6155,9 +6241,9 @@ Some Miscellaneous Commands
`dump-macros ()'
Print all of the Readline key sequences bound to macros and the
- strings they ouput. If a numeric argument is supplied, the output
- is formatted in such a way that it can be made part of an INPUTRC
- file. This command is unbound by default.
+ strings they output. If a numeric argument is supplied, the
+ output is formatted in such a way that it can be made part of an
+ INPUTRC file. This command is unbound by default.
`glob-expand-word (C-x *)'
The word before point is treated as a pattern for pathname
@@ -6174,22 +6260,22 @@ Some Miscellaneous Commands
`shell-expand-line (M-C-e)'
Expand the line as the shell does. This performs alias and
history expansion as well as all of the shell word expansions
- (*note Shell Expansions::.).
+ (*note Shell Expansions::).
`history-expand-line (M-^)'
Perform history expansion on the current line.
`magic-space ()'
Perform history expansion on the current line and insert a space
- (*note History Interaction::.).
+ (*note History Interaction::).
`alias-expand-line ()'
- Perform alias expansion on the current line (*note Aliases::.).
+ Perform alias expansion on the current line (*note Aliases::).
`history-and-alias-expand-line ()'
Perform history and alias expansion on the current line.
-`insert-last-argument (M-., M-_)'
+`insert-last-argument (M-. or M-_)'
A synonym for `yank-last-arg'.
`operate-and-get-next (C-o)'
@@ -6214,7 +6300,7 @@ standard.
In order to switch interactively between `emacs' and `vi' editing
modes, use the `set -o emacs' and `set -o vi' commands (*note The Set
-Builtin::.). The Readline default is `emacs' mode.
+Builtin::). The Readline default is `emacs' mode.
When you enter a line in `vi' mode, you are already placed in
`insertion' mode, as if you had typed an `i'. Pressing <ESC> switches
@@ -6230,7 +6316,7 @@ Programmable Completion
When word completion is attempted for an argument to a command for
which a completion specification (a COMPSPEC) has been defined using
-the `complete' builtin (*note Programmable Completion Builtins::.), the
+the `complete' builtin (*note Programmable Completion Builtins::), the
programmable completion facilities are invoked.
First, the command name is identified. If a compspec has been
@@ -6242,7 +6328,7 @@ a compspec for the portion following the final slash.
Once a compspec has been found, it is used to generate the list of
matching words. If a compspec is not found, the default Bash completion
-described above (*note Commands For Completion::.) is performed.
+described above (*note Commands For Completion::) is performed.
First, the actions specified by the compspec are used. Only matches
which are prefixed by the word being completed are returned. When the
@@ -6261,9 +6347,9 @@ considered. The string is first split using the characters in the `IFS'
special variable as delimiters. Shell quoting is honored. Each word
is then expanded using brace expansion, tilde expansion, parameter and
variable expansion, command substitution, arithmetic expansion, and
-pathname expansion, as described above (*note Shell Expansions::.).
-The results are split using the rules described above (*note Word
-Splitting::.). The results of the expansion are prefix-matched against
+pathname expansion, as described above (*note Shell Expansions::). The
+results are split using the rules described above (*note Word
+Splitting::). The results of the expansion are prefix-matched against
the word being completed, and the matching words become the possible
completions.
@@ -6271,7 +6357,7 @@ completions.
command specified with the `-F' and `-C' options is invoked. When the
command or function is invoked, the `COMP_LINE' and `COMP_POINT'
variables are assigned values as described above (*note Bash
-Variables::.). If a shell function is being invoked, the `COMP_WORDS'
+Variables::). If a shell function is being invoked, the `COMP_WORDS'
and `COMP_CWORD' variables are also set. When the function or command
is invoked, the first argument is the name of the command whose
arguments are being completed, the second argument is the word being
@@ -6282,9 +6368,9 @@ or command has complete freedom in generating the matches.
Any function specified with `-F' is invoked first. The function may
use any of the shell facilities, including the `compgen' builtin
-described below (*note Programmable Completion Builtins::.), to
-generate the matches. It must put the possible completions in the
-`COMPREPLY' array variable.
+described below (*note Programmable Completion Builtins::), to generate
+the matches. It must put the possible completions in the `COMPREPLY'
+array variable.
Next, any command specified with the `-C' option is invoked in an
environment equivalent to command substitution. It should print a list
@@ -6305,10 +6391,17 @@ options are added to each member of the completion list, and the result
is returned to the Readline completion code as the list of possible
completions.
- If a compspec is found, whatever it generates is returned to the
-completion code as the full set of possible completions. The default
-Bash completions are not attempted, and the Readline default of
-filename completion is disabled.
+ If the previously-applied actions do not generate any matches, and
+the `-o dirnames' option was supplied to `complete' when the compspec
+was defined, directory name completion is attempted.
+
+ By default, if a compspec is found, whatever it generates is
+returned to the completion code as the full set of possible completions.
+The default Bash completions are not attempted, and the Readline default
+of filename completion is disabled. If the `-o default' option was
+supplied to `complete' when the compspec was defined, Readline's
+default completion will be performed if the compspec generates no
+matches.

File: bashref.info, Node: Programmable Completion Builtins, Prev: Programmable Completion, Up: Command Line Editing
@@ -6338,7 +6431,7 @@ completion facilities.
no matches were generated.
`complete'
- `complete [-abcdefjkvu] [-A ACTION] [-G GLOBPAT] [-W WORDLIST]
+ `complete [-abcdefjkvu] [-o COMP-OPTION] [-A ACTION] [-G GLOBPAT] [-W WORDLIST]
[-P PREFIX] [-S SUFFIX] [-X FILTERPAT] [-F FUNCTION]
[-C COMMAND] NAME [NAME ...]'
`complete -pr [NAME ...]'
@@ -6352,13 +6445,33 @@ completion facilities.
The process of applying these completion specifications when word
completion is attempted is described above (*note Programmable
- Completion::.).
+ Completion::).
Other options, if specified, have the following meanings. The
arguments to the `-G', `-W', and `-X' options (and, if necessary,
the `-P' and `-S' options) should be quoted to protect them from
expansion before the `complete' builtin is invoked.
+ `-o COMP-OPTION'
+ The COMP-OPTION controls several aspects of the compspec's
+ behavior beyond the simple generation of completions.
+ COMP-OPTION may be one of:
+
+ `default'
+ Use readline's default completion if the compspec
+ generates no matches.
+
+ `dirnames'
+ Perform directory name completion if the compspec
+ generates no matches.
+
+ `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 `-F'.
+
`-A ACTION'
The ACTION may be one of the following to generate a list of
possible completions:
@@ -6371,7 +6484,7 @@ completion facilities.
`binding'
Readline key binding names (*note Bindable Readline
- Commands::.).
+ Commands::).
`builtin'
Names of shell builtin commands. May also be specified
@@ -6401,11 +6514,11 @@ completion facilities.
`helptopic'
Help topics as accepted by the `help' builtin (*note
- Bash Builtins::.).
+ Bash Builtins::).
`hostname'
Hostnames, as taken from the file specified by the
- `HOSTFILE' shell variable (*note Bash Variables::.).
+ `HOSTFILE' shell variable (*note Bash Variables::).
`job'
Job names, if job control is active. May also be
@@ -6419,11 +6532,11 @@ completion facilities.
`setopt'
Valid arguments for the `-o' option to the `set' builtin
- (*note The Set Builtin::.).
+ (*note The Set Builtin::).
`shopt'
Shell option names as accepted by the `shopt' builtin
- (*note Bash Builtins::.).
+ (*note Bash Builtins::).
`signal'
Signal names.
@@ -6505,7 +6618,7 @@ Bash History Facilities
=======================
When the `-o history' option to the `set' builtin is enabled (*note
-The Set Builtin::.), the shell provides access to the COMMAND HISTORY,
+The Set Builtin::), the shell provides access to the "command history",
the list of commands previously typed. The value of the `HISTSIZE'
shell variable is used as the number of commands to save in a history
list. The text of the last `$HISTSIZE' commands (default 500) is saved.
@@ -6521,7 +6634,7 @@ no more than the number of lines specified by the value of the
`HISTFILESIZE' variable. When an interactive shell exits, the last
`$HISTSIZE' lines are copied from the history list to the file named by
`$HISTFILE'. If the `histappend' shell option is set (*note Bash
-Builtins::.), the lines are appended to the history file, otherwise the
+Builtins::), the lines are appended to the history file, otherwise the
history file is overwritten. If `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
@@ -6533,7 +6646,7 @@ a portion of the history list. The `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 (*note Commands
-For History::.).
+For History::).
The shell allows control over which commands are saved on the history
list. The `HISTCONTROL' and `HISTIGNORE' variables may be set to cause
@@ -6581,7 +6694,7 @@ and history file.
A useful alias to use with the `fc' command is `r='fc -s'', so
that typing `r cc' runs the last command beginning with `cc' and
- typing `r' re-executes the last command (*note Aliases::.).
+ typing `r' re-executes the last command (*note Aliases::).
`history'
history [N]
@@ -6591,8 +6704,8 @@ and history file.
history -ps ARG
With no options, display the history list with line numbers.
- Lines prefixed with with a `*' have been modified. An argument of
- N lists only the last N lines. Options, if supplied, have the
+ Lines prefixed with a `*' have been modified. An argument of N
+ lists only the last N lines. Options, if supplied, have the
following meanings:
`-c'
@@ -6661,7 +6774,7 @@ appearance of the history expansion character, which is `!' by default.
Only `\' and `'' may be used to escape the history expansion character.
Several shell options settable with the `shopt' builtin (*note Bash
-Builtins::.) may be used to tailor the behavior of history expansion.
+Builtins::) may be used to tailor the behavior of history expansion.
If the `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
@@ -7148,20 +7261,20 @@ does not provide the necessary support.
`--enable-alias'
Allow alias expansion and include the `alias' and `unalias'
- builtins (*note Aliases::.).
+ builtins (*note Aliases::).
`--enable-arith-for-command'
Include support for the alternate form of the `for' command that
behaves like the C language `for' statement (*note Looping
- Constructs::.).
+ Constructs::).
`--enable-array-variables'
Include support for one-dimensional array shell variables (*note
- Arrays::.).
+ Arrays::).
`--enable-bang-history'
Include support for `csh'-like history substitution (*note History
- Interaction::.).
+ Interaction::).
`--enable-brace-expansion'
Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ).
@@ -7170,16 +7283,16 @@ does not provide the necessary support.
`--enable-command-timing'
Include support for recognizing `time' as a reserved word and for
displaying timing statistics for the pipeline following `time'
- (*note Pipelines::.). This allows pipelines as well as shell
+ (*note Pipelines::). This allows pipelines as well as shell
builtins and functions to be timed.
`--enable-cond-command'
Include support for the `[[' conditional command (*note
- Conditional Constructs::.).
+ Conditional Constructs::).
`--enable-directory-stack'
Include support for a `csh'-like directory stack and the `pushd',
- `popd', and `dirs' builtins (*note The Directory Stack::.).
+ `popd', and `dirs' builtins (*note The Directory Stack::).
`--enable-disabled-builtins'
Allow builtin commands to be invoked via `builtin xxx' even after
@@ -7189,7 +7302,7 @@ does not provide the necessary support.
`--enable-dparen-arithmetic'
Include support for the `((...))' command (*note Conditional
- Constructs::.).
+ Constructs::).
`--enable-extended-glob'
Include support for the extended pattern matching features
@@ -7197,24 +7310,24 @@ does not provide the necessary support.
`--enable-help-builtin'
Include the `help' builtin, which displays help on shell builtins
- and variables (*note Bash Builtins::.).
+ and variables (*note Bash Builtins::).
`--enable-history'
Include command history and the `fc' and `history' builtin
- commands (*note Bash History Facilities::.).
+ commands (*note Bash History Facilities::).
`--enable-job-control'
- This enables the job control features (*note Job Control::.), if
+ This enables the job control features (*note Job Control::), if
the operating system supports them.
`--enable-net-redirections'
This enables the special handling of filenames of the form
`/dev/tcp/HOST/PORT' and `/dev/udp/HOST/PORT' when used in
- redirections (*note Redirections::.).
+ redirections (*note Redirections::).
`--enable-process-substitution'
- This enables process substitution (*note Process Substitution::.)
- if the operating system provides the necessary support.
+ This enables process substitution (*note Process Substitution::) if
+ the operating system provides the necessary support.
`--enable-prompt-string-decoding'
Turn on the interpretation of a number of backslash-escaped
@@ -7224,12 +7337,12 @@ does not provide the necessary support.
`--enable-progcomp'
Enable the programmable completion facilities (*note Programmable
- Completion::.). If Readline is not enabled, this option has no
+ Completion::). If Readline is not enabled, this option has no
effect.
`--enable-readline'
Include support for command-line editing and history with the Bash
- version of the Readline library (*note Command Line Editing::.).
+ version of the Readline library (*note Command Line Editing::).
`--enable-restricted'
Include support for a "restricted shell". If this is enabled,
@@ -7238,7 +7351,7 @@ does not provide the necessary support.
`--enable-select'
Include the `select' builtin, which allows the generation of simple
- menus (*note Conditional Constructs::.).
+ menus (*note Conditional Constructs::).
`--enable-usg-echo-default'
A synonym for `--enable-xpg-echo-default'.
@@ -7303,70 +7416,69 @@ be implemented. There are some differences between the traditional
Bourne shell and Bash; this section quickly details the differences of
significance. A number of these differences are explained in greater
depth in previous sections. This section uses the version of `sh'
-included SVR4.2 as the baseline reference.
+included in SVR4.2 as the baseline reference.
* Bash is POSIX-conformant, even where the POSIX specification
- differs from traditional `sh' behavior.
+ differs from traditional `sh' behavior (*note Bash POSIX Mode::).
* Bash has multi-character invocation options (*note Invoking
- Bash::.).
+ Bash::).
- * Bash has command-line editing (*note Command Line Editing::.) and
+ * Bash has command-line editing (*note Command Line Editing::) and
the `bind' builtin.
* Bash provides a programmable word completion mechanism (*note
- Programmable Completion::.), and two builtin commands, `complete'
+ Programmable Completion::), and two builtin commands, `complete'
and `compgen', to manipulate it.
- * Bash has command history (*note Bash History Facilities::.) and the
+ * Bash has command history (*note Bash History Facilities::) and the
`history' and `fc' builtins to manipulate it.
* Bash implements `csh'-like history expansion (*note History
- Interaction::.).
+ Interaction::).
- * Bash has one-dimensional array variables (*note Arrays::.), and the
+ * Bash has one-dimensional array variables (*note Arrays::), and the
appropriate variable expansions and assignment syntax to use them.
Several of the Bash builtins take options to act on arrays. Bash
provides a number of built-in array variables.
* The `$'...'' quoting syntax, which expands ANSI-C
backslash-escaped characters in the text between the single quotes,
- is supported (*note ANSI-C Quoting::.).
+ is supported (*note ANSI-C Quoting::).
* Bash supports the `$"..."' quoting syntax to do locale-specific
translation of the characters between the double quotes. The
`-D', `--dump-strings', and `--dump-po-strings' invocation options
list the translatable strings found in a script (*note Locale
- Translation::.).
+ Translation::).
* Bash implements the `!' keyword to negate the return value of a
- pipeline (*note Pipelines::.). Very useful when an `if' statement
+ pipeline (*note Pipelines::). Very useful when an `if' statement
needs to act only if a test fails.
* Bash has the `time' reserved word and command timing (*note
- Pipelines::.). The display of the timing statistics may be
+ Pipelines::). The display of the timing statistics may be
controlled with the `TIMEFORMAT' variable.
* Bash implements the `for (( EXPR1 ; EXPR2 ; EXPR3 ))' arithmetic
for command, similar to the C language (*note Looping
- Constructs::.).
+ Constructs::).
* Bash includes the `select' compound command, which allows the
- generation of simple menus (*note Conditional Constructs::.).
+ generation of simple menus (*note Conditional Constructs::).
* Bash includes the `[[' compound command, which makes conditional
- testing part of the shell grammar (*note Conditional
- Constructs::.).
+ testing part of the shell grammar (*note Conditional Constructs::).
- * Bash includes brace expansion (*note Brace Expansion::.) and tilde
- expansion (*note Tilde Expansion::.).
+ * Bash includes brace expansion (*note Brace Expansion::) and tilde
+ expansion (*note Tilde Expansion::).
* Bash implements command aliases and the `alias' and `unalias'
- builtins (*note Aliases::.).
+ builtins (*note Aliases::).
* Bash provides shell arithmetic, the `((' compound command (*note
- Conditional Constructs::.), and arithmetic expansion (*note Shell
- Arithmetic::.).
+ Conditional Constructs::), and arithmetic expansion (*note Shell
+ Arithmetic::).
* Variables present in the shell's initial environment are
automatically exported to child processes. The Bourne shell does
@@ -7375,33 +7487,33 @@ included SVR4.2 as the baseline reference.
* Bash includes the POSIX pattern removal `%', `#', `%%' and `##'
expansions to remove leading or trailing substrings from variable
- values (*note Shell Parameter Expansion::.).
+ values (*note Shell Parameter Expansion::).
* The expansion `${#xx}', which returns the length of `${xx}', is
- supported (*note Shell Parameter Expansion::.).
+ supported (*note Shell Parameter Expansion::).
* The expansion `${var:'OFFSET`[:'LENGTH`]}', which expands to the
substring of `var''s value of length LENGTH, beginning at OFFSET,
- is present (*note Shell Parameter Expansion::.).
+ is present (*note Shell Parameter Expansion::).
* The expansion `${var/[/]'PATTERN`[/'REPLACEMENT`]}', which matches
PATTERN and replaces it with REPLACEMENT in the value of `var', is
- available (*note Shell Parameter Expansion::.).
+ available (*note Shell Parameter Expansion::).
* The expansion `${!PREFIX}*' expansion, which expands to the names
of all shell variables whose names begin with PREFIX, is available
- (*note Shell Parameter Expansion::.).
+ (*note Shell Parameter Expansion::).
* Bash has INDIRECT variable expansion using `${!word}' (*note Shell
- Parameter Expansion::.).
+ Parameter Expansion::).
* Bash can expand positional parameters beyond `$9' using `${NUM}'.
* The POSIX `$()' form of command substitution is implemented (*note
- Command Substitution::.), and preferred to the Bourne shell's ```'
+ Command Substitution::), and preferred to the Bourne shell's ```'
(which is also implemented for backwards compatibility).
- * Bash has process substitution (*note Process Substitution::.).
+ * Bash has process substitution (*note Process Substitution::).
* Bash automatically assigns variables that provide information
about the current user (`UID', `EUID', and `GROUPS'), the current
@@ -7410,68 +7522,68 @@ included SVR4.2 as the baseline reference.
`BASH_VERSINFO'). *Note Bash Variables::, for details.
* The `IFS' variable is used to split only the results of expansion,
- not all words (*note Word Splitting::.). This closes a
+ not all words (*note Word Splitting::). This closes a
longstanding shell security hole.
* Bash implements the full set of POSIX 1003.2 filename expansion
operators, including CHARACTER CLASSES, EQUIVALENCE CLASSES, and
- COLLATING SYMBOLS (*note Filename Expansion::.).
+ COLLATING SYMBOLS (*note Filename Expansion::).
* Bash implements extended pattern matching features when the
- `extglob' shell option is enabled (*note Pattern Matching::.).
+ `extglob' shell option is enabled (*note Pattern Matching::).
* It is possible to have a variable and a function with the same
name; `sh' does not separate the two name spaces.
* Bash functions are permitted to have local variables using the
`local' builtin, and thus useful recursive functions may be written
- (*note Bash Builtins::.).
+ (*note Bash Builtins::).
* Variable assignments preceding commands affect only that command,
- even builtins and functions (*note Environment::.). In `sh', all
+ even builtins and functions (*note Environment::). In `sh', all
variable assignments preceding commands are global unless the
command is executed from the file system.
* Bash performs filename expansion on filenames specified as operands
- to input and output redirection operators (*note Redirections::.).
+ to input and output redirection operators (*note Redirections::).
* Bash contains the `<>' redirection operator, allowing a file to be
opened for both reading and writing, and the `&>' redirection
operator, for directing standard output and standard error to the
- same file (*note Redirections::.).
+ same file (*note Redirections::).
* Bash treats a number of filenames specially when they are used in
- redirection operators (*note Redirections::.).
+ redirection operators (*note Redirections::).
* Bash can open network connections to arbitrary machines and
- services with the redirection operators (*note Redirections::.).
+ services with the redirection operators (*note Redirections::).
* The `noclobber' option is available to avoid overwriting existing
- files with output redirection (*note The Set Builtin::.). The
- `>|' redirection operator may be used to override `noclobber'.
+ files with output redirection (*note The Set Builtin::). The `>|'
+ redirection operator may be used to override `noclobber'.
- * The Bash `cd' and `pwd' builtins (*note Bourne Shell Builtins::.)
- each take `-L' and `-P' builtins to switch between logical and
+ * The Bash `cd' and `pwd' builtins (*note Bourne Shell Builtins::)
+ each take `-L' and `-P' options to switch between logical and
physical modes.
* Bash allows a function to override a builtin with the same name,
and provides access to that builtin's functionality within the
function via the `builtin' and `command' builtins (*note Bash
- Builtins::.).
+ Builtins::).
* The `command' builtin allows selective disabling of functions when
- command lookup is performed (*note Bash Builtins::.).
+ command lookup is performed (*note Bash Builtins::).
* Individual builtins may be enabled or disabled using the `enable'
- builtin (*note Bash Builtins::.).
+ builtin (*note Bash Builtins::).
* The Bash `exec' builtin takes additional options that allow users
to control the contents of the environment passed to the executed
command, and what the zeroth argument to the command is to be
- (*note Bourne Shell Builtins::.).
+ (*note Bourne Shell Builtins::).
* Shell functions may be exported to children via the environment
- using `export -f' (*note Shell Functions::.).
+ using `export -f' (*note Shell Functions::).
* The Bash `export', `readonly', and `declare' builtins can take a
`-f' option to act on shell functions, a `-p' option to display
@@ -7483,15 +7595,15 @@ included SVR4.2 as the baseline reference.
* The Bash `hash' builtin allows a name to be associated with an
arbitrary filename, even when that filename cannot be found by
searching the `$PATH', using `hash -p' (*note Bourne Shell
- Builtins::.).
+ Builtins::).
* Bash includes a `help' builtin for quick reference to shell
- facilities (*note Bash Builtins::.).
+ facilities (*note Bash Builtins::).
* The `printf' builtin is available to display formatted output
- (*note Bash Builtins::.).
+ (*note Bash Builtins::).
- * The Bash `read' builtin (*note Bash Builtins::.) will read a line
+ * The Bash `read' builtin (*note Bash Builtins::) will read a line
ending in `\' with the `-r' option, and will use the `REPLY'
variable as a default if no non-option arguments are supplied.
The Bash `read' builtin also accepts a prompt string with the `-p'
@@ -7506,43 +7618,43 @@ included SVR4.2 as the baseline reference.
* The `return' builtin may be used to abort execution of scripts
executed with the `.' or `source' builtins (*note Bourne Shell
- Builtins::.).
+ Builtins::).
* Bash includes the `shopt' builtin, for finer control of shell
- optional capabilities (*note Bash Builtins::.).
+ optional capabilities (*note Bash Builtins::).
* Bash has much more optional behavior controllable with the `set'
- builtin (*note The Set Builtin::.).
+ builtin (*note The Set Builtin::).
- * The `test' builtin (*note Bourne Shell Builtins::.) is slightly
+ * The `test' builtin (*note Bourne Shell Builtins::) is slightly
different, as it implements the POSIX algorithm, which specifies
the behavior based on the number of arguments.
- * The `trap' builtin (*note Bourne Shell Builtins::.) allows a
+ * The `trap' builtin (*note Bourne Shell Builtins::) allows a
`DEBUG' pseudo-signal specification, similar to `EXIT'. Commands
specified with a `DEBUG' trap are executed after every simple
command. The `DEBUG' trap is not inherited by shell functions.
* The Bash `type' builtin is more extensive and gives more
- information about the names it finds (*note Bash Builtins::.).
+ information about the names it finds (*note Bash Builtins::).
* The Bash `umask' builtin permits a `-p' option to cause the output
to be displayed in the form of a `umask' command that may be
- reused as input (*note Bourne Shell Builtins::.).
+ reused as input (*note Bourne Shell Builtins::).
* Bash implements a `csh'-like directory stack, and provides the
`pushd', `popd', and `dirs' builtins to manipulate it (*note The
- Directory Stack::.). Bash also makes the directory stack visible
+ Directory Stack::). Bash also makes the directory stack visible
as the value of the `DIRSTACK' shell variable.
* Bash interprets special backslash-escaped characters in the prompt
- strings when interactive (*note Printing a Prompt::.).
+ strings when interactive (*note Printing a Prompt::).
* The Bash restricted mode is more useful (*note The Restricted
- Shell::.); the SVR4.2 shell restricted mode is too limited.
+ Shell::); the SVR4.2 shell restricted mode is too limited.
* The `disown' builtin can remove a job from the internal shell job
- table (*note Job Control Builtins::.) or suppress the sending of
+ table (*note Job Control Builtins::) or suppress the sending of
`SIGHUP' to a job when the shell exits as the result of a `SIGHUP'.
* The SVR4.2 shell has two privilege-related builtins (`mldmode' and
@@ -7555,6 +7667,7 @@ included SVR4.2 as the baseline reference.
* The SVR4.2 `sh' uses a `TIMEOUT' variable like Bash uses `TMOUT'.
+
More features unique to Bash may be found in *Note Bash Features::.
Implementation Differences From The SVR4.2 Shell
@@ -7719,6 +7832,7 @@ Parameter and Variable Index
* BASH_VERSION: Bash Variables.
* bell-style: Readline Init File Syntax.
* CDPATH: Bourne Shell Variables.
+* COLUMNS: Bash Variables.
* comment-begin: Readline Init File Syntax.
* COMP_CWORD: Bash Variables.
* COMP_LINE: Bash Variables.
@@ -7763,6 +7877,7 @@ Parameter and Variable Index
* LC_MESSAGES: Bash Variables.
* LC_NUMERIC: Bash Variables.
* LINENO: Bash Variables.
+* LINES: Bash Variables.
* MACHTYPE: Bash Variables.
* MAIL: Bourne Shell Variables.
* MAILCHECK: Bash Variables.
@@ -7804,11 +7919,11 @@ Function Index
* Menu:
* abort (C-g): Miscellaneous Commands.
-* accept-line (Newline, Return): Commands For History.
+* accept-line (Newline or Return): Commands For History.
* backward-char (C-b): Commands For Moving.
* backward-delete-char (Rubout): Commands For Text.
* backward-kill-line (C-x Rubout): Commands For Killing.
-* backward-kill-word (M-DEL): Commands For Killing.
+* backward-kill-word (M-<DEL>): Commands For Killing.
* backward-word (M-b): Commands For Moving.
* beginning-of-history (M-<): Commands For History.
* beginning-of-line (C-a): Commands For Moving.
@@ -7817,7 +7932,7 @@ Function Index
* character-search (C-]): Miscellaneous Commands.
* character-search-backward (M-C-]): Miscellaneous Commands.
* clear-screen (C-l): Commands For Moving.
-* complete (TAB): Commands For Completion.
+* complete (<TAB>): Commands For Completion.
* copy-backward-word (): Commands For Killing.
* copy-forward-word (): Commands For Killing.
* copy-region-as-kill (): Commands For Killing.
@@ -7851,9 +7966,9 @@ Function Index
* non-incremental-forward-search-history (M-n): Commands For History.
* non-incremental-reverse-search-history (M-p): Commands For History.
* possible-completions (M-?): Commands For Completion.
-* prefix-meta (ESC): Miscellaneous Commands.
+* prefix-meta (<ESC>): Miscellaneous Commands.
* previous-history (C-p): Commands For History.
-* quoted-insert (C-q, C-v): Commands For Text.
+* quoted-insert (C-q or C-v): Commands For Text.
* re-read-init-file (C-x C-r): Miscellaneous Commands.
* redraw-current-line (): Commands For Moving.
* reverse-search-history (C-r): Commands For History.
@@ -7863,13 +7978,13 @@ Function Index
* start-kbd-macro (C-x (): Keyboard Macros.
* transpose-chars (C-t): Commands For Text.
* transpose-words (M-t): Commands For Text.
-* undo (C-_, C-x C-u): Miscellaneous Commands.
+* undo (C-_ or C-x C-u): Miscellaneous Commands.
* universal-argument (): Numeric Arguments.
* unix-line-discard (C-u): Commands For Killing.
* unix-word-rubout (C-w): Commands For Killing.
* upcase-word (M-u): Commands For Text.
* yank (C-y): Commands For Killing.
-* yank-last-arg (M-., M-_): Commands For History.
+* yank-last-arg (M-. or M-_): Commands For History.
* yank-nth-arg (M-C-y): Commands For History.
* yank-pop (M-y): Commands For Killing.
@@ -7916,8 +8031,8 @@ Concept Index
* evaluation, arithmetic: Shell Arithmetic.
* event designators: Event Designators.
* execution environment: Command Execution Environment.
-* exit status <1>: Exit Status.
-* exit status: Definitions.
+* exit status <1>: Definitions.
+* exit status: Exit Status.
* expansion: Shell Expansions.
* expansion, arithmetic: Arithmetic Expansion.
* expansion, brace: Brace Expansion.
@@ -7944,8 +8059,8 @@ Concept Index
* interactive shell <1>: Interactive Shells.
* interactive shell: Invoking Bash.
* job: Definitions.
-* job control <1>: Job Control Basics.
-* job control: Definitions.
+* job control <1>: Definitions.
+* job control: Job Control Basics.
* kill ring: Readline Killing Commands.
* killing text: Readline Killing Commands.
* localization: Locale Translation.
@@ -7982,13 +8097,14 @@ Concept Index
* shell, interactive: Interactive Shells.
* signal: Definitions.
* signal handling: Signals.
-* special builtin <1>: Special Builtins.
-* special builtin: Definitions.
+* special builtin <1>: Definitions.
+* special builtin: Special Builtins.
* startup files: Bash Startup Files.
* suspending jobs: Job Control Basics.
* tilde expansion: Tilde Expansion.
* token: Definitions.
* variable, shell: Shell Parameters.
+* variables, readline: Readline Init File Syntax.
* word: Definitions.
* word splitting: Word Splitting.
* yanking text: Readline Killing Commands.
@@ -7996,126 +8112,126 @@ Concept Index

Tag Table:
-Node: Top1185
-Node: Introduction3316
-Node: What is Bash?3541
-Node: What is a shell?4642
-Node: Definitions6876
-Node: Basic Shell Features9542
-Node: Shell Syntax10766
-Node: Shell Operation11790
-Node: Quoting13085
-Node: Escape Character14345
-Node: Single Quotes14817
-Node: Double Quotes15152
-Node: ANSI-C Quoting16055
-Node: Locale Translation16957
-Node: Comments17378
-Node: Shell Commands17984
-Node: Simple Commands18865
-Node: Pipelines19488
-Node: Lists21015
-Node: Looping Constructs22529
-Node: Conditional Constructs24976
-Node: Command Grouping30918
-Node: Shell Functions32295
-Node: Shell Parameters34833
-Node: Positional Parameters36159
-Node: Special Parameters37052
-Node: Shell Expansions39711
-Node: Brace Expansion41635
-Node: Tilde Expansion43305
-Node: Shell Parameter Expansion45637
-Node: Command Substitution52439
-Node: Arithmetic Expansion53761
-Node: Process Substitution54606
-Node: Word Splitting55643
-Node: Filename Expansion57095
-Node: Pattern Matching59055
-Node: Quote Removal61450
-Node: Redirections61736
-Node: Executing Commands68607
-Node: Simple Command Expansion69274
-Node: Command Search and Execution71197
-Node: Command Execution Environment73194
-Node: Environment75648
-Node: Exit Status77300
-Node: Signals78497
-Node: Shell Scripts80392
-Node: Shell Builtin Commands82776
-Node: Bourne Shell Builtins84211
-Node: Bash Builtins99107
-Node: The Set Builtin123146
-Node: Special Builtins129959
-Node: Shell Variables130931
-Node: Bourne Shell Variables131367
-Node: Bash Variables133147
-Node: Bash Features147888
-Node: Invoking Bash148770
-Node: Bash Startup Files153441
-Node: Interactive Shells158148
-Node: What is an Interactive Shell?158550
-Node: Is this Shell Interactive?159185
-Node: Interactive Shell Behavior159991
-Node: Bash Conditional Expressions163279
-Node: Shell Arithmetic166574
-Node: Aliases169005
-Node: Arrays171510
-Node: The Directory Stack174530
-Node: Directory Stack Builtins175236
-Node: Printing a Prompt178114
-Node: The Restricted Shell180486
-Node: Bash POSIX Mode181964
-Node: Job Control186258
-Node: Job Control Basics186724
-Node: Job Control Builtins190939
-Node: Job Control Variables195234
-Node: Command Line Editing196384
-Node: Introduction and Notation197382
-Node: Readline Interaction198999
-Node: Readline Bare Essentials200191
-Node: Readline Movement Commands201971
-Node: Readline Killing Commands202927
-Node: Readline Arguments204832
-Node: Searching205806
-Node: Readline Init File207685
-Node: Readline Init File Syntax208739
-Node: Conditional Init Constructs218285
-Node: Sample Init File220723
-Node: Bindable Readline Commands223892
-Node: Commands For Moving225085
-Node: Commands For History225933
-Node: Commands For Text228727
-Node: Commands For Killing230678
-Node: Numeric Arguments232644
-Node: Commands For Completion233770
-Node: Keyboard Macros237602
-Node: Miscellaneous Commands238160
-Node: Readline vi Mode242534
-Node: Programmable Completion243444
-Node: Programmable Completion Builtins248120
-Node: Using History Interactively254226
-Node: Bash History Facilities254905
-Node: Bash History Builtins257466
-Node: History Interaction261038
-Node: Event Designators263590
-Node: Word Designators264517
-Node: Modifiers266146
-Node: Installing Bash267463
-Node: Basic Installation268605
-Node: Compilers and Options271723
-Node: Compiling For Multiple Architectures272457
-Node: Installation Names274114
-Node: Specifying the System Type274837
-Node: Sharing Defaults275544
-Node: Operation Controls276209
-Node: Optional Features277160
-Node: Reporting Bugs284581
-Node: Major Differences From The Bourne Shell285678
-Node: Builtin Index299726
-Node: Reserved Word Index303317
-Node: Variable Index304793
-Node: Function Index310465
-Node: Concept Index314955
+Node: Top1157
+Node: Introduction3286
+Node: What is Bash?3511
+Node: What is a shell?4612
+Node: Definitions6846
+Node: Basic Shell Features9512
+Node: Shell Syntax10736
+Node: Shell Operation11760
+Node: Quoting13045
+Node: Escape Character14304
+Node: Single Quotes14776
+Node: Double Quotes15111
+Node: ANSI-C Quoting16012
+Node: Locale Translation16915
+Node: Comments17690
+Node: Shell Commands18295
+Node: Simple Commands19176
+Node: Pipelines19797
+Node: Lists21322
+Node: Looping Constructs22835
+Node: Conditional Constructs25279
+Node: Command Grouping31220
+Node: Shell Functions32597
+Node: Shell Parameters35134
+Node: Positional Parameters36459
+Node: Special Parameters37350
+Node: Shell Expansions40008
+Node: Brace Expansion41928
+Node: Tilde Expansion43597
+Node: Shell Parameter Expansion45928
+Node: Command Substitution52728
+Node: Arithmetic Expansion54050
+Node: Process Substitution54894
+Node: Word Splitting55931
+Node: Filename Expansion57383
+Node: Pattern Matching59341
+Node: Quote Removal62472
+Node: Redirections62758
+Node: Executing Commands69629
+Node: Simple Command Expansion70296
+Node: Command Search and Execution72217
+Node: Command Execution Environment74214
+Node: Environment76667
+Node: Exit Status78318
+Node: Signals79513
+Node: Shell Scripts81405
+Node: Shell Builtin Commands83788
+Node: Bourne Shell Builtins85218
+Node: Bash Builtins100145
+Node: The Set Builtin124177
+Node: Special Builtins131034
+Node: Shell Variables132006
+Node: Bourne Shell Variables132442
+Node: Bash Variables134221
+Node: Bash Features149565
+Node: Invoking Bash150447
+Node: Bash Startup Files155232
+Node: Interactive Shells160102
+Node: What is an Interactive Shell?160504
+Node: Is this Shell Interactive?161139
+Node: Interactive Shell Behavior161945
+Node: Bash Conditional Expressions165212
+Node: Shell Arithmetic168506
+Node: Aliases170937
+Node: Arrays173440
+Node: The Directory Stack176460
+Node: Directory Stack Builtins177166
+Node: Printing a Prompt180044
+Node: The Restricted Shell182414
+Node: Bash POSIX Mode183892
+Node: Job Control189520
+Node: Job Control Basics189986
+Node: Job Control Builtins194200
+Node: Job Control Variables198495
+Node: Command Line Editing199644
+Node: Introduction and Notation200642
+Node: Readline Interaction202259
+Node: Readline Bare Essentials203445
+Node: Readline Movement Commands205225
+Node: Readline Killing Commands206181
+Node: Readline Arguments208090
+Node: Searching209125
+Node: Readline Init File211115
+Node: Readline Init File Syntax212169
+Node: Conditional Init Constructs222372
+Node: Sample Init File224896
+Node: Bindable Readline Commands228065
+Node: Commands For Moving229264
+Node: Commands For History230112
+Node: Commands For Text233000
+Node: Commands For Killing234933
+Node: Numeric Arguments236883
+Node: Commands For Completion238010
+Node: Keyboard Macros241590
+Node: Miscellaneous Commands242148
+Node: Readline vi Mode246510
+Node: Programmable Completion247419
+Node: Programmable Completion Builtins252467
+Node: Using History Interactively259374
+Node: Bash History Facilities260053
+Node: Bash History Builtins262613
+Node: History Interaction266179
+Node: Event Designators268730
+Node: Word Designators269657
+Node: Modifiers271286
+Node: Installing Bash272603
+Node: Basic Installation273745
+Node: Compilers and Options276863
+Node: Compiling For Multiple Architectures277597
+Node: Installation Names279254
+Node: Specifying the System Type279977
+Node: Sharing Defaults280684
+Node: Operation Controls281349
+Node: Optional Features282300
+Node: Reporting Bugs289705
+Node: Major Differences From The Bourne Shell290802
+Node: Builtin Index304814
+Node: Reserved Word Index308405
+Node: Variable Index309881
+Node: Function Index315667
+Node: Concept Index320157

End Tag Table
diff --git a/doc/bashref.texi b/doc/bashref.texi
index 10b8027..ea3702f 100644
--- a/doc/bashref.texi
+++ b/doc/bashref.texi
@@ -5,13 +5,13 @@
@c %**end of header
@ignore
-Last Change: Tue Mar 14 11:38:10 EST 2000
+Last Change: Wed Mar 28 14:48:38 EST 2001
@end ignore
-@set EDITION 2.4
-@set VERSION 2.04
-@set UPDATED 14 March 2000
-@set UPDATE-MONTH March 2000
+@set EDITION 2.5
+@set VERSION 2.05
+@set UPDATED 28 Mar 2001
+@set UPDATE-MONTH Mar 2001
@iftex
@finalout
@@ -413,7 +413,7 @@ following:
@enumerate
@item
Reads its input from a file (@pxref{Shell Scripts}), from a string
-supplied as an argument to the @samp{-c} invocation option
+supplied as an argument to the @option{-c} invocation option
(@pxref{Invoking Bash}), or from the user's terminal.
@item
@@ -470,7 +470,7 @@ has special meaning to the shell and must be quoted if it is to
represent itself.
When the command history expansion facilities are being used, the
@var{history expansion} character, usually @samp{!}, must be quoted
-to prevent history expansion. @xref{Bash History Facilities} for
+to prevent history expansion. @xref{Bash History Facilities}, for
more details concerning history expansion.
There are three quoting mechanisms: the
@var{escape character}, single quotes, and double quotes.
@@ -517,7 +517,7 @@ when in double quotes (@pxref{Shell Parameter Expansion}).
Words of the form @code{$'@var{string}'} are treated specially. The
word expands to @var{string}, with backslash-escaped characters replaced
-as specifed by the ANSI C standard. Backslash escape sequences, if
+as specified by the ANSI C standard. Backslash escape sequences, if
present, are decoded as follows:
@table @code
@@ -564,6 +564,13 @@ is ignored.
If the string is translated and replaced, the replacement is
double-quoted.
+Some systems use the message catalog selected by the @env{LC_MESSAGES}
+shell variable. Others create the name of the message catalog from the
+value of the @env{TEXTDOMAIN} shell variable, possibly adding a
+suffix of @samp{.mo}. If you use the @env{TEXTDOMAIN} variable, you
+may need to set the @env{TEXTDOMAINDIR} variable to the location of
+the message catalog files.
+
@node Comments
@subsection Comments
@cindex comments, shell
@@ -641,9 +648,9 @@ The reserved word @code{time} causes timing statistics
to be printed for the pipeline once it finishes.
The statistics currently consist of elapsed (wall-clock) time and
user and system time consumed by the command's execution.
-The @samp{-p} option changes the output format to that specified
+The @option{-p} option changes the output format to that specified
by @sc{posix}.
-The @code{TIMEFORMAT} variable may be set to a format string that
+The @env{TIMEFORMAT} variable may be set to a format string that
specifies how the timing information should be displayed.
@xref{Bash Variables}, for a description of the available formats.
The use of @code{time} as a reserved word permits the timing of
@@ -874,14 +881,14 @@ of items. The set of expanded words is printed on the standard
error output stream, each preceded by a number. If the
@samp{in @var{words}} is omitted, the positional parameters are printed,
as if @samp{in "$@@"} had been specifed.
-The @code{PS3} prompt is then displayed and a line is read from the
+The @env{PS3} prompt is then displayed and a line is read from the
standard input.
If the line consists of a number corresponding to one of the displayed
words, then the value of @var{name} is set to that word.
If the line is empty, the words and prompt are displayed again.
If @code{EOF} is read, the @code{select} command completes.
Any other value read causes @var{name} to be set to null.
-The line read is saved in the variable @code{REPLY}.
+The line read is saved in the variable @env{REPLY}.
The @var{commands} are executed after each selection until a
@code{break} or @code{return} command is executed, at which
@@ -1046,7 +1053,7 @@ during its execution (@pxref{Positional Parameters}).
The special parameter @samp{#} that expands to the number of
positional parameters is updated to reflect the change.
Positional parameter @code{0} is unchanged.
-The @code{FUNCNAME} variable is set to the name of the function
+The @env{FUNCNAME} variable is set to the name of the function
while the function is executing.
If the builtin command @code{return}
@@ -1139,13 +1146,13 @@ only be referenced; assignment to them is not allowed.
Expands to the positional parameters, starting from one. When the
expansion occurs within double quotes, it expands to a single word
with the value of each parameter separated by the first character
-of the @code{IFS}
+of the @env{IFS}
special variable. That is, @code{"$*"} is equivalent
to @code{"$1@var{c}$2@var{c}@dots{}"}, where @var{c}
is the first character of the value of the @code{IFS}
variable.
-If @code{IFS} is unset, the parameters are separated by spaces.
-If @code{IFS} is null, the parameters are joined without intervening
+If @env{IFS} is unset, the parameters are separated by spaces.
+If @env{IFS} is null, the parameters are joined without intervening
separators.
@@ -1169,7 +1176,7 @@ pipeline.
(A hyphen.) Expands to the current option flags as specified upon
invocation, by the @code{set}
builtin command, or those set by the shell itself
-(such as the @samp{-i} option).
+(such as the @option{-i} option).
@item $
Expands to the process @sc{id} of the shell. In a @code{()} subshell, it
@@ -1183,7 +1190,7 @@ Expands to the process @sc{id} of the most recently executed background
Expands to the name of the shell or shell script. This is set at
shell initialization. If Bash is invoked with a file of commands
(@pxref{Shell Scripts}), @code{$0} is set to the name of that file.
-If Bash is started with the @samp{-c} option (@pxref{Invoking Bash}),
+If Bash is started with the @option{-c} option (@pxref{Invoking Bash}),
then @code{$0} is set to the first argument after the string to be
executed, if one is present. Otherwise, it is set
to the filename used to invoke Bash, as given by argument zero.
@@ -1311,16 +1318,16 @@ If none of the characters in the tilde-prefix are quoted, the
characters in the tilde-prefix following the tilde are treated as a
possible @var{login name}.
If this login name is the null string, the tilde is replaced with the
-value of the @code{HOME} shell variable.
-If @code{HOME} is unset, the home directory of the user executing the
+value of the @env{HOME} shell variable.
+If @env{HOME} is unset, the home directory of the user executing the
shell is substituted instead.
Otherwise, the tilde-prefix is replaced with the home directory
associated with the specified login name.
If the tilde-prefix is @samp{~+}, the value of
-the shell variable @code{PWD} replaces the tilde-prefix.
+the shell variable @env{PWD} replaces the tilde-prefix.
If the tilde-prefix is @samp{~-}, the value of the shell variable
-@code{OLDPWD}, if it is set, is substituted.
+@env{OLDPWD}, if it is set, is substituted.
If the characters following the tilde in the tilde-prefix consist of a
number @var{N}, optionally prefixed by a @samp{+} or a @samp{-},
@@ -1338,7 +1345,7 @@ Each variable assignment is checked for unquoted tilde-prefixes immediately
following a @samp{:} or @samp{=}.
In these cases, tilde expansion is also performed.
Consequently, one may use file names with tildes in assignments to
-@code{PATH}, @code{MAILPATH}, and @code{CDPATH},
+@env{PATH}, @env{MAILPATH}, and @env{CDPATH},
and the shell assigns the expanded value.
The following table shows how Bash treats unquoted tilde-prefixes:
@@ -1465,7 +1472,7 @@ are used, in which case the indexing starts at 1.
@item $@{!@var{prefix}*@}
Expands to the names of variables whose names begin with @var{prefix},
-separated by the first character of the @code{IFS} special variable.
+separated by the first character of the @env{IFS} special variable.
@item $@{#@var{parameter}@}
The length in characters of the expanded value of @var{parameter} is
@@ -1635,22 +1642,22 @@ The shell scans the results of parameter expansion, command substitution,
and arithmetic expansion that did not occur within double quotes for
word splitting.
-The shell treats each character of @code{$IFS}
+The shell treats each character of @env{$IFS}
as a delimiter, and splits the results of the other
expansions into words on these characters. If
-@code{IFS} is unset, or its value is exactly @code{<space><tab><newline>},
-the default, then any sequence of @code{IFS}
-characters serves to delimit words. If @code{IFS}
+@env{IFS} is unset, or its value is exactly @code{<space><tab><newline>},
+the default, then any sequence of @env{IFS}
+characters serves to delimit words. If @env{IFS}
has a value other than the default, then sequences of
the whitespace characters @code{space} and @code{tab}
are ignored at the beginning and end of the
word, as long as the whitespace character is in the
-value of @code{IFS} (an @code{IFS} whitespace character).
-Any character in @code{IFS} that is not @code{IFS}
-whitespace, along with any adjacent @code{IFS}
-whitespace characters, delimits a field. A sequence of @code{IFS}
+value of @env{IFS} (an @env{IFS} whitespace character).
+Any character in @env{IFS} that is not @env{IFS}
+whitespace, along with any adjacent @env{IFS}
+whitespace characters, delimits a field. A sequence of @env{IFS}
whitespace characters is also treated as a delimiter.
-If the value of @code{IFS} is null, no word splitting occurs.
+If the value of @env{IFS} is null, no word splitting occurs.
Explicit null arguments (@code{""} or @code{''}) are retained.
Unquoted implicit null arguments, resulting from the expansion of
@@ -1671,7 +1678,7 @@ is performed.
@cindex filename expansion
@cindex pathname expansion
-After word splitting, unless the @samp{-f} option has been set
+After word splitting, unless the @option{-f} option has been set
(@pxref{The Set Builtin}), Bash scans each word for the characters
@samp{*}, @samp{?}, and @samp{[}.
If one of these characters appears, then the word is
@@ -1696,20 +1703,20 @@ See the description of @code{shopt} in @ref{Bash Builtins},
for a description of the @code{nocaseglob}, @code{nullglob},
and @code{dotglob} options.
-The @code{GLOBIGNORE}
+The @env{GLOBIGNORE}
shell variable may be used to restrict the set of filenames matching a
-pattern. If @code{GLOBIGNORE}
+pattern. If @env{GLOBIGNORE}
is set, each matching filename that also matches one of the patterns in
-@code{GLOBIGNORE} is removed from the list of matches. The filenames
+@env{GLOBIGNORE} is removed from the list of matches. The filenames
@file{.} and @file{..}
-are always ignored, even when @code{GLOBIGNORE}
-is set. However, setting @code{GLOBIGNORE} has the effect of
+are always ignored, even when @env{GLOBIGNORE}
+is set. However, setting @env{GLOBIGNORE} has the effect of
enabling the @code{dotglob}
shell option, so all other filenames beginning with a
@samp{.} will match.
To get the old behavior of ignoring filenames beginning with a
-@samp{.}, make @samp{.*} one of the patterns in @code{GLOBIGNORE}.
-The @code{dotglob} option is disabled when @code{GLOBIGNORE}
+@samp{.}, make @samp{.*} one of the patterns in @env{GLOBIGNORE}.
+The @code{dotglob} option is disabled when @env{GLOBIGNORE}
is unset.
@node Pattern Matching
@@ -1730,14 +1737,26 @@ Matches any string, including the null string.
Matches any single character.
@item [@dots{}]
Matches any one of the enclosed characters. A pair of characters
-separated by a minus sign denotes a @var{range};
-any character lexically between those two characters, inclusive,
+separated by a hyphen denotes a @var{range expression};
+any character that sorts between those two characters, inclusive,
+using the current locale's collating sequence and character set,
is matched. If the first character following the
@samp{[} is a @samp{!} or a @samp{^}
then any character not enclosed is matched. A @samp{@minus{}}
may be matched by including it as the first or last character
in the set. A @samp{]} may be matched by including it as the first
character in the set.
+The sorting order of characters in range expressions is determined by
+the current locale and the value of the @env{LC_COLLATE} shell variable,
+if set.
+
+For example, in the default C locale, @samp{[a-dx-z]} is equivalent to
+@samp{[abcdxyz]}. Many locales sort characters in dictionary order, and in
+these locales @samp{[a-dx-z]} is typically not equivalent to @samp{[abcdxyz]};
+it might be equivalent to @samp{[aBbCcDdxXyYz]}, for example. To obtain
+the traditional interpretation of ranges in bracket expressions, you can
+force the use of the C locale by setting the @env{LC_COLLATE} or
+@env{LC_ALL} environment variable to the value @samp{C}.
Within @samp{[} and @samp{]}, @var{character classes} can be specified
using the syntax
@@ -2097,11 +2116,11 @@ builtin is invoked.
@item
If the name is neither a shell function nor a builtin,
and contains no slashes, Bash searches each element of
-@code{$PATH} for a directory containing an executable file
+@env{$PATH} for a directory containing an executable file
by that name. Bash uses a hash table to remember the full
-pathnames of executable files to avoid multiple @code{PATH} searches
+pathnames of executable files to avoid multiple @env{PATH} searches
(see the description of @code{hash} in @ref{Bourne Shell Builtins}).
-A full search of the directories in @code{$PATH}
+A full search of the directories in @env{$PATH}
is performed only if the command is not found in the hash table.
If the search is unsuccessful, the shell prints an error
message and returns an exit status of 127.
@@ -2169,7 +2188,7 @@ shell aliases defined with @code{alias} (@pxref{Aliases})
@item
various process @sc{id}s, including those of background jobs
(@pxref{Lists}), the value of @code{$$}, and the value of
-@code{$PPID}
+@env{$PPID}
@end itemize
@@ -2241,7 +2260,7 @@ parameter assignments, as described in @ref{Shell Parameters}.
These assignment statements affect only the environment seen
by that command.
-If the @samp{-k} option is set (@pxref{The Set Builtin}), then all
+If the @option{-k} option is set (@pxref{The Set Builtin}), then all
parameter assignments are placed in the environment for a command,
not just those that precede the command name.
@@ -2329,7 +2348,7 @@ which the trap is executed.
A shell script is a text file containing shell commands. When such
a file is used as the first non-option argument when invoking Bash,
-and neither the @samp{-c} nor @samp{-s} option is supplied
+and neither the @option{-c} nor @option{-s} option is supplied
(@pxref{Invoking Bash}),
Bash reads and executes commands from the file, then exits. This
mode of operation creates a non-interactive shell. When Bash runs
@@ -2341,7 +2360,7 @@ are unset.
A shell script may be made executable by using the @code{chmod} command
to turn on the execute bit. When Bash finds such a file while
-searching the @code{$PATH} for a command, it spawns a subshell to
+searching the @env{$PATH} for a command, it spawns a subshell to
execute it. In other words, executing
@example
filename @var{arguments}
@@ -2435,9 +2454,9 @@ The return status is zero.
@end example
Read and execute commands from the @var{filename} argument in the
current shell context. If @var{filename} does not contain a slash,
-the @code{PATH} variable is used to find
-@var{filename}. The current directory is searched if @var{filename}
-is not found in @code{$PATH}.
+the @env{PATH} variable is used to find @var{filename}.
+When Bash is not in @sc{posix} mode, the current directory is searched
+if @var{filename} is not found in @env{$PATH}.
If any @var{arguments} are supplied, they become the positional
parameters when @var{filename} is executed. Otherwise the positional
parameters are unchanged.
@@ -2462,13 +2481,13 @@ The return status is zero unless @var{n} is not greater than or equal to 1.
cd [-LP] [@var{directory}]
@end example
Change the current working directory to @var{directory}. If @var{directory}
-is not given, the value of the @code{HOME} shell variable is used. If the
-shell variable @code{CDPATH} exists, it is used as a search path. If
-@var{directory} begins with a slash, @code{CDPATH} is not used.
-The @samp{-P} option means
+is not given, the value of the @env{HOME} shell variable is used. If the
+shell variable @env{CDPATH} exists, it is used as a search path. If
+@var{directory} begins with a slash, @env{CDPATH} is not used.
+The @option{-P} option means
to not follow symbolic links; symbolic links are followed by default
-or with the @samp{-L} option.
-If @var{directory} is @samp{-}, it is equivalent to @code{$OLDPWD}.
+or with the @option{-L} option.
+If @var{directory} is @samp{-}, it is equivalent to @env{$OLDPWD}.
The return status is zero if the directory is successfully changed,
non-zero otherwise.
@@ -2502,12 +2521,12 @@ exec [-cl] [-a @var{name}] [@var{command} [@var{arguments}]]
@end example
If @var{command}
is supplied, it replaces the shell without creating a new process.
-If the @samp{-l} option is supplied, the shell places a dash at the
+If the @option{-l} option is supplied, the shell places a dash at the
beginning of the zeroth arg passed to @var{command}.
This is what the @code{login} program does.
-The @samp{-c} option causes @var{command} to be executed with an empty
+The @option{-c} option causes @var{command} to be executed with an empty
environment.
-If @samp{-a} is supplied, the shell passes @var{name} as the zeroth
+If @option{-a} is supplied, the shell passes @var{name} as the zeroth
argument to @var{command}.
If no @var{command} is specified, redirections may be used to affect
the current shell environment. If there are no redirection errors, the
@@ -2528,14 +2547,14 @@ Any trap on @code{EXIT} is executed before the shell terminates.
export [-fn] [-p] [@var{name}[=@var{value}]]
@end example
Mark each @var{name} to be passed to child processes
-in the environment. If the @samp{-f} option is supplied, the @var{name}s
+in the environment. If the @option{-f} option is supplied, the @var{name}s
refer to shell functions; otherwise the names refer to shell variables.
-The @samp{-n} option means to no longer mark each @var{name} for export.
-If no @var{names} are supplied, or if the @samp{-p} option is given, a
+The @option{-n} option means to no longer mark each @var{name} for export.
+If no @var{names} are supplied, or if the @option{-p} option is given, a
list of exported names is displayed.
-The @samp{-p} option displays output in a form that may be reused as input.
+The @option{-p} option displays output in a form that may be reused as input.
The return status is zero unless an invalid option is supplied, one of
-the names is not a valid shell variable name, or @samp{-f} is supplied
+the names is not a valid shell variable name, or @option{-f} is supplied
with a name that is not a shell function.
@item getopts
@@ -2553,18 +2572,18 @@ Each time it is invoked, @code{getopts}
places the next option in the shell variable @var{name}, initializing
@var{name} if it does not exist,
and the index of the next argument to be processed into the
-variable @code{OPTIND}.
-@code{OPTIND} is initialized to 1 each time the shell or a shell script
+variable @env{OPTIND}.
+@env{OPTIND} is initialized to 1 each time the shell or a shell script
is invoked.
When an option requires an argument,
-@code{getopts} places that argument into the variable @code{OPTARG}.
-The shell does not reset @code{OPTIND} automatically; it must be manually
+@code{getopts} places that argument into the variable @env{OPTARG}.
+The shell does not reset @env{OPTIND} automatically; it must be manually
reset between multiple calls to @code{getopts} within the same shell
invocation if a new set of parameters is to be used.
When the end of options is encountered, @code{getopts} exits with a
return value greater than zero.
-@code{OPTIND} is set to the index of the first non-option argument,
+@env{OPTIND} is set to the index of the first non-option argument,
and @code{name} is set to @samp{?}.
@code{getopts}
@@ -2576,21 +2595,21 @@ given in @var{args}, @code{getopts} parses those instead.
error reporting is used. In normal operation diagnostic messages
are printed when invalid options or missing option arguments are
encountered.
-If the variable @code{OPTERR}
+If the variable @env{OPTERR}
is set to 0, no error messages will be displayed, even if the first
character of @code{optstring} is not a colon.
If an invalid option is seen,
@code{getopts} places @samp{?} into @var{name} and, if not silent,
-prints an error message and unsets @code{OPTARG}.
+prints an error message and unsets @env{OPTARG}.
If @code{getopts} is silent, the option character found is placed in
-@code{OPTARG} and no diagnostic message is printed.
+@env{OPTARG} and no diagnostic message is printed.
If a required argument is not found, and @code{getopts}
is not silent, a question mark (@samp{?}) is placed in @var{name},
@code{OPTARG} is unset, and a diagnostic message is printed.
If @code{getopts} is silent, then a colon (@samp{:}) is placed in
-@var{name} and @code{OPTARG} is set to the option character found.
+@var{name} and @env{OPTARG} is set to the option character found.
@item hash
@btindex hash
@@ -2600,10 +2619,10 @@ hash [-r] [-p @var{filename}] [@var{name}]
Remember the full pathnames of commands specified as @var{name} arguments,
so they need not be searched for on subsequent invocations.
The commands are found by searching through the directories listed in
-@code{$PATH}.
-The @samp{-p} option inhibits the path search, and @var{filename} is
+@env{$PATH}.
+The @option{-p} option inhibits the path search, and @var{filename} is
used as the location of @var{name}.
-The @samp{-r} option causes the shell to forget all remembered locations.
+The @option{-r} option causes the shell to forget all remembered locations.
If no arguments are given, information about remembered commands is printed.
The return status is zero unless a @var{name} is not found or an invalid
option is supplied.
@@ -2614,9 +2633,9 @@ option is supplied.
pwd [-LP]
@end example
Print the absolute pathname of the current working directory.
-If the @samp{-P} option is supplied, the pathname printed will not
+If the @option{-P} option is supplied, the pathname printed will not
contain symbolic links.
-If the @samp{-L} option is supplied, the pathname printed may contain
+If the @option{-L} option is supplied, the pathname printed may contain
symbolic links.
The return status is zero unless an error is encountered while
determining the name of the current directory or an invalid option
@@ -2629,16 +2648,16 @@ readonly [-apf] [@var{name}] @dots{}
@end example
Mark each @var{name} as readonly.
The values of these names may not be changed by subsequent assignment.
-If the @samp{-f} option is supplied, each @var{name} refers to a shell
+If the @option{-f} option is supplied, each @var{name} refers to a shell
function.
-The @samp{-a} option means each @var{name} refers to an array variable.
-If no @var{name} arguments are given, or if the @samp{-p}
+The @option{-a} option means each @var{name} refers to an array variable.
+If no @var{name} arguments are given, or if the @option{-p}
option is supplied, a list of all readonly names is printed.
-The @samp{-p} option causes output to be displayed in a format that
+The @option{-p} option causes output to be displayed in a format that
may be reused as input.
The return status is zero unless an invalid option is supplied, one of
the @var{name} arguments is not a valid shell variable or function name,
-or the @samp{-f} option is supplied with a name that is not a shell function.
+or the @option{-f} option is supplied with a name that is not a shell function.
@item return
@btindex return
@@ -2764,10 +2783,10 @@ equal to @samp{-}, all specified signals are reset to the values
they had when the shell was started.
If @var{arg} is the null string, then the signal specified by
each @var{sigspec} is ignored by the shell and commands it invokes.
-If @var{arg} is not present and @samp{-p} has been supplied,
+If @var{arg} is not present and @option{-p} has been supplied,
the shell displays the trap commands associated with each @var{sigspec}.
If no arguments are supplied, or
-only @samp{-p} is given, @code{trap} prints the list of commands
+only @option{-p} is given, @code{trap} prints the list of commands
associated with each signal number in a form that may be reused as
shell input.
Each @var{sigspec} is either a signal name such as @code{SIGINT} (with
@@ -2776,7 +2795,7 @@ If a @var{sigspec}
is @code{0} or @code{EXIT}, @var{arg} is executed when the shell exits.
If a @var{sigspec} is @code{DEBUG}, the command @var{arg} is executed
after every simple command.
-The @samp{-l} option causes the shell to print a list of signal names
+The @option{-l} option causes the shell to print a list of signal names
and their corresponding numbers.
Signals ignored upon entry to the shell cannot be trapped or reset.
@@ -2795,10 +2814,10 @@ Set the shell process's file creation mask to @var{mode}. If
@var{mode} begins with a digit, it is interpreted as an octal number;
if not, it is interpreted as a symbolic mode mask similar
to that accepted by the @code{chmod} command. If @var{mode} is
-omitted, the current value of the mask is printed. If the @samp{-S}
+omitted, the current value of the mask is printed. If the @option{-S}
option is supplied without a @var{mode} argument, the mask is printed
in a symbolic format.
-If the @samp{-p} option is supplied, and @var{mode}
+If the @option{-p} option is supplied, and @var{mode}
is omitted, the output is in a form that may be reused as input.
The return status is zero if the mode is successfully changed or if
no @var{mode} argument is supplied, and non-zero otherwise.
@@ -2813,9 +2832,9 @@ results in permissions of @code{755}.
unset [-fv] [@var{name}]
@end example
Each variable or function @var{name} is removed.
-If no options are supplied, or the @samp{-v} option is given, each
+If no options are supplied, or the @option{-v} option is given, each
@var{name} refers to a shell variable.
-If the @samp{-f} option is given, the @var{name}s refer to shell
+If the @option{-f} option is given, the @var{name}s refer to shell
functions, and the function definition is removed.
Readonly variables and functions may not be unset.
The return status is zero unless a @var{name} does not exist or is
@@ -2837,7 +2856,7 @@ Some of these commands are specified in the @sc{posix} 1003.2 standard.
alias [@code{-p}] [@var{name}[=@var{value}] @dots{}]
@end example
-Without arguments or with the @samp{-p} option, @code{alias} prints
+Without arguments or with the @option{-p} option, @code{alias} prints
the list of aliases on the standard output in a form that allows
them to be reused as input.
If arguments are supplied, an alias is defined for each @var{name}
@@ -2874,6 +2893,7 @@ names are
@code{emacs-meta},
@code{emacs-ctlx},
@code{vi},
+@code{vi-move},
@code{vi-command}, and
@code{vi-insert}.
@code{vi} is equivalent to @code{vi-command};
@@ -2946,20 +2966,20 @@ command [-pVv] @var{command} [@var{arguments} @dots{}]
Runs @var{command} with @var{arguments} ignoring any shell function
named @var{command}.
Only shell builtin commands or commands found by searching the
-@code{PATH} are executed.
+@env{PATH} are executed.
If there is a shell function named @code{ls}, running @samp{command ls}
within the function will execute the external command @code{ls}
instead of calling the function recursively.
-The @samp{-p} option means to use a default value for @code{$PATH}
+The @option{-p} option means to use a default value for @env{PATH}
that is guaranteed to find all of the standard utilities.
The return status in this case is 127 if @var{command} cannot be
found or an error occurred, and the exit status of @var{command}
otherwise.
-If either the @samp{-V} or @samp{-v} option is supplied, a
-description of @var{command} is printed. The @samp{-v} option
+If either the @option{-V} or @option{-v} option is supplied, a
+description of @var{command} is printed. The @option{-v} option
causes a single word indicating the command or file name used to
-invoke @var{command} to be displayed; the @samp{-V} option produces
+invoke @var{command} to be displayed; the @option{-V} option produces
a more verbose description. In this case, the return status is
zero if @var{command} is found, and non-zero if not.
@@ -2972,11 +2992,11 @@ declare [-afFrxi] [-p] [@var{name}[=@var{value}]]
Declare variables and give them attributes. If no @var{name}s
are given, then display the values of variables instead.
-The @samp{-p} option will display the attributes and values of each
-@var{name}. When @samp{-p} is used, additional options are ignored.
-The @samp{-F} option inhibits the display of function definitions;
-only the function name and attributes are printed. @samp{-F} implies
-@samp{-f}. The following options can be used to restrict output
+The @option{-p} option will display the attributes and values of each
+@var{name}. When @option{-p} is used, additional options are ignored.
+The @option{-F} option inhibits the display of function definitions;
+only the function name and attributes are printed. @option{-F} implies
+@option{-f}. The following options can be used to restrict output
to variables with the specified attributes or to give variables
attributes:
@@ -3013,7 +3033,7 @@ using the compound assignment syntax (@pxref{Arrays}),
one of the @var{names} is not a valid shell variable name,
an attempt is made to turn off readonly status for a readonly variable,
an attempt is made to turn off array status for an array variable,
-or an attempt is made to display a non-existent function with @samp{-f}.
+or an attempt is made to display a non-existent function with @option{-f}.
@item echo
@btindex echo
@@ -3023,10 +3043,10 @@ echo [-neE] [@var{arg} @dots{}]
Output the @var{arg}s, separated by spaces, terminated with a
newline.
The return status is always 0.
-If @samp{-n} is specified, the trailing newline is suppressed.
-If the @samp{-e} option is given, interpretation of the following
+If @option{-n} is specified, the trailing newline is suppressed.
+If the @option{-e} option is given, interpretation of the following
backslash-escaped characters is enabled.
-The @samp{-E} option disables the interpretation of these escape characters,
+The @option{-E} option disables the interpretation of these escape characters,
even on systems where they are interpreted by default.
The @code{xpg_echo} shell option may be used to
dynamically determine whether or not @code{echo} expands these
@@ -3070,24 +3090,24 @@ Enable and disable builtin shell commands.
Disabling a builtin allows a disk command which has the same name
as a shell builtin to be executed without specifying a full pathname,
even though the shell normally searches for builtins before disk commands.
-If @samp{-n} is used, the @var{name}s become disabled. Otherwise
+If @option{-n} is used, the @var{name}s become disabled. Otherwise
@var{name}s are enabled. For example, to use the @code{test} binary
-found via @code{$PATH} instead of the shell builtin version, type
+found via @env{$PATH} instead of the shell builtin version, type
@samp{enable -n test}.
-If the @samp{-p} option is supplied, or no @var{name} arguments appear,
+If the @option{-p} option is supplied, or no @var{name} arguments appear,
a list of shell builtins is printed. With no other arguments, the list
consists of all enabled shell builtins.
-The @samp{-a} option means to list
+The @option{-a} option means to list
each builtin with an indication of whether or not it is enabled.
-The @samp{-f} option means to load the new builtin command @var{name}
+The @option{-f} option means to load the new builtin command @var{name}
from shared object @var{filename}, on systems that support dynamic loading.
-The @samp{-d} option will delete a builtin loaded with @samp{-f}.
+The @option{-d} option will delete a builtin loaded with @option{-f}.
If there are no options, a list of the shell builtins is displayed.
-The @samp{-s} option restricts @code{enable} to the @sc{posix} special
-builtins. If @samp{-s} is used with @samp{-f}, the new builtin becomes
+The @option{-s} option restricts @code{enable} to the @sc{posix} special
+builtins. If @option{-s} is used with @option{-f}, the new builtin becomes
a special builtin (@pxref{Special Builtins}).
The return status is zero unless a @var{name} is not a shell builtin
@@ -3102,7 +3122,7 @@ Display helpful information about builtin commands.
If @var{pattern} is specified, @code{help} gives detailed help
on all commands matching @var{pattern}, otherwise a list of
the builtins is printed.
-The @samp{-s} option restricts the information displayed to a short
+The @option{-s} option restricts the information displayed to a short
usage synopsis.
The return status is zero unless no command matches @var{pattern}.
@@ -3173,12 +3193,12 @@ and so on, with leftover words and their intervening separators assigned
to the last @var{name}.
If there are fewer words read from the standard input than names,
the remaining names are assigned empty values.
-The characters in the value of the @code{IFS} variable
+The characters in the value of the @env{IFS} variable
are used to split the line into words.
The backslash character @samp{\} may be used to remove any special
meaning for the next character read and for line continuation.
If no names are supplied, the line read is assigned to the
-variable @code{REPLY}.
+variable @env{REPLY}.
The return code is zero, unless end-of-file is encountered or @code{read}
times out.
Options, if supplied, have the following meanings:
@@ -3230,9 +3250,9 @@ terminal or a pipe.
shopt [-pqsu] [-o] [@var{optname} @dots{}]
@end example
Toggle the values of variables controlling optional shell behavior.
-With no options, or with the @samp{-p} option, a list of all settable
+With no options, or with the @option{-p} option, a list of all settable
options is displayed, with an indication of whether or not each is set.
-The @samp{-p} option causes output to be displayed in a form that
+The @option{-p} option causes output to be displayed in a form that
may be reused as input.
Other options have the following meanings:
@@ -3246,17 +3266,17 @@ Disable (unset) each @var{optname}.
@item -q
Suppresses normal output; the return status
indicates whether the @var{optname} is set or unset.
-If multiple @var{optname} arguments are given with @samp{-q},
+If multiple @var{optname} arguments are given with @option{-q},
the return status is zero if all @var{optnames} are enabled;
non-zero otherwise.
@item -o
Restricts the values of
-@var{optname} to be those defined for the @samp{-o} option to the
+@var{optname} to be those defined for the @option{-o} option to the
@code{set} builtin (@pxref{The Set Builtin}).
@end table
-If either @samp{-s} or @samp{-u}
+If either @option{-s} or @option{-u}
is used with no @var{optname} arguments, the display is limited to
those options which are set or unset, respectively.
@@ -3293,7 +3313,7 @@ longer exists, a normal path search is performed.
@item checkwinsize
If set, Bash checks the window size after each command
and, if necessary, updates the values of
-@code{LINES} and @code{COLUMNS}.
+@env{LINES} and @env{COLUMNS}.
@item cmdhist
If set, Bash
@@ -3322,7 +3342,7 @@ If set, the extended pattern matching features described above
@item histappend
If set, the history list is appended to the file named by the value
-of the @code{HISTFILE}
+of the @env{HISTFILE}
variable when the shell exits, rather than overwriting the file.
@item histreedit
@@ -3364,7 +3384,7 @@ accessed since the last time it was checked, the message
@item no_empty_cmd_completion
If set, and Readline is being used, Bash will not attempt to search
-the @code{PATH} for possible completions when completion is attempted
+the @env{PATH} for possible completions when completion is attempted
on an empty line.
@item nocaseglob
@@ -3398,7 +3418,7 @@ builtin prints an error message when the shift count exceeds the
number of positional parameters.
@item sourcepath
-If set, the @code{source} builtin uses the value of @code{PATH}
+If set, the @code{source} builtin uses the value of @env{PATH}
to find the directory containing the file supplied as an argument.
This option is enabled by default.
@@ -3429,7 +3449,7 @@ type [-atp] [@var{name} @dots{}]
For each @var{name}, indicate how it would be interpreted if used as a
command name.
-If the @samp{-t} option is used, @code{type} prints a single word
+If the @option{-t} option is used, @code{type} prints a single word
which is one of @samp{alias}, @samp{function}, @samp{builtin},
@samp{file} or @samp{keyword},
if @var{name} is an alias, shell function, shell builtin,
@@ -3437,13 +3457,13 @@ disk file, or shell reserved word, respectively.
If the @var{name} is not found, then nothing is printed, and
@code{type} returns a failure status.
-If the @samp{-p} option is used, @code{type} either returns the name
-of the disk file that would be executed, or nothing if @samp{-t}
+If the @option{-p} option is used, @code{type} either returns the name
+of the disk file that would be executed, or nothing if @option{-t}
would not return @samp{file}.
-If the @samp{-a} option is used, @code{type} returns all of the places
+If the @option{-a} option is used, @code{type} returns all of the places
that contain an executable named @var{file}.
-This includes aliases and functions, if and only if the @samp{-p} option
+This includes aliases and functions, if and only if the @option{-p} option
is not also used.
The return status is zero if any of the @var{names} are found, non-zero
@@ -3513,12 +3533,12 @@ The maximum amount of virtual memory available to the process.
If @var{limit} is given, it is the new value of the specified resource.
Otherwise, the current value of the soft limit for the specified resource
-is printed, unless the @samp{-H} option is supplied.
-When setting new limits, if neither @samp{-H} nor @samp{-S} is supplied,
+is printed, unless the @option{-H} option is supplied.
+When setting new limits, if neither @option{-H} nor @option{-S} is supplied,
both the hard and soft limits are set.
-If no option is given, then @samp{-f} is assumed. Values are in 1024-byte
-increments, except for @samp{-t}, which is in seconds, @samp{-p},
-which is in units of 512-byte blocks, and @samp{-n} and @samp{-u}, which
+If no option is given, then @option{-f} is assumed. Values are in 1024-byte
+increments, except for @option{-t}, which is in seconds, @option{-p},
+which is in units of 512-byte blocks, and @option{-n} and @option{-u}, which
are unscaled values.
The return status is zero unless an invalid option is supplied, a
@@ -3531,7 +3551,7 @@ non-numeric argument other than @code{unlimited} is supplied as a
unalias [-a] [@var{name} @dots{} ]
@end example
-Remove each @var{name} from the list of aliases. If @samp{-a} is
+Remove each @var{name} from the list of aliases. If @option{-a} is
supplied, all aliases are removed.
Aliases are described in @ref{Aliases}.
@@ -3558,7 +3578,8 @@ Options, if specified, have the following meanings:
@table @code
@item -a
-Mark variables which are modified or created for export.
+Mark variables and function which are modified or created for export
+to the environment of subsequent commands.
@item -b
Cause the status of terminated background jobs to be reported
@@ -3670,9 +3691,9 @@ Same as @code{-x}.
@item -p
Turn on privileged mode.
-In this mode, the @code{$BASH_ENV} and @code{$ENV} files are not
+In this mode, the @env{$BASH_ENV} and @env{$ENV} files are not
processed, shell functions are not inherited from the environment,
-and the @code{SHELLOPTS} variable, if it appears in the environment,
+and the @env{SHELLOPTS} variable, if it appears in the environment,
is ignored.
If the shell is started with the effective user (group) id not equal to the
real user (group) id, and the @code{-p} option is not supplied, these actions
@@ -3741,8 +3762,8 @@ unset. Otherwise, the positional parameters are set to the
@item -
Signal the end of options, cause all remaining @var{arguments}
-to be assigned to the positional parameters. The @samp{-x}
-and @samp{-v} options are turned off.
+to be assigned to the positional parameters. The @option{-x}
+and @option{-v} options are turned off.
If there are no arguments, the positional parameters remain unchanged.
@end table
@@ -3823,7 +3844,7 @@ A list of characters that separate fields; used when the shell splits
words as part of expansion.
@item MAIL
-If this parameter is set to a filename and the @code{MAILPATH} variable
+If this parameter is set to a filename and the @env{MAILPATH} variable
is not set, Bash informs the user of the arrival of mail in
the specified file.
@@ -3849,7 +3870,7 @@ commands.
@item PS1
The primary prompt string. The default value is @samp{\s-\v\$ }.
@xref{Printing a Prompt}, for the complete list of escape
-sequences that are expanded before @code{PS1} is displayed.
+sequences that are expanded before @env{PS1} is displayed.
@item PS2
The secondary prompt string. The default value is @samp{> }.
@@ -3902,7 +3923,7 @@ The build version.
The release status (e.g., @var{beta1}).
@item BASH_VERSINFO[5]
-The value of @code{MACHTYPE}.
+The value of @env{MACHTYPE}.
@end table
@@ -3913,7 +3934,7 @@ This variable is available only in shell functions invoked by the
programmable completion facilities (@pxref{Programmable Completion}).
@item COMP_CWORD
-An index into @code{$@{COMP_WORDS@}} of the word containing the current
+An index into @env{$@{COMP_WORDS@}} of the word containing the current
cursor position.
This variable is available only in shell functions invoked by the
programmable completion facilities (@pxref{Programmable Completion}).
@@ -3946,7 +3967,7 @@ Assigning to members of this array variable may be used to modify
directories already in the stack, but the @code{pushd} and @code{popd}
builtins must be used to add and remove directories.
Assignment to this variable will not change the current directory.
-If @code{DIRSTACK} is unset, it loses its special properties, even if
+If @env{DIRSTACK} is unset, it loses its special properties, even if
it is subsequently reset.
@item EUID
@@ -3954,14 +3975,14 @@ The numeric effective user id of the current user. This variable
is readonly.
@item FCEDIT
-The editor used as a default by the @samp{-e} option to the @code{fc}
+The editor used as a default by the @option{-e} option to the @code{fc}
builtin command.
@item FIGNORE
A colon-separated list of suffixes to ignore when performing
filename completion.
A file name whose suffix matches one of the entries in
-@code{FIGNORE}
+@env{FIGNORE}
is excluded from the list of matched file names. A sample
value is @samp{.o:~}
@@ -3969,14 +3990,14 @@ value is @samp{.o:~}
A colon-separated list of patterns defining the set of filenames to
be ignored by filename expansion.
If a filename matched by a filename expansion pattern also matches one
-of the patterns in @code{GLOBIGNORE}, it is removed from the list
+of the patterns in @env{GLOBIGNORE}, it is removed from the list
of matches.
@item GROUPS
An array variable containing the list of groups of which the current
user is a member.
-Assignments to @code{GROUPS} have no effect and are silently discarded.
-If @code{GROUPS} is unset, it loses its special properties, even if it is
+Assignments to @env{GROUPS} have no effect and return an error status.
+If @env{GROUPS} is unset, it loses its special properties, even if it is
subsequently reset.
@item histchars
@@ -3995,14 +4016,14 @@ parser to treat the rest of the line as a comment.
@item HISTCMD
The history number, or index in the history list, of the current
-command. If @code{HISTCMD} is unset, it loses its special properties,
+command. If @env{HISTCMD} is unset, it loses its special properties,
even if it is subsequently reset.
@item FUNCNAME
The name of any currently-executing shell function.
This variable exists only when a shell function is executing.
-Assignments to @code{FUNCNAME} have no effect and are silently discarded.
-If @code{FUNCNAME} is unset, it loses its special properties, even if
+Assignments to @env{FUNCNAME} have no effect and return an error status.
+If @env{FUNCNAME} is unset, it loses its special properties, even if
it is subsequently reset.
@item HISTCONTROL
@@ -4015,23 +4036,23 @@ Unset, or set to any other value than those above, means to save
all lines on the history list.
The second and subsequent lines of a multi-line compound command are
not tested, and are added to the history regardless of the value of
-@code{HISTCONTROL}.
+@env{HISTCONTROL}.
@item HISTIGNORE
A colon-separated list of patterns used to decide which command
lines should be saved on the history list. Each pattern is
anchored at the beginning of the line and must match the complete
line (no implicit @samp{*} is appended). Each pattern is tested
-against the line after the checks specified by @code{HISTCONTROL}
+against the line after the checks specified by @env{HISTCONTROL}
are applied. In addition to the normal shell pattern matching
characters, @samp{&} matches the previous history line. @samp{&}
may be escaped using a backslash; the backslash is removed
before attempting a match.
The second and subsequent lines of a multi-line compound command are
not tested, and are added to the history regardless of the value of
-@code{HISTIGNORE}.
+@env{HISTIGNORE}.
-@code{HISTIGNORE} subsumes the function of @code{HISTCONTROL}. A
+@env{HISTIGNORE} subsumes the function of @env{HISTCONTROL}. A
pattern of @samp{&} is identical to @code{ignoredups}, and a
pattern of @samp{[ ]*} is identical to @code{ignorespace}.
Combining these two patterns, separating them with a colon,
@@ -4061,9 +4082,9 @@ is running;
the next time hostname completion is attempted after the
value is changed, Bash adds the contents of the new file to the
existing list.
-If @code{HOSTFILE} is set, but has no value, Bash attempts to read
+If @env{HOSTFILE} is set, but has no value, Bash attempts to read
@file{/etc/hosts} to obtain the list of possible hostname completions.
-When @code{HOSTFILE} is unset, the hostname list is cleared.
+When @env{HOSTFILE} is unset, the hostname list is cleared.
@item HOSTNAME
The name of the current host.
@@ -4090,7 +4111,7 @@ Used to determine the locale category for any category not specifically
selected with a variable starting with @code{LC_}.
@item LC_ALL
-This variable overrides the value of @code{LANG} and any other
+This variable overrides the value of @env{LANG} and any other
@code{LC_} variable specifying a locale category.
@item LC_COLLATE
@@ -4112,6 +4133,16 @@ strings preceded by a @samp{$} (@pxref{Locale Translation}).
@item LC_NUMERIC
This variable determines the locale category used for number formatting.
+@item LINES
+Used by the @code{select} builtin command to determine the column length
+for printing selection lists. Automatically set upon receipt of a
+@code{SIGWINCH}.
+
+@item COLUMNS
+Used by the @code{select} builtin command to determine the terminal width
+when printing selection lists. Automatically set upon receipt of a
+@code{SIGWINCH}.
+
@item LINENO
The line number in the script or shell function currently executing.
@@ -4121,7 +4152,11 @@ is executing, in the standard @sc{gnu} @var{cpu-company-system} format.
@item MAILCHECK
How often (in seconds) that the shell should check for mail in the
-files specified in the @code{MAILPATH} or @code{MAIL} variables.
+files specified in the @env{MAILPATH} or @env{MAIL} variables.
+The default is 60 seconds. When it is time to check
+for mail, the shell does so before displaying the primary prompt.
+If this variable is unset, or set to a value that is not a number
+greater than or equal to zero, the shell disables mail checking.
@item OLDPWD
The previous working directory as set by the @code{cd} builtin.
@@ -4145,7 +4180,7 @@ is readonly.
@item PROMPT_COMMAND
If set, the value is interpreted as a command to execute
-before the printing of each primary prompt (@code{$PS1}).
+before the printing of each primary prompt (@env{$PS1}).
@item PS3
The value of this variable is used as the prompt for the
@@ -4154,8 +4189,8 @@ The value of this variable is used as the prompt for the
@item PS4
The value is the prompt printed before the command line is echoed
-when the @samp{-x} option is set (@pxref{The Set Builtin}).
-The first character of @code{PS4} is replicated multiple times, as
+when the @option{-x} option is set (@pxref{The Set Builtin}).
+The first character of @env{PS4} is replicated multiple times, as
necessary, to indicate multiple levels of indirection.
The default is @samp{+ }.
@@ -4179,9 +4214,9 @@ since the assignment.
@item SHELLOPTS
A colon-separated list of enabled shell options. Each word in
-the list is a valid argument for the @samp{-o} option to the
+the list is a valid argument for the @option{-o} option to the
@code{set} builtin command (@pxref{The Set Builtin}).
-The options appearing in @code{SHELLOPTS} are those reported
+The options appearing in @env{SHELLOPTS} are those reported
as @samp{on} by @samp{set -o}.
If this variable is in the environment when Bash
starts up, each shell option in the list will be enabled before
@@ -4291,18 +4326,26 @@ to be recognized.
A list of all double-quoted strings preceded by @samp{$}
is printed on the standard ouput
in the @sc{gnu} @code{gettext} PO (portable object) file format.
-Equivalent to @samp{-D} except for the output format.
+Equivalent to @option{-D} except for the output format.
@item --dump-strings
-Equivalent to @samp{-D}.
+Equivalent to @option{-D}.
@item --help
Display a usage message on standard output and exit sucessfully.
+@item --init-file @var{filename}
+@itemx --rcfile @var{filename}
+Execute commands from @var{filename} (instead of @file{~/.bashrc})
+in an interactive shell.
+
@item --login
-Make this shell act as if it were directly invoked by login.
-This is equivalent to @samp{exec -l bash} but can be issued from
-another shell, such as @code{csh}. @samp{exec bash --login}
+Make this shell act as if it had been directly invoked by login.
+When the shell is interactive, this is equivalent to starting a
+login shell with @samp{exec -l bash}.
+When the shell is not interactive, the login shell startup files will
+be executed.
+@samp{exec bash --login}
will replace the current shell with a Bash login shell.
@xref{Bash Startup Files}, for a description of the special behavior
of a login shell.
@@ -4329,15 +4372,11 @@ is intended to make Bash behave as a strict superset of that
standard. @xref{Bash POSIX Mode}, for a description of the Bash
@sc{posix} mode.
-@item --rcfile @var{filename}
-Execute commands from @var{filename} (instead of @file{~/.bashrc})
-in an interactive shell.
-
@item --restricted
Make the shell a restricted shell (@pxref{The Restricted Shell}).
@item --verbose
-Equivalent to @samp{-v}. Print shell input lines as they're read.
+Equivalent to @option{-v}. Print shell input lines as they're read.
@item --version
Show version information for this instance of
@@ -4373,7 +4412,7 @@ is printed on the standard ouput.
These are the strings that
are subject to language translation when the current locale
is not @code{C} or @code{POSIX} (@pxref{Locale Translation}).
-This implies the @samp{-n} option; no commands will be executed.
+This implies the @option{-n} option; no commands will be executed.
@item --
A @code{--} signals the end of options and disables further option
@@ -4384,14 +4423,14 @@ Any arguments after the @code{--} are treated as filenames and arguments.
@cindex interactive shell
An @emph{interactive} shell is one started without non-option arguments,
-unless @samp{-s} is specified,
-without specifying the @samp{-c} option, and whose input and output are both
+unless @option{-s} is specified,
+without specifying the @option{-c} option, and whose input and output are both
connected to terminals (as determined by @code{isatty(3)}), or one
-started with the @samp{-i} option. @xref{Interactive Shells} for more
+started with the @option{-i} option. @xref{Interactive Shells}, for more
information.
If arguments remain after option processing, and neither the
-@samp{-c} nor the @samp{-s}
+@option{-c} nor the @option{-s}
option has been supplied, the first argument is assumed to
be the name of a file containing shell commands (@pxref{Shell Scripts}).
When Bash is invoked in this fashion, @code{$0}
@@ -4412,15 +4451,15 @@ Tilde Expansion (@pxref{Tilde Expansion}).
Interactive shells are described in @ref{Interactive Shells}.
-@subsubheading Invoked as an interactive login shell, or with @samp{--login}
+@subsubheading Invoked as an interactive login shell, or with @option{--login}
When Bash is invoked as an interactive login shell, or as a
-non-interactive shell with the @samp{--login} option, it first reads and
+non-interactive shell with the @option{--login} option, it first reads and
executes commands from the file @file{/etc/profile}, if that file exists.
After reading that file, it looks for @file{~/.bash_profile},
@file{~/.bash_login}, and @file{~/.profile}, in that order, and reads
and executes commands from the first one that exists and is readable.
-The @samp{--noprofile} option may be used when the shell is started to
+The @option{--noprofile} option may be used when the shell is started to
inhibit this behavior.
When a login shell exits, Bash reads and executes commands from
@@ -4430,8 +4469,8 @@ the file @file{~/.bash_logout}, if it exists.
When an interactive shell that is not a login shell is started, Bash
reads and executes commands from @file{~/.bashrc}, if that file exists.
-This may be inhibited by using the @samp{--norc} option.
-The @samp{--rcfile @var{file}} option will force Bash to read and
+This may be inhibited by using the @option{--norc} option.
+The @option{--rcfile @var{file}} option will force Bash to read and
execute commands from @var{file} instead of @file{~/.bashrc}.
So, typically, your @file{~/.bash_profile} contains the line
@@ -4444,7 +4483,7 @@ after (or before) any login-specific initializations.
@subsubheading Invoked non-interactively
When Bash is started non-interactively, to run a shell script,
-for example, it looks for the variable @code{BASH_ENV} in the environment,
+for example, it looks for the variable @env{BASH_ENV} in the environment,
expands its value if it appears there, and uses the expanded value as
the name of a file to read and execute. Bash behaves as if the
following command were executed:
@@ -4452,9 +4491,13 @@ following command were executed:
@code{if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi}
@end example
@noindent
-but the value of the @code{PATH} variable is not used to search for the
+but the value of the @env{PATH} variable is not used to search for the
file name.
+As noted above, if a non-interactive shell is invoked with the
+@option{--login} option, Bash attempts to read and execute commands from the
+login shell startup files.
+
@subsubheading Invoked with name @code{sh}
If Bash is invoked with the name @code{sh}, it tries to mimic the
@@ -4462,15 +4505,15 @@ startup behavior of historical versions of @code{sh} as closely as
possible, while conforming to the @sc{posix} standard as well.
When invoked as an interactive login shell, or as a non-interactive
-shell with the @samp{--login} option, it first attempts to read
+shell with the @option{--login} option, it first attempts to read
and execute commands from @file{/etc/profile} and @file{~/.profile}, in
that order.
-The @samp{--noprofile} option may be used to inhibit this behavior.
+The @option{--noprofile} option may be used to inhibit this behavior.
When invoked as an interactive shell with the name @code{sh}, Bash
-looks for the variable @code{ENV}, expands its value if it is defined,
+looks for the variable @env{ENV}, expands its value if it is defined,
and uses the expanded value as the name of a file to read and execute.
Since a shell invoked as @code{sh} does not attempt to read and execute
-commands from any other startup files, the @samp{--rcfile} option has
+commands from any other startup files, the @option{--rcfile} option has
no effect.
A non-interactive shell invoked with the name @code{sh} does not attempt
to read any other startup files.
@@ -4481,9 +4524,9 @@ the startup files are read.
@subsubheading Invoked in @sc{posix} mode
When Bash is started in @sc{posix} mode, as with the
-@samp{--posix} command line option, it follows the @sc{posix} standard
+@option{--posix} command line option, it follows the @sc{posix} standard
for startup files.
-In this mode, interactive shells expand the @code{ENV} variable
+In this mode, interactive shells expand the @env{ENV} variable
and commands are read and executed from the file whose name is the
expanded value.
No other startup files are read.
@@ -4495,8 +4538,8 @@ daemon, usually @code{rshd}. If Bash determines it is being run by
rshd, it reads and executes commands from @file{~/.bashrc}, if that
file exists and is readable.
It will not do this if invoked as @code{sh}.
-The @samp{--norc} option may be used to inhibit this behavior, and the
-@samp{--rcfile} option may be used to force another file to be read, but
+The @option{--norc} option may be used to inhibit this behavior, and the
+@option{--rcfile} option may be used to force another file to be read, but
@code{rshd} does not generally invoke the shell with those options or
allow them to be specified.
@@ -4505,7 +4548,7 @@ allow them to be specified.
If Bash is started with the effective user (group) id not equal to the
real user (group) id, and the @code{-p} option is not supplied, no startup
files are read, shell functions are not inherited from the environment,
-the @code{SHELLOPTS} variable, if it appears in the environment, is ignored,
+the @env{SHELLOPTS} variable, if it appears in the environment, is ignored,
and the effective user id is set to the real user id.
If the @code{-p} option is supplied at invocation, the startup behavior is
the same, but the effective user id is not reset.
@@ -4525,16 +4568,16 @@ the same, but the effective user id is not reset.
@subsection What is an Interactive Shell?
An interactive shell
-is one started without non-option arguments, unless @samp{-s} is
-specified, without specifiying the @samp{-c} option, and
+is one started without non-option arguments, unless @option{-s} is
+specified, without specifiying the @option{-c} option, and
whose input and output are both
connected to terminals (as determined by @code{isatty(3)}),
-or one started with the @samp{-i} option.
+or one started with the @option{-i} option.
An interactive shell generally reads from and writes to a user's
terminal.
-The @samp{-s} invocation option may be used to set the positional parameters
+The @option{-s} invocation option may be used to set the positional parameters
when an interactive shell is started.
@node Is this Shell Interactive?
@@ -4553,7 +4596,7 @@ esac
@end example
Alternatively, startup scripts may examine the variable
-@code{$PS1}; it is unset in non-interactive shells, and set in
+@env{PS1}; it is unset in non-interactive shells, and set in
interactive shells. Thus:
@example
@@ -4580,13 +4623,13 @@ control is in effect, Bash ignores the keyboard-generated job control
signals @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}.
@item
-Bash expands and displays @code{$PS1} before reading the first line
-of a command, and expands and displays @code{$PS2} before reading the
+Bash expands and displays @env{PS1} before reading the first line
+of a command, and expands and displays @env{PS2} before reading the
second and subsequent lines of a multi-line command.
@item
-Bash executes the value of the @code{PROMPT_COMMAND} variable as a command
-before printing the primary prompt, @code{$PS1}
+Bash executes the value of the @env{PROMPT_COMMAND} variable as a command
+before printing the primary prompt, @env{$PS1}
(@pxref{Bash Variables}).
@item
@@ -4602,7 +4645,7 @@ standard input when reading a command (@pxref{The Set Builtin}).
Command history (@pxref{Bash History Facilities})
and history expansion (@pxref{History Interaction})
are enabled by default.
-Bash will save the command history to the file named by @code{$HISTFILE}
+Bash will save the command history to the file named by @env{$HISTFILE}
when an interactive shell exits.
@item
@@ -4622,12 +4665,12 @@ An interactive login shell sends a @code{SIGHUP} to all jobs on exit
if the @code{hupoxexit} shell option has been enabled (@pxref{Signals}).
@item
-The @samp{-n} invocation option is ignored, and @samp{set -n} has
+The @option{-n} invocation option is ignored, and @samp{set -n} has
no effect (@pxref{The Set Builtin}).
@item
Bash will check for mail periodically, depending on the values of the
-@code{MAIL}, @code{MAILPATH}, and @code{MAILCHECK} shell variables
+@env{MAIL}, @env{MAILPATH}, and @env{MAILCHECK} shell variables
(@pxref{Bash Variables}).
@item
@@ -4660,9 +4703,9 @@ builtin is enabled by default (see the description of the @code{cdspell}
option to the @code{shopt} builtin in @ref{Bash Builtins}).
@item
-The shell will check the value of the @code{TMOUT} variable and exit
+The shell will check the value of the @env{TMOUT} variable and exit
if a command is not read within the specified number of seconds after
-printing @code{$PS1} (@pxref{Bash Variables}).
+printing @env{$PS1} (@pxref{Bash Variables}).
@end enumerate
@@ -4759,7 +4802,7 @@ inode numbers.
@item -o @var{optname}
True if shell option @var{optname} is enabled.
-The list of options appears in the description of the @samp{-o}
+The list of options appears in the description of the @option{-o}
option to the @code{set} builtin (@pxref{The Set Builtin}).
@item -z @var{string}
@@ -5010,7 +5053,7 @@ of the array @var{name}. These subscripts differ only when the word
appears within double quotes. If the word is double-quoted,
@code{$@{name[*]@}} expands to a single word with
the value of each array member separated by the first character of the
-@code{IFS} variable, and @code{$@{name[@@]@}} expands each element of
+@env{IFS} variable, and @code{$@{name[@@]@}} expands each element of
@var{name} to a separate word. When there are no array members,
@code{$@{name[@@]@}} expands to nothing. This is analogous to the
expansion of the special parameters @samp{@@} and @samp{*}.
@@ -5029,9 +5072,9 @@ entire array. A subscript of @samp{*} or @samp{@@} also removes the
entire array.
The @code{declare}, @code{local}, and @code{readonly}
-builtins each accept a @samp{-a}
+builtins each accept a @option{-a}
option to specify an array. The @code{read}
-builtin accepts a @samp{-a}
+builtin accepts a @option{-a}
option to assign a list of words read from the standard input
to an array, and can read values from the standard input into
individual array elements. The @code{set} and @code{declare}
@@ -5055,7 +5098,7 @@ the directory removed. The @code{dirs} builtin displays the contents
of the directory stack.
The contents of the directory stack are also visible
-as the value of the @code{DIRSTACK} shell variable.
+as the value of the @env{DIRSTACK} shell variable.
@node Directory Stack Builtins
@subsection Directory Stack Builtins
@@ -5151,8 +5194,8 @@ executes the equivalent of `@code{cd} @var{dir}'.
@section Controlling the Prompt
@cindex prompting
-The value of the variable @code{PROMPT_COMMAND} is examined just before
-Bash prints each primary prompt. If @code{PROMPT_COMMAND} is set and
+The value of the variable @env{PROMPT_COMMAND} is examined just before
+Bash prints each primary prompt. If @env{PROMPT_COMMAND} is set and
has a non-null value, then the
value is executed just as if it had been typed on the command line.
@@ -5196,7 +5239,7 @@ The release of Bash, version + patchlevel (e.g., 2.00.0)
@item \w
The current working directory.
@item \W
-The basename of @code{$PWD}.
+The basename of @env{$PWD}.
@item \!
The history number of this command.
@item \#
@@ -5231,7 +5274,7 @@ expansion, and quote removal, subject to the value of the
@cindex restricted shell
If Bash is started with the name @code{rbash}, or the
-@samp{--restricted}
+@option{--restricted}
option is supplied at invocation, the shell becomes restricted.
A restricted shell is used to
set up an environment more controlled than the standard shell.
@@ -5241,20 +5284,20 @@ with the exception that the following are disallowed:
@item
Changing directories with the @code{cd} builtin.
@item
-Setting or unsetting the values of the @code{SHELL}, @code{PATH},
-@code{ENV}, or @code{BASH_ENV} variables.
+Setting or unsetting the values of the @env{SHELL}, @env{PATH},
+@env{ENV}, or @env{BASH_ENV} variables.
@item
Specifying command names containing slashes.
@item
Specifying a filename containing a slash as an argument to the @code{.}
builtin command.
@item
-Specifying a filename containing a slash as an argument to the @samp{-p}
+Specifying a filename containing a slash as an argument to the @option{-p}
option to the @code{hash} builtin command.
@item
Importing function definitions from the shell environment at startup.
@item
-Parsing the value of @code{SHELLOPTS} from the shell environment at startup.
+Parsing the value of @env{SHELLOPTS} from the shell environment at startup.
@item
Redirecting output using the @samp{>}, @samp{>|}, @samp{<>}, @samp{>&},
@samp{&>}, and @samp{>>} redirection operators.
@@ -5262,9 +5305,9 @@ Redirecting output using the @samp{>}, @samp{>|}, @samp{<>}, @samp{>&},
Using the @code{exec} builtin to replace the shell with another command.
@item
Adding or deleting builtin commands with the
-@samp{-f} and @samp{-d} options to the @code{enable} builtin.
+@option{-f} and @option{-d} options to the @code{enable} builtin.
@item
-Specifying the @samp{-p} option to the @code{command} builtin.
+Specifying the @option{-p} option to the @code{command} builtin.
@item
Turning off restricted mode with @samp{set +r} or @samp{set +o restricted}.
@end itemize
@@ -5273,7 +5316,7 @@ Turning off restricted mode with @samp{set +r} or @samp{set +o restricted}.
@section Bash POSIX Mode
@cindex POSIX Mode
-Starting Bash with the @samp{--posix} command-line option or executing
+Starting Bash with the @option{--posix} command-line option or executing
@samp{set -o posix} while Bash is running will cause Bash to conform more
closely to the @sc{posix} 1003.2 standard by changing the behavior to
match that specified by @sc{posix} in areas where the Bash default differs.
@@ -5283,31 +5326,33 @@ The following list is what's changed when `@sc{posix} mode' is in effect:
@enumerate
@item
When a command in the hash table no longer exists, Bash will re-search
-@code{$PATH} to find the new location. This is also available with
+@env{$PATH} to find the new location. This is also available with
@samp{shopt -s checkhash}.
@item
-The @samp{>&} redirection does not redirect stdout and stderr.
+The message printed by the job control code and builtins when a job
+exits with a non-zero status is `Done(status)'.
@item
The message printed by the job control code and builtins when a job
-exits with a non-zero status is `Done(status)'.
+is stopped is `Stopped(@var{signame})', where @var{signame} is, for
+example, @code{SIGTSTP}.
@item
Reserved words may not be aliased.
@item
-The @sc{posix} 1003.2 @code{PS1} and @code{PS2} expansions of @samp{!} to
+The @sc{posix} 1003.2 @env{PS1} and @env{PS2} expansions of @samp{!} to
the history number and @samp{!!} to @samp{!} are enabled,
-and parameter expansion is performed on the values of @code{PS1} and
-@code{PS2} regardless of the setting of the @code{promptvars} option.
+and parameter expansion is performed on the values of @env{PS1} and
+@env{PS2} regardless of the setting of the @code{promptvars} option.
@item
Interactive comments are enabled by default. (Bash has them on by
default anyway.)
@item
-The @sc{posix} 1003.2 startup files are executed (@code{$ENV}) rather than
+The @sc{posix} 1003.2 startup files are executed (@env{$ENV}) rather than
the normal Bash files.
@item
@@ -5316,7 +5361,7 @@ name, rather than on all assignment statements on the line.
@item
The default history file is @file{~/.sh_history} (this is the
-default value of @code{$HISTFILE}).
+default value of @env{$HISTFILE}).
@item
The output of @samp{kill -l} prints all the signal names on a single line,
@@ -5357,15 +5402,15 @@ the command name, and so on.
@item
If the @code{cd} builtin finds a directory to change to
-using @code{$CDPATH}, the
-value it assigns to the @code{PWD} variable does not contain any
+using @env{$CDPATH}, the
+value it assigns to the @env{PWD} variable does not contain any
symbolic links, as if @samp{cd -P} had been executed.
@item
-If @code{$CDPATH} is set, the @code{cd} builtin will not implicitly
+If @env{CDPATH} is set, the @code{cd} builtin will not implicitly
append the current directory to it. This means that @code{cd} will
fail if no valid directory name can be constructed from
-any of the entries in @code{$CDPATH}, even if the a directory with
+any of the entries in @env{$CDPATH}, even if the a directory with
the same name as the name given as an argument to @code{cd} exists
in the current directory.
@@ -5389,9 +5434,34 @@ Assignment statements preceding @sc{posix} 1003.2 special builtins
persist in the shell environment after the builtin completes.
@item
+Assignment statements preceding shell function calls persist in the
+shell environment after the function returns, as if a @sc{posix}
+special builtin command had been executed.
+
+@item
The @code{export} and @code{readonly} builtin commands display their
output in the format required by @sc{posix} 1003.2.
+@item
+The @code{trap} builtin displays signal names without the leading
+@code{SIG}.
+
+@item
+The @code{.} and @code{source} builtins do not search the current directory
+for the filename argument if it is not found by searching @env{PATH}.
+
+@item
+Subshells spawned to execute command substitutions inherit the value of
+the @option{-e} option from the parent shell. When not in @sc{posix} mode,
+Bash clears the @option{-e} option in such subshells.
+
+@item
+Alias expansion is always enabled, even in non-interactive shells.
+
+@item
+When the @code{set} builtin is invoked without options, it does not display
+shell function names and definitions.
+
@end enumerate
There is other @sc{posix} 1003.2 behavior that Bash does not implement.
@@ -5401,6 +5471,18 @@ Specifically:
@item
Assignment statements affect the execution environment of all
builtins, not just special ones.
+
+@item
+When a subshell is created to execute a shell script with execute permission,
+but without a leading @samp{#!}, Bash sets @code{$0} to the full pathname of
+the script as found by searching @code{$PATH}, rather than the command as
+typed by the user.
+
+@item
+When using @samp{.} to source a shell script found in @code{$PATH}, bash
+checks execute permission bits rather than read permission bits, just as
+if it were searching for a command.
+
@end enumerate
@node Job Control
@@ -5504,7 +5586,7 @@ The shell learns immediately whenever a job changes state.
Normally, Bash waits until it is about to print a prompt
before reporting changes in a job's status so as to not interrupt
any other output. If the
-the @samp{-b} option to the @code{set} builtin is enabled,
+the @option{-b} option to the @code{set} builtin is enabled,
Bash reports such changes immediately (@pxref{The Set Builtin}).
If an attempt to exit Bash is while jobs are stopped, the
@@ -5576,7 +5658,7 @@ output is restricted to information about that job.
If @var{jobspec} is not supplied, the status of all jobs is
listed.
-If the @samp{-x} option is supplied, @code{jobs} replaces any
+If the @option{-x} option is supplied, @code{jobs} replaces any
@var{jobspec} found in @var{command} or @var{arguments} with the
corresponding process group @sc{id}, and executes @var{command},
passing it @var{argument}s, returning its exit status.
@@ -5592,8 +5674,8 @@ named by job specification @var{jobspec} or process @sc{id} @var{pid}.
@var{sigspec} is either a signal name such as @code{SIGINT} (with or without
the @code{SIG} prefix) or a signal number; @var{signum} is a signal number.
If @var{sigspec} and @var{signum} are not present, @code{SIGTERM} is used.
-The @samp{-l} option lists the signal names.
-If any arguments are supplied when @samp{-l} is given, the names of the
+The @option{-l} option lists the signal names.
+If any arguments are supplied when @option{-l} is given, the names of the
signals corresponding to the arguments are listed, and the return status
is zero.
@var{exit_status} is a number specifying a signal number or the exit
@@ -5622,13 +5704,13 @@ disown [-ar] [-h] [@var{jobspec} @dots{}]
@end example
Without options, each @var{jobspec} is removed from the table of
active jobs.
-If the @samp{-h} option is given, the job is not removed from the table,
+If the @option{-h} option is given, the job is not removed from the table,
but is marked so that @code{SIGHUP} is not sent to the job if the shell
receives a @code{SIGHUP}.
-If @var{jobspec} is not present, and neither the @samp{-a} nor @samp{-r}
+If @var{jobspec} is not present, and neither the @option{-a} nor @option{-r}
option is supplied, the current job is used.
-If no @var{jobspec} is supplied, the @samp{-a} option means to remove or
-mark all jobs; the @samp{-r} option without a @var{jobspec}
+If no @var{jobspec} is supplied, the @option{-a} option means to remove or
+mark all jobs; the @option{-r} option without a @var{jobspec}
argument restricts operation to running jobs.
@item suspend
@@ -5637,7 +5719,7 @@ argument restricts operation to running jobs.
suspend [-f]
@end example
Suspend the execution of this shell until it receives a
-@code{SIGCONT} signal. The @samp{-f} option means to suspend
+@code{SIGCONT} signal. The @option{-f} option means to suspend
even if the shell is a login shell.
@end table
@@ -5834,7 +5916,7 @@ supports the @code{VPATH} variable, such as GNU @code{make}.
@code{cd} to the
directory where you want the object files and executables to go and run
the @code{configure} script from the source directory. You may need to
-supply the @samp{--srcdir=PATH} argument to tell @code{configure} where the
+supply the @option{--srcdir=PATH} argument to tell @code{configure} where the
source files are. @code{configure} automatically checks for the
source code in the directory that @code{configure} is in and in `..'.
@@ -5865,12 +5947,12 @@ directories for other architectures.
By default, @samp{make install} will install into
@file{/usr/local/bin}, @file{/usr/local/man}, etc. You can
specify an installation prefix other than @file{/usr/local} by
-giving @code{configure} the option @samp{--prefix=@var{PATH}}.
+giving @code{configure} the option @option{--prefix=@var{PATH}}.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.
If you give @code{configure} the option
-@samp{--exec-prefix=@var{PATH}}, @samp{make install} will use
+@option{--exec-prefix=@var{PATH}}, @samp{make install} will use
@var{PATH} as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
@@ -5881,7 +5963,7 @@ There may be some features @code{configure} can not figure out
automatically, but needs to determine by the type of host Bash
will run on. Usually @code{configure} can figure that
out, but if it prints a message saying it can not guess the host
-type, give it the @samp{--host=TYPE} option. @samp{TYPE} can
+type, give it the @option{--host=TYPE} option. @samp{TYPE} can
either be a short name for the system type, such as @samp{sun4},
or a canonical name with three fields: @samp{CPU-COMPANY-SYSTEM}
(e.g., @samp{sparc-sun-sunos4.1.2}).
@@ -5939,16 +6021,16 @@ options. @samp{configure --help} prints the complete list.
@node Optional Features
@section Optional Features
-The Bash @code{configure} has a number of @samp{--enable-@var{feature}}
+The Bash @code{configure} has a number of @option{--enable-@var{feature}}
options, where @var{feature} indicates an optional part of Bash.
-There are also several @samp{--with-@var{package}} options,
+There are also several @option{--with-@var{package}} options,
where @var{package} is something like @samp{bash-malloc} or @samp{purify}.
To turn off the default use of a package, use
-@samp{--without-@var{package}}. To configure Bash without a feature
-that is enabled by default, use @samp{--disable-@var{feature}}.
+@option{--without-@var{package}}. To configure Bash without a feature
+that is enabled by default, use @option{--disable-@var{feature}}.
-Here is a complete list of the @samp{--enable-} and
-@samp{--with-} options that the Bash @code{configure} recognizes.
+Here is a complete list of the @option{--enable-} and
+@option{--with-} options that the Bash @code{configure} recognizes.
@table @code
@item --with-afs
@@ -5996,7 +6078,7 @@ This produces a shell with minimal features, close to the historical
Bourne shell.
@end table
-There are several @samp{--enable-} options that alter how Bash is
+There are several @option{--enable-} options that alter how Bash is
compiled and linked, rather than changing run-time features.
@table @code
@@ -6094,7 +6176,7 @@ the operating system provides the necessary support.
@item --enable-prompt-string-decoding
Turn on the interpretation of a number of backslash-escaped characters
-in the @code{$PS1}, @code{$PS2}, @code{$PS3}, and @code{$PS4} prompt
+in the @env{$PS1}, @env{$PS2}, @env{$PS3}, and @env{$PS4} prompt
strings. See @ref{Printing a Prompt}, for a complete list of prompt
string escape sequences.
@@ -6121,7 +6203,7 @@ A synonym for @code{--enable-xpg-echo-default}.
@item --enable-xpg-echo-default
Make the @code{echo} builtin expand backslash-escaped characters by default,
-without requiring the @samp{-e} option.
+without requiring the @option{-e} option.
This sets the default value of the @code{xpg_echo} shell option to @code{on},
which makes the Bash @code{echo} behave more like the version specified in
the Single Unix Specification, version 2.
@@ -6186,14 +6268,14 @@ differences between the traditional Bourne shell and Bash; this
section quickly details the differences of significance. A
number of these differences are explained in greater depth in
previous sections.
-This section uses the version of @code{sh} included SVR4.2 as
+This section uses the version of @code{sh} included in SVR4.2 as
the baseline reference.
@itemize @bullet
@item
Bash is @sc{posix}-conformant, even where the @sc{posix} specification
-differs from traditional @code{sh} behavior.
+differs from traditional @code{sh} behavior (@pxref{Bash POSIX Mode}).
@item
Bash has multi-character invocation options (@pxref{Invoking Bash}).
@@ -6229,7 +6311,7 @@ is supported (@pxref{ANSI-C Quoting}).
@item
Bash supports the @code{$"@dots{}"} quoting syntax to do
locale-specific translation of the characters between the double
-quotes. The @samp{-D}, @samp{--dump-strings}, and @samp{--dump-po-strings}
+quotes. The @option{-D}, @option{--dump-strings}, and @option{--dump-po-strings}
invocation options list the translatable strings found in a script
(@pxref{Locale Translation}).
@@ -6241,7 +6323,7 @@ Very useful when an @code{if} statement needs to act only if a test fails.
@item
Bash has the @code{time} reserved word and command timing (@pxref{Pipelines}).
The display of the timing statistics may be controlled with the
-@code{TIMEFORMAT} variable.
+@env{TIMEFORMAT} variable.
@item
Bash implements the @code{for (( @var{expr1} ; @var{expr2} ; @var{expr3} ))}
@@ -6319,14 +6401,14 @@ Bash has process substitution (@pxref{Process Substitution}).
@item
Bash automatically assigns variables that provide information about the
-current user (@code{UID}, @code{EUID}, and @code{GROUPS}), the current host
-(@code{HOSTTYPE}, @code{OSTYPE}, @code{MACHTYPE}, and @code{HOSTNAME}),
-and the instance of Bash that is running (@code{BASH},
-@code{BASH_VERSION}, and @code{BASH_VERSINFO}). @xref{Bash Variables},
+current user (@env{UID}, @env{EUID}, and @env{GROUPS}), the current host
+(@env{HOSTTYPE}, @env{OSTYPE}, @env{MACHTYPE}, and @env{HOSTNAME}),
+and the instance of Bash that is running (@env{BASH},
+@env{BASH_VERSION}, and @env{BASH_VERSINFO}). @xref{Bash Variables},
for details.
@item
-The @code{IFS} variable is used to split only the results of expansion,
+The @env{IFS} variable is used to split only the results of expansion,
not all words (@pxref{Word Splitting}).
This closes a longstanding shell security hole.
@@ -6380,7 +6462,7 @@ The @samp{>|} redirection operator may be used to override @code{noclobber}.
@item
The Bash @code{cd} and @code{pwd} builtins (@pxref{Bourne Shell Builtins})
-each take @samp{-L} and @samp{-P} builtins to switch between logical and
+each take @option{-L} and @option{-P} options to switch between logical and
physical modes.
@item
@@ -6408,16 +6490,16 @@ using @code{export -f} (@pxref{Shell Functions}).
@item
The Bash @code{export}, @code{readonly}, and @code{declare} builtins can
-take a @samp{-f} option to act on shell functions, a @samp{-p} option to
+take a @option{-f} option to act on shell functions, a @option{-p} option to
display variables with various attributes set in a format that can be
-used as shell input, a @samp{-n} option to remove various variable
+used as shell input, a @option{-n} option to remove various variable
attributes, and @samp{name=value} arguments to set variable attributes
and values simultaneously.
@item
The Bash @code{hash} builtin allows a name to be associated with
an arbitrary filename, even when that filename cannot be found by
-searching the @code{$PATH}, using @samp{hash -p}
+searching the @env{$PATH}, using @samp{hash -p}
(@pxref{Bourne Shell Builtins}).
@item
@@ -6431,17 +6513,17 @@ The @code{printf} builtin is available to display formatted output
@item
The Bash @code{read} builtin (@pxref{Bash Builtins})
will read a line ending in @samp{\} with
-the @samp{-r} option, and will use the @code{REPLY} variable as a
+the @option{-r} option, and will use the @env{REPLY} variable as a
default if no non-option arguments are supplied.
The Bash @code{read} builtin
-also accepts a prompt string with the @samp{-p} option and will use
-Readline to obtain the line when given the @samp{-e} option.
+also accepts a prompt string with the @option{-p} option and will use
+Readline to obtain the line when given the @option{-e} option.
The @code{read} builtin also has additional options to control input:
-the @samp{-s} option will turn off echoing of input characters as
-they are read, the @samp{-t} option will allow @code{read} to time out
+the @option{-s} option will turn off echoing of input characters as
+they are read, the @option{-t} option will allow @code{read} to time out
if input does not arrive within a specified number of seconds, the
-@samp{-n} option will allow reading only a specified number of
-characters rather than a full line, and the @samp{-d} option will read
+@option{-n} option will allow reading only a specified number of
+characters rather than a full line, and the @option{-d} option will read
until a particular character rather than newline.
@item
@@ -6474,7 +6556,7 @@ The Bash @code{type} builtin is more extensive and gives more information
about the names it finds (@pxref{Bash Builtins}).
@item
-The Bash @code{umask} builtin permits a @samp{-p} option to cause
+The Bash @code{umask} builtin permits a @option{-p} option to cause
the output to be displayed in the form of a @code{umask} command
that may be reused as input (@pxref{Bourne Shell Builtins}).
@@ -6483,7 +6565,7 @@ Bash implements a @code{csh}-like directory stack, and provides the
@code{pushd}, @code{popd}, and @code{dirs} builtins to manipulate it
(@pxref{The Directory Stack}).
Bash also makes the directory stack visible as the value of the
-@code{DIRSTACK} shell variable.
+@env{DIRSTACK} shell variable.
@item
Bash interprets special backslash-escaped characters in the prompt
@@ -6507,11 +6589,11 @@ The SVR4.2 shell has two privilege-related builtins
Bash does not have the @code{stop} or @code{newgrp} builtins.
@item
-Bash does not use the @code{SHACCT} variable or perform shell accounting.
+Bash does not use the @env{SHACCT} variable or perform shell accounting.
@item
-The SVR4.2 @code{sh} uses a @code{TIMEOUT} variable like Bash uses
-@code{TMOUT}.
+The SVR4.2 @code{sh} uses a @env{TIMEOUT} variable like Bash uses
+@env{TMOUT}.
@end itemize
@@ -6544,7 +6626,7 @@ function call), it misbehaves badly.
@item
In a questionable attempt at security, the SVR4.2 shell,
-when invoked without the @samp{-p} option, will alter its real
+when invoked without the @option{-p} option, will alter its real
and effective @sc{uid} and @sc{gid} if they are less than some
magic threshold value, commonly 100.
This can lead to unexpected results.
@@ -6554,8 +6636,8 @@ The SVR4.2 shell does not allow users to trap @code{SIGSEGV},
@code{SIGALRM}, or @code{SIGCHLD}.
@item
-The SVR4.2 shell does not allow the @code{IFS}, @code{MAILCHECK},
-@code{PATH}, @code{PS1}, or @code{PS2} variables to be unset.
+The SVR4.2 shell does not allow the @env{IFS}, @env{MAILCHECK},
+@env{PATH}, @env{PS1}, or @env{PS2} variables to be unset.
@item
The SVR4.2 shell treats @samp{^} as the undocumented equivalent of
diff --git a/doc/readline.3 b/doc/readline.3
deleted file mode 100644
index c1ed9cf..0000000
--- a/doc/readline.3
+++ /dev/null
@@ -1,1205 +0,0 @@
-.\"
-.\" MAN PAGE COMMENTS to
-.\"
-.\" Chet Ramey
-.\" Information Network Services
-.\" Case Western Reserve University
-.\" chet@ins.CWRU.Edu
-.\"
-.\" Last Change: Tue Jun 1 13:28:03 EDT 1999
-.\"
-.TH READLINE 3 "1999 Jun 1" GNU
-.\"
-.\" File Name macro. This used to be `.PN', for Path Name,
-.\" but Sun doesn't seem to like that very much.
-.\"
-.de FN
-\fI\|\\$1\|\fP
-..
-.SH NAME
-readline \- get a line from a user with editing
-.SH SYNOPSIS
-.LP
-.nf
-.ft B
-#include <stdio.h>
-#include <readline.h>
-#include <history.h>
-.ft
-.fi
-.LP
-.nf
-.ft B
-char *readline (prompt)
-char *prompt;
-.ft
-.fi
-.SH COPYRIGHT
-.if n Readline is Copyright (C) 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc.
-.if t Readline is Copyright \(co 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc.
-.SH DESCRIPTION
-.LP
-.B readline
-will read a line from the terminal
-and return it, using
-.B prompt
-as a prompt. If
-.B prompt
-is null, no prompt is issued. The line returned is allocated with
-.IR malloc (3),
-so the caller must free it when finished. The line returned
-has the final newline removed, so only the text of the line
-remains.
-.LP
-.B readline
-offers editing capabilities while the user is entering the
-line.
-By default, the line editing commands
-are similar to those of emacs.
-A vi\-style line editing interface is also available.
-.SH RETURN VALUE
-.LP
-.B readline
-returns the text of the line read. A blank line
-returns the empty string. If
-.B EOF
-is encountered while reading a line, and the line is empty,
-.B NULL
-is returned. If an
-.B EOF
-is read with a non\-empty line, it is
-treated as a newline.
-.SH NOTATION
-.LP
-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
-keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards
-without a
-.I meta
-key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key
-then the
-.I x
-key. This makes ESC the \fImeta prefix\fP.
-The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP,
-or press the Escape key
-then hold the Control key while pressing the
-.I x
-key.)
-.PP
-Readline commands may be given numeric
-.IR arguments ,
-which normally act as a repeat count. Sometimes, however, it is the
-sign of the argument that is significant. Passing a negative argument
-to a command that acts in the forward direction (e.g., \fBkill\-line\fP)
-causes that command to act in a backward direction. Commands whose
-behavior with arguments deviates from this are noted.
-.PP
-When a command is described as \fIkilling\fP text, the text
-deleted is saved for possible future retrieval
-(\fIyanking\fP). The killed text is saved in a
-\fIkill ring\fP. Consecutive kills cause the text to be
-accumulated into one unit, which can be yanked all at once.
-Commands which do not kill text separate the chunks of text
-on the kill ring.
-.SH INITIALIZATION FILE
-.LP
-Readline is customized by putting commands in an initialization
-file (the \fIinputrc\fP file).
-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 .
-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
-readline init file. Blank lines are ignored.
-Lines beginning with a \fB#\fP are comments.
-Lines beginning with a \fB$\fP indicate conditional constructs.
-Other lines denote key bindings and variable settings.
-Each program using this library may add its own commands
-and bindings.
-.PP
-For example, placing
-.RS
-.PP
-M\-Control\-u: universal\-argument
-.RE
-or
-.RS
-C\-Meta\-u: universal\-argument
-.RE
-into the
-.I inputrc
-would make M\-C\-u execute the readline command
-.IR universal\-argument .
-.PP
-The following symbolic character names are recognized while
-processing key bindings:
-.IR RUBOUT ,
-.IR DEL ,
-.IR ESC ,
-.IR LFD ,
-.IR NEWLINE ,
-.IR RET ,
-.IR RETURN ,
-.IR SPC ,
-.IR SPACE ,
-and
-.IR TAB .
-.PP
-In addition to command names, readline allows keys to be bound
-to a string that is inserted when the key is pressed (a \fImacro\fP).
-.PP
-.SS Key Bindings
-.PP
-The syntax for controlling key bindings in the
-.I inputrc
-file is simple. All that is required is the name of the
-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.
-When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP,
-.I keyname
-is the name of a key spelled out in English. For example:
-.sp
-.RS
-Control\-u: universal\-argument
-.br
-Meta\-Rubout: backward\-kill\-word
-.br
-Control\-o: ">&output"
-.RE
-.LP
-In the above example,
-.I C\-u
-is bound to the function
-.BR universal\-argument ,
-.I M-DEL
-is bound to the function
-.BR backward\-kill\-word ,
-and
-.I C\-o
-is bound to run the macro
-expressed on the right hand side (that is, to insert the text
-.I >&output
-into the line).
-.PP
-In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP,
-.B keyseq
-differs from
-.B keyname
-above in that strings denoting
-an entire key sequence may be specified by placing the sequence
-within double quotes. Some GNU Emacs style key escapes can be
-used, as in the following example.
-.sp
-.RS
-"\eC\-u": universal\-argument
-.br
-"\eC\-x\eC\-r": re\-read\-init\-file
-.br
-"\ee[11~": "Function Key 1"
-.RE
-.PP
-In this example,
-.I C-u
-is again bound to the function
-.BR universal\-argument .
-.I "C-x C-r"
-is bound to the function
-.BR re\-read\-init\-file ,
-and
-.I "ESC [ 1 1 ~"
-is bound to insert the text
-.BR "Function Key 1" .
-The full set of GNU Emacs style escape sequences is
-.RS
-.PD 0
-.TP
-.B \eC\-
-control prefix
-.TP
-.B \eM\-
-meta prefix
-.TP
-.B \ee
-an escape character
-.TP
-.B \e\e
-backslash
-.TP
-.B \e"
-literal "
-.TP
-.B \e'
-literal '
-.RE
-.PD
-.PP
-In addition to the GNU Emacs style escape sequences, a second
-set of backslash escapes is available:
-.RS
-.PD 0
-.TP
-.B \ea
-alert (bell)
-.TP
-.B \eb
-backspace
-.TP
-.B \ed
-delete
-.TP
-.B \ef
-form feed
-.TP
-.B \en
-newline
-.TP
-.B \er
-carriage return
-.TP
-.B \et
-horizontal tab
-.TP
-.B \ev
-vertical tab
-.TP
-.B \e\fInnn\fP
-the character whose ASCII code is the octal value \fInnn\fP
-(one to three digits)
-.TP
-.B \ex\fInnn\fP
-the character whose ASCII code is the hexadecimal value \fInnn\fP
-(one to three digits)
-.RE
-.PD
-.PP
-When entering the text of a macro, single or double quotes should
-be used to indicate a macro definition. Unquoted text
-is assumed to be a function name.
-In the macro body, the backslash escapes described above are expanded.
-Backslash will quote any other character in the macro text,
-including " and '.
-.PP
-.B Bash
-allows the current readline key bindings to be displayed or modified
-with the
-.B bind
-builtin command. The editing mode may be switched during interactive
-use by using the
-.B \-o
-option to the
-.B set
-builtin command. Other programs using this library provide
-similar mechanisms. The
-.I inputrc
-file may be edited and re-read if a program does not provide
-any other means to incorporate new bindings.
-.SS Variables
-.PP
-Readline has variables that can be used to further customize its
-behavior. A variable may be set in the
-.I inputrc
-file with a statement of the form
-.RS
-.PP
-\fBset\fP \fIvariable\-name\fP \fIvalue\fP
-.RE
-.PP
-Except where noted, readline variables can take the values
-.B On
-or
-.BR Off .
-The variables and their default values are:
-.PP
-.PD 0
-.TP
-.B bell\-style (audible)
-Controls what happens when readline wants to ring the terminal bell.
-If set to \fBnone\fP, readline never rings the bell. If set to
-\fBvisible\fP, readline uses a visible bell if one is available.
-If set to \fBaudible\fP, readline attempts to ring the terminal's bell.
-.TP
-.B comment\-begin (``#'')
-The string that is inserted in \fBvi\fP mode when the
-.B insert\-comment
-command is executed.
-This command is bound to
-.B M\-#
-in emacs mode and to
-.B #
-in vi command mode.
-.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\-query\-items (100)
-This determines when the user is queried about viewing
-the number of possible completions
-generated by the \fBpossible\-completions\fP command.
-It may be set to any integer value greater than or equal to
-zero. If the number of possible completions is greater than
-or equal to the value of this variable, the user is asked whether
-or not he wishes to view them; otherwise they are simply listed
-on the terminal.
-.TP
-.B convert\-meta (On)
-If set to \fBOn\fP, readline will convert characters with the
-eighth bit set to an ASCII key sequence
-by stripping the eighth bit and prepending an
-escape character (in effect, using escape as the \fImeta prefix\fP).
-.TP
-.B disable\-completion (Off)
-If set to \fBOn\fP, readline will inhibit word completion. Completion
-characters will be inserted into the line as if they had been
-mapped to \fBself-insert\fP.
-.TP
-.B editing\-mode (emacs)
-Controls whether readline begins with a set of key bindings similar
-to \fIemacs\fP or \fIvi\fP.
-.B editing\-mode
-can be set to either
-.B emacs
-or
-.BR vi .
-.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 expand\-tilde (Off)
-If set to \fBon\fP, tilde expansion is performed when readline
-attempts word completion.
-.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
-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,
-vi-command\fP, and
-.IR vi-insert .
-\fIvi\fP is equivalent to \fIvi-command\fP; \fIemacs\fP is
-equivalent to \fIemacs-standard\fP. The default value is
-.IR emacs ;
-the value of
-.B editing\-mode
-also affects the default keymap.
-.TP
-.B mark\-directories (On)
-If set to \fBOn\fP, complete<d directory names have a slash
-appended.
-.TP
-.B mark\-modified\-lines (Off)
-If set to \fBOn\fP, history lines that have been modified are displayed
-with a preceding asterisk (\fB*\fP).
-.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
-sequence.
-.TP
-.B print\-completions\-horizontally (Off)
-If set to \fBOn\fP, readline will display completions with matches
-sorted horizontally in alphabetical order, rather than down the screen.
-.TP
-.B show\-all\-if\-ambiguous (Off)
-This alters the default behavior of the completion functions. If
-set to
-.BR on ,
-words which have more than one possible completion cause the
-matches to be listed immediately instead of ringing the bell.
-.TP
-.B visible\-stats (Off)
-If set to \fBOn\fP, a character denoting a file's type as reported
-by \fBstat\fP(2) is appended to the filename when listing possible
-completions.
-.PD
-.SS Conditional Constructs
-.PP
-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 performed as the result
-of tests. There are four parser directives used.
-.IP \fB$if\fP
-The
-.B $if
-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.
-.RS
-.IP \fBmode\fP
-The \fBmode=\fP form of the \fB$if\fP directive is used to test
-whether readline is in emacs or vi mode.
-This may be used in conjunction
-with the \fBset keymap\fP command, for instance, to set bindings in
-the \fIemacs-standard\fP and \fIemacs-ctlx\fP keymaps only if
-readline is starting out in emacs mode.
-.IP \fBterm\fP
-The \fBterm=\fP form may be used to include terminal-specific
-key bindings, perhaps to bind the key sequences output by the
-terminal's function keys. The word on the right side of the
-.B =
-is tested against the full name of the terminal and the portion
-of the terminal name before the first \fB\-\fP. This allows
-.I sun
-to match both
-.I sun
-and
-.IR sun\-cmd ,
-for instance.
-.IP \fBapplication\fP
-The \fBapplication\fP construct is used to include
-application-specific settings. Each program using the readline
-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:
-.sp 1
-.RS
-.nf
-\fB$if\fP bash
-# Quote the current or previous word
-"\eC-xq": "\eeb\e"\eef\e""
-\fB$endif\fP
-.fi
-.RE
-.RE
-.IP \fB$endif\fP
-This command, as seen in the previous example, terminates an
-\fB$if\fP command.
-.IP \fB$else\fP
-Commands in this branch of the \fB$if\fP directive are executed if
-the test fails.
-.IP \fB$include\fP
-This directive takes a single filename as an argument and reads commands
-and bindings from that file. For example, the following directive
-would read \fI/etc/inputrc\fP:
-.sp 1
-.RS
-.nf
-\fB$include\fP \^ \fI/etc/inputrc\fP
-.fi
-.RE
-.SH SEARCHING
-.PP
-Readline provides commands for searching through the command history
-for lines containing a specified string.
-There are two search modes:
-.I incremental
-and
-.IR non-incremental .
-.PP
-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 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
-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 execute that command.
-For instance, a \fInewline\fP will terminate the search and accept
-the line, thereby executing the command from the history list.
-.PP
-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 contents of the current line.
-.SH EDITING COMMANDS
-.PP
-The following is a list of the names of the commands and the default
-key sequences to which they are bound.
-Command names without an accompanying key sequence are unbound by default.
-.SS Commands for Moving
-.PP
-.PD 0
-.TP
-.B beginning\-of\-line (C\-a)
-Move to the start of the current line.
-.TP
-.B end\-of\-line (C\-e)
-Move to the end of the line.
-.TP
-.B forward\-char (C\-f)
-Move forward a character.
-.TP
-.B backward\-char (C\-b)
-Move back a character.
-.TP
-.B forward\-word (M\-f)
-Move forward to the end of the next word. Words are composed of
-alphanumeric characters (letters and digits).
-.TP
-.B backward\-word (M\-b)
-Move back to the start of the current or previous word. Words are
-composed of alphanumeric characters (letters and digits).
-.TP
-.B clear\-screen (C\-l)
-Clear the screen leaving the current line at the top of the screen.
-With an argument, refresh the current line without clearing the
-screen.
-.TP
-.B redraw\-current\-line
-Refresh the current line.
-.PD
-.SS Commands for Manipulating the History
-.PP
-.PD 0
-.TP
-.B accept\-line (Newline, Return)
-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.
-.TP
-.B previous\-history (C\-p)
-Fetch the previous command from the history list, moving back in
-the list.
-.TP
-.B next\-history (C\-n)
-Fetch the next command from the history list, moving forward in the
-list.
-.TP
-.B beginning\-of\-history (M\-<)
-Move to the first line in the history.
-.TP
-.B end\-of\-history (M\->)
-Move to the end of the input history, i.e., the line currently being
-entered.
-.TP
-.B reverse\-search\-history (C\-r)
-Search backward starting at the current line and moving `up' through
-the history as necessary. This is an incremental search.
-.TP
-.B forward\-search\-history (C\-s)
-Search forward starting at the current line and moving `down' through
-the history as necessary. This is an incremental search.
-.TP
-.B non\-incremental\-reverse\-search\-history (M\-p)
-Search backward through the history starting at the current line
-using a non-incremental search for a string supplied by the user.
-.TP
-.B non\-incremental\-forward\-search\-history (M\-n)
-Search forward through the history using a non-incremental search
-for a string supplied by the user.
-.TP
-.B history\-search\-forward
-Search forward through the history for the string of characters
-between the start of the current line and the current cursor
-position (the \fIpoint\fP).
-This is a non-incremental search.
-.TP
-.B history\-search\-backward
-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.
-.TP
-.B yank\-nth\-arg (M\-C\-y)
-Insert the first argument to the previous command (usually
-the second word on the previous line) at point (the current
-cursor position). With an argument
-.IR n ,
-insert the \fIn\fPth word from the previous command (the words
-in the previous command begin with word 0). A negative argument
-inserts the \fIn\fPth word from the end of the previous command.
-.TP
-.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.
-Successive calls to \fByank\-last\-arg\fP move back through the history
-list, inserting the last argument of each line in turn.
-.PD
-.SS Commands for Changing Text
-.PP
-.PD 0
-.TP
-.B delete\-char (C\-d)
-Delete the character under the cursor. If point is at the
-beginning of the line, there are no characters in the line, and
-the last character typed was not bound to \fBBdelete\-char\fP, then return
-.SM
-.BR EOF .
-.TP
-.B backward\-delete\-char (Rubout)
-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.
-.TP
-.B tab\-insert (M-TAB)
-Insert a tab character.
-.TP
-.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...)
-Insert the character typed.
-.TP
-.B transpose\-chars (C\-t)
-Drag the character before point forward over the character at point.
-Point moves forward as well. If point is at the end of the line, then
-transpose the two characters before point. Negative arguments don't work.
-.TP
-.B transpose\-words (M\-t)
-Drag the word behind the cursor past the word in front of the cursor
-moving the cursor over that word as well.
-.TP
-.B upcase\-word (M\-u)
-Uppercase the current (or following) word. With a negative argument,
-uppercase the previous word, but do not move point.
-.TP
-.B downcase\-word (M\-l)
-Lowercase the current (or following) word. With a negative argument,
-lowercase the previous word, but do not move point.
-.TP
-.B capitalize\-word (M\-c)
-Capitalize the current (or following) word. With a negative argument,
-capitalize the previous word, but do not move point.
-.PD
-.SS Killing and Yanking
-.PP
-.PD 0
-.TP
-.B kill\-line (C\-k)
-Kill the text from the current cursor position to the end of the line.
-.TP
-.B backward\-kill\-line (C\-x Rubout)
-Kill backward to the beginning of the line.
-.TP
-.B unix\-line\-discard (C\-u)
-Kill backward from point to the beginning of the line.
-The killed text is saved on the kill-ring.
-.\" There is no real difference between this and backward-kill-line
-.TP
-.B kill\-whole\-line
-Kill all characters on the current line, no matter where the
-cursor is.
-.TP
-.B kill\-word (M\-d)
-Kill from the cursor to the end of the current word, or if between
-words, to the end of the next word. Word boundaries are the same as
-those used by \fBforward\-word\fP.
-.TP
-.B backward\-kill\-word (M\-Rubout)
-Kill the word behind the cursor. Word boundaries are the same as
-those used by \fBbackward\-word\fP.
-.TP
-.B unix\-word\-rubout (C\-w)
-Kill the word behind the cursor, using white space as a word boundary.
-The word boundaries are different from
-.BR backward\-kill\-word .
-.TP
-.B delete\-horizontal\-space (M\-\e)
-Delete all spaces and tabs around point.
-.TP
-.B kill\-region
-Kill the text between the point and \fImark\fP (saved cursor position).
-This text is referred to as the \fIregion\fP.
-.TP
-.B copy\-region\-as\-kill
-Copy the text in the region to the kill buffer.
-.TP
-.B copy\-backward\-word
-Copy the word before point to the kill buffer.
-The word boundaries are the same as \fBbackward\-word\fP.
-.TP
-.B copy\-forward\-word
-Copy the word following point to the kill buffer.
-The word boundaries are the same as \fBforward\-word\fP.
-.TP
-.B yank (C\-y)
-Yank the top of the kill ring into the buffer at the cursor.
-.TP
-.B yank\-pop (M\-y)
-Rotate the kill ring, and yank the new top. Only works following
-.B yank
-or
-.BR yank\-pop .
-.PD
-.SS Numeric Arguments
-.PP
-.PD 0
-.TP
-.B digit\-argument (M\-0, M\-1, ..., M\-\-)
-Add this digit to the argument already accumulating, or start a new
-argument. M\-\- starts a negative argument.
-.TP
-.B universal\-argument
-This is another way to specify an argument.
-If this command is followed by one or more digits, optionally with a
-leading minus sign, those digits define the argument.
-If the command is followed by digits, executing
-.B universal\-argument
-again ends the numeric argument, but is otherwise ignored.
-As a special case, if this command is immediately followed 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 initially one, so executing this function the
-first time makes the argument count four, a second time makes the
-argument count sixteen, and so on.
-.PD
-.SS Completing
-.PP
-.PD 0
-.TP
-.B complete (TAB)
-Attempt to perform completion on the text before point.
-The actual completion performed is application-specific.
-.BR Bash ,
-for instance, attempts completion treating the text as a variable
-(if the text begins with \fB$\fP), username (if the text begins with
-\fB~\fP), hostname (if the text begins with \fB@\fP), or
-command (including aliases and functions) in turn. If none
-of these produces a match, filename completion is attempted.
-.BR Gdb ,
-on the other hand,
-allows completion of program functions and variables, and
-only attempts filename completion under certain circumstances.
-.TP
-.B possible\-completions (M\-?)
-List the possible completions of the text before point.
-.TP
-.B insert\-completions (M\-*)
-Insert all completions of the text before point
-that would have been generated by
-\fBpossible\-completions\fP.
-.TP
-.B menu\-complete
-Similar to \fBcomplete\fP, but replaces the word to be completed
-with a single match from the list of possible completions.
-Repeated execution of \fBmenu\-complete\fP steps through the list
-of possible completions, inserting each match in turn.
-At the end of the list of completions, the bell is rung and the
-original text is restored.
-An argument of \fIn\fP moves \fIn\fP positions forward in the list
-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
-.PD 0
-.TP
-.B start\-kbd\-macro (C\-x (\^)
-Begin saving the characters typed into the current keyboard macro.
-.TP
-.B end\-kbd\-macro (C\-x )\^)
-Stop saving the characters typed into the current keyboard macro
-and store the definition.
-.TP
-.B call\-last\-kbd\-macro (C\-x e)
-Re-execute the last keyboard macro defined, by making the characters
-in the macro appear as if typed at the keyboard.
-.PD
-.SS Miscellaneous
-.PP
-.PD 0
-.TP
-.B re\-read\-init\-file (C\-x C\-r)
-Read in the contents of the \fIinputrc\fP file, and incorporate
-any bindings or variable assignments found there.
-.TP
-.B abort (C\-g)
-Abort the current editing command and
-ring the terminal's bell (subject to the setting of
-.BR bell\-style ).
-.TP
-.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...)
-If the metafied character \fIx\fP is lowercase, run the command
-that is bound to the corresponding uppercase character.
-.TP
-.B prefix\-meta (ESC)
-Metafy the next character typed.
-.SM
-.B ESC
-.B f
-is equivalent to
-.BR Meta\-f .
-.TP
-.B undo (C\-_, C\-x C\-u)
-Incremental undo, separately remembered for each line.
-.TP
-.B revert\-line (M\-r)
-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\-&)
-Perform tilde expansion on the current word.
-.TP
-.B set\-mark (C\-@, M-<space>)
-Set the mark to the current point. If a
-numeric argument is supplied, the mark is set to that position.
-.TP
-.B exchange\-point\-and\-mark (C\-x C\-x)
-Swap the point with the mark. The current cursor position is set to
-the saved position, and the old cursor position is saved as the mark.
-.TP
-.B character\-search (C\-])
-A character is read and point is moved to the next occurrence of that
-character. A negative count searches for previous occurrences.
-.TP
-.B character\-search\-backward (M\-C\-])
-A character is read and point is moved to the previous occurrence of that
-character. A negative count searches for subsequent occurrences.
-.TP
-.B insert\-comment (M\-#)
-The value of the readline
-.B comment\-begin
-variable is inserted at the beginning of the current line, and the line
-is accepted as if a newline had been typed. This makes the current line
-a shell comment.
-.TP
-.B dump\-functions
-Print all of the functions and their key bindings 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 \fIinputrc\fP file.
-.TP
-.B dump\-variables
-Print all of the settable variables and their values 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 \fIinputrc\fP file.
-.TP
-.B dump\-macros
-Print all of the readline key sequences bound to macros and the
-strings they ouput. If a numeric argument is supplied,
-the output is formatted in such a way that it can be made part
-of an \fIinputrc\fP file.
-.TP
-.B emacs\-editing\-mode (C\-e)
-When in
-.B vi
-editing mode, this causes a switch to
-.B emacs
-editing mode.
-.TP
-.B vi\-editing\-mode (M\-C\-j)
-When in
-.B emacs
-editing mode, this causes a switch to
-.B vi
-editing mode.
-.PD
-.SH DEFAULT KEY BINDINGS
-.LP
-The following is a list of the default emacs and vi bindings.
-Characters with the 8th bit set are written as M\-<character>, and
-are referred to as
-.I metafied
-characters.
-The printable ASCII characters not mentioned in the list of emacs
-standard bindings are bound to the
-.I self\-insert
-function, which just inserts the given character into the input line.
-In vi insertion mode, all characters not specifically mentioned are
-bound to
-.IR self\-insert .
-Characters assigned to signal generation by
-.IR stty (1)
-or the terminal driver, such as C-Z or C-C,
-retain that function.
-Upper and lower case
-.I metafied
-characters are bound to the same function in the emacs mode
-meta keymap.
-The remaining characters are unbound, which causes readline
-to ring the bell (subject to the setting of the
-.B bell\-style
-variable).
-.SS Emacs Mode
-.RS +.6i
-.nf
-.ta 2.5i
-.sp
-Emacs Standard bindings
-.sp
-"C-@" set-mark
-"C-A" beginning-of-line
-"C-B" backward-char
-"C-D" delete-char
-"C-E" end-of-line
-"C-F" forward-char
-"C-G" abort
-"C-H" backward-delete-char
-"C-I" complete
-"C-J" accept-line
-"C-K" kill-line
-"C-L" clear-screen
-"C-M" accept-line
-"C-N" next-history
-"C-P" previous-history
-"C-Q" quoted-insert
-"C-R" reverse-search-history
-"C-S" forward-search-history
-"C-T" transpose-chars
-"C-U" unix-line-discard
-"C-V" quoted-insert
-"C-W" unix-word-rubout
-"C-Y" yank
-"C-]" character-search
-"C-_" undo
-"\^ " to "/" self-insert
-"0" to "9" self-insert
-":" to "~" self-insert
-"C-?" backward-delete-char
-.PP
-Emacs Meta bindings
-.sp
-"M-C-G" abort
-"M-C-H" backward-kill-word
-"M-C-I" tab-insert
-"M-C-J" vi-editing-mode
-"M-C-M" vi-editing-mode
-"M-C-R" revert-line
-"M-C-Y" yank-nth-arg
-"M-C-[" complete
-"M-C-]" character-search-backward
-"M-space" set-mark
-"M-#" insert-comment
-"M-&" tilde-expand
-"M-*" insert-completions
-"M--" digit-argument
-"M-." yank-last-arg
-"M-0" digit-argument
-"M-1" digit-argument
-"M-2" digit-argument
-"M-3" digit-argument
-"M-4" digit-argument
-"M-5" digit-argument
-"M-6" digit-argument
-"M-7" digit-argument
-"M-8" digit-argument
-"M-9" digit-argument
-"M-<" beginning-of-history
-"M-=" possible-completions
-"M->" end-of-history
-"M-?" possible-completions
-"M-B" backward-word
-"M-C" capitalize-word
-"M-D" kill-word
-"M-F" forward-word
-"M-L" downcase-word
-"M-N" non-incremental-forward-search-history
-"M-P" non-incremental-reverse-search-history
-"M-R" revert-line
-"M-T" transpose-words
-"M-U" upcase-word
-"M-Y" yank-pop
-"M-\e" delete-horizontal-space
-"M-~" tilde-expand
-"M-C-?" backward-delete-word
-"M-_" yank-last-arg
-.PP
-Emacs Control-X bindings
-.sp
-"C-XC-G" abort
-"C-XC-R" re-read-init-file
-"C-XC-U" undo
-"C-XC-X" exchange-point-and-mark
-"C-X(" start-kbd-macro
-"C-X)" end-kbd-macro
-"C-XE" call-last-kbd-macro
-"C-XC-?" backward-kill-line
-.sp
-.RE
-.SS VI Mode bindings
-.RS +.6i
-.nf
-.ta 2.5i
-.sp
-.PP
-VI Insert Mode functions
-.sp
-"C-D" vi-eof-maybe
-"C-H" backward-delete-char
-"C-I" complete
-"C-J" accept-line
-"C-M" accept-line
-"C-R" reverse-search-history
-"C-S" forward-search-history
-"C-T" transpose-chars
-"C-U" unix-line-discard
-"C-V" quoted-insert
-"C-W" unix-word-rubout
-"C-Y" yank
-"C-[" vi-movement-mode
-"C-_" undo
-"\^ " to "~" self-insert
-"C-?" backward-delete-char
-.PP
-VI Command Mode functions
-.sp
-"C-D" vi-eof-maybe
-"C-E" emacs-editing-mode
-"C-G" abort
-"C-H" backward-char
-"C-J" accept-line
-"C-K" kill-line
-"C-L" clear-screen
-"C-M" accept-line
-"C-N" next-history
-"C-P" previous-history
-"C-Q" quoted-insert
-"C-R" reverse-search-history
-"C-S" forward-search-history
-"C-T" transpose-chars
-"C-U" unix-line-discard
-"C-V" quoted-insert
-"C-W" unix-word-rubout
-"C-Y" yank
-"\^ " forward-char
-"#" insert-comment
-"$" end-of-line
-"%" vi-match
-"&" vi-tilde-expand
-"*" vi-complete
-"+" next-history
-"," vi-char-search
-"-" previous-history
-"." vi-redo
-"/" vi-search
-"0" beginning-of-line
-"1" to "9" vi-arg-digit
-";" vi-char-search
-"=" vi-complete
-"?" vi-search
-"A" vi-append-eol
-"B" vi-prev-word
-"C" vi-change-to
-"D" vi-delete-to
-"E" vi-end-word
-"F" vi-char-search
-"G" vi-fetch-history
-"I" vi-insert-beg
-"N" vi-search-again
-"P" vi-put
-"R" vi-replace
-"S" vi-subst
-"T" vi-char-search
-"U" revert-line
-"W" vi-next-word
-"X" backward-delete-char
-"Y" vi-yank-to
-"\e" vi-complete
-"^" vi-first-print
-"_" vi-yank-arg
-"`" vi-goto-mark
-"a" vi-append-mode
-"b" vi-prev-word
-"c" vi-change-to
-"d" vi-delete-to
-"e" vi-end-word
-"f" vi-char-search
-"h" backward-char
-"i" vi-insertion-mode
-"j" next-history
-"k" prev-history
-"l" forward-char
-"m" vi-set-mark
-"n" vi-search-again
-"p" vi-put
-"r" vi-change-char
-"s" vi-subst
-"t" vi-char-search
-"u" undo
-"w" vi-next-word
-"x" vi-delete
-"y" vi-yank-to
-"|" vi-column
-"~" vi-change-case
-.RE
-.SH "SEE ALSO"
-.PD 0
-.TP
-\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey
-.TP
-\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey
-.TP
-\fIbash\fP(1)
-.PD
-.SH FILES
-.PD 0
-.TP
-.FN ~/.inputrc
-Individual \fBreadline\fP initialization file
-.PD
-.SH AUTHORS
-Brian Fox, Free Software Foundation
-.br
-bfox@gnu.org
-.PP
-Chet Ramey, Case Western Reserve University
-.br
-chet@ins.CWRU.Edu
-.SH BUG REPORTS
-If you find a bug in
-.B readline,
-you should report it. But first, you should
-make sure that it really is a bug, and that it appears in the latest
-version of the
-.B readline
-library that you have.
-.PP
-Once you have determined that a bug actually exists, mail a
-bug report to \fIbug\-readline\fP@\fIgnu.org\fP.
-If you have a fix, you are welcome to mail that
-as well! Suggestions and `philosophical' bug reports may be mailed
-to \fPbug-readline\fP@\fIgnu.org\fP or posted to the Usenet
-newsgroup
-.BR gnu.bash.bug .
-.PP
-Comments and bug reports concerning
-this manual page should be directed to
-.IR chet@ins.CWRU.Edu .
-.SH BUGS
-.PP
-It's too big and too slow.
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index e8375a3..c49af9f 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -1,51 +1,72 @@
-%% TeX macros to handle texinfo files
-
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
-% 94, 95, 1996 Free Software Foundation, Inc.
-
-%This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write
-%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-%Boston, MA 02111-1307, USA.
-
-
-%In other words, you are welcome to use, share and improve this program.
-%You are forbidden to forbid anyone else to use, share and improve
-%what you give them. Help stamp out software-hoarding!
-
-
-% Send bug reports to bug-texinfo@prep.ai.mit.edu.
-% Please include a *precise* test case in each bug report.
-
-
-% Make it possible to create a .fmt file just by loading this file:
-% if the underlying format is not loaded, start by loading it now.
-% Added by gildea November 1993.
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{1999-09-25.10}
+%
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
+% Free Software Foundation, Inc.
+%
+% This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write
+% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+% Boston, MA 02111-1307, USA.
+%
+% In other words, you are welcome to use, share and improve this program.
+% You are forbidden to forbid anyone else to use, share and improve
+% what you give them. Help stamp out software-hoarding!
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% ftp://ftp.gnu.org/gnu/texinfo.tex
+% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
+% ftp://texinfo.org/tex/texinfo.tex
+% ftp://us.ctan.org/macros/texinfo/texinfo.tex
+% (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
+% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+% The texinfo.tex in any given Texinfo distribution could well be out
+% of date, so if that's what you're using, please check.
+% Texinfo has a small home page at http://texinfo.org/.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
+% The extra runs of TeX get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages. You can get
+% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
-% This automatically updates the version number based on RCS.
-\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision: 2.185 $
-\message{Loading texinfo package [Version \texinfoversion]:}
+\message{Loading texinfo [version \texinfoversion]:}
% If in a .fmt file, print the version number
% and turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
+\everyjob{\message{[Texinfo version \texinfoversion]}%
\catcode`+=\active \catcode`\_=\active}
% Save some parts of plain tex whose names we will redefine.
-
\let\ptexb=\b
\let\ptexbullet=\bullet
\let\ptexc=\c
@@ -53,27 +74,17 @@
\let\ptexdot=\.
\let\ptexdots=\dots
\let\ptexend=\end
-\let\ptexequiv = \equiv
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
\let\ptexi=\i
\let\ptexlbrace=\{
\let\ptexrbrace=\}
\let\ptexstar=\*
\let\ptext=\t
-\let\ptextilde=\~
-
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-\let\~ = \tie % And make it available as @~.
+% We never want plain's outer \+ definition in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
\message{Basics,}
\chardef\other=12
@@ -82,18 +93,47 @@
% starts a new line in the output.
\newlinechar = `^^J
-% Set up fixed words for English.
-\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
-\def\putwordInfo{Info}%
-\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
-\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
-\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
-\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
-\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
-\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
-\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
-\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
-\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
% Ignore a token.
%
@@ -102,10 +142,11 @@
\hyphenation{ap-pen-dix}
\hyphenation{mini-buf-fer mini-buf-fers}
\hyphenation{eshell}
+\hyphenation{white-space}
% Margin to add to right of even pages, to left of odd pages.
-\newdimen \bindingoffset
-\newdimen \normaloffset
+\newdimen \bindingoffset
+\newdimen \normaloffset
\newdimen\pagewidth \newdimen\pageheight
% Sometimes it is convenient to have everything in the transcript file
@@ -113,87 +154,119 @@
% since that produces some useless output on the terminal.
%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\ifx\eTeXversion\undefined
\def\loggingall{\tracingcommands2 \tracingstats2
\tracingpages1 \tracingoutput1 \tracinglostchars1
\tracingmacros2 \tracingparagraphs1 \tracingrestores1
\showboxbreadth\maxdimen\showboxdepth\maxdimen
}%
+\else
+\def\loggingall{\tracingcommands3 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \tracingscantokens1 \tracingassigns1 \tracingifs1
+ \tracinggroups1 \tracingnesting2
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\fi
-%---------------------Begin change-----------------------
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
%
-%%%% For @cropmarks command.
-% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
%
-\newdimen\cornerlong \newdimen\cornerthick
-\newdimen \topandbottommargin
-\newdimen \outerhsize \newdimen \outervsize
-\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
-\outerhsize=7in
-%\outervsize=9.5in
-% Alternative @smallbook page size is 9.25in
-\outervsize=9.25in
-\topandbottommargin=.75in
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
%
-%---------------------End change-----------------------
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
% \onepageout takes a vbox as an argument. Note that \pagecontents
% does insertions, but you have to call it yourself.
-\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
\def\onepageout#1{%
- \hoffset=\normaloffset
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
\ifodd\pageno \advance\hoffset by \bindingoffset
\else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+ \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+ %
{%
- \escapechar = `\\ % use backslash in output files.
- \indexdummies
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \escapechar = `\\ % use backslash in output files.
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
\shipout\vbox{%
- {\let\hsize=\pagewidth \makeheadline}%
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
\pagebody{#1}%
- {\let\hsize=\pagewidth \makefootline}%
- }%
- }%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingxxx.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 2\baselineskip
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \turnoffactive
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
-%%%% For @cropmarks command %%%%
-
-% Here is a modification of the main output routine for Near East Publications
-% This provides right-angle cropmarks at all four corners.
-% The contents of the page are centerlined into the cropmarks,
-% and any desired binding offset is added as an \hskip on either
-% site of the centerlined box. (P. A. MacKay, 12 November, 1986)
-%
-\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
-{\escapechar=`\\\relax % makes sure backslash is used in output files.
- \shipout
- \vbox to \outervsize{\hsize=\outerhsize
- \vbox{\line{\ewtop\hfill\ewtop}}
- \nointerlineskip
- \line{\vbox{\moveleft\cornerthick\nstop}
- \hfill
- \vbox{\moveright\cornerthick\nstop}}
- \vskip \topandbottommargin
- \centerline{\ifodd\pageno\hskip\bindingoffset\fi
- \vbox{
- {\let\hsize=\pagewidth \makeheadline}
- \pagebody{#1}
- {\let\hsize=\pagewidth \makefootline}}
- \ifodd\pageno\else\hskip\bindingoffset\fi}
- \vskip \topandbottommargin plus1fill minus1fill
- \boxmaxdepth\cornerthick
- \line{\vbox{\moveleft\cornerthick\nsbot}
- \hfill
- \vbox{\moveright\cornerthick\nsbot}}
- \nointerlineskip
- \vbox{\line{\ewbot\hfill\ewbot}}
- }}
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
-%
-% Do @cropmarks to get crop marks
-\def\cropmarks{\let\onepageout=\croppageout }
-
\newinsert\margin \dimen\margin=\maxdimen
\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
@@ -207,7 +280,6 @@
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
}
-%
% Here are the rules for the cropmarks. Note that they are
% offset so that the space between them is truly \outerhsize or \outervsize
% (P. A. MacKay, 12 November, 1986)
@@ -302,11 +374,11 @@
%% Call \inENV within environments (after a \begingroup)
\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment. Type Return to continue.}
+\ifENV\errmessage{Still within an environment; press RETURN to continue}
\endgroup\fi} % This is not perfect, but it should reduce lossage
% @begin foo is the same as @foo, for now.
-\newhelp\EMsimple{Type <Return> to continue.}
+\newhelp\EMsimple{Press RETURN to continue.}
\outer\def\begin{\parsearg\beginxxx}
@@ -365,7 +437,7 @@
% @@ prints an @
% Kludge this until the fonts are right (grr).
-\def\@{{\tt \char '100}}
+\def\@{{\tt\char64}}
% This is turned off because it was never documented
% and you can use @w{...} around a quote to suppress ligatures.
@@ -375,8 +447,8 @@
%\def\'{{'}}
% Used to generate quoted braces.
-\def\mylbrace {{\tt \char '173}}
-\def\myrbrace {{\tt \char '175}}
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
\let\{=\mylbrace
\let\}=\myrbrace
\begingroup
@@ -413,6 +485,18 @@
\fi\fi
}
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }
@@ -422,14 +506,11 @@
% @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 }
-% @enddots{} is an end-of-sentence ellipsis.
-\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
-
% @! is an end-of-sentence bang.
-\gdef\!{!\spacefactor=3000 }
+\def\!{!\spacefactor=3000 }
% @? is an end-of-sentence query.
-\gdef\?{?\spacefactor=3000 }
+\def\?{?\spacefactor=3000 }
% @w prevents a word break. Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would
@@ -513,53 +594,81 @@ where each line of input produces a line of output.}
%% This method tries to make TeX break the page naturally
%% if the depth of the box does not fit.
%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
%\prevdepth=-1000pt
%}}
\def\needx#1{%
- % Go into vertical mode, so we don't make a big box in the middle of a
+ % Ensure vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
%
- % Don't add any leading before our big empty box, but allow a page
- % break, since the best break might be right here.
- \allowbreak
- \nointerlineskip
- \vtop to #1\mil{\vfil}%
- %
- % TeX does not even consider page breaks if a penalty added to the
- % main vertical list is 10000 or more. But in order to see if the
- % empty box we just added fits on the page, we must make it consider
- % page breaks. On the other hand, we don't want to actually break the
- % page after the empty box. So we use a penalty of 9999.
- %
- % There is an extremely small chance that TeX will actually break the
- % page at this \penalty, if there are no other feasible breakpoints in
- % sight. (If the user is using lots of big @group commands, which
- % almost-but-not-quite fill up a page, TeX will have a hard time doing
- % good page breaking, for example.) However, I could not construct an
- % example where a page broke at this \penalty; if it happens in a real
- % document, then we can reconsider our strategy.
- \penalty9999
- %
- % Back up by the size of the box, whether we did a page break or not.
- \kern -#1\mil
- %
- % Do not allow a page break right after this kern.
- \nobreak
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
}
% @br forces paragraph break
\let\br = \par
-% @dots{} output some dots
+% @dots{} output an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+ \leavevmode
+ \hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+}
-\def\dots{$\ldots$}
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \leavevmode
+ \hbox to 2em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+ \spacefactor=3000
+}
-% @page forces the start of a new page
+% @page forces the start of a new page
+%
\def\page{\par\vfill\supereject}
% @exdent text....
@@ -626,314 +735,50 @@ where each line of input produces a line of output.}
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment
-\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
-\parsearg \commentxxx}
-
-\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
\let\c=\comment
-% @paragraphindent is defined for the Info formatting commands only.
-\let\paragraphindent=\comment
-
-% Prevent errors for section commands.
-% Used in @ignore and in failing conditionals.
-\def\ignoresections{%
-\let\chapter=\relax
-\let\unnumbered=\relax
-\let\top=\relax
-\let\unnumberedsec=\relax
-\let\unnumberedsection=\relax
-\let\unnumberedsubsec=\relax
-\let\unnumberedsubsection=\relax
-\let\unnumberedsubsubsec=\relax
-\let\unnumberedsubsubsection=\relax
-\let\section=\relax
-\let\subsec=\relax
-\let\subsubsec=\relax
-\let\subsection=\relax
-\let\subsubsection=\relax
-\let\appendix=\relax
-\let\appendixsec=\relax
-\let\appendixsection=\relax
-\let\appendixsubsec=\relax
-\let\appendixsubsection=\relax
-\let\appendixsubsubsec=\relax
-\let\appendixsubsubsection=\relax
-\let\contents=\relax
-\let\smallbook=\relax
-\let\titlepage=\relax
-}
-
-% Used in nested conditionals, where we have to parse the Texinfo source
-% and so want to turn off most commands, in case they are used
-% incorrectly.
-%
-\def\ignoremorecommands{%
- \let\defcodeindex = \relax
- \let\defcv = \relax
- \let\deffn = \relax
- \let\deffnx = \relax
- \let\defindex = \relax
- \let\defivar = \relax
- \let\defmac = \relax
- \let\defmethod = \relax
- \let\defop = \relax
- \let\defopt = \relax
- \let\defspec = \relax
- \let\deftp = \relax
- \let\deftypefn = \relax
- \let\deftypefun = \relax
- \let\deftypevar = \relax
- \let\deftypevr = \relax
- \let\defun = \relax
- \let\defvar = \relax
- \let\defvr = \relax
- \let\ref = \relax
- \let\xref = \relax
- \let\printindex = \relax
- \let\pxref = \relax
- \let\settitle = \relax
- \let\setchapternewpage = \relax
- \let\setchapterstyle = \relax
- \let\everyheading = \relax
- \let\evenheading = \relax
- \let\oddheading = \relax
- \let\everyfooting = \relax
- \let\evenfooting = \relax
- \let\oddfooting = \relax
- \let\headings = \relax
- \let\include = \relax
- \let\lowersections = \relax
- \let\down = \relax
- \let\raisesections = \relax
- \let\up = \relax
- \let\set = \relax
- \let\clear = \relax
- \let\item = \relax
-}
-
-% Ignore @ignore ... @end ignore.
-%
-\def\ignore{\doignore{ignore}}
-
-% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
-%
-\def\ifinfo{\doignore{ifinfo}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\html{\doignore{html}}
-\def\menu{\doignore{menu}}
-\def\direntry{\doignore{direntry}}
-
-% Also ignore @macro ... @end macro. The user must run texi2dvi,
-% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
-\def\macro{\doignore{macro}}
-\let\unmacro = \comment
-
-
-% @dircategory CATEGORY -- specify a category of the dir file
-% which this file should belong to. Ignore this in TeX.
-\let\dircategory = \comment
-
-% Ignore text until a line `@end #1'.
-%
-\def\doignore#1{\begingroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define a command to swallow text until we reach `@end #1'.
- \long\def\doignoretext##1\end #1{\enddoignore}%
- %
- % Make sure that spaces turn into tokens that match what \doignoretext wants.
- \catcode32 = 10
- %
- % And now expand that command.
- \doignoretext
-}
-
-% What we do to finish off ignored text.
-%
-\def\enddoignore{\endgroup\ignorespaces}%
-
-\newif\ifwarnedobs\warnedobsfalse
-\def\obstexwarn{%
- \ifwarnedobs\relax\else
- % We need to warn folks that they may have trouble with TeX 3.0.
- % This uses \immediate\write16 rather than \message to get newlines.
- \immediate\write16{}
- \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
- \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
- \immediate\write16{If you are running another version of TeX, relax.}
- \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
- \immediate\write16{ Then upgrade your TeX installation if you can.}
- \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
- \immediate\write16{If you are stuck with version 3.0, run the}
- \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
- \immediate\write16{ to use a workaround.}
- \immediate\write16{}
- \global\warnedobstrue
- \fi
-}
-
-% **In TeX 3.0, setting text in \nullfont hangs tex. For a
-% workaround (which requires the file ``dummy.tfm'' to be installed),
-% uncomment the following line:
-%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
-
-% Ignore text, except that we keep track of conditional commands for
-% purposes of nesting, up to an `@end #1' command.
-%
-\def\nestedignore#1{%
- \obstexwarn
- % We must actually expand the ignored text to look for the @end
- % command, so that nested ignore constructs work. Thus, we put the
- % text into a \vbox and then do nothing with the result. To minimize
- % the change of memory overflow, we follow the approach outlined on
- % page 401 of the TeXbook: make the current font be a dummy font.
- %
- \setbox0 = \vbox\bgroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define `@end #1' to end the box, which will in turn undefine the
- % @end command again.
- \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
- %
- % We are going to be parsing Texinfo commands. Most cause no
- % trouble when they are used incorrectly, but some commands do
- % complicated argument parsing or otherwise get confused, so we
- % undefine them.
- %
- % We can't do anything about stray @-signs, unfortunately;
- % they'll produce `undefined control sequence' errors.
- \ignoremorecommands
- %
- % Set the current font to be \nullfont, a TeX primitive, and define
- % all the font commands to also use \nullfont. We don't use
- % dummy.tfm, as suggested in the TeXbook, because not all sites
- % might have that installed. Therefore, math mode will still
- % produce output, but that should be an extremely small amount of
- % stuff compared to the main input.
- %
- \nullfont
- \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
- \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
- \let\tensf = \nullfont
- % Similarly for index fonts (mostly for their use in
- % smallexample)
- \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
- \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
- \let\indsf = \nullfont
- %
- % Don't complain when characters are missing from the fonts.
- \tracinglostchars = 0
- %
- % Don't bother to do space factor calculations.
- \frenchspacing
- %
- % Don't report underfull hboxes.
- \hbadness = 10000
- %
- % Do minimal line-breaking.
- \pretolerance = 10000
- %
- % Do not execute instructions in @tex
- \def\tex{\doignore{tex}}
-}
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it. Make sure the catcode of space is correct to avoid
-% losing inside @example, for instance.
-%
-\def\set{\begingroup\catcode` =10 \parsearg\setxxx}
-\def\setxxx#1{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
- \def\temp{#2}%
- \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
- \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
- \fi
- \endgroup
-}
-% Can't use \xdef to pre-expand #2 and save some time, since \temp or
-% \next or other control sequences that we've defined might get us into
-% an infinite loop. Consider `@set foo @cite{bar}'.
-\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
-
-% @clear VAR clears (i.e., unsets) the variable VAR.
-%
-\def\clear{\parsearg\clearxxx}
-\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
-
-% @value{foo} gets the text saved in variable foo.
-%
-\def\value#1{\expandafter
- \ifx\csname SET#1\endcsname\relax
- {\{No value for ``#1''\}}
- \else \csname SET#1\endcsname \fi}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% We cannot implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
%
-\def\ifset{\parsearg\ifsetxxx}
-\def\ifsetxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifsetfail
+\def\paragraphindent{\parsearg\doparagraphindent}
+\def\doparagraphindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
\else
- \expandafter\ifsetsucceed
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
\fi
+ \parindent = \defaultparindent
}
-\def\ifsetsucceed{\conditionalsucceed{ifset}}
-\def\ifsetfail{\nestedignore{ifset}}
-\defineunmatchedend{ifset}
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
-%
-\def\ifclear{\parsearg\ifclearxxx}
-\def\ifclearxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifclearsucceed
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\def\exampleindent{\parsearg\doexampleindent}
+\def\doexampleindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
\else
- \expandafter\ifclearfail
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
\fi
}
-\def\ifclearsucceed{\conditionalsucceed{ifclear}}
-\def\ifclearfail{\nestedignore{ifclear}}
-\defineunmatchedend{ifclear}
-
-% @iftex always succeeds; we read the text following, through @end
-% iftex). But `@end iftex' should be valid only after an @iftex.
-%
-\def\iftex{\conditionalsucceed{iftex}}
-\defineunmatchedend{iftex}
-
-% We can't just want to start a group at @iftex (for example) and end it
-% at @end iftex, since then @set commands inside the conditional have no
-% effect (they'd get reverted at the end of the group). So we must
-% define \Eiftex to redefine itself to be its previous value. (We can't
-% just define it to fail again with an ``unmatched end'' error, since
-% the @ifset might be nested.)
-%
-\def\conditionalsucceed#1{%
- \edef\temp{%
- % Remember the current value of \E#1.
- \let\nece{prevE#1} = \nece{E#1}%
- %
- % At the `@end #1', redefine \E#1 to be its previous value.
- \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
- }%
- \temp
-}
-
-% We need to expand lots of \csname's, but we don't want to expand the
-% control sequences after we've constructed them.
-%
-\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
% @asis just yields its argument. Used with @table, for example.
%
@@ -956,63 +801,229 @@ where each line of input produces a line of output.}
\def\bullet{\implicitmath\ptexbullet\implicitmath}
\def\minus{\implicitmath-\implicitmath}
-\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
-\let\nwnode=\node
-\let\lastnode=\relax
-
-\def\donoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\setref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\unnumbnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\appendixnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
% @refill is a no-op.
\let\refill=\relax
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
% @setfilename is done at the beginning of every texinfo file.
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
- \readauxfile
- \opencontents
+ \iflinks
+ \readauxfile
+ \fi % \openindices needs to do some work in any case.
\openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'.
\global\let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ % Just to be on the safe side, close the input stream before the \input.
+ \openin 1 texinfo.cnf
+ \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
+ \closein1
+ \temp
+ %
\comment % Ignore the actual filename.
}
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
% @bye.
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
-% \def\macroxxx#1#2 \end macro{%
-% \expandafter\gdef\macrotemp#1{#2}%
-% \endgroup}
-%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
-%\def\linemacroxxx#1#2 \end linemacro{%
-%\let\parsearg=\relax
-%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
-%\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
-%\expandafter\gdef\macrotempx#1{#2}%
-%\endgroup}
-
-%\def\butfirst#1{}
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+\ifx\pdfoutput\undefined
+ \pdffalse
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\linkcolor = \relax
+ \let\pdfmakeoutlines = \relax
+\else
+ \pdftrue
+ \pdfoutput = 1
+ \input pdfcolor
+ \def\dopdfimage#1#2#3{%
+ \def\imagewidth{#2}%
+ \def\imageheight{#3}%
+ \ifnum\pdftexversion < 14
+ \pdfimage
+ \else
+ \pdfximage
+ \fi
+ \ifx\empty\imagewidth\else width \imagewidth \fi
+ \ifx\empty\imageheight\else height \imageheight \fi
+ {#1.pdf}%
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ \def\pdfmkdest#1{\pdfdest name{#1@} xyz}
+ \def\pdfmkpgn#1{#1@}
+ \let\linkcolor = \Cyan
+ \def\endlink{\Black\pdfendlink}
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ \def\pdfmakeoutlines{{%
+ \openin 1 \jobname.toc
+ \ifeof 1\else\bgroup
+ \closein 1
+ \indexnofonts
+ \def\tt{}
+ % thanh's hack / proper braces in bookmarks
+ \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+ \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+ %
+ \def\chapentry ##1##2##3{}
+ \def\unnumbchapentry ##1##2{}
+ \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \input \jobname.toc
+ \def\chapentry ##1##2##3{%
+ \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
+ \def\unnumbchapentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\secentry ##1##2##3##4{%
+ \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
+ \def\unnumbsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsecentry ##1##2##3##4##5{%
+ \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
+ \def\unnumbsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsubsecentry ##1##2##3##4##5##6{%
+ \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
+ \def\unnumbsubsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \input \jobname.toc
+ \egroup\fi
+ }}
+ \def\makelinks #1,{%
+ \def\params{#1}\def\E{END}%
+ \ifx\params\E
+ \let\nextmakelinks=\relax
+ \else
+ \let\nextmakelinks=\makelinks
+ \ifnum\lnkcount>0,\fi
+ \picknum{#1}%
+ \startlink attr{/Border [0 0 0]}
+ goto name{\pdfmkpgn{\the\pgn}}%
+ \linkcolor #1%
+ \advance\lnkcount by 1%
+ \endlink
+ \fi
+ \nextmakelinks
+ }
+ \def\picknum#1{\expandafter\pn#1}
+ \def\pn#1{%
+ \def\p{#1}%
+ \ifx\p\lbrace
+ \let\nextpn=\ppn
+ \else
+ \let\nextpn=\ppnn
+ \def\first{#1}
+ \fi
+ \nextpn
+ }
+ \def\ppn#1{\pgn=#1\gobble}
+ \def\ppnn{\pgn=\first}
+ \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \ifx\p\space\else\addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \fi
+ \nextsp}
+ \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ \def\pdfurl#1{%
+ \begingroup
+ \normalturnoffactive\def\@{@}%
+ \leavevmode\Red
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ % #1
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
+ \linkcolor #1\endlink}
+ \def\mkpgn#1{#1@}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\fi % \ifx\pdfoutput
\message{fonts,}
-
% Font-change commands.
-% Texinfo supports the sans serif font style, which plain TeX does not.
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf analogous to plain's \rm, etc.
\newfam\sffam
\def\sf{\fam=\sffam \tensf}
@@ -1021,8 +1032,9 @@ where each line of input produces a line of output.}
% We don't need math for this one.
\def\ttsl{\tenttsl}
-%% Try out Computer Modern fonts at \magstephalf
-\let\mainmagstep=\magstephalf
+% Use Computer Modern fonts at \magstephalf (11pt).
+\newcount\mainmagstep
+\mainmagstep=\magstephalf
% Set the font macro #1 to the font named #2, adding on the
% specified font prefix (normally `cm').
@@ -1077,22 +1089,30 @@ where each line of input produces a line of output.}
\setfont\deftt\ttshape{10}{\magstep1}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
-% Fonts for indices and small examples (9pt).
-% We actually use the slanted font rather than the italic,
-% because texinfo normally uses the slanted fonts for that.
-% Do not make many font distinctions in general in the index, since they
-% aren't very useful.
-\setfont\ninett\ttshape{9}{1000}
-\setfont\indrm\rmshape{9}{1000}
-\setfont\indit\slshape{9}{1000}
-\let\indsl=\indit
-\let\indtt=\ninett
-\let\indttsl=\ninett
-\let\indsf=\indrm
-\let\indbf=\indrm
-\setfont\indsc\scshape{10}{900}
-\font\indi=cmmi9
-\font\indsy=cmsy9
+% Fonts for indices, footnotes, small examples (9pt).
+\setfont\smallrm\rmshape{9}{1000}
+\setfont\smalltt\ttshape{9}{1000}
+\setfont\smallbf\bfshape{10}{900}
+\setfont\smallit\itshape{9}{1000}
+\setfont\smallsl\slshape{9}{1000}
+\setfont\smallsf\sfshape{9}{1000}
+\setfont\smallsc\scshape{10}{900}
+\setfont\smallttsl\ttslshape{10}{900}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for title page:
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\setfont\titleit\itbshape{10}{\magstep4}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
% Chapter (and unnumbered) fonts (17.28pt).
\setfont\chaprm\rmbshape{12}{\magstep2}
@@ -1100,7 +1120,7 @@ where each line of input produces a line of output.}
\setfont\chapsl\slbshape{10}{\magstep3}
\setfont\chaptt\ttbshape{12}{\magstep2}
\setfont\chapttsl\ttslshape{10}{\magstep3}
-\setfont\chapsf\sfbshape{12}{\magstep2}
+\setfont\chapsf\sfbshape{17}{1000}
\let\chapbf=\chaprm
\setfont\chapsc\scbshape{10}{\magstep3}
\font\chapi=cmmi12 scaled \magstep2
@@ -1137,19 +1157,15 @@ where each line of input produces a line of output.}
\setfont\ssecit\itbshape{10}{1315}
\setfont\ssecsl\slbshape{10}{1315}
\setfont\ssectt\ttbshape{12}{\magstephalf}
-\setfont\ssecttsl\ttslshape{10}{\magstep1}
+\setfont\ssecttsl\ttslshape{10}{1315}
\setfont\ssecsf\sfbshape{12}{\magstephalf}
\let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{\magstep1}
\font\sseci=cmmi12 scaled \magstephalf
-\font\ssecsy=cmsy10 scaled \magstep1
+\font\ssecsy=cmsy10 scaled 1315
% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
% but that is not a standard magnification.
-% Fonts for title page:
-\setfont\titlerm\rmbshape{12}{\magstep3}
-\let\authorrm = \secrm
-
% In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families. Since
% texinfo doesn't allow for producing subscripts and superscripts, we
@@ -1174,6 +1190,13 @@ where each line of input produces a line of output.}
\let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
\let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
\resetmathfonts}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
\def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
@@ -1190,16 +1213,21 @@ where each line of input produces a line of output.}
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
\resetmathfonts \setleading{15pt}}
\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
-\def\indexfonts{%
- \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
- \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
- \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
- \resetmathfonts \setleading{12pt}}
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \resetmathfonts \setleading{11pt}}
% Set up the default fonts, so we can use them for creating boxes.
%
\textfonts
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0
@@ -1214,13 +1242,14 @@ where each line of input produces a line of output.}
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one.
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
-\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
\let\i=\smartitalic
-\let\var=\smartitalic
-\let\dfn=\smartitalic
+\let\var=\smartslanted
+\let\dfn=\smartslanted
\let\emph=\smartitalic
-\let\cite=\smartitalic
+\let\cite=\smartslanted
\def\b#1{{\bf #1}}
\let\strong=\b
@@ -1237,22 +1266,22 @@ where each line of input produces a line of output.}
\null
}
\let\ttfont=\t
-\def\samp #1{`\tclose{#1}'\null}
-\setfont\smallrm\rmshape{8}{1000}
-\font\smallsy=cmsy9
-\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
- \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\keyrm\rmshape{8}{1000}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
\vbox{\hrule\kern-0.4pt
- \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
\kern-0.4pt\hrule}%
- \kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
% The old definition, with no lozenge:
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+% @file, @option are the same as @samp.
\let\file=\samp
-\let\url=\samp % perhaps include a hypertex \special eventually
-\def\email#1{$\langle${\tt #1}$\rangle$}
+\let\option=\samp
% @code is a modification of @t,
% which makes spaces the same size as normal in the surrounding text.
@@ -1287,43 +1316,117 @@ where each line of input produces a line of output.}
% and arrange explicitly to hyphenate at a dash.
% -- rms.
{
-\catcode`\-=\active
-\catcode`\_=\active
-\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
-% The following is used by \doprintindex to insure that long function names
-% wrap around. It is necessary for - and _ to be active before the index is
-% read from the file, as \entry parses the arguments long before \code is
-% ever called. -- mycroft
-\global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder}
+ \catcode`\-=\active
+ \catcode`\_=\active
+ %
+ \global\def\code{\begingroup
+ \catcode`\-=\active \let-\codedash
+ \catcode`\_=\active \let_\codeunder
+ \codex
+ }
+ %
+ % If we end up with any active - characters when handling the index,
+ % just treat them as a normal -.
+ \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
}
\def\realdash{-}
-\def\realunder{_}
\def\codedash{-\discretionary{}{}{}}
-\def\codeunder{\normalunderscore\discretionary{}{}{}}
+\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
\def\codex #1{\tclose{#1}\endgroup}
%\let\exp=\tclose %Was temporary
% @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect.
-%
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
+\def\kbdinputstylexxx#1{%
+ \def\arg{#1}%
+ \ifx\arg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\arg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\arg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
+% the catcodes are wrong for parsearg to work.)
+\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
+
\def\xkey{\key}
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\ttsl\look}}\fi
-\else{\tclose{\ttsl\look}}\fi}
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @url, @env, @command quotes seem unnecessary, so use \code.
+\let\url=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url. Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
% Check if we are currently using a typewriter font. Since all the
% Computer Modern typewriter fonts have zero interword stretch (and
% shrink), and it is reasonable to expect all typewriter fonts to have
% this property, we can check that font parameter.
-%
+%
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of
-% @dmn{}pt.
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
%
\def\dmn#1{\thinspace #1}
@@ -1334,11 +1437,14 @@ where each line of input produces a line of output.}
% Polish suppressed-l. --karl, 22sep96.
%\def\l#1{{\li #1}\null}
+% Explicit font changes: @r, @sc, undocumented @ii.
\def\r#1{{\rm #1}} % roman font
-% Use of \lowercase was suggested.
\def\sc#1{{\smallcaps#1}} % smallcaps font
\def\ii#1{{\it #1}} % italic font
+% @acronym downcases the argument and prints in smallcaps.
+\def\acronym#1{{\smallcaps \lowercase{#1}}}
+
% @pounds{} is a sterling sign.
\def\pounds{{\it\$}}
@@ -1349,20 +1455,23 @@ where each line of input produces a line of output.}
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
% First the title page. Must do @settitle before @titlepage.
-\def\titlefont#1{{\titlerm #1}}
-
\newif\ifseenauthor
\newif\iffinishedtitlepage
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
\def\shorttitlepage{\parsearg\shorttitlepagezzz}
\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\endgroup\page\hbox{}\page}
\def\titlepage{\begingroup \parindent=0pt \textfonts
\let\subtitlerm=\tenrm
-% I deinstalled the following change because \cmr12 is undefined.
-% This change was not in the ChangeLog anyway. --rms.
-% \let\subtitlerm=\cmr12
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
%
\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
@@ -1372,7 +1481,7 @@ where each line of input produces a line of output.}
%
% Now you can print the title using @title.
\def\title{\parsearg\titlezzz}%
- \def\titlezzz##1{\leftline{\titlefont{##1}}
+ \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
% print a rule at the page bottom also.
\finishedtitlepagefalse
\vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
@@ -1411,6 +1520,23 @@ where each line of input produces a line of output.}
% after the title page, which we certainly don't want.
\oldpage
\endgroup
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+ %
+ \ifpdf \pdfmakepagedesttrue \fi
+ %
\HEADINGSon
}
@@ -1424,10 +1550,10 @@ where each line of input produces a line of output.}
\let\thispage=\folio
-\newtoks \evenheadline % Token sequence for heading line of even pages
-\newtoks \oddheadline % Token sequence for heading line of odd pages
-\newtoks \evenfootline % Token sequence for footing line of even pages
-\newtoks \oddfootline % Token sequence for footing line of odd pages
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
% Now make Tex use those variables
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
@@ -1461,10 +1587,7 @@ where each line of input produces a line of output.}
\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
-\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
@@ -1472,12 +1595,15 @@ where each line of input produces a line of output.}
\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -\baselineskip
+ \global\advance\vsize by -\baselineskip
+}
-\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
-\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
%
}% unbind the catcode of @.
@@ -1545,39 +1671,23 @@ where each line of input produces a line of output.}
% Subroutines used in generating headings
% Produces Day Month Year style of output.
-\def\today{\number\day\space
-\ifcase\month\or
-January\or February\or March\or April\or May\or June\or
-July\or August\or September\or October\or November\or December\fi
-\space\number\year}
-
-% Use this if you want the Month Day, Year style of output.
-%\def\today{\ifcase\month\or
-%January\or February\or March\or April\or May\or June\or
-%July\or August\or September\or October\or November\or December\fi
-%\space\number\day, \number\year}
-
-% @settitle line... specifies the title of the document, for headings
-% It generates no output of its own
-
-\def\thistitle{No Title}
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
\def\settitle{\parsearg\settitlezzz}
\def\settitlezzz #1{\gdef\thistitle{#1}}
\message{tables,}
-
-% @tabs -- simple alignment
-
-% These don't work. For one thing, \+ is defined as outer.
-% So these macros cannot even be defined.
-
-%\def\tabs{\parsearg\tabszzz}
-%\def\tabszzz #1{\settabs\+#1\cr}
-%\def\tabline{\parsearg\tablinezzz}
-%\def\tablinezzz #1{\+#1\cr}
-%\def\&{&}
-
% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
% default indentation of table text
@@ -1621,11 +1731,6 @@ July\or August\or September\or October\or November\or December\fi
\itemindex{#1}%
\nobreak % This prevents a break before @itemx.
%
- % Be sure we are not still in the middle of a paragraph.
- %{\parskip = 0in
- %\par
- %}%
- %
% If the item text does not fit in the space we have, put it on a line
% by itself, and do not allow a page break either before or after that
% line. We do not start a paragraph here because then if the next
@@ -1654,13 +1759,17 @@ July\or August\or September\or October\or November\or December\fi
\itemxneedsnegativevskipfalse
\else
% The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line. Since that
- % text will be indented by \tableindent, we make the item text be in
- % a zero-width box.
+ % following text (if any) will end up on the same line.
\noindent
- \rlap{\hskip -\tableindent\box0}\ignorespaces%
- \endgroup%
- \itemxneedsnegativevskiptrue%
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
\fi
}
@@ -1671,9 +1780,10 @@ July\or August\or September\or October\or November\or December\fi
\def\xitem{\errmessage{@xitem while not in a table}}
\def\xitemx{\errmessage{@xitemx while not in a table}}
-%% Contains a kludge to get @end[description] to work
+% Contains a kludge to get @end[description] to work.
\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+% @table, @ftable, @vtable.
\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
{\obeylines\obeyspaces%
\gdef\tablex #1^^M{%
@@ -1733,7 +1843,7 @@ July\or August\or September\or October\or November\or December\fi
\def\itemize{\parsearg\itemizezzz}
\def\itemizezzz #1{%
- \begingroup % ended by the @end itemsize
+ \begingroup % ended by the @end itemize
\itemizey {#1}{\Eitemize}
}
@@ -1861,7 +1971,7 @@ July\or August\or September\or October\or November\or December\fi
\def\itemizeitem{%
\advance\itemno by 1
{\let\par=\endgraf \smallbreak}%
-\ifhmode \errmessage{\in hmode at itemizeitem}\fi
+\ifhmode \errmessage{In hmode at itemizeitem}\fi
{\parskip=0in \hskip 0pt
\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
\vadjust{\penalty 1200}}%
@@ -1879,7 +1989,7 @@ July\or August\or September\or October\or November\or December\fi
% To make preamble:
%
-% Either define widths of columns in terms of percent of \hsize:
+% Either define widths of columns in terms of percent of \hsize:
% @multitable @columnfractions .25 .3 .45
% @item ...
%
@@ -1897,13 +2007,13 @@ July\or August\or September\or October\or November\or December\fi
% the preamble, break the line within one argument and it
% will parse correctly, i.e.,
%
-% @multitable {Column 1 template} {Column 2 template} {Column 3
+% @multitable {Column 1 template} {Column 2 template} {Column 3
% template}
% Not:
-% @multitable {Column 1 template} {Column 2 template}
+% @multitable {Column 1 template} {Column 2 template}
% {Column 3 template}
-% Each new table line starts with @item, each subsequent new column
+% Each new table line starts with @item, each subsequent new column
% starts with @tab. Empty columns may be produced by supplying @tab's
% with nothing between them for as many times as empty columns are needed,
% ie, @tab@tab@tab will produce two empty columns.
@@ -1915,15 +2025,15 @@ July\or August\or September\or October\or November\or December\fi
% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
% @item first col stuff @tab second col stuff @tab third col
-% @item
-% first col stuff
-% @tab
-% second col stuff
-% @tab
-% third col
-% @item first col stuff @tab second col stuff
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
% @tab Many paragraphs of text may be used in any column.
-%
+%
% They will wrap at the width determined by the template.
% @item@tab@tab This will be in third column.
% @end multitable
@@ -1935,10 +2045,7 @@ July\or August\or September\or October\or November\or December\fi
% @multitablelinespace is space to leave between table items, baseline
% to baseline.
% 0pt means it depends on current normal line spacing.
-
-%%%%
-% Dimensions
-
+%
\newskip\multitableparskip
\newskip\multitableparindent
\newdimen\multitablecolspace
@@ -1948,117 +2055,150 @@ July\or August\or September\or October\or November\or December\fi
\multitablecolspace=12pt
\multitablelinespace=0pt
-%%%%
% Macros used to set up halign preamble:
+%
\let\endsetuptable\relax
\def\xendsetuptable{\endsetuptable}
\let\columnfractions\relax
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
-%% 2/1/96, to allow fractions to be given with more than one digit.
-\def\pickupwholefraction#1 {\global\advance\colcount by1 %
-\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
-\setuptable}
+% #1 is the part of the @columnfraction before the decimal point, which
+% is presumably either 0 or the empty string (but we don't check, we
+% just throw it away). #2 is the decimal part, which we use as the
+% percent of \hsize for this column.
+\def\pickupwholefraction#1.#2 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
+ \setuptable
+}
\newcount\colcount
-\def\setuptable#1{\def\firstarg{#1}%
-\ifx\firstarg\xendsetuptable\let\go\relax%
-\else
- \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
\else
- \ifsetpercent
- \let\go\pickupwholefraction % In this case arg of setuptable
- % is the decimal point before the
- % number given in percent of hsize.
- % We don't need this so we don't use it.
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
\else
- \global\advance\colcount by1
- \setbox0=\hbox{#1 }% Add a normal word space as a separator;
- % typically that is always in the input, anyway.
- \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
+ % typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
\fi%
- \fi%
-\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
-\fi\go}
-
-%%%%
-% multitable syntax
-\def\tab{&\hskip1sp\relax} % 2/2/96
- % tiny skip here makes sure this column space is
- % maintained, even if it is never used.
+ \fi
+ \go
+}
+% This used to have \hskip1sp. But then the space in a template line is
+% not enough. That is bad. So let's go back to just & until we
+% encounter the problem it was intended to solve again.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{&}
-%%%%
% @multitable ... @end multitable definitions:
-
+%
\def\multitable{\parsearg\dotable}
-
\def\dotable#1{\bgroup
-\let\item\cr
-\tolerance=9500
-\hbadness=9500
-\setmultitablespacing
-\parskip=\multitableparskip
-\parindent=\multitableparindent
-\overfullrule=0pt
-\global\colcount=0\relax%
-\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
- % To parse everything between @multitable and @item :
-\setuptable#1 \endsetuptable
- % Need to reset this to 0 after \setuptable.
-\global\colcount=0\relax%
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
-\halign\bgroup&\global\advance\colcount by 1\relax%
-\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- % If user has set preamble in terms of percent of \hsize
- % we will use that dimension as the width of the column, and
- % the \leftskip will keep entries from bumping into each other.
- % Table will start at left margin and final column will justify at
- % right margin.
-\ifnum\colcount=1
-\else
- \ifsetpercent
+ \vskip\parskip
+ \let\item\crcr
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
+ %
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % \everycr will reset column counter, \colcount, at the end of
+ % each line. Every column entry will cause \colcount to advance by one.
+ % The table preamble
+ % looks at the current \colcount to find the correct column width.
+ \everycr{\noalign{%
+ %
+ % \filbreak%% keeps underfull box messages off when table breaks over pages.
+ % Maybe so, but it also creates really weird page breaks when the table
+ % breaks over pages. Wouldn't \vfil be better? Wait until the problem
+ % manifests itself, so it can be fixed for real --karl.
+ \global\colcount=0\relax}}%
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup&\global\advance\colcount by 1\relax
+ \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
\else
- % If user has <not> set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace
- \advance\hsize by \multitablecolspace
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
\fi
- % In either case we will make \leftskip=\multitablecolspace:
-\leftskip=\multitablecolspace
-\fi
-\noindent##\multistrut}\cr%
- % \everycr will reset column counter, \colcount, at the end of
- % each line. Every column entry will cause \colcount to advance by one.
- % The table preamble
- % looks at the current \colcount to find the correct column width.
-\global\everycr{\noalign{%
-\filbreak%% keeps underfull box messages off when table breaks over pages.
-\global\colcount=0\relax}}
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively marking
+ % characters.
+ \noindent\ignorespaces##\unskip\multistrut}\cr
}
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
% If so, do nothing. If not, give it an appropriate dimension based on
% current baselineskip.
\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
%% strut to put in table in case some entry doesn't have descenders,
%% to keep lines equally spaced
\let\multistrut = \strut
-%% Test to see if parskip is larger than space between lines of
-%% table. If not, do nothing.
-%% If so, set to same dimension as multitablelinespace.
\else
+%% FIXME: what is \box0 supposed to be?
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
width0pt\relax} \fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
\ifdim\multitableparskip>\multitablelinespace
\global\multitableparskip=\multitablelinespace
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
@@ -2071,6 +2211,356 @@ width0pt\relax} \fi
\fi}
+\message{conditionals,}
+% Prevent errors for section commands.
+% Used in @ignore and in failing conditionals.
+\def\ignoresections{%
+ \let\chapter=\relax
+ \let\unnumbered=\relax
+ \let\top=\relax
+ \let\unnumberedsec=\relax
+ \let\unnumberedsection=\relax
+ \let\unnumberedsubsec=\relax
+ \let\unnumberedsubsection=\relax
+ \let\unnumberedsubsubsec=\relax
+ \let\unnumberedsubsubsection=\relax
+ \let\section=\relax
+ \let\subsec=\relax
+ \let\subsubsec=\relax
+ \let\subsection=\relax
+ \let\subsubsection=\relax
+ \let\appendix=\relax
+ \let\appendixsec=\relax
+ \let\appendixsection=\relax
+ \let\appendixsubsec=\relax
+ \let\appendixsubsection=\relax
+ \let\appendixsubsubsec=\relax
+ \let\appendixsubsubsection=\relax
+ \let\contents=\relax
+ \let\smallbook=\relax
+ \let\titlepage=\relax
+}
+
+% Used in nested conditionals, where we have to parse the Texinfo source
+% and so want to turn off most commands, in case they are used
+% incorrectly.
+%
+\def\ignoremorecommands{%
+ \let\defcodeindex = \relax
+ \let\defcv = \relax
+ \let\deffn = \relax
+ \let\deffnx = \relax
+ \let\defindex = \relax
+ \let\defivar = \relax
+ \let\defmac = \relax
+ \let\defmethod = \relax
+ \let\defop = \relax
+ \let\defopt = \relax
+ \let\defspec = \relax
+ \let\deftp = \relax
+ \let\deftypefn = \relax
+ \let\deftypefun = \relax
+ \let\deftypeivar = \relax
+ \let\deftypeop = \relax
+ \let\deftypevar = \relax
+ \let\deftypevr = \relax
+ \let\defun = \relax
+ \let\defvar = \relax
+ \let\defvr = \relax
+ \let\ref = \relax
+ \let\xref = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
+ \let\settitle = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\everyheading = \relax
+ \let\evenheading = \relax
+ \let\oddheading = \relax
+ \let\everyfooting = \relax
+ \let\evenfooting = \relax
+ \let\oddfooting = \relax
+ \let\headings = \relax
+ \let\include = \relax
+ \let\lowersections = \relax
+ \let\down = \relax
+ \let\raisesections = \relax
+ \let\up = \relax
+ \let\set = \relax
+ \let\clear = \relax
+ \let\item = \relax
+}
+
+% Ignore @ignore ... @end ignore.
+%
+\def\ignore{\doignore{ignore}}
+
+% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
+%
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\html{\doignore{html}}
+\def\menu{\doignore{menu}}
+\def\direntry{\doignore{direntry}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory = \comment
+
+% Ignore text until a line `@end #1'.
+%
+\def\doignore#1{\begingroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define a command to swallow text until we reach `@end #1'.
+ % This @ is a catcode 12 token (that is the normal catcode of @ in
+ % this texinfo.tex file). We change the catcode of @ below to match.
+ \long\def\doignoretext##1@end #1{\enddoignore}%
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \catcode32 = 10
+ %
+ % Ignore braces, too, so mismatched braces don't cause trouble.
+ \catcode`\{ = 9
+ \catcode`\} = 9
+ %
+ % We must not have @c interpreted as a control sequence.
+ \catcode`\@ = 12
+ %
+ % Make the letter c a comment character so that the rest of the line
+ % will be ignored. This way, the document can have (for example)
+ % @c @end ifinfo
+ % and the @end ifinfo will be properly ignored.
+ % (We've just changed @ to catcode 12.)
+ \catcode`\c = 14
+ %
+ % And now expand that command.
+ \doignoretext
+}
+
+% What we do to finish off ignored text.
+%
+\def\enddoignore{\endgroup\ignorespaces}%
+
+\newif\ifwarnedobs\warnedobsfalse
+\def\obstexwarn{%
+ \ifwarnedobs\relax\else
+ % We need to warn folks that they may have trouble with TeX 3.0.
+ % This uses \immediate\write16 rather than \message to get newlines.
+ \immediate\write16{}
+ \immediate\write16{WARNING: for users of Unix TeX 3.0!}
+ \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
+ \immediate\write16{If you are running another version of TeX, relax.}
+ \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
+ \immediate\write16{ Then upgrade your TeX installation if you can.}
+ \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
+ \immediate\write16{If you are stuck with version 3.0, run the}
+ \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
+ \immediate\write16{ to use a workaround.}
+ \immediate\write16{}
+ \global\warnedobstrue
+ \fi
+}
+
+% **In TeX 3.0, setting text in \nullfont hangs tex. For a
+% workaround (which requires the file ``dummy.tfm'' to be installed),
+% uncomment the following line:
+%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
+
+% Ignore text, except that we keep track of conditional commands for
+% purposes of nesting, up to an `@end #1' command.
+%
+\def\nestedignore#1{%
+ \obstexwarn
+ % We must actually expand the ignored text to look for the @end
+ % command, so that nested ignore constructs work. Thus, we put the
+ % text into a \vbox and then do nothing with the result. To minimize
+ % the change of memory overflow, we follow the approach outlined on
+ % page 401 of the TeXbook: make the current font be a dummy font.
+ %
+ \setbox0 = \vbox\bgroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define `@end #1' to end the box, which will in turn undefine the
+ % @end command again.
+ \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
+ %
+ % We are going to be parsing Texinfo commands. Most cause no
+ % trouble when they are used incorrectly, but some commands do
+ % complicated argument parsing or otherwise get confused, so we
+ % undefine them.
+ %
+ % We can't do anything about stray @-signs, unfortunately;
+ % they'll produce `undefined control sequence' errors.
+ \ignoremorecommands
+ %
+ % Set the current font to be \nullfont, a TeX primitive, and define
+ % all the font commands to also use \nullfont. We don't use
+ % dummy.tfm, as suggested in the TeXbook, because not all sites
+ % might have that installed. Therefore, math mode will still
+ % produce output, but that should be an extremely small amount of
+ % stuff compared to the main input.
+ %
+ \nullfont
+ \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
+ \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
+ \let\tensf=\nullfont
+ % Similarly for index fonts (mostly for their use in smallexample).
+ \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
+ \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
+ \let\smallsf=\nullfont
+ %
+ % Don't complain when characters are missing from the fonts.
+ \tracinglostchars = 0
+ %
+ % Don't bother to do space factor calculations.
+ \frenchspacing
+ %
+ % Don't report underfull hboxes.
+ \hbadness = 10000
+ %
+ % Do minimal line-breaking.
+ \pretolerance = 10000
+ %
+ % Do not execute instructions in @tex
+ \def\tex{\doignore{tex}}%
+ % Do not execute macro definitions.
+ % `c' is a comment character, so the word `macro' will get cut off.
+ \def\macro{\doignore{ma}}%
+}
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it. Make sure the catcode of space is correct to avoid
+% losing inside @example, for instance.
+%
+\def\set{\begingroup\catcode` =10
+ \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
+ \parsearg\setxxx}
+\def\setxxx#1{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ \def\temp{#2}%
+ \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
+ \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+ \fi
+ \endgroup
+}
+% Can't use \xdef to pre-expand #2 and save some time, since \temp or
+% \next or other control sequences that we've defined might get us into
+% an infinite loop. Consider `@set foo @cite{bar}'.
+\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\def\clear{\parsearg\clearxxx}
+\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+
+% @value{foo} gets the text saved in variable foo.
+{
+ \catcode`\_ = \active
+ %
+ % We might end up with active _ or - characters in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}. So \let any
+ % such active characters to their normal equivalents.
+ \gdef\value{\begingroup
+ \catcode`\-=12 \catcode`\_=12
+ \indexbreaks \let_\normalunderscore
+ \valuexxx}
+}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we \let\value to this in \indexdummies). Ones
+% whose names contain - or _ still won't work, but we can't do anything
+% about that. The command has to be fully expandable, since the result
+% winds up in the index file. This means that if the variable's value
+% contains other Texinfo commands, it's almost certain it will fail
+% (although perhaps we could fix that with sufficient work to do a
+% one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+\def\ifset{\parsearg\ifsetxxx}
+\def\ifsetxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifsetfail
+ \else
+ \expandafter\ifsetsucceed
+ \fi
+}
+\def\ifsetsucceed{\conditionalsucceed{ifset}}
+\def\ifsetfail{\nestedignore{ifset}}
+\defineunmatchedend{ifset}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+\def\ifclear{\parsearg\ifclearxxx}
+\def\ifclearxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifclearsucceed
+ \else
+ \expandafter\ifclearfail
+ \fi
+}
+\def\ifclearsucceed{\conditionalsucceed{ifclear}}
+\def\ifclearfail{\nestedignore{ifclear}}
+\defineunmatchedend{ifclear}
+
+% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
+% following, through the first @end iftex (etc.). Make `@end iftex'
+% (etc.) valid only after an @iftex.
+%
+\def\iftex{\conditionalsucceed{iftex}}
+\def\ifnothtml{\conditionalsucceed{ifnothtml}}
+\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
+\defineunmatchedend{iftex}
+\defineunmatchedend{ifnothtml}
+\defineunmatchedend{ifnotinfo}
+
+% We can't just want to start a group at @iftex (for example) and end it
+% at @end iftex, since then @set commands inside the conditional have no
+% effect (they'd get reverted at the end of the group). So we must
+% define \Eiftex to redefine itself to be its previous value. (We can't
+% just define it to fail again with an ``unmatched end'' error, since
+% the @ifset might be nested.)
+%
+\def\conditionalsucceed#1{%
+ \edef\temp{%
+ % Remember the current value of \E#1.
+ \let\nece{prevE#1} = \nece{E#1}%
+ %
+ % At the `@end #1', redefine \E#1 to be its previous value.
+ \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
+ }%
+ \temp
+}
+
+% We need to expand lots of \csname's, but we don't want to expand the
+% control sequences after we've constructed them.
+%
+\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
\message{indexing,}
% Index generation facilities
@@ -2086,12 +2576,14 @@ width0pt\relax} \fi
% the file that accumulates this index. The file's extension is foo.
% The name of an index should be no more than 2 characters long
% for the sake of vms.
-
-\def\newindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#1}}
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
}
% @defindex foo == \newindex{foo}
@@ -2100,31 +2592,37 @@ width0pt\relax} \fi
% Define @defcodeindex, like @defindex except put all entries in @code.
-\def\newcodeindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#1}}
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}
}
\def\defcodeindex{\parsearg\newcodeindex}
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
-\def\synindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#2}}%
+% The \closeout helps reduce unnecessary open files; the limit on the
+% Acorn RISC OS is a mere 16 files.
+\def\synindex#1 #2 {%
+ \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+ \expandafter\closeout\csname#1indfile\endcsname
+ \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+ \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+ \noexpand\doindex{#2}}%
}
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
-\def\syncodeindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#2}}%
+\def\syncodeindex#1 #2 {%
+ \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+ \expandafter\closeout\csname#1indfile\endcsname
+ \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+ \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+ \noexpand\docodeindex{#2}}%
}
% Define \doindex, the driver for all \fooindex macros.
@@ -2145,6 +2643,7 @@ width0pt\relax} \fi
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
\def\indexdummies{%
+\def\ { }%
% Take care of the plain tex accent commands.
\def\"{\realbackslash "}%
\def\`{\realbackslash `}%
@@ -2174,8 +2673,11 @@ width0pt\relax} \fi
% (Must be a way to avoid doing expansion at all, and thus not have to
% laboriously list every single command here.)
\def\@{@}% will be @@ when we switch to @ as escape char.
-%\let\{ = \lbracecmd
-%\let\} = \rbracecmd
+% Need these in case \tex is in effect and \{ is a \delimiter again.
+% But can't use \lbracecmd and \rbracecmd because texindex assumes
+% braces and backslashes are used only as delimiters.
+\let\{ = \mylbrace
+\let\} = \myrbrace
\def\_{{\realbackslash _}}%
\def\w{\realbackslash w }%
\def\bf{\realbackslash bf }%
@@ -2186,12 +2688,22 @@ width0pt\relax} \fi
\def\gtr{\realbackslash gtr}%
\def\less{\realbackslash less}%
\def\hat{\realbackslash hat}%
-%\def\char{\realbackslash char}%
\def\TeX{\realbackslash TeX}%
\def\dots{\realbackslash dots }%
-\def\copyright{\realbackslash copyright }%
+\def\result{\realbackslash result}%
+\def\equiv{\realbackslash equiv}%
+\def\expansion{\realbackslash expansion}%
+\def\print{\realbackslash print}%
+\def\error{\realbackslash error}%
+\def\point{\realbackslash point}%
+\def\copyright{\realbackslash copyright}%
\def\tclose##1{\realbackslash tclose {##1}}%
\def\code##1{\realbackslash code {##1}}%
+\def\uref##1{\realbackslash uref {##1}}%
+\def\url##1{\realbackslash url {##1}}%
+\def\env##1{\realbackslash env {##1}}%
+\def\command##1{\realbackslash command {##1}}%
+\def\option##1{\realbackslash option {##1}}%
\def\dotless##1{\realbackslash dotless {##1}}%
\def\samp##1{\realbackslash samp {##1}}%
\def\,##1{\realbackslash ,{##1}}%
@@ -2199,6 +2711,7 @@ width0pt\relax} \fi
\def\r##1{\realbackslash r {##1}}%
\def\i##1{\realbackslash i {##1}}%
\def\b##1{\realbackslash b {##1}}%
+\def\sc##1{\realbackslash sc {##1}}%
\def\cite##1{\realbackslash cite {##1}}%
\def\key##1{\realbackslash key {##1}}%
\def\file##1{\realbackslash file {##1}}%
@@ -2206,7 +2719,16 @@ width0pt\relax} \fi
\def\kbd##1{\realbackslash kbd {##1}}%
\def\dfn##1{\realbackslash dfn {##1}}%
\def\emph##1{\realbackslash emph {##1}}%
+\def\acronym##1{\realbackslash acronym {##1}}%
+%
+% Handle some cases of @value -- where the variable name does not
+% contain - or _, and the value does not contain any
+% (non-fully-expandable) commands.
+\let\value = \expandablevalue
+%
\unsepspaces
+% Turn off macro expansion
+\turnoffmacros
}
% If an index command is used in an @example environment, any spaces
@@ -2263,6 +2785,12 @@ width0pt\relax} \fi
%\let\tt=\indexdummyfont
\let\tclose=\indexdummyfont
\let\code=\indexdummyfont
+\let\url=\indexdummyfont
+\let\uref=\indexdummyfont
+\let\env=\indexdummyfont
+\let\acronym=\indexdummyfont
+\let\command=\indexdummyfont
+\let\option=\indexdummyfont
\let\file=\indexdummyfont
\let\samp=\indexdummyfont
\let\kbd=\indexdummyfont
@@ -2278,14 +2806,24 @@ width0pt\relax} \fi
% so we do not become unable to do a definition.
{\catcode`\@=0 \catcode`\\=\other
-@gdef@realbackslash{\}}
+ @gdef@realbackslash{\}}
\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% For \ifx comparisons.
+\def\emptymacro{\empty}
-\let\SETmarginindex=\relax %initialize!
-% workhorse for all \fooindexes
-% #1 is name of index, #2 is stuff to put there
-\def\doind #1#2{%
+% Most index entries go through here, but \dosubind is the general case.
+%
+\def\doind#1#2{\dosubind{#1}{#2}\empty}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% \empty if called from \doind, as we usually are. The main exception
+% is with defuns, which call us directly.
+%
+\def\dosubind#1#2#3{%
% Put the index entry in the margin if desired.
\ifx\SETmarginindex\relax\else
\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
@@ -2296,48 +2834,75 @@ width0pt\relax} \fi
\indexdummies % Must do this here, since \bf, etc expand at this stage
\escapechar=`\\
{%
- \let\folio=0 % We will expand all macros now EXCEPT \folio.
+ \let\folio = 0% We will expand all macros now EXCEPT \folio.
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash.
%
- % First process the index-string with all font commands turned off
- % to get the string to sort by.
- {\indexnofonts \xdef\indexsorttmp{#2}}%
+ \def\thirdarg{#3}%
%
- % Now produce the complete index entry, with both the sort key and the
- % original text, including any font commands.
+ % If third arg is present, precede it with space in sort key.
+ \ifx\thirdarg\emptymacro
+ \let\subentry = \empty
+ \else
+ \def\subentry{ #3}%
+ \fi
+ %
+ % First process the index entry with all font commands turned
+ % off to get the string to sort by.
+ {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
+ %
+ % Now the real index entry with the fonts.
\toks0 = {#2}%
+ %
+ % If third (subentry) arg is present, add it to the index
+ % string. And include a space.
+ \ifx\thirdarg\emptymacro \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ % Set up the complete index entry, with both the sort key
+ % and the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file, texindex reduces to
+ % two when writing the .??s sorted result.
\edef\temp{%
\write\csname#1indfile\endcsname{%
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
}%
- \temp
+ %
+ % If a skip is the last thing on the list now, preserve it
+ % by backing up by \lastskip, doing the \write, then inserting
+ % the skip again. Otherwise, the whatsit generated by the
+ % \write will make \lastskip zero. The result is that sequences
+ % like this:
+ % @end defun
+ % @tindex whatever
+ % @defun ...
+ % will have extra space inserted, because the \medbreak in the
+ % start of the @defun won't see the skip inserted by the @end of
+ % the previous defun.
+ %
+ % But don't do any of this if we're not in vertical mode. We
+ % don't want to do a \vskip and prematurely end a paragraph.
+ %
+ % Avoid page breaks due to these extra skips, too.
+ %
+ \iflinks
+ \ifvmode
+ \skip0 = \lastskip
+ \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
+ \fi
+ %
+ \temp % do the write
+ %
+ %
+ \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
+ \fi
}%
}%
\penalty\count255
}%
}
-\def\dosubind #1#2#3{%
-{\count10=\lastpenalty %
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\escapechar=`\\%
-{\let\folio=0%
-\def\rawbackslashxx{\indexbackslash}%
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2 #3}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
-\temp }%
-}\penalty\count10}}
-
% The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic}
% or
@@ -2370,36 +2935,30 @@ width0pt\relax} \fi
% Define the macros used in formatting output of the sorted index material.
-% This is what you call to cause a particular index to get printed.
-% Write
-% @unnumbered Function Index
-% @printindex fn
-
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
\def\printindex{\parsearg\doprintindex}
-
\def\doprintindex#1{\begingroup
\dobreak \chapheadingskip{10000}%
%
- \indexfonts \rm
+ \smallfonts \rm
\tolerance = 9500
\indexbreaks
- \def\indexbackslash{\rawbackslashxx}%
- % Index files are almost Texinfo source, but we use \ as the escape
- % character. It would be better to use @, but that's too big a change
- % to make right now.
- \catcode`\\ = 0
- \catcode`\@ = 11
- \escapechar = `\\
- \begindoublecolumns
%
% See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
\openin 1 \jobname.#1s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
% and it loses the chapter title and the aux file entries for the
% index. The easiest way to prevent this problem is to make sure
% there is some text.
- (Index is nonexistent)
+ \putwordIndexNonexistent
\else
%
% If the index file exists but is empty, then \openin leaves \ifeof
@@ -2407,33 +2966,54 @@ width0pt\relax} \fi
% it can discover if there is anything in it.
\read 1 to \temp
\ifeof 1
- (Index is empty)
+ \putwordIndexIsEmpty
\else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\rawbackslashxx}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
\input \jobname.#1s
+ \enddoublecolumns
\fi
\fi
\closein 1
- \enddoublecolumns
\endgroup}
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
-% Same as \bigskipamount except no shrink.
-% \balancecolumns gets confused if there is any shrink.
-\newskip\initialskipamount \initialskipamount 12pt plus4pt
-
-\def\initial #1{%
-{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
-\ifdim\lastskip<\initialskipamount
-\removelastskip \penalty-200 \vskip \initialskipamount\fi
-\line{\secbf#1\hfill}\kern 2pt\penalty10000}}
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \penalty -300
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ \vskip .33\baselineskip plus .1\baselineskip
+ %
+ % Do our best not to break after the initial.
+ \nobreak
+}}
% This typesets a paragraph consisting of #1, dot leaders, and then #2
% flush to the right margin. It is used for index and table of contents
% entries. The paragraph is indented by \leftskip.
%
-\def\entry #1#2{\begingroup
+\def\entry#1#2{\begingroup
%
% Start a new paragraph if necessary, so our assignments below can't
% affect previous text.
@@ -2456,12 +3036,15 @@ width0pt\relax} \fi
%
% \hangafter is reset to 1 (which is the value we want) at the start
% of each paragraph, so we need not do anything with that.
- \hangindent=2em
+ \hangindent = 2em
%
% When the entry text needs to be broken, just fill out the first line
% with blank space.
\rightskip = 0pt plus1fil
%
+ % A bit of stretch before each entry for the benefit of balancing columns.
+ \vskip 0pt plus1pt
+ %
% Start a ``paragraph'' for the index entry so the line breaking
% parameters we've set above will have an effect.
\noindent
@@ -2486,7 +3069,11 @@ width0pt\relax} \fi
% The `\ ' here is removed by the implicit \unskip that TeX does as
% part of (the primitive) \par. Without it, a spurious underfull
% \hbox ensues.
- \ #2% The page number ends the paragraph.
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ \ #2% The page number ends the paragraph.
+ \fi
\fi%
\par
\endgroup}
@@ -2515,24 +3102,41 @@ width0pt\relax} \fi
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
% Grab any single-column material above us.
- \output = {\global\setbox\partialpage
- =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
- \eject
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
%
- % Now switch to the double-column output routine.
- \output={\doublecolumnout}%
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
%
% Change the page size parameters. We could do this once outside this
% routine, in each of @smallbook, @afourpaper, and the default 8.5x11
% format, but then we repeat the same computation. Repeating a couple
% of assignments once per index is clearly meaningless for the
- % execution time, so we may as well do it once.
+ % execution time, so we may as well do it in one place.
%
% First we halve the line length, less a little for the gutter between
% the columns. We compute the gutter based on the line length, so it
% changes automatically with the paper format. The magic constant
- % below is chosen so that the gutter has the same value (well, +- <
- % 1pt) as it did when we hard-coded it.
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
%
% We put the result in a separate register, \doublecolumhsize, so we
% can restore it in \pagesofar, after \hsize itself has (potentially)
@@ -2545,109 +3149,140 @@ width0pt\relax} \fi
%
% Double the \vsize as well. (We don't need a separate register here,
% since nobody clobbers \vsize.)
+ \advance\vsize by -\ht\partialpage
\vsize = 2\vsize
}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
\def\doublecolumnout{%
\splittopskip=\topskip \splitmaxdepth=\maxdepth
% Get the available space for the double columns -- the normal
% (undoubled) page height minus any material left over from the
% previous page.
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
- % box0 will be the left-hand column, box1 the right.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ %
+ % box0 will be the left-hand column, box2 the right.
\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
\onepageout\pagesofar
- \unvbox255 \penalty\outputpenalty
+ \unvbox255
+ \penalty\outputpenalty
}
\def\pagesofar{%
- % The contents of the output page -- any previous material,
- % followed by the two boxes we just split.
+ % Re-output the contents of the output page -- any previous material,
+ % followed by the two boxes we just split, in box0 and box2.
\unvbox\partialpage
+ %
\hsize = \doublecolumnhsize
- \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
}
\def\enddoublecolumns{%
- \output={\balancecolumns}\eject % split what we have
- \endgroup
- % Back to normal single-column typesetting, but take account of the
- % fact that we just accumulated some stuff on the output page.
- \pagegoal=\vsize
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
}
\def\balancecolumns{%
- % Called on the last page of the double column material.
- \setbox0=\vbox{\unvbox255}%
+ % Called at the end of the double column material.
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
\dimen@ = \ht0
\advance\dimen@ by \topskip
\advance\dimen@ by-\baselineskip
- \divide\dimen@ by 2
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
\splittopskip = \topskip
% Loop until we get a decent breakpoint.
- {\vbadness=10000 \loop \global\setbox3=\copy0
- \global\setbox1=\vsplit3 to\dimen@
- \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}%
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
\setbox0=\vbox to\dimen@{\unvbox1}%
\setbox2=\vbox to\dimen@{\unvbox3}%
+ %
\pagesofar
}
-\catcode `\@=\other
+\catcode`\@ = \other
\message{sectioning,}
-% Define chapters, sections, etc.
+% Chapters, sections, etc.
-\newcount \chapno
-\newcount \secno \secno=0
-\newcount \subsecno \subsecno=0
-\newcount \subsubsecno \subsubsecno=0
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount \appendixno \appendixno = `\@
-\def\appendixletter{\char\the\appendixno}
-
-\newwrite \contentsfile
-% This is called from \setfilename.
-\def\opencontents{\openout \contentsfile = \jobname.toc}
+\newcount\appendixno \appendixno = `\@
+% \def\appendixletter{\char\the\appendixno}
+% We do the following for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
% Each @chapter defines this as the name of the chapter.
-% page headings and footings can use it. @section does likewise
-
-\def\thischapter{} \def\thissection{}
-\def\seccheck#1{\if \pageno<0 %
-\errmessage{@#1 not allowed after generating table of contents}\fi
-%
-}
-
-\def\chapternofonts{%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\def\result{\realbackslash result}
-\def\equiv{\realbackslash equiv}
-\def\expansion{\realbackslash expansion}
-\def\print{\realbackslash print}
-\def\TeX{\realbackslash TeX}
-\def\dots{\realbackslash dots}
-\def\copyright{\realbackslash copyright}
-\def\tt{\realbackslash tt}
-\def\bf{\realbackslash bf }
-\def\w{\realbackslash w}
-\def\less{\realbackslash less}
-\def\gtr{\realbackslash gtr}
-\def\hat{\realbackslash hat}
-\def\char{\realbackslash char}
-\def\tclose##1{\realbackslash tclose {##1}}
-\def\code##1{\realbackslash code {##1}}
-\def\samp##1{\realbackslash samp {##1}}
-\def\r##1{\realbackslash r {##1}}
-\def\b##1{\realbackslash b {##1}}
-\def\key##1{\realbackslash key {##1}}
-\def\file##1{\realbackslash file {##1}}
-\def\kbd##1{\realbackslash kbd {##1}}
-% These are redefined because @smartitalic wouldn't work inside xdef.
-\def\i##1{\realbackslash i {##1}}
-\def\cite##1{\realbackslash cite {##1}}
-\def\var##1{\realbackslash var {##1}}
-\def\emph##1{\realbackslash emph {##1}}
-\def\dfn##1{\realbackslash dfn {##1}}
-}
+% page headings and footings can use it. @section does likewise.
+\def\thischapter{}
+\def\thissection{}
\newcount\absseclevel % used to calculate proper heading level
\newcount\secbase\secbase=0 % @raise/lowersections modify this count
@@ -2719,57 +3354,59 @@ width0pt\relax} \fi
\fi
}
-
+% @chapter, @appendix, @unnumbered.
\def\thischaptername{No Chapter Title}
\outer\def\chapter{\parsearg\chapteryyy}
\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz #1{\seccheck{chapter}%
+\def\chapterzzz #1{%
\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
+\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
\chapmacro {#1}{\the\chapno}%
\gdef\thissection{#1}%
\gdef\thischaptername{#1}%
% We don't substitute the actual chapter name into \thischapter
% because we don't want its macros evaluated now.
\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
-{\chapternofonts%
-\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\the\chapno}}}%
+\temp
+\donoderef
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
\global\let\subsubsection = \numberedsubsubsec
-}}
+}
\outer\def\appendix{\parsearg\appendixyyy}
\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
-\def\appendixzzz #1{\seccheck{appendix}%
+\def\appendixzzz #1{%
\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \appendixno by 1 \message{Appendix \appendixletter}%
+\global\advance \appendixno by 1
+\message{\putwordAppendix\space \appendixletter}%
\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
\gdef\thissection{#1}%
\gdef\thischaptername{#1}%
\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
-{\chapternofonts%
-\edef\temp{{\realbackslash chapentry
- {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\putwordAppendix{} \appendixletter}}}%
+\temp
+\appendixnoderef
\global\let\section = \appendixsec
\global\let\subsection = \appendixsubsec
\global\let\subsubsection = \appendixsubsubsec
-}}
+}
% @centerchap is like @unnumbered, but the heading is centered.
\outer\def\centerchap{\parsearg\centerchapyyy}
\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+% @top is like @unnumbered.
\outer\def\top{\parsearg\unnumberedyyy}
+
\outer\def\unnumbered{\parsearg\unnumberedyyy}
\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
-\def\unnumberedzzz #1{\seccheck{unnumbered}%
+\def\unnumberedzzz #1{%
\secno=0 \subsecno=0 \subsubsecno=0
%
% This used to be simply \message{#1}, but TeX fully expands the
@@ -2781,146 +3418,139 @@ width0pt\relax} \fi
% Anyway, we don't want the fully-expanded definition of @cite to appear
% as a result of the \message, we just want `@cite' itself. We use
% \the<toks register> to achieve this: TeX expands \the<toks> only once,
-% simply yielding the contents of the <toks register>.
+% simply yielding the contents of <toks register>. (We also do this for
+% the toc entries.)
\toks0 = {#1}\message{(\the\toks0)}%
%
\unnumbchapmacro {#1}%
\gdef\thischapter{#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
\global\let\section = \unnumberedsec
\global\let\subsection = \unnumberedsubsec
\global\let\subsubsection = \unnumberedsubsubsec
-}}
+}
+% Sections.
\outer\def\numberedsec{\parsearg\secyyy}
\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
-\def\seczzz #1{\seccheck{section}%
+\def\seczzz #1{%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash secentry %
-{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\the\chapno}{\the\secno}}}%
+\temp
+\donoderef
+\nobreak
+}
\outer\def\appendixsection{\parsearg\appendixsecyyy}
\outer\def\appendixsec{\parsearg\appendixsecyyy}
\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
-\def\appendixsectionzzz #1{\seccheck{appendixsection}%
+\def\appendixsectionzzz #1{%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash secentry %
-{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\appendixletter}{\the\secno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
-\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
+\def\unnumberedseczzz #1{%
\plainsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+% Subsections.
\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
-\def\numberedsubseczzz #1{\seccheck{subsection}%
+\def\numberedsubseczzz #1{%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsecentry %
-{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
-\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
+\def\appendixsubseczzz #1{%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsecentry %
-{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
-\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
+\def\unnumberedsubseczzz #1{%
\plainsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+% Subsubsections.
\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
-\def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
+\def\numberedsubsubseczzz #1{%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1}
{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsubsecentry %
- {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
- {\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
-\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
+\def\appendixsubsubseczzz #1{%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1}
{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsubsecentry{#1}%
- {\appendixletter}
- {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
-\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
+\def\unnumberedsubsubseczzz #1{%
\plainsubsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
% These are variants which are not "outer", so they can appear in @ifinfo.
% Actually, they should now be obsolete; ordinary section commands should work.
@@ -2949,8 +3579,7 @@ width0pt\relax} \fi
% Define @majorheading, @heading and @subheading
-% NOTE on use of \vbox for chapter headings, section headings, and
-% such:
+% NOTE on use of \vbox for chapter headings, section headings, and such:
% 1) We use \vbox rather than the earlier \line to permit
% overlong headings to fold.
% 2) \hyphenpenalty is set to 10000 because hyphenation in a
@@ -2997,12 +3626,12 @@ width0pt\relax} \fi
\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-\def\CHAPPAGoff{
+\def\CHAPPAGoff{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chapbreak
\global\let\pagealignmacro=\chappager}
-\def\CHAPPAGon{
+\def\CHAPPAGon{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chappager
\global\let\pagealignmacro=\chappager
@@ -3056,7 +3685,7 @@ width0pt\relax} \fi
\def\unnchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 10000 %
+ \rm #1\hfill}}\bigskip \par\nobreak
}
\def\chfopen #1#2{\chapoddpage {\chapfonts
@@ -3067,7 +3696,7 @@ width0pt\relax} \fi
\def\centerchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt
- \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
+ \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
}
\def\CHAPFopen{
@@ -3096,7 +3725,7 @@ width0pt\relax} \fi
% Print any size section title.
-%
+%
% #1 is the section type (sec/subsec/subsubsec), #2 is the section
% number (maybe empty), #3 the text.
\def\sectionheading#1#2#3{%
@@ -3120,43 +3749,77 @@ width0pt\relax} \fi
}
-\message{toc printing,}
-% Finish up the main text and prepare to read what we've written
-% to \contentsfile.
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc. We supply {\folio} at the end of the
+% argument, which will end up as the last argument to the \...entry macro.
+%
+% We open the .toc file here instead of at @setfilename or any other
+% given time so that @contents can be put in the document anywhere.
+%
+\newif\iftocfileopened
+\def\writetocentry#1{%
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ \iflinks \write\tocfile{#1{\folio}}\fi
+}
\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Finish up the main text and prepare to read what we've written
+% to \tocfile.
+%
\def\startcontents#1{%
% If @setchapternewpage on, and @headings double, the contents should
% start on an odd page, unlike chapters. Thus, we maintain
% \contentsalignmacro in parallel with \pagealignmacro.
% From: Torbjorn Granlund <tege@matematik.su.se>
\contentsalignmacro
- \immediate\closeout \contentsfile
- \ifnum \pageno>0
- \pageno = -1 % Request roman numbered pages.
- \fi
+ \immediate\closeout\tocfile
+ %
% Don't need to put `Contents' or `Short Contents' in the headline.
% It is abundantly clear what they are.
\unnumbchapmacro{#1}\def\thischapter{}%
+ \savepageno = \pageno
\begingroup % Set up to handle contents files properly.
\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
- \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
+ % We can't do this, because then an actual ^ in a section
+ % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
+ %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
\raggedbottom % Worry more about breakpoints than the bottom.
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
}
% Normal (long) toc.
-\outer\def\contents{%
- \startcontents{\putwordTableofContents}%
- \input \jobname.toc
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \pdfmakeoutlines
\endgroup
- \vfill \eject
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
}
% And just the chapters.
-\outer\def\summarycontents{%
- \startcontents{\putwordShortContents}%
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
%
\let\chapentry = \shortchapentry
\let\unnumbchapentry = \shortunnumberedentry
@@ -3172,12 +3835,23 @@ width0pt\relax} \fi
\def\unnumbsubsecentry ##1##2{}
\def\subsubsecentry ##1##2##3##4##5##6{}
\def\unnumbsubsubsecentry ##1##2{}
- \input \jobname.toc
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup
- \vfill \eject
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
}
\let\shortcontents = \summarycontents
+\ifpdf
+ \pdfcatalog{/PageMode /UseOutlines}%
+\fi
+
% These macros generate individual entries in the table of contents.
% The first argument is the chapter or section name.
% The last argument is the page number.
@@ -3188,7 +3862,7 @@ width0pt\relax} \fi
% See comments in \dochapentry re vbox and related settings
\def\shortchapentry#1#2#3{%
- \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
}
% Typeset the label for a chapter or appendix for the short contents.
@@ -3196,10 +3870,14 @@ width0pt\relax} \fi
% We could simplify the code here by writing out an \appendixentry
% command in the toc file for appendices, instead of using \chapentry
% for both, but it doesn't seem worth it.
-\setbox0 = \hbox{\shortcontrm \putwordAppendix }
-\newdimen\shortappendixwidth \shortappendixwidth = \wd0
-
+%
+\newdimen\shortappendixwidth
+%
\def\shortchaplabel#1{%
+ % Compute width of word "Appendix", may change with language.
+ \setbox0 = \hbox{\shortcontrm \putwordAppendix}%
+ \shortappendixwidth = \wd0
+ %
% We typeset #1 in a box of constant width, regardless of the text of
% #1, so the chapter titles will come out aligned.
\setbox0 = \hbox{#1}%
@@ -3214,7 +3892,7 @@ width0pt\relax} \fi
}
\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
-\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
+\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
% Sections.
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
@@ -3241,35 +3919,36 @@ width0pt\relax} \fi
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
\begingroup
\chapentryfonts
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup
\nobreak\vskip .25\baselineskip plus.1\baselineskip
}
\def\dosecentry#1#2{\begingroup
\secentryfonts \leftskip=\tocindent
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsecentry#1#2{\begingroup
\subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsubsecentry#1#2{\begingroup
\subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
% Final typesetting of a toc entry; we use the same \entry macro as for
% the index entries, but we want to suppress hyphenation here. (We
% can't do that in the \entry macro, since index entries might consist
% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
-%
-% \turnoffactive is for the sake of @" used for umlauts.
\def\tocentry#1#2{\begingroup
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
- \entry{\turnoffactive #1}{\turnoffactive #2}%
+ % Do not use \turnoffactive in these arguments. Since the toc is
+ % typeset in cmr, so characters such as _ would come out wrong; we
+ % have to do the usual translation tricks.
+ \entry{#1}{#2}%
\endgroup}
% Space between chapter (or whatever) number and the title.
@@ -3285,6 +3964,7 @@ width0pt\relax} \fi
\message{environments,}
+% @foo ... @end foo.
% Since these characters are used in examples, it should be an even number of
% \tt widths. Each \tt character is 1en, so two makes it 1em.
@@ -3335,31 +4015,36 @@ width0pt\relax} \fi
% But \@ or @@ will get a plain tex @ character.
\def\tex{\begingroup
-\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
-\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
-\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
-\catcode `\%=14
-\catcode 43=12 % plus
-\catcode`\"=12
-\catcode`\==12
-\catcode`\|=12
-\catcode`\<=12
-\catcode`\>=12
-\escapechar=`\\
-%
-\let\,=\ptexcomma
-\let\~=\ptextilde
-\let\{=\ptexlbrace
-\let\}=\ptexrbrace
-\let\.=\ptexdot
-\let\*=\ptexstar
-\let\dots=\ptexdots
-\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}
-\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}
-\def\@{@}%
-\let\bullet=\ptexbullet
-\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
-%
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+ \catcode `\%=14
+ \catcode 43=12 % plus
+ \catcode`\"=12
+ \catcode`\==12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\*=\ptexstar
+ \let\t=\ptext
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
\let\Etex=\endgroup}
% Define @lisp ... @endlisp.
@@ -3404,8 +4089,8 @@ width0pt\relax} \fi
% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
\let\nonarrowing=\relax
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \cartouche: draw rectangle w/rounded corners around argument
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
\font\circle=lcircle10
\newdimen\circthick
\newdimen\cartouter\newdimen\cartinner
@@ -3432,9 +4117,9 @@ width0pt\relax} \fi
\cartinner=\hsize \advance\cartinner by-\lskip
\advance\cartinner by-\rskip
\cartouter=\hsize
- \advance\cartouter by 18pt % allow for 3pt kerns on either
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
% side, and for 6pt waste from
-% each corner char
+% each corner char, and rule thickness
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
% Flag to tell @lisp, etc., not to narrow margin.
\let\nonarrowing=\comment
@@ -3488,48 +4173,52 @@ width0pt\relax} \fi
\fi
}
-% To ending an @example-like environment, we first end the paragraph
-% (via \afterenvbreak's vertical glue), and then the group. That way we
-% keep the zero \parskip that the environments set -- \parskip glue
-% will be inserted at the beginning of the next paragraph in the
-% document, after the environment.
+% Define the \E... control sequence only if we are inside the particular
+% environment, so the error checking in \end will work.
%
-\def\nonfillfinish{\afterenvbreak\endgroup}%
+% To end an @example-like environment, we first end the paragraph (via
+% \afterenvbreak's vertical glue), and then the group. That way we keep
+% the zero \parskip that the environments set -- \parskip glue will be
+% inserted at the beginning of the next paragraph in the document, after
+% the environment.
+%
+\def\nonfillfinish{\afterenvbreak\endgroup}
-% This macro is
+% @lisp: indented, narrowed, typewriter font.
\def\lisp{\begingroup
\nonfillstart
\let\Elisp = \nonfillfinish
\tt
- \rawbackslash % have \ input char produce \ char from current font
- \gobble
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
}
-% Define the \E... control sequence only if we are inside the
-% environment, so the error checking in \end will work.
-%
-% We must call \lisp last in the definition, since it reads the
-% return following the @example (or whatever) command.
-%
+% @example: Same as @lisp.
\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
-\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
-\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-% @smallexample and @smalllisp. This is not used unless the @smallbook
-% command is given. Originally contributed by Pavel@xerox.
+% @small... is usually equivalent to the non-small (@smallbook
+% redefines). We must call \example (or whatever) last in the
+% definition, since it reads the return following the @example (or
+% whatever) command.
+%
+% This actually allows (for example) @end display inside an
+% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
%
+\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
+\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
+\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
+\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
+
+% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
+% Originally contributed by Pavel@xerox.
\def\smalllispx{\begingroup
- \nonfillstart
- \let\Esmalllisp = \nonfillfinish
- \let\Esmallexample = \nonfillfinish
- %
- % Smaller fonts for small examples.
- \indexfonts \tt
- \rawbackslash % make \ output the \ character from the current font (tt)
- \gobble
+ \def\Esmalllisp{\nonfillfinish\endgroup}%
+ \def\Esmallexample{\nonfillfinish\endgroup}%
+ \smallfonts
+ \lisp
}
-% This is @display; same as @lisp except use roman font.
+% @display: same as @lisp except keep current font.
%
\def\display{\begingroup
\nonfillstart
@@ -3537,7 +4226,15 @@ width0pt\relax} \fi
\gobble
}
-% This is @format; same as @display except don't narrow margins.
+% @smalldisplay (when @smallbook): @display plus smaller fonts.
+%
+\def\smalldisplayx{\begingroup
+ \def\Esmalldisplay{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \display
+}
+
+% @format: same as @display except don't narrow margins.
%
\def\format{\begingroup
\let\nonarrowing = t
@@ -3546,20 +4243,27 @@ width0pt\relax} \fi
\gobble
}
-% @flushleft (same as @format) and @flushright.
+% @smallformat (when @smallbook): @format plus smaller fonts.
%
-\def\flushleft{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eflushleft = \nonfillfinish
- \gobble
+\def\smallformatx{\begingroup
+ \def\Esmallformat{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \format
}
+
+% @flushleft (same as @format).
+%
+\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
+
+% @flushright.
+%
\def\flushright{\begingroup
\let\nonarrowing = t
\nonfillstart
\let\Eflushright = \nonfillfinish
\advance\leftskip by 0pt plus 1fill
- \gobble}
+ \gobble
+}
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
% and narrows the margins.
@@ -3582,9 +4286,11 @@ width0pt\relax} \fi
\fi
}
+
\message{defuns,}
-% Define formatter for defuns
-% First, allow user to change definition object font (\df) internally
+% @defun etc.
+
+% Allow user to change definition object font (\df) internally
\def\setdeffont #1 {\csname DEF#1\endcsname}
\newskip\defbodyindent \defbodyindent=.4in
@@ -3618,16 +4324,17 @@ width0pt\relax} \fi
% Definitions of (, ) and & used in args for functions.
% This is the definition of ( outside of all parentheses.
-\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
-\global\advance\parencount by 1 }
+\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
+ \global\advance\parencount by 1
+}
%
% This is the definition of ( when already inside a level of parens.
\gdef\opnested{\char`\(\global\advance\parencount by 1 }
%
\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
-% also in that case restore the outer-level definition of (.
-\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
-\global\advance \parencount by -1 }
+ % also in that case restore the outer-level definition of (.
+ \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
+ \global\advance \parencount by -1 }
% If we encounter &foo, then turn on ()-hacking afterwards
\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
%
@@ -3635,8 +4342,17 @@ width0pt\relax} \fi
} % End of definition inside \activeparens
%% These parens (in \boldbrax) actually are a little bolder than the
%% contained text. This is especially needed for [ and ]
-\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
-\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
+\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
+\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
+\let\ampnr = \&
+\def\lbrb{{\bf\char`\[}}
+\def\rbrb{{\bf\char`\]}}
+
+% Active &'s sneak into the index arguments, so make sure it's defined.
+{
+ \catcode`& = 13
+ \global\let& = \ampnr
+}
% First, defname, which formats the header line itself.
% #1 should be the function name.
@@ -3647,20 +4363,18 @@ width0pt\relax} \fi
% outside the @def...
\dimen2=\leftskip
\advance\dimen2 by -\defbodyindent
-\dimen3=\rightskip
-\advance\dimen3 by -\defbodyindent
-\noindent %
+\noindent
\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %
+\parshape 2 0in \dimen0 \defargsindent \dimen1
% Now output arg 2 ("Function" or some such)
% ending at \deftypemargin from the right margin,
% but stuck inside a box of width 0 so it does not interfere with linebreaking
{% Adjust \hsize to exclude the ambient margins,
% so that \rightline will obey them.
-\advance \hsize by -\dimen2 \advance \hsize by -\dimen3
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
+\advance \hsize by -\dimen2
+\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
% Make all lines underfull and no complaints:
\tolerance=10000 \hbadness=10000
\advance\leftskip by -\defbodyindent
@@ -3681,23 +4395,62 @@ width0pt\relax} \fi
\def#1{\endgraf\endgroup\medbreak}%
\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup %
\catcode 61=\active % 61 is `='
\obeylines\activeparens\spacesplit#3}
-\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+%
+\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
+% Used for @deftypemethod and @deftypeivar.
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by a space, is the class name.
+% #5 is the method's return type.
+%
+\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
+
+% Used for @deftypeop. The change from \deftypemethparsebody is an
+% extra argument at the beginning which is the `category', instead of it
+% being the hardwired string `Method' or `Instance Variable'. We have
+% to account for this both in the \...x definition and in parsing the
+% input at hand. Thus also need a control sequence (passed as #5) for
+% the \E... definition to assign the category name to.
+%
+\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 ##3 {%
+ \def#4{##1}%
+ \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
+
\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
@@ -3706,7 +4459,7 @@ width0pt\relax} \fi
\def#2##1 ##2 {\def#4{##1}%
\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
@@ -3721,7 +4474,7 @@ width0pt\relax} \fi
\def#1{\endgraf\endgroup\medbreak}%
\def#2{\begingroup\obeylines\spacesplit#3}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup %
\catcode 61=\active %
@@ -3729,7 +4482,7 @@ width0pt\relax} \fi
% This is used for \def{tp,vr}parsebody. It could probably be used for
% some of the others, too, with some judicious conditionals.
-%
+%
\def\parsebodycommon#1#2#3{%
\begingroup\inENV %
\medbreak %
@@ -3738,7 +4491,7 @@ width0pt\relax} \fi
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
\parindent=0in
- \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+ \advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines
}
@@ -3763,17 +4516,16 @@ width0pt\relax} \fi
}
% Fine, but then we have to eventually remove the \empty *and* the
-% braces (if any). That's what this does, putting the result in \tptemp.
-%
-\def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}%
+% braces (if any). That's what this does.
+%
+\def\removeemptybraces\empty#1\relax{#1}
% After \spacesplit has done its work, this is called -- #1 is the final
% thing to call, #2 the type name (which starts with \empty), and #3
% (which might be empty) the arguments.
-%
+%
\def\parsetpheaderline#1#2#3{%
- \removeemptybraces#2\relax
- #1{\tptemp}{#3}%
+ #1{\removeemptybraces#2\relax}{#3}%
}%
\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
@@ -3784,7 +4536,7 @@ width0pt\relax} \fi
\def#2##1 ##2 {\def#4{##1}%
\begingroup\obeylines\spacesplit{#3{##2}}}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\spacesplit{#3{#5}}}
@@ -3808,16 +4560,17 @@ width0pt\relax} \fi
% First, define the processing that is wanted for arguments of \defun
% Use this to expand the args and terminate the paragraph they make up
-\def\defunargs #1{\functionparens \sl
+\def\defunargs#1{\functionparens \sl
% Expand, preventing hyphenation at `-' chars.
% Note that groups don't affect changes in \hyphenchar.
-\hyphenchar\tensl=0
+% Set the font temporarily and use \font in case \setfont made \tensl a macro.
+{\tensl\hyphenchar\font=0}%
#1%
-\hyphenchar\tensl=45
-\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
+{\tensl\hyphenchar\font=45}%
+\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
\interlinepenalty=10000
\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
+\endgraf\nobreak\vskip -\parskip\nobreak
}
\def\deftypefunargs #1{%
@@ -3828,7 +4581,7 @@ width0pt\relax} \fi
\tclose{#1}% avoid \code because of side effects on active chars
\interlinepenalty=10000
\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
+\endgraf\nobreak\vskip -\parskip\nobreak
}
% Do complete processing of one @defun or @defunx line already parsed.
@@ -3847,7 +4600,7 @@ width0pt\relax} \fi
\def\defun{\defparsebody\Edefun\defunx\defunheader}
\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Function}%
+\begingroup\defname {#1}{\putwordDeffunc}%
\defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
@@ -3861,7 +4614,7 @@ width0pt\relax} \fi
% #1 is the data type, #2 the name, #3 the args.
\def\deftypefunheaderx #1#2 #3\relax{%
\doind {fn}{\code{#2}}% Make entry in function index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
\deftypefunargs {#3}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
@@ -3892,7 +4645,7 @@ width0pt\relax} \fi
\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Macro}%
+\begingroup\defname {#1}{\putwordDefmac}%
\defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
@@ -3902,42 +4655,77 @@ width0pt\relax} \fi
\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Special Form}%
+\begingroup\defname {#1}{\putwordDefspec}%
\defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
-% This definition is run if you use @defunx
-% anywhere other than immediately after a @defun or @defunx.
-
-\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
-\def\defunx #1 {\errmessage{@defunx in invalid context}}
-\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
-\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
-\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
-\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
-
-% @defmethod, and so on
-
-% @defop {Funny Method} foo-class frobnicate argument
-
+% @defop CATEGORY CLASS OPERATION ARG...
+%
\def\defop #1 {\def\defoptype{#1}%
\defopparsebody\Edefop\defopx\defopheader\defoptype}
-
-\def\defopheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
-\begingroup\defname {#2}{\defoptype{} on #1}%
+%
+\def\defopheader#1#2#3{%
+\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
+\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
\defunargs {#3}\endgroup %
}
-% @defmethod == @defop Method
+% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
+%
+\def\deftypeop #1 {\def\deftypeopcategory{#1}%
+ \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
+ \deftypeopcategory}
+%
+% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
+\def\deftypeopheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}
+ {\deftypeopcategory\ \putwordon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
-\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+% @deftypemethod CLASS TYPE METHOD ARG...
+%
+\def\deftypemethod{%
+ \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
+%
+% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
+\def\deftypemethodheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
-\def\defmethodheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% entry in function index
-\begingroup\defname {#2}{Method on #1}%
-\defunargs {#3}\endgroup %
+% @deftypeivar CLASS TYPE VARNAME
+%
+\def\deftypeivar{%
+ \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
+%
+% #1 is the class name, #2 the data type, #3 the variable name.
+\def\deftypeivarheader#1#2#3{%
+ \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
+ \begingroup
+ \defname{#3}{\putwordInstanceVariableof\ \code{#1}}%
+ \defvarargs{#3}%
+ \endgroup
+}
+
+% @defmethod == @defop Method
+%
+\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+%
+% #1 is the class name, #2 the method name, #3 the args.
+\def\defmethodheader#1#2#3{%
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{#2}{\putwordMethodon\ \code{#1}}%
+ \defunargs{#3}%
+ \endgroup
}
% @defcv {Class Option} foo-class foo-flag
@@ -3946,37 +4734,30 @@ width0pt\relax} \fi
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
\def\defcvarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{\defcvtype{} of #1}%
+\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
+\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
\defvarargs {#3}\endgroup %
}
-% @defivar == @defcv {Instance Variable}
-
+% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
+%
\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
-
-\def\defivarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{Instance Variable of #1}%
-\defvarargs {#3}\endgroup %
+%
+\def\defivarheader#1#2#3{%
+ \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
+ \begingroup
+ \defname{#2}{\putwordInstanceVariableof\ #1}%
+ \defvarargs{#3}%
+ \endgroup
}
-% These definitions are run if you use @defmethodx, etc.,
-% anywhere other than immediately after a @defmethod, etc.
-
-\def\defopx #1 {\errmessage{@defopx in invalid context}}
-\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
-\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
-\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
-
-% Now @defvar
-
+% @defvar
% First, define the processing that is wanted for arguments of @defvar.
% This is actually simple: just print them in roman.
% This must expand the args and terminate the paragraph they make up
\def\defvarargs #1{\normalparens #1%
\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000}
+\endgraf\nobreak\vskip -\parskip\nobreak}
% @defvr Counter foo-count
@@ -3990,7 +4771,7 @@ width0pt\relax} \fi
\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{Variable}%
+\begingroup\defname {#1}{\putwordDefvar}%
\defvarargs {#2}\endgroup %
}
@@ -3999,7 +4780,7 @@ width0pt\relax} \fi
\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{User Option}%
+\begingroup\defname {#1}{\putwordDefopt}%
\defvarargs {#2}\endgroup %
}
@@ -4007,33 +4788,26 @@ width0pt\relax} \fi
\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
-% #1 is the data type. #2 is the name.
+% #1 is the data type. #2 is the name, perhaps followed by text that
+% is actually part of the data type, which should not be put into the index.
\def\deftypevarheader #1#2{%
-\doind {vr}{\code{#2}}% Make entry in variables index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
+\dovarind#2 \relax% Make entry in variables index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
+\endgraf\nobreak\vskip -\parskip\nobreak
\endgroup}
+\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
% @deftypevr {Global Flag} int enable
\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
-\def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
+\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
+\endgraf\nobreak\vskip -\parskip\nobreak
\endgroup}
-% This definition is run if you use @defvarx
-% anywhere other than immediately after a @defvar or @defvarx.
-
-\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
-\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
-\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
-\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
-\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
-
% Now define @deftp
% Args are printed in bold, a slight difference from @defvar.
@@ -4046,51 +4820,394 @@ width0pt\relax} \fi
\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
-% This definition is run if you use @deftpx, etc
-% anywhere other than immediately after a @deftp, etc.
+% These definitions are used if you use @defunx (etc.)
+% anywhere other than immediately after a @defun or @defunx.
+%
+\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
+\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
+\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
+\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
+\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
+\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
+\def\defopx#1 {\errmessage{@defopx in invalid context}}
+\def\defspecx#1 {\errmessage{@defspecx in invalid context}}
+\def\deftpx#1 {\errmessage{@deftpx in invalid context}}
+\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
+\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
+\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
+\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
+\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
+\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
+\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
+\def\defunx#1 {\errmessage{@defunx in invalid context}}
+\def\defvarx#1 {\errmessage{@defvarx in invalid context}}
+\def\defvrx#1 {\errmessage{@defvrx in invalid context}}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scanmacro#1{%
+ \begingroup \newlinechar`\^^M
+ % Undo catcode changes of \startcontents and \doprintindex
+ \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ \toks0={#1\endinput}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \let\xeatspaces\eatspaces
+ \input \jobname.tmp
+ \endgroup
+}
+\else
+\def\scanmacro#1{%
+\begingroup \newlinechar`\^^M
+% Undo catcode changes of \startcontents and \doprintindex
+\catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
+\fi
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+\def\macrolist{} % List of all defined macros in the form
+ % \do\macro1\do\macro2...
+
+% Utility routines.
+% Thisdoes \let #1 = #2, except with \csnames.
+\def\cslet#1#2{%
+\expandafter\expandafter
+\expandafter\let
+\expandafter\expandafter
+\csname#1\endcsname
+\csname#2\endcsname}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=12\catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\macrobodyctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\{=12
+ \catcode`\}=12
+ \catcode`\@=12
+ \catcode`\^^M=12
+ \usembodybackslash}
+
+\def\macroargctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\@=12
+ \catcode`\\=12}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{The name \the\macname\space is reserved}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ % Add the macroname to \macrolist
+ \toks0 = \expandafter{\macrolist\do}%
+ \xdef\macrolist{\the\toks0
+ \expandafter\noexpand\csname\the\macname\endcsname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\def\unmacro{\parsearg\unmacroxxx}
+\def\unmacroxxx#1{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist
+ \begingroup
+ \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
+ \def\do##1{%
+ \def\tempb{##1}%
+ \ifx\tempa\tempb
+ % remove this
+ \else
+ \toks0 = \expandafter{\newmacrolist\do}%
+ \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
+ \fi}%
+ \def\newmacrolist{}%
+ % Execute macro list to define \newmacrolist
+ \macrolist
+ \global\let\macrolist\newmacrolist
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \next}
-\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
+% We mant to disable all macros during \shipout so that they are not
+% expanded by \write.
+\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
+ \edef\next{\macrolist}\expandafter\endgroup\next}
-\message{cross reference,}
-% Define cross-reference macros
-\newwrite \auxfile
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Just make them active and then expand them all to nothing.
+\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{\ignoreactivespaces
+\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
+ \expandafter\noexpand\csname#2\endcsname}%
+\expandafter\endgroup\next}
-\newif\ifhavexrefs % True if xref values are known.
+
+\message{cross references,}
+% @xref etc.
+
+\newwrite\auxfile
+
+\newif\ifhavexrefs % True if xref values are known.
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-% @inforef is simple.
+% @inforef is relatively simple.
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
-% \setref{foo} defines a cross-reference point named foo.
+% @node's job is to define \lastnode.
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx [#1,]}
+\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
-\def\setref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ysectionnumberandtype}}
+% The sectioning commands (@chapter, etc.) call these.
+\def\donoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Ysectionnumberandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\unnumbnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\appendixnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Yappendixletterandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
-\def\unnumbsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ynothing}}
-\def\appendixsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Yappendixletterandtype}}
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
+% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
+% to set \indexdummies so commands such as @code in a section title
+% aren't expanded. It would be nicer not to expand the titles in the
+% first place, but there's so many layers that that is hard to do.
+%
+\def\setref#1#2{{%
+ \indexdummies
+ \pdfmkdest{#1}%
+ \dosetq{#1-title}{Ytitle}%
+ \dosetq{#1-pg}{Ypagenumber}%
+ \dosetq{#1-snt}{#2}%
+}}
-% \xref, \pxref, and \ref generate cross-references to specified points.
-% For \xrefX, #1 is the node name, #2 the name of the Info
-% cross-reference, #3 the printed node name, #4 the name of the Info
-% file, #5 the name of the printed manual. All but the node name can be
-% omitted.
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
%
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]}
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
\def\printedmanual{\ignorespaces #5}%
\def\printednodename{\ignorespaces #3}%
\setbox1=\hbox{\printedmanual}%
@@ -4103,7 +5220,7 @@ width0pt\relax} \fi
\else
% Use the actual chapter/section title appear inside
% the square brackets. Use the real section title if we have it.
- \ifdim \wd1>0pt%
+ \ifdim \wd1 > 0pt
% It is in another manual, so we don't have it.
\def\printednodename{\ignorespaces #1}%
\else
@@ -4124,27 +5241,54 @@ width0pt\relax} \fi
% are best written with fairly long node names, containing hyphens, this
% is a loss. Therefore, we give the text of the node name again, so it
% is as if TeX is seeing it for the first time.
+ \ifpdf
+ \leavevmode
+ \getfilename{#4}%
+ \ifnum\filenamelength>0
+ \startlink attr{/Border [0 0 0]}%
+ goto file{\the\filename.pdf} name{#1@}%
+ \else
+ \startlink attr{/Border [0 0 0]}%
+ goto name{#1@}%
+ \fi
+ \linkcolor
+ \fi
+ %
\ifdim \wd1 > 0pt
- \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
+ \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
\else
% _ (for example) has to be the character _ for the purposes of the
% control sequence corresponding to the node, but it has to expand
% into the usual \leavevmode...\vrule stuff for purposes of
% printing. So we \turnoffactive for the \refx-snt, back on for the
% printing, back off for the \refx-pg.
- {\turnoffactive \refx{#1-snt}{}}%
- \space [\printednodename],\space
+ {\normalturnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % [mynode],
+ [\printednodename],\space
+ % page 3
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
\fi
+ \endlink
\endgroup}
% \dosetq is the interface for calls from other macros
-% Use \turnoffactive so that punctuation chars such as underscore
-% work in node names.
-\def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat%
-\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
-\next}}
+% Use \normalturnoffactive so that punctuation chars such as underscore
+% and backslash work in node names. (\turnoffactive doesn't do \.)
+\def\dosetq#1#2{%
+ {\let\folio=0%
+ \normalturnoffactive
+ \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
+ \iflinks
+ \next
+ \fi
+ }%
+}
% \internalsetq {foo}{page} expands into
% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
@@ -4195,13 +5339,15 @@ width0pt\relax} \fi
\def\refx#1#2{%
\expandafter\ifx\csname X#1\endcsname\relax
% If not defined, say something at least.
- $\langle$un\-de\-fined$\rangle$%
- \ifhavexrefs
- \message{\linenumber Undefined cross reference `#1'.}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
\fi
\fi
\else
@@ -4211,84 +5357,101 @@ width0pt\relax} \fi
#2% Output the suffix in any case.
}
-% Read the last existing aux file, if any. No error if none exists.
-
% This is the macro invoked by entries in the aux file.
-\def\xrdef #1#2{
-{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
+%
+\def\xrdef#1{\begingroup
+ % Reenable \ as an escape while reading the second argument.
+ \catcode`\\ = 0
+ \afterassignment\endgroup
+ \expandafter\gdef\csname X#1\endcsname
+}
-\def\readauxfile{%
-\begingroup
-\catcode `\^^@=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\^^C=\other
-\catcode `\^^D=\other
-\catcode `\^^E=\other
-\catcode `\^^F=\other
-\catcode `\^^G=\other
-\catcode `\^^H=\other
-\catcode `\ =\other
-\catcode `\^^L=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode 26=\other
-\catcode `\^^[=\other
-\catcode `\^^\=\other
-\catcode `\^^]=\other
-\catcode `\^^^=\other
-\catcode `\^^_=\other
-\catcode `\@=\other
-\catcode `\^=\other
-\catcode `\~=\other
-\catcode `\[=\other
-\catcode `\]=\other
-\catcode`\"=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode `\$=\other
-\catcode `\#=\other
-\catcode `\&=\other
-% `\+ does not work, so use 43.
-\catcode 43=\other
-% Make the characters 128-255 be printing characters
-{%
- \count 1=128
- \def\loop{%
- \catcode\count 1=\other
- \advance\count 1 by 1
- \ifnum \count 1<256 \loop \fi
+% Read the last existing aux file, if any. No error if none exists.
+\def\readauxfile{\begingroup
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ % It was suggested to define this as 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ % Make the characters 128-255 be printing characters
+ {%
+ \count 1=128
+ \def\loop{%
+ \catcode\count 1=\other
+ \advance\count 1 by 1
+ \ifnum \count 1<256 \loop \fi
+ }%
}%
-}%
-% the aux file uses ' as the escape.
-% Turn off \ as an escape so we do not lose on
-% entries which were dumped with control sequences in their names.
-% For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
-% Reference to such entries still does not work the way one would wish,
-% but at least they do not bomb out when the aux file is read in.
-\catcode `\{=1 \catcode `\}=2
-\catcode `\%=\other
-\catcode `\'=0
-\catcode`\^=7 % to make ^^e4 etc usable in xref tags
-\catcode `\\=\other
-\openin 1 \jobname.aux
-\ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
-\global\warnedobstrue
-\fi
-% Open the new aux file. Tex will close it automatically at exit.
-\openout \auxfile=\jobname.aux
+ % The aux file uses ' as the escape (for now).
+ % Turn off \ as an escape so we do not lose on
+ % entries which were dumped with control sequences in their names.
+ % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
+ % Reference to such entries still does not work the way one would wish,
+ % but at least they do not bomb out when the aux file is read in.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\%=\other
+ \catcode`\'=0
+ \catcode`\\=\other
+ %
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.aux
+ \global\havexrefstrue
+ \global\warnedobstrue
+ \fi
+ % Open the new aux file. TeX will close it automatically at exit.
+ \openout\auxfile=\jobname.aux
\endgroup}
@@ -4303,7 +5466,7 @@ width0pt\relax} \fi
% space to prevent strange expansion errors.)
\def\supereject{\par\penalty -20000\footnoteno =0 }
-% @footnotestyle is meaningful for info output only..
+% @footnotestyle is meaningful for info output only.
\let\footnotestyle=\comment
\let\ptexfootnote=\footnote
@@ -4329,7 +5492,11 @@ width0pt\relax} \fi
% Don't bother with the trickery in plain.tex to not require the
% footnote text as a parameter. Our footnotes don't need to be so general.
%
-\long\gdef\footnotezzz#1{\insert\footins{%
+% Oh yes, they do; otherwise, @ifset and anything else that uses
+% \parseargline fail inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\long\gdef\footnotezzz{\insert\footins\bgroup
% We want to typeset this text as a normal paragraph, even if the
% footnote reference occurs in (for example) a display environment.
% So reset some parameters.
@@ -4343,6 +5510,8 @@ width0pt\relax} \fi
\xspaceskip\z@skip
\parindent\defaultparindent
%
+ \smallfonts \rm
+ %
% Hang the footnote text off the number.
\hang
\textindent{\thisfootno}%
@@ -4351,8 +5520,13 @@ width0pt\relax} \fi
% expands into a box, it must come within the paragraph, lest it
% provide a place where TeX can split the footnote.
\footstrut
- #1\strut}%
+ \futurelet\next\fo@t
}
+\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
+ \else\let\next\f@t\fi \next}
+\def\f@@t{\bgroup\aftergroup\@foot\let\next}
+\def\f@t#1{#1\@foot}
+\def\@foot{\strut\par\egroup}
}%end \catcode `\@=11
@@ -4409,36 +5583,117 @@ width0pt\relax} \fi
%
\def\finalout{\overfullrule=0pt}
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ \closein 1
+ % Do not bother showing banner with post-v2.7 epsf.tex (available in
+ % doc/epsf.tex until it shows up on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is just the usual extra ignored arg for parsing this stuff.
+\def\imagexxx#1,#2,#3,#4\finish{%
+ \ifpdf
+ \centerline{\dopdfimage{#1}{#2}{#3}}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ % If the image is by itself, center it.
+ \ifvmode
+ \nobreak\bigskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \centerline{\epsfbox{#1.eps}}%
+ \bigbreak
+ \else
+ % In the middle of a paragraph, no extra space.
+ \epsfbox{#1.eps}%
+ \fi
+ \endgroup
+ \fi
+}
-% End of control word definitions.
-\message{and turning on texinfo input format.}
+\message{localization,}
+% and i18n.
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
+% @documentlanguage is usually given very early, just after
+% @setfilename. If done too late, it may not override everything
+% properly. Single argument is the language abbreviation.
+% It would be nice if we could set up a hyphenation file here.
+%
+\def\documentlanguage{\parsearg\dodocumentlanguage}
+\def\dodocumentlanguage#1{%
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \let\temp = \relax
+ \else
+ \def\temp{\input txi-#1.tex }%
+ \fi
+ \temp
+ \endgroup
}
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? In the current directory
+should work if nowhere else does.}
+
-% Set some numeric style parameters, for 8.5 x 11 format.
+% @documentencoding should change something in TeX eventually, most
+% likely, but for now just recognize it.
+\let\documentencoding = \comment
-\hsize = 6in
-\hoffset = .25in
+
+% Page size parameters.
+%
\newdimen\defaultparindent \defaultparindent = 15pt
-\parindent = \defaultparindent
-\parskip 3pt plus 2pt minus 1pt
-\setleading{13.2pt}
-\advance\topskip by 1.2cm
\chapheadingskip = 15pt plus 4pt minus 2pt
\secheadingskip = 12pt plus 3pt minus 2pt
\subsecheadingskip = 9pt plus 2pt minus 2pt
% Prevent underfull vbox error messages.
-\vbadness=10000
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
% Following George Bush, just get rid of widows and orphans.
\widowpenalty=10000
@@ -4447,101 +5702,125 @@ width0pt\relax} \fi
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% using an old version of TeX, don't do anything. We want the amount of
% stretch added to depend on the line length, hence the dependence on
-% \hsize. This makes it come to about 9pt for the 8.5x11 format.
+% \hsize. We call this whenever the paper size is set.
%
-\ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
-\else
- \emergencystretch = \hsize
- \divide\emergencystretch by 45
-\fi
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
-% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
-\def\smallbook{
- \global\chapheadingskip = 15pt plus 4pt minus 2pt
- \global\secheadingskip = 12pt plus 3pt minus 2pt
- \global\subsecheadingskip = 9pt plus 2pt minus 2pt
+% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
+% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
+% set \parskip and call \setleading for \baselineskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
%
- \global\lispnarrowing = 0.3in
- \setleading{12pt}
- \advance\topskip by -1cm
- \global\parskip 2pt plus 1pt
- \global\hsize = 5in
- \global\vsize=7.5in
- \global\tolerance=700
- \global\hfuzz=1pt
- \global\contentsrightmargin=0pt
- \global\deftypemargin=0pt
- \global\defbodyindent=.5cm
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
%
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
%
- \global\let\smalllisp=\smalllispx
- \global\let\smallexample=\smalllispx
- \global\def\Esmallexample{\Esmalllisp}
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
}
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.5 (or so) format.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \setleading{12pt}%
+ %
+ \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \deftypemargin = 0pt
+ \defbodyindent = .5cm
+ %
+ \let\smalldisplay = \smalldisplayx
+ \let\smallexample = \smalllispx
+ \let\smallformat = \smallformatx
+ \let\smalllisp = \smalllispx
+}}
+
% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{
-\global\tolerance=700
-\global\hfuzz=1pt
-\setleading{12pt}
-\global\parskip 15pt plus 1pt
-
-\global\vsize= 53\baselineskip
-\advance\vsize by \topskip
-%\global\hsize= 5.85in % A4 wide 10pt
-\global\hsize= 6.5in
-\global\outerhsize=\hsize
-\global\advance\outerhsize by 0.5in
-\global\outervsize=\vsize
-\global\advance\outervsize by 0.6in
-
-\global\pagewidth=\hsize
-\global\pageheight=\vsize
-}
-
-\bindingoffset=0pt
-\normaloffset=\hoffset
-\pagewidth=\hsize
-\pageheight=\vsize
-
-% Allow control of the text dimensions. Parameters in order: textheight;
-% textwidth; voffset; hoffset; binding offset; topskip.
-% All require a dimension;
-% header is additional; added length extends the bottom of the page.
-
-\def\changepagesizes#1#2#3#4#5#6{
- \global\vsize= #1
- \global\topskip= #6
- \advance\vsize by \topskip
- \global\voffset= #3
- \global\hsize= #2
- \global\outerhsize=\hsize
- \global\advance\outerhsize by 0.5in
- \global\outervsize=\vsize
- \global\advance\outervsize by 0.6in
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
- \global\normaloffset= #4
- \global\bindingoffset= #5}
+\def\afourpaper{{\globaldefs = 1
+ \setleading{12pt}%
+ \parskip = 3pt plus 2pt minus 1pt
+ %
+ \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+}}
% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
-\def\afourlatex
- {\global\tolerance=700
- \global\hfuzz=1pt
- \setleading{12pt}
- \global\parskip 15pt plus 1pt
- \advance\baselineskip by 1.6pt
- \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
- }
+\def\afourlatex{{\globaldefs = 1
+ \setleading{13.6pt}%
+ %
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
+ %
+ \globaldefs = 0
+}}
% Use @afourwide to print on European A4 paper in wide format.
-\def\afourwide{\afourpaper
-\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
+\def\afourwide{%
+ \afourpaper
+ \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
+ %
+ \globaldefs = 0
+}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\def\pagesizes{\parsearg\pagesizesxxx}
+\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
% Define macros to output various characters with catcode for normal text.
\catcode`\"=\other
@@ -4552,6 +5831,7 @@ width0pt\relax} \fi
\catcode`\<=\other
\catcode`\>=\other
\catcode`\+=\other
+\catcode`\$=\other
\def\normaldoublequote{"}
\def\normaltilde{~}
\def\normalcaret{^}
@@ -4560,6 +5840,7 @@ width0pt\relax} \fi
\def\normalless{<}
\def\normalgreater{>}
\def\normalplus{+}
+\def\normaldollar{$}
% This macro is used to make a character print one way in ttfont
% where it can probably just be output, and another way in other fonts,
@@ -4570,7 +5851,13 @@ width0pt\relax} \fi
% interword stretch (and shrink), and it is reasonable to expect all
% typewriter fonts to have this, we can check that font parameter.
%
-\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
% Turn off all special characters except @
% (and those which the user can use as if they were ordinary).
@@ -4578,13 +5865,12 @@ width0pt\relax} \fi
% use math or other variants that look better in normal text.
\catcode`\"=\active
-\def\activedoublequote{{\tt \char '042}}
+\def\activedoublequote{{\tt\char34}}
\let"=\activedoublequote
\catcode`\~=\active
-\def~{{\tt \char '176}}
+\def~{{\tt\char126}}
\chardef\hat=`\^
\catcode`\^=\active
-\def\auxhat{\def^{'hat}}
\def^{{\tt \hat}}
\catcode`\_=\active
@@ -4593,7 +5879,7 @@ width0pt\relax} \fi
\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
\catcode`\|=\active
-\def|{{\tt \char '174}}
+\def|{{\tt\char124}}
\chardef \less=`\<
\catcode`\<=\active
\def<{{\tt \less}}
@@ -4602,6 +5888,8 @@ width0pt\relax} \fi
\def>{{\tt \gtr}}
\catcode`\+=\active
\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}
%\catcode 27=\active
%\def^^[{$\diamondsuit$}
@@ -4632,9 +5920,6 @@ width0pt\relax} \fi
% \normalbackslash outputs one backslash in fixed width font.
\def\normalbackslash{{\tt\rawbackslashxx}}
-% Say @foo, not \foo, in error messages.
-\escapechar=`\@
-
% \catcode 17=0 % Define control-q
\catcode`\\=\active
@@ -4648,7 +5933,8 @@ width0pt\relax} \fi
@let|=@normalverticalbar
@let<=@normalless
@let>=@normalgreater
-@let+=@normalplus}
+@let+=@normalplus
+@let$=@normaldollar}
@def@normalturnoffactive{@let"=@normaldoublequote
@let\=@normalbackslash
@@ -4658,7 +5944,8 @@ width0pt\relax} \fi
@let|=@normalverticalbar
@let<=@normalless
@let>=@normalgreater
-@let+=@normalplus}
+@let+=@normalplus
+@let$=@normaldollar}
% Make _ and + \other characters, temporarily.
% This is canceled by @fixbackslash.
@@ -4677,16 +5964,29 @@ width0pt\relax} \fi
% Also back turn on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
%
-@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
- @catcode`+=@active @catcode`@_=@active}
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
-%% These look ok in all fonts, so just make them not special. The @rm below
-%% makes sure that the current font starts out as the newly loaded cmr10
-@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+@c Set initial fonts.
@textfonts
@rm
+
@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
@c End: