Editor (execute any command) options processing

masterenoc--- via Bug reports for GNU GLOBAL <[email protected]> Sat, 4 May 2024 21:20:20 +0200 (CEST)
Newsgroups gmane.comp.gnu.global.bugs
Message-ID <[email protected]>
------=_Part_313791_1046445869.1714850420434
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi all,

I have been using Gnu Global for a while and I noticed gtags-cscope
cannot execute binaries with options and argument. This "execution" of
binaries is seldomly used, I only saw it when a new shell is run (!
command) and to execute the editor in a file, being the later the
reason I made this patch.

I use emacsclient and I like to use the editor "emacsclient -n[-c]"
(sometimes I add the -c option), this cannot be used without this
patch because gtags-cscope tries to find a binary named "emacsclient
-n[-c]". Please, check the attached patch and let me know if there is
any problem with the implementation.

Regards,

------=_Part_313791_1046445869.1714850420434
Content-Type: text/x-patch; charset=UTF-8; name=global-options.patch
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=global-options.patch

Index: INSTALL
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /sources/global/global/INSTALL,v
retrieving revision 1.36
diff -c -r1.36 INSTALL
*** INSTALL=091 Feb 2021 05:43:20 -0000=091.36
--- INSTALL=094 May 2024 18:43:04 -0000
***************
*** 1,87 ****
! ___________________________________
! |      |  |  |     |  _  |     |  |
! |  |___|  |  |  |  |    _|  |  |  |    GNU GLOBAL source code tagging sys=
tem
! |  |   |  |  |  |  |     |     |  |
! |  ~~  |   ~~|     |  ~  |  |  |   ~~|          for all hackers.
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!  Copyright (c) 2000, 2002, 2003, 2004, 2006, 2011 Tama Communications Cor=
poration
 =20
!  This file is free software; as a special exception the author gives
!  unlimited permission to copy and/or distribute it, with or without
!  modifications, as long as this notice is preserved.
 =20
!  This program is distributed in the hope that it will be useful, but
!  WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
!  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 =20
! =09=09----------------------------------
!=20
! Installation of GNU Global.
!=20
! [Note]  Though GNU Global supports only UNIX(POSIX) environment,
!         some outside projects develop DOS or Windows 32 version of it.
!         Please see:
!                 http://www.gnu.org/software/global/download.html
!=20
! 1. Preparation.
!=20
! o If you want to use the -I option of global(1) then idutils(1) is needed=
.
!=20
!    You can get idutils at:
!=20
! =09ftp://ftp.gnu.org/pub/gnu/idutils/
!  =20
! o If you want to use the --form(-f) or --dynamic(-D) option of htags(1) t=
hen
!   Perl version 5 or later is needed.
!=20
!    If you don't have it, you can fetch it from this site.
!=20
! =09http://www.perl.com/CPAN/
!=20
! 2. How to install.
!=20
! =09$ ./configure
! =09$ make
! =09# make install
!=20
! =09(You can see the options of configure by invoking './configure --help'=
)
!=20
! 3. Using Global with editors.
!=20
! o Emacs
!=20
!    Global supports GNU Emacs and XEmacs. If you meet some troubles,
!    please mail to [email protected].
!=20
!    You can get them at:
!=20
! =09GNU emacs:
! =09=09ftp://ftp.gnu.org/pub/gnu/emacs/
! =09XEmacs:
! =09=09http://www.xemacs.org
!=20
!    Installation procedure is written in gtags.el itself.
!=20
! o Elvis
!=20
!    You need Elvis 2.1 or later. You can get it at:
!=20
! =09http://elvis.vi-editor.org/
!=20
!    Please copy an elvis script to your home directory.
!=20
! =09$ cp /usr/local/share/gtags/elvis.rc $HOME/.elvisrc
! =09$ PATH=3D/usr/local/share/gtags/script:$PATH
!=20
! o Vim
!=20
!    You can get it at:
!=20
! =09http://www.vim.org/
!=20
!    Please copy vim scripts to your plug-in directory.
!=20
! =09$ cp /usr/local/share/gtags/gtags.vim $HOME/.vim/plugin
! =09$ cp /usr/local/share/gtags/gtags-cscope.vim $HOME/.vim/plugin
!=20
! Good luck!
--- 1,368 ----
! Installation Instructions
! *************************
 =20
!    Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free
! Software Foundation, Inc.
 =20
!    Copying and distribution of this file, with or without modification,
! are permitted in any medium without royalty provided the copyright
! notice and this notice are preserved.  This file is offered as-is,
! without warranty of any kind.
!=20
! Basic Installation
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
!=20
!    Briefly, the shell command './configure && make && make install'
! should configure, build, and install this package.  The following
! more-detailed instructions are generic; see the 'README' file for
! instructions specific to this package.  Some packages provide this
! 'INSTALL' file but do not implement all of the features documented
! below.  The lack of an optional feature in a given package is not
! necessarily a bug.  More recommendations for GNU packages can be found
! in *note Makefile Conventions: (standards)Makefile Conventions.
!=20
!    The 'configure' shell script attempts to guess correct values for
! various system-dependent variables used during compilation.  It uses
! those values to create a 'Makefile' in each directory of the package.
! It may also create one or more '.h' files containing system-dependent
! definitions.  Finally, it creates a shell script 'config.status' that
! you can run in the future to recreate the current configuration, and a
! file 'config.log' containing compiler output (useful mainly for
! debugging 'configure').
!=20
!    It can also use an optional file (typically called 'config.cache' and
! enabled with '--cache-file=3Dconfig.cache' or simply '-C') that saves the
! results of its tests to speed up reconfiguring.  Caching is disabled by
! default to prevent problems with accidental use of stale cache files.
!=20
!    If you need to do unusual things to compile the package, please try
! to figure out how 'configure' could check whether to do them, and mail
! diffs or instructions to the address given in the 'README' so they can
! be considered for the next release.  If you are using the cache, and at
! some point 'config.cache' contains results you don't want to keep, you
! may remove or edit it.
!=20
!    The file 'configure.ac' (or 'configure.in') is used to create
! 'configure' by a program called 'autoconf'.  You need 'configure.ac' if
! you want to change it or regenerate 'configure' using a newer version of
! 'autoconf'.
!=20
!    The simplest way to compile this package is:
!=20
!   1. 'cd' to the directory containing the package's source code and type
!      './configure' to configure the package for your system.
!=20
!      Running 'configure' might take a while.  While running, it prints
!      some messages telling which features it is checking for.
!=20
!   2. Type 'make' to compile the package.
!=20
!   3. Optionally, type 'make check' to run any self-tests that come with
!      the package, generally using the just-built uninstalled binaries.
!=20
!   4. Type 'make install' to install the programs and any data files and
!      documentation.  When installing into a prefix owned by root, it is
!      recommended that the package be configured and built as a regular
!      user, and only the 'make install' phase executed with root
!      privileges.
!=20
!   5. Optionally, type 'make installcheck' to repeat any self-tests, but
!      this time using the binaries in their final installed location.
!      This target does not install anything.  Running this target as a
!      regular user, particularly if the prior 'make install' required
!      root privileges, verifies that the installation completed
!      correctly.
!=20
!   6. You can remove the program binaries and object files from the
!      source code directory by typing 'make clean'.  To also remove the
!      files that 'configure' created (so you can compile the package for
!      a different kind of computer), type 'make distclean'.  There is
!      also a 'make maintainer-clean' target, but that is intended mainly
!      for the package's developers.  If you use it, you may have to get
!      all sorts of other programs in order to regenerate files that came
!      with the distribution.
!=20
!   7. Often, you can also type 'make uninstall' to remove the installed
!      files again.  In practice, not all packages have tested that
!      uninstallation works correctly, even though it is required by the
!      GNU Coding Standards.
!=20
!   8. Some packages, particularly those that use Automake, provide 'make
!      distcheck', which can by used by developers to test that all other
!      targets like 'make install' and 'make uninstall' work correctly.
!      This target is generally not run by end users.
!=20
! Compilers and Options
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
!=20
!    Some systems require unusual options for compilation or linking that
! the 'configure' script does not know about.  Run './configure --help'
! for details on some of the pertinent environment variables.
!=20
!    You can give 'configure' initial values for configuration parameters
! by setting variables in the command line or in the environment.  Here is
! an example:
!=20
!      ./configure CC=3Dc99 CFLAGS=3D-g LIBS=3D-lposix
!=20
!    *Note Defining Variables::, for more details.
!=20
! Compiling For Multiple Architectures
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
!=20
!    You can compile the package for more than one kind of computer at the
! same time, by placing the object files for each architecture in their
! own directory.  To do this, you can use GNU 'make'.  'cd' to the
! directory where you want the object files and executables to go and run
! the 'configure' script.  'configure' automatically checks for the source
! code in the directory that 'configure' is in and in '..'.  This is known
! as a "VPATH" build.
!=20
!    With a non-GNU 'make', it is safer to compile the package for one
! architecture at a time in the source code directory.  After you have
! installed the package for one architecture, use 'make distclean' before
! reconfiguring for another architecture.
!=20
!    On MacOS X 10.5 and later systems, you can create libraries and
! executables that work on multiple system types--known as "fat" or
! "universal" binaries--by specifying multiple '-arch' options to the
! compiler but only a single '-arch' option to the preprocessor.  Like
! this:
!=20
!      ./configure CC=3D"gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64"=
 \
!                  CXX=3D"g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64=
" \
!                  CPP=3D"gcc -E" CXXCPP=3D"g++ -E"
!=20
!    This is not guaranteed to produce working output in all cases, you
! may have to build one architecture at a time and combine the results
! using the 'lipo' tool if you have problems.
!=20
! Installation Names
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
!=20
!    By default, 'make install' installs the package's commands under
! '/usr/local/bin', include files under '/usr/local/include', etc.  You
! can specify an installation prefix other than '/usr/local' by giving
! 'configure' the option '--prefix=3DPREFIX', where PREFIX must be an
! absolute file name.
!=20
!    You can specify separate installation prefixes for
! architecture-specific files and architecture-independent files.  If you
! pass the option '--exec-prefix=3DPREFIX' to 'configure', the package uses
! PREFIX as the prefix for installing programs and libraries.
! Documentation and other data files still use the regular prefix.
!=20
!    In addition, if you use an unusual directory layout you can give
! options like '--bindir=3DDIR' to specify different values for particular
! kinds of files.  Run 'configure --help' for a list of the directories
! you can set and what kinds of files go in them.  In general, the default
! for these options is expressed in terms of '${prefix}', so that
! specifying just '--prefix' will affect all of the other directory
! specifications that were not explicitly provided.
!=20
!    The most portable way to affect installation locations is to pass the
! correct locations to 'configure'; however, many packages provide one or
! both of the following shortcuts of passing variable assignments to the
! 'make install' command line to change installation locations without
! having to reconfigure or recompile.
!=20
!    The first method involves providing an override variable for each
! affected directory.  For example, 'make install
! prefix=3D/alternate/directory' will choose an alternate location for all
! directory configuration variables that were expressed in terms of
! '${prefix}'.  Any directories that were specified during 'configure',
! but not in terms of '${prefix}', must each be overridden at install time
! for the entire installation to be relocated.  The approach of makefile
! variable overrides for each directory variable is required by the GNU
! Coding Standards, and ideally causes no recompilation.  However, some
! platforms have known limitations with the semantics of shared libraries
! that end up requiring recompilation when using this method, particularly
! noticeable in packages that use GNU Libtool.
!=20
!    The second method involves providing the 'DESTDIR' variable.  For
! example, 'make install DESTDIR=3D/alternate/directory' will prepend
! '/alternate/directory' before all installation names.  The approach of
! 'DESTDIR' overrides is not required by the GNU Coding Standards, and
! does not work on platforms that have drive letters.  On the other hand,
! it does better at avoiding recompilation issues, and works well even
! when some directory options were not specified in terms of '${prefix}'
! at 'configure' time.
!=20
! Optional Features
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
!=20
!    If the package supports it, you can cause programs to be installed
! with an extra prefix or suffix on their names by giving 'configure' the
! option '--program-prefix=3DPREFIX' or '--program-suffix=3DSUFFIX'.
!=20
!    Some packages pay attention to '--enable-FEATURE' options to
! 'configure', where FEATURE indicates an optional part of the package.
! They may also pay attention to '--with-PACKAGE' options, where PACKAGE
! is something like 'gnu-as' or 'x' (for the X Window System).  The
! 'README' should mention any '--enable-' and '--with-' options that the
! package recognizes.
!=20
!    For packages that use the X Window System, 'configure' can usually
! find the X include and library files automatically, but if it doesn't,
! you can use the 'configure' options '--x-includes=3DDIR' and
! '--x-libraries=3DDIR' to specify their locations.
!=20
!    Some packages offer the ability to configure how verbose the
! execution of 'make' will be.  For these packages, running './configure
! --enable-silent-rules' sets the default to minimal output, which can be
! overridden with 'make V=3D1'; while running './configure
! --disable-silent-rules' sets the default to verbose, which can be
! overridden with 'make V=3D0'.
!=20
! Particular systems
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
!=20
!    On HP-UX, the default C compiler is not ANSI C compatible.  If GNU CC
! is not installed, it is recommended to use the following options in
! order to use an ANSI C compiler:
!=20
!      ./configure CC=3D"cc -Ae -D_XOPEN_SOURCE=3D500"
!=20
! and if that doesn't work, install pre-built binaries of GCC for HP-UX.
!=20
!    HP-UX 'make' updates targets which have the same timestamps as their
! prerequisites, which makes it generally unusable when shipped generated
! files such as 'configure' are involved.  Use GNU 'make' instead.
!=20
!    On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
! parse its '<wchar.h>' header file.  The option '-nodtk' can be used as a
! workaround.  If GNU CC is not installed, it is therefore recommended to
! try
!=20
!      ./configure CC=3D"cc"
!=20
! and if that doesn't work, try
!=20
!      ./configure CC=3D"cc -nodtk"
!=20
!    On Solaris, don't put '/usr/ucb' early in your 'PATH'.  This
! directory contains several dysfunctional programs; working variants of
! these programs are available in '/usr/bin'.  So, if you need '/usr/ucb'
! in your 'PATH', put it _after_ '/usr/bin'.
!=20
!    On Haiku, software installed for all users goes in '/boot/common',
! not '/usr/local'.  It is recommended to use the following options:
!=20
!      ./configure --prefix=3D/boot/common
!=20
! Specifying the System Type
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!=20
!    There may be some features 'configure' cannot figure out
! automatically, but needs to determine by the type of machine the package
! will run on.  Usually, assuming the package is built to be run on the
! _same_ architectures, 'configure' can figure that out, but if it prints
! a message saying it cannot guess the machine type, give it the
! '--build=3DTYPE' option.  TYPE can either be a short name for the system
! type, such as 'sun4', or a canonical name which has the form:
!=20
!      CPU-COMPANY-SYSTEM
!=20
! where SYSTEM can have one of these forms:
!=20
!      OS
!      KERNEL-OS
!=20
!    See the file 'config.sub' for the possible values of each field.  If
! 'config.sub' isn't included in this package, then this package doesn't
! need to know the machine type.
!=20
!    If you are _building_ compiler tools for cross-compiling, you should
! use the option '--target=3DTYPE' to select the type of system they will
! produce code for.
!=20
!    If you want to _use_ a cross compiler, that generates code for a
! platform different from the build platform, you should specify the
! "host" platform (i.e., that on which the generated programs will
! eventually be run) with '--host=3DTYPE'.
!=20
! Sharing Defaults
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
!=20
!    If you want to set default values for 'configure' scripts to share,
! you can create a site shell script called 'config.site' that gives
! default values for variables like 'CC', 'cache_file', and 'prefix'.
! 'configure' looks for 'PREFIX/share/config.site' if it exists, then
! 'PREFIX/etc/config.site' if it exists.  Or, you can set the
! 'CONFIG_SITE' environment variable to the location of the site script.
! A warning: not all 'configure' scripts look for a site script.
!=20
! Defining Variables
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
!=20
!    Variables not defined in a site shell script can be set in the
! environment passed to 'configure'.  However, some packages may run
! configure again during the build, and the customized values of these
! variables may be lost.  In order to avoid this problem, you should set
! them in the 'configure' command line, using 'VAR=3Dvalue'.  For example:
!=20
!      ./configure CC=3D/usr/local2/bin/gcc
!=20
! causes the specified 'gcc' to be used as the C compiler (unless it is
! overridden in the site shell script).
!=20
! Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
! Autoconf limitation.  Until the limitation is lifted, you can use this
! workaround:
!=20
!      CONFIG_SHELL=3D/bin/bash ./configure CONFIG_SHELL=3D/bin/bash
!=20
! 'configure' Invocation
! =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
!=20
!    'configure' recognizes the following options to control how it
! operates.
!=20
! '--help'
! '-h'
!      Print a summary of all of the options to 'configure', and exit.
!=20
! '--help=3Dshort'
! '--help=3Drecursive'
!      Print a summary of the options unique to this package's
!      'configure', and exit.  The 'short' variant lists options used only
!      in the top level, while the 'recursive' variant lists options also
!      present in any nested packages.
!=20
! '--version'
! '-V'
!      Print the version of Autoconf used to generate the 'configure'
!      script, and exit.
!=20
! '--cache-file=3DFILE'
!      Enable the cache: use and save the results of the tests in FILE,
!      traditionally 'config.cache'.  FILE defaults to '/dev/null' to
!      disable caching.
!=20
! '--config-cache'
! '-C'
!      Alias for '--cache-file=3Dconfig.cache'.
!=20
! '--quiet'
! '--silent'
! '-q'
!      Do not print messages saying which checks are being made.  To
!      suppress all normal output, redirect it to '/dev/null' (any error
!      messages will still be shown).
!=20
! '--srcdir=3DDIR'
!      Look for the package's source code in directory DIR.  Usually
!      'configure' can determine that directory automatically.
!=20
! '--prefix=3DDIR'
!      Use DIR as the installation prefix.  *note Installation Names:: for
!      more details, including other options available for fine-tuning the
!      installation locations.
!=20
! '--no-create'
! '-n'
!      Run the configure checks, but stop before creating any output
!      files.
 =20
! 'configure' also accepts some other, not widely useful, options.  Run
! 'configure --help' for more details.
Index: doc/texinfo.tex
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /sources/global/global/doc/texinfo.tex,v
retrieving revision 1.5
diff -c -r1.5 texinfo.tex
*** doc/texinfo.tex=0921 Jan 2011 23:53:57 -0000=091.5
--- doc/texinfo.tex=094 May 2024 18:43:05 -0000
***************
*** 1,13 ****
  % texinfo.tex -- TeX macros to handle Texinfo files.
! %=20
  % Load plain if necessary, i.e., if running under initex.
  \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
  %
! \def\texinfoversion{2011-01-15.17}
  %
! % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
! % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
! % 2007, 2008, 2009, 2010, 2011 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
--- 1,11 ----
  % 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{2021-04-25.21}
  %
! % Copyright 1985, 1986, 1988, 1990-2021 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
***************
*** 20,40 ****
  % General Public License for more details.
  %
  % You should have received a copy of the GNU General Public License
! % along with this program.  If not, see <http://www.gnu.org/licenses/>.
  %
  % As a special exception, when this file is read by TeX when processing
  % a Texinfo source document, you may use the result without
! % restriction.  (This has been our intent since Texinfo was invented.)
  %
  % Please try the latest version of texinfo.tex before submitting bug
  % reports; you can get the latest version from:
! %   http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
! %   ftp://tug.org/tex/texinfo.tex
! %     (and all CTAN mirrors, see http://www.ctan.org).
  % The texinfo.tex in any given distribution could well be out
  % of date, so if that's what you're using, please check.
  %
! % Send bug reports to [email protected].  Please include including a
  % complete document in each bug report with which we can reproduce the
  % problem.  Patches are, of course, greatly appreciated.
  %
--- 18,39 ----
  % General Public License for more details.
  %
  % You should have received a copy of the GNU General Public License
! % along with this program.  If not, see <https://www.gnu.org/licenses/>.
  %
  % As a special exception, when this file is read by TeX when processing
  % a Texinfo source document, you may use the result without
! % restriction. This Exception is an additional permission under section 7
! % of the GNU General Public License, version 3 ("GPLv3").
  %
  % Please try the latest version of texinfo.tex before submitting bug
  % reports; you can get the latest version from:
! %   https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
! %   https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
! %   https://www.gnu.org/software/texinfo/ (the Texinfo home page)
  % The texinfo.tex in any given distribution could well be out
  % of date, so if that's what you're using, please check.
  %
! % Send bug reports to [email protected].  Please include a
  % complete document in each bug report with which we can reproduce the
  % problem.  Patches are, of course, greatly appreciated.
  %
***************
*** 54,60 ****
  % extent.  You can get the existing language-specific files from the
  % full Texinfo distribution.
  %
! % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
 =20
 =20
  \message{Loading texinfo [version \texinfoversion]:}
--- 53,59 ----
  % extent.  You can get the existing language-specific files from the
  % full Texinfo distribution.
  %
! % The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
 =20
 =20
  \message{Loading texinfo [version \texinfoversion]:}
***************
*** 65,70 ****
--- 64,73 ----
  \everyjob{\message{[Texinfo version \texinfoversion]}%
    \catcode`+=3D\active \catcode`\_=3D\active}
 =20
+ % LaTeX's \typeout.  This ensures that the messages it is used for
+ % are identical in format to the corresponding ones from latex/pdflatex.
+ \def\typeout{\immediate\write17}%
+=20
  \chardef\other=3D12
 =20
  % We never want plain's \outer definition of \+ in Texinfo.
***************
*** 95,101 ****
--- 98,106 ----
  \let\ptexraggedright=3D\raggedright
  \let\ptexrbrace=3D\}
  \let\ptexslash=3D\/
+ \let\ptexsp=3D\sp
  \let\ptexstar=3D\*
+ \let\ptexsup=3D\sup
  \let\ptext=3D\t
  \let\ptextop=3D\top
  {\catcode`\'=3D\active \global\let\ptexquoteright'}% active in plain's ma=
th mode
***************
*** 116,125 ****
  % 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 i=
s empty)}\fi
! \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Ind=
ex 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
--- 121,131 ----
  % 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\putworderror\undefined     \gdef\putworderror{error}\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{(I=
ndex 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
***************
*** 153,172 ****
  \ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
  \ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
 =20
! % Since the category of space is not known, we have to be careful.
! \chardef\spacecat =3D 10
! \def\spaceisspace{\catcode`\ =3D\spacecat}
!=20
! % sometimes characters are active, so we need control sequences.
! \chardef\colonChar =3D `\:
! \chardef\commaChar =3D `\,
  \chardef\dashChar  =3D `\-
! \chardef\dotChar   =3D `\.
! \chardef\exclamChar=3D `\!
! \chardef\lquoteChar=3D `\`
! \chardef\questChar =3D `\?
! \chardef\rquoteChar=3D `\'
! \chardef\semiChar  =3D `\;
  \chardef\underChar =3D `\_
 =20
  % Ignore a token.
--- 159,172 ----
  \ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
  \ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
 =20
! % Give the space character the catcode for a space.
! \def\spaceisspace{\catcode`\ =3D10\relax}
!=20
! % Likewise for ^^M, the end of line character.
! \def\endlineisspace{\catcode13=3D10\relax}
!=20
  \chardef\dashChar  =3D `\-
! \chardef\slashChar =3D `\/
  \chardef\underChar =3D `\_
 =20
  % Ignore a token.
***************
*** 188,204 ****
    wide-spread wrap-around
  }
 =20
- % Margin to add to right of even pages, to left of odd pages.
- \newdimen\bindingoffset
- \newdimen\normaloffset
- \newdimen\pagewidth \newdimen\pageheight
-=20
- % For a final copy, take out the rectangles
- % that mark overfull boxes (in case you have decided
- % that the text looks ok even though it passes the margin).
- %
- \def\finalout{\overfullrule=3D0pt }
-=20
  % Sometimes it is convenient to have everything in the transcript file
  % and nothing on the terminal.  We don't just call \tracingall here,
  % since that produces some useless output on the terminal.  We also make
--- 188,193 ----
***************
*** 215,221 ****
    \tracingmacros2
    \tracingrestores1
    \showboxbreadth\maxdimen \showboxdepth\maxdimen
!   \ifx\eTeXversion\undefined\else % etex gives us more logging
      \tracingscantokens1
      \tracingifs1
      \tracinggroups1
--- 204,210 ----
    \tracingmacros2
    \tracingrestores1
    \showboxbreadth\maxdimen \showboxdepth\maxdimen
!   \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
      \tracingscantokens1
      \tracingifs1
      \tracinggroups1
***************
*** 226,231 ****
--- 215,227 ----
    \errorcontextlines16
  }%
 =20
+ % @errormsg{MSG}.  Do the index-like expansions on MSG, but if things
+ % aren't perfect, it's not the end of the world, being an error message,
+ % after all.
+ %
+ \def\errormsg{\begingroup \indexnofonts \doerrormsg}
+ \def\doerrormsg#1{\errmessage{#1}}
+=20
  % add check for \lastpenalty to plain's definitions.  If the last thing
  % we did was a \nobreak, we don't want to insert more space.
  %
***************
*** 236,252 ****
  \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
    \removelastskip\penalty-200\bigskip\fi\fi}
 =20
! % Do @cropmarks to get crop marks.
  %
! \newif\ifcropmarks
! \let\cropmarks =3D \cropmarkstrue
! %
! % Dimensions to add cropmarks at corners.
! % Added by P. A. MacKay, 12 Nov. 1986
  %
  \newdimen\outerhsize \newdimen\outervsize % set by the paper size routine=
s
- \newdimen\cornerlong  \cornerlong=3D1pc
- \newdimen\cornerthick \cornerthick=3D.3pt
  \newdimen\topandbottommargin \topandbottommargin=3D.75in
 =20
  % Output a mark which sets \thischapter, \thissection and \thiscolor.
--- 232,247 ----
  \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
    \removelastskip\penalty-200\bigskip\fi\fi}
 =20
! %=0C Output routine
  %
!=20
! % For a final copy, take out the rectangles
! % that mark overfull boxes (in case you have decided
! % that the text looks ok even though it passes the margin).
  %
+ \def\finalout{\overfullrule=3D0pt }
+=20
  \newdimen\outerhsize \newdimen\outervsize % set by the paper size routine=
s
  \newdimen\topandbottommargin \topandbottommargin=3D.75in
 =20
  % Output a mark which sets \thischapter, \thissection and \thiscolor.
***************
*** 258,356 ****
  %
  % Another complication is to let the user choose whether \thischapter
  % (\thissection) refers to the chapter (section) in effect at the top
! % of a page, or that at the bottom of a page.  The solution is
! % described on page 260 of The TeXbook.  It involves outputting two
! % marks for the sectioning macros, one before the section break, and
! % one after.  I won't pretend I can describe this better than DEK...
  \def\domark{%
!   \toks0=3D\expandafter{\lastchapterdefs}%
!   \toks2=3D\expandafter{\lastsectiondefs}%
    \toks4=3D\expandafter{\prevchapterdefs}%
    \toks6=3D\expandafter{\prevsectiondefs}%
!   \toks8=3D\expandafter{\lastcolordefs}%
    \mark{%
!                    \the\toks0 \the\toks2
!       \noexpand\or \the\toks4 \the\toks6
!     \noexpand\else \the\toks8
    }%
  }
  % \topmark doesn't work for the very first chapter (after the title
  % page or the contents), so we use \firstmark there -- this gets us
  % the mark with the chapter defs, unless the user sneaks in, e.g.,
  % @setcolor (or @url, or @link, etc.) between @contents and the very
  % first @chapter.
  \def\gettopheadingmarks{%
!   \ifcase0\topmark\fi
    \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  }
  \def\getbottomheadingmarks{\ifcase1\botmark\fi}
! \def\getcolormarks{\ifcase2\topmark\fi}
 =20
  % Avoid "undefined control sequence" errors.
! \def\lastchapterdefs{}
! \def\lastsectiondefs{}
  \def\prevchapterdefs{}
  \def\prevsectiondefs{}
! \def\lastcolordefs{}
 =20
  % Main output routine.
  \chardef\PAGE =3D 255
! \output =3D {\onepageout{\pagecontents\PAGE}}
 =20
  \newbox\headlinebox
  \newbox\footlinebox
 =20
! % \onepageout takes a vbox as an argument.  Note that \pagecontents
! % does insertions, but you have to call it yourself.
  \def\onepageout#1{%
!   \ifcropmarks \hoffset=3D0pt \else \hoffset=3D\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 ''cod=
e).
    \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
!   \setbox\headlinebox =3D \vbox{\let\hsize=3D\pagewidth \makeheadline}%
    \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
!   \setbox\footlinebox =3D \vbox{\let\hsize=3D\pagewidth \makefootline}%
    %
    {%
      % 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.
      %
!     \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=
.
!                % We don't want .vr (or whatever) entries like this:
!                % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acrony=
m}}
!                % "\acronym" won't work when it's read back in;
!                % it needs to be
!                % {\code {{\tt \backslashcurfont }acronym}
      \shipout\vbox{%
        % Do this early so pdf references go to the beginning of the page.
        \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
        %
-       \ifcropmarks \vbox to \outervsize\bgroup
-         \hsize =3D \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}%
        \ifdim\ht\footlinebox > 0pt
--- 253,382 ----
  %
  % Another complication is to let the user choose whether \thischapter
  % (\thissection) refers to the chapter (section) in effect at the top
! % of a page, or that at the bottom of a page.
!=20
! % \domark is called twice inside \chapmacro, to add one
! % mark before the section break, and one after.
! %   In the second call \prevchapterdefs is the same as \currentchapterdef=
s,
! % and \prevsectiondefs is the same as \currentsectiondefs.
! %   Then if the page is not broken at the mark, some of the previous
! % section appears on the page, and we can get the name of this section
! % from \firstmark for @everyheadingmarks top.
! %   @everyheadingmarks bottom uses \botmark.
! %
! % See page 260 of The TeXbook.
  \def\domark{%
!   \toks0=3D\expandafter{\currentchapterdefs}%
!   \toks2=3D\expandafter{\currentsectiondefs}%
    \toks4=3D\expandafter{\prevchapterdefs}%
    \toks6=3D\expandafter{\prevsectiondefs}%
!   \toks8=3D\expandafter{\currentcolordefs}%
    \mark{%
!                    \the\toks0 \the\toks2  % 0: marks for @everyheadingmar=
ks top
!       \noexpand\or \the\toks4 \the\toks6  % 1: for @everyheadingmarks bot=
tom
!     \noexpand\else \the\toks8             % 2: color marks
    }%
  }
+=20
+ % \gettopheadingmarks, \getbottomheadingmarks,
+ % \getcolormarks - extract needed part of mark.
+ %
  % \topmark doesn't work for the very first chapter (after the title
  % page or the contents), so we use \firstmark there -- this gets us
  % the mark with the chapter defs, unless the user sneaks in, e.g.,
  % @setcolor (or @url, or @link, etc.) between @contents and the very
  % first @chapter.
  \def\gettopheadingmarks{%
!   \ifcase0\the\savedtopmark\fi
    \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  }
  \def\getbottomheadingmarks{\ifcase1\botmark\fi}
! \def\getcolormarks{\ifcase2\the\savedtopmark\fi}
 =20
  % Avoid "undefined control sequence" errors.
! \def\currentchapterdefs{}
! \def\currentsectiondefs{}
! \def\currentsection{}
  \def\prevchapterdefs{}
  \def\prevsectiondefs{}
! \def\currentcolordefs{}
!=20
! % Margin to add to right of even pages, to left of odd pages.
! \newdimen\bindingoffset
! \newdimen\normaloffset
! \newdimen\txipagewidth \newdimen\txipageheight
 =20
  % Main output routine.
+ %
  \chardef\PAGE =3D 255
! \newtoks\defaultoutput
! \defaultoutput =3D {\savetopmark\onepageout{\pagecontents\PAGE}}
! \output=3D\expandafter{\the\defaultoutput}
 =20
  \newbox\headlinebox
  \newbox\footlinebox
 =20
! % When outputting the double column layout for indices, an output routine
! % is run several times, which hides the original value of \topmark.  This
! % can lead to a page heading being output and duplicating the chapter hea=
ding
! % of the index.  Hence, save the contents of \topmark at the beginning of
! % the output routine.  The saved contents are valid until we actually
! % \shipout a page.
! %
! % (We used to run a short output routine to actually set \topmark and
! % \firstmark to the right values, but if this was called with an empty pa=
ge
! % containing whatsits for writing index entries, the whatsits would be th=
rown
! % away and the index auxiliary file would remain empty.)
! %
! \newtoks\savedtopmark
! \newif\iftopmarksaved
! \topmarksavedtrue
! \def\savetopmark{%
!   \iftopmarksaved\else
!     \global\savedtopmark=3D\expandafter{\topmark}%
!     \global\topmarksavedtrue
!   \fi
! }
!=20
! % \onepageout takes a vbox as an argument.
! % \shipout a vbox for a single page, adding an optional header, footer
! % and footnote.  This also causes index entries for this page to be writt=
en
! % to the auxiliary files.
! %
  \def\onepageout#1{%
!   \hoffset=3D\normaloffset
    %
    \ifodd\pageno  \advance\hoffset by \bindingoffset
    \else \advance\hoffset by -\bindingoffset\fi
    %
+   \checkchapterpage
+   %
+   % Retrieve the information for the headings from the marks in the page,
+   % and call Plain TeX's \makeheadline and \makefootline, which use the
+   % values in \headline and \footline.
+   %
+   % Common context changes for both heading and footing.
    % Do this outside of the \shipout so @code etc. will be expanded in
    % the headline as they should be, not taken literally (outputting ''cod=
e).
+   \def\commonheadfootline{\let\hsize=3D\txipagewidth \texinfochars}
+   %
    \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
!   \global\setbox\headlinebox =3D \vbox{\commonheadfootline \makeheadline}=
%
    \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
!   \global\setbox\footlinebox =3D \vbox{\commonheadfootline \makefootline}=
%
    %
    {%
+     % Set context for writing to auxiliary files like index files.
      % 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.
      %
!     \atdummies         % don't expand commands in the output.
!     \turnoffactive
      \shipout\vbox{%
        % Do this early so pdf references go to the beginning of the page.
        \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
        %
        \unvbox\headlinebox
        \pagebody{#1}%
        \ifdim\ht\footlinebox > 0pt
***************
*** 361,391 ****
          \unvbox\footlinebox
        \fi
        %
!       \ifcropmarks
!           \egroup % end of \vbox\bgroup
!         \hfil\egroup % end of (centering) \line\bgroup
!         \vskip\topandbottommargin plus1fill minus1fill
!         \boxmaxdepth =3D \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 \indexdummies
    \advancepageno
    \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  }
 =20
  \newinsert\margin \dimen\margin=3D\maxdimen
 =20
! \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=3D\maxdepth #1}}
  {\catcode`\@ =3D11
  \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  % marginal hacks, [email protected] (Juha Takala)
--- 387,403 ----
          \unvbox\footlinebox
        \fi
        %
!     }%
!   }%
!   \global\topmarksavedfalse
    \advancepageno
    \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  }
 =20
  \newinsert\margin \dimen\margin=3D\maxdimen
 =20
! % Main part of page, including any footnotes
! \def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=3D\maxdepth #1}}
  {\catcode`\@ =3D11
  \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  % marginal hacks, [email protected] (Juha Takala)
***************
*** 396,415 ****
  \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  }
 =20
! % Here are the rules for the cropmarks.  Note that they are
! % offset so that the space between them is truly \outerhsize or \outervsi=
ze
! % (P. A. MacKay, 12 November, 1986)
! %
! \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
! \def\nstop{\vbox
!   {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
! \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
! \def\nsbot{\vbox
!   {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
 =20
  % Parse an argument, then pass it to #1.  The argument is the rest of
  % the input line (except we remove a trailing comment).  #1 should be a
  % macro which expects an ordinary undelimited TeX argument.
  %
  \def\parsearg{\parseargusing{}}
  \def\parseargusing#1#2{%
--- 408,436 ----
  \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  }
 =20
! % Check if we are on the first page of a chapter.  Used for printing head=
ings.
! \newif\ifchapterpage
! \def\checkchapterpage{%
!   % Get the chapter that was current at the end of the last page
!   \ifcase1\the\savedtopmark\fi
!   \let\prevchaptername\thischaptername
!   %
!   \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
!   \let\curchaptername\thischaptername
!   %
!   \ifx\curchaptername\prevchaptername
!     \chapterpagefalse
!   \else
!     \chapterpagetrue
!   \fi
! }
!=20
! % Argument parsing
 =20
  % Parse an argument, then pass it to #1.  The argument is the rest of
  % the input line (except we remove a trailing comment).  #1 should be a
  % macro which expects an ordinary undelimited TeX argument.
+ % For example, \def\foo{\parsearg\fooxxx}.
  %
  \def\parsearg{\parseargusing{}}
  \def\parseargusing#1#2{%
***************
*** 428,434 ****
    }%
  }
 =20
! % First remove any @comment, then any @c comment.
  \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
 =20
--- 449,456 ----
    }%
  }
 =20
! % First remove any @comment, then any @c comment.  Pass the result on to
! % \argcheckspaces.
  \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
 =20
***************
*** 465,478 ****
  %
  \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
 =20
  % \parseargdef\foo{...}
  %=09is roughly equivalent to
  % \def\foo{\parsearg\Xfoo}
  % \def\Xfoo#1{...}
- %
- % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
- % favourite TeX trick.  --kasal, 16nov03
-=20
  \def\parseargdef#1{%
    \expandafter \doparseargdef \csname\string#1\endcsname #1%
  }
--- 487,499 ----
  %
  \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
 =20
+=20
+ % \parseargdef - define a command taking an argument on the line
+ %
  % \parseargdef\foo{...}
  %=09is roughly equivalent to
  % \def\foo{\parsearg\Xfoo}
  % \def\Xfoo#1{...}
  \def\parseargdef#1{%
    \expandafter \doparseargdef \csname\string#1\endcsname #1%
  }
***************
*** 545,563 ****
  }
  \def\inenvironment#1{%
    \ifx#1\empty
!     out of any environment%
    \else
      in environment \expandafter\string#1%
    \fi
  }
 =20
! % @end foo executes the definition of \Efoo.
! % But first, it executes a specialized version of \checkenv
! %
  \parseargdef\end{%
    \if 1\csname iscond.#1\endcsname
    \else
!     % The general wording of \badenverr may not be ideal, but... --kasal,=
 06nov03
      \expandafter\checkenv\csname#1\endcsname
      \csname E#1\endcsname
      \endgroup
--- 566,583 ----
  }
  \def\inenvironment#1{%
    \ifx#1\empty
!     outside of any environment%
    \else
      in environment \expandafter\string#1%
    \fi
  }
 =20
!=20
! % @end foo calls \checkenv and executes the definition of \Efoo.
  \parseargdef\end{%
    \if 1\csname iscond.#1\endcsname
    \else
!     % The general wording of \badenverr may not be ideal.
      \expandafter\checkenv\csname#1\endcsname
      \csname E#1\endcsname
      \endgroup
***************
*** 583,589 ****
  \def\:{\spacefactor=3D1000 }
 =20
  % @* forces a line break.
! \def\*{\hfil\break\hbox{}\ignorespaces}
 =20
  % @/ allows a line break.
  \let\/=3D\allowbreak
--- 603,609 ----
  \def\:{\spacefactor=3D1000 }
 =20
  % @* forces a line break.
! \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
 =20
  % @/ allows a line break.
  \let\/=3D\allowbreak
***************
*** 608,614 ****
    \else\ifx\temp\offword \plainnonfrenchspacing
    \else
      \errhelp =3D \EMsimple
!     \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
    \fi\fi
  }
 =20
--- 628,634 ----
    \else\ifx\temp\offword \plainnonfrenchspacing
    \else
      \errhelp =3D \EMsimple
!     \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
    \fi\fi
  }
 =20
***************
*** 662,682 ****
      \endgraf % Not \par, as it may have been set to \lisppar.
      \global\dimen1 =3D \prevdepth
    \egroup           % End the \vtop.
    % \dimen0 is the vertical size of the group's box.
    \dimen0 =3D \ht\groupbox  \advance\dimen0 by \dp\groupbox
    % \dimen2 is how much space is left on the page (more or less).
!   \dimen2 =3D \pageheight   \advance\dimen2 by -\pagetotal
    % if the group doesn't fit on the current page, and it's a big big
    % group, force a page break.
    \ifdim \dimen0 > \dimen2
!     \ifdim \pagetotal < \vfilllimit\pageheight
        \page
      \fi
    \fi
    \box\groupbox
-   \prevdepth =3D \dimen1
-   \checkinserts
  }
  %
  % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  % message, so this ends up printing `@group can only ...'.
--- 682,707 ----
      \endgraf % Not \par, as it may have been set to \lisppar.
      \global\dimen1 =3D \prevdepth
    \egroup           % End the \vtop.
+   \addgroupbox
+   \prevdepth =3D \dimen1
+   \checkinserts
+ }
+=20
+ \def\addgroupbox{
    % \dimen0 is the vertical size of the group's box.
    \dimen0 =3D \ht\groupbox  \advance\dimen0 by \dp\groupbox
    % \dimen2 is how much space is left on the page (more or less).
!   \dimen2 =3D \txipageheight   \advance\dimen2 by -\pagetotal
    % if the group doesn't fit on the current page, and it's a big big
    % group, force a page break.
    \ifdim \dimen0 > \dimen2
!     \ifdim \pagetotal < \vfilllimit\txipageheight
        \page
      \fi
    \fi
    \box\groupbox
  }
+=20
  %
  % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  % message, so this ends up printing `@group can only ...'.
***************
*** 690,704 ****
 =20
  \newdimen\mil  \mil=3D0.001in
 =20
- % Old definition--didn't work.
- %\parseargdef\need{\par %
- %% This method tries to make TeX break the page naturally
- %% if the depth of the box does not fit.
- %{\baselineskip=3D0pt%
- %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
- %\prevdepth=3D-1000pt
- %}}
-=20
  \parseargdef\need{%
    % Ensure vertical mode, so we don't make a big box in the middle of a
    % paragraph.
--- 715,720 ----
***************
*** 809,844 ****
    \temp
  }
 =20
- % @| inserts a changebar to the left of the current line.  It should
- % surround any changed text.  This approach does *not* work if the
- % change spans more than two lines of output.  To handle that, we would
- % have adopt a much more difficult approach (putting marks into the main
- % vertical list for the beginning and end of each change).  This command
- % is not documented, not supported, and doesn't work.
- %
- \def\|{%
-   % \vadjust can only be used in horizontal mode.
-   \leavevmode
-   %
-   % Append this vertical mode material after the current line in the outp=
ut.
-   \vadjust{%
-     % We want to insert a rule with the height and depth of the current
-     % leading; that is exactly what \strutbox is supposed to record.
-     \vskip-\baselineskip
-     %
-     % \vadjust-items are inserted at the left edge of the type.  So
-     % the \llap here moves out into the left-hand margin.
-     \llap{%
-       %
-       % For a thicker or thinner bar, change the `1pt'.
-       \vrule height\baselineskip width1pt
-       %
-       % This is the space between the bar and the text.
-       \hskip 12pt
-     }%
-   }%
- }
-=20
  % @include FILE -- \input text of FILE.
  %
  \def\include{\parseargusing\filenamecatcodes\includezzz}
--- 825,830 ----
***************
*** 885,891 ****
  \def\popthisfilestack{\errthisfilestackempty}
  \def\errthisfilestackempty{\errmessage{Internal error:
    the stack of filenames is empty.}}
!=20
  \def\thisfile{}
 =20
  % @center line
--- 871,877 ----
  \def\popthisfilestack{\errthisfilestackempty}
  \def\errthisfilestackempty{\errmessage{Internal error:
    the stack of filenames is empty.}}
! %
  \def\thisfile{}
 =20
  % @center line
***************
*** 893,929 ****
  %
  \parseargdef\center{%
    \ifhmode
!     \let\next\centerH
    \else
!     \let\next\centerV
    \fi
!   \next{\hfil \ignorespaces#1\unskip \hfil}%
  }
! \def\centerH#1{%
!   {%
!     \hfil\break
!     \advance\hsize by -\leftskip
!     \advance\hsize by -\rightskip
!     \line{#1}%
!     \break
!   }%
  }
- \def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
 =20
  % @sp n   outputs n lines of vertical space
!=20
  \parseargdef\sp{\vskip #1\baselineskip}
 =20
  % @comment ...line which is ignored...
  % @c is the same as @comment
  % @ignore ... @end ignore  is another way to write a comment
 =20
- \def\comment{\begingroup \catcode`\^^M=3D\other%
- \catcode`\@=3D\other \catcode`\{=3D\other \catcode`\}=3D\other%
- \commentxxx}
- {\catcode`\^^M=3D\other \gdef\commentxxx#1^^M{\endgroup}}
 =20
! \let\c=3D\comment
 =20
  % @paragraphindent NCHARS
  % We'll use ems for NCHARS, close enough.
--- 879,926 ----
  %
  \parseargdef\center{%
    \ifhmode
!     \let\centersub\centerH
    \else
!     \let\centersub\centerV
    \fi
!   \centersub{\hfil \ignorespaces#1\unskip \hfil}%
!   \let\centersub\relax % don't let the definition persist, just in case
  }
! \def\centerH#1{{%
!   \hfil\break
!   \advance\hsize by -\leftskip
!   \advance\hsize by -\rightskip
!   \line{#1}%
!   \break
! }}
! %
! \newcount\centerpenalty
! \def\centerV#1{%
!   % The idea here is the same as in \startdefun, \cartouche, etc.: if
!   % @center is the first thing after a section heading, we need to wipe
!   % out the negative parskip inserted by \sectionheading, but still
!   % prevent a page break here.
!   \centerpenalty =3D \lastpenalty
!   \ifnum\centerpenalty>10000 \vskip\parskip \fi
!   \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
!   \line{\kern\leftskip #1\kern\rightskip}%
  }
 =20
  % @sp n   outputs n lines of vertical space
! %
  \parseargdef\sp{\vskip #1\baselineskip}
 =20
  % @comment ...line which is ignored...
  % @c is the same as @comment
  % @ignore ... @end ignore  is another way to write a comment
 =20
 =20
! \def\c{\begingroup \catcode`\^^M=3D\active%
! \catcode`\@=3D\other \catcode`\{=3D\other \catcode`\}=3D\other%
! \cxxx}
! {\catcode`\^^M=3D\active \gdef\cxxx#1^^M{\endgroup}}
! %
! \let\comment\c
 =20
  % @paragraphindent NCHARS
  % We'll use ems for NCHARS, close enough.
***************
*** 994,1065 ****
  % paragraph.
  %
  \gdef\dosuppressfirstparagraphindent{%
!   \gdef\indent{%
!     \restorefirstparagraphindent
!     \indent
!   }%
!   \gdef\noindent{%
!     \restorefirstparagraphindent
!     \noindent
!   }%
!   \global\everypar =3D {%
!     \kern -\parindent
!     \restorefirstparagraphindent
!   }%
  }
!=20
  \gdef\restorefirstparagraphindent{%
!   \global \let \indent =3D \ptexindent
!   \global \let \noindent =3D \ptexnoindent
!   \global \everypar =3D {}%
  }
 =20
 =20
  % @refill is a no-op.
  \let\refill=3D\relax
 =20
! % 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 =3D \linksfalse
!=20
! % @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{%
!    \fixbackslash  % Turn off hack to swallow `\input texinfo'.
!    \iflinks
!      \tryauxfile
!      % Open the new aux file.  TeX will close it automatically at exit.
!      \immediate\openout\auxfile=3D\jobname.aux
!    \fi % \openindices needs to do some work in any case.
!    \openindices
!    \let\setfilename=3D\comment % Ignore extra @setfilename cmds.
!    %
!    % If texinfo.cnf is present on the system, read it.
!    % Useful for site-wide @afourpaper, etc.
!    \openin 1 texinfo.cnf
!    \ifeof 1 \else \input texinfo.cnf \fi
!    \closein 1
!    %
!    \comment % Ignore the actual filename.
! }
!=20
! % Called from \setfilename.
! %
! \def\openindices{%
!   \newindex{cp}%
!   \newcodeindex{fn}%
!   \newcodeindex{vr}%
!   \newcodeindex{tp}%
!   \newcodeindex{ky}%
!   \newcodeindex{pg}%
! }
 =20
  % @bye.
! \outer\def\bye{\pagealignmacro\tracingstats=3D1\ptexend}
 =20
 =20
  \message{pdf,}
--- 991,1024 ----
  % paragraph.
  %
  \gdef\dosuppressfirstparagraphindent{%
!   \gdef\indent  {\restorefirstparagraphindent \indent}%
!   \gdef\noindent{\restorefirstparagraphindent \noindent}%
!   \global\everypar =3D {\kern -\parindent \restorefirstparagraphindent}%
  }
! %
  \gdef\restorefirstparagraphindent{%
!   \global\let\indent =3D \ptexindent
!   \global\let\noindent =3D \ptexnoindent
!   \global\everypar =3D {}%
! }
!=20
! % leave vertical mode without cancelling any first paragraph indent
! \gdef\imageindent{%
!   \toks0=3D\everypar
!   \everypar=3D{}%
!   \ptexnoindent
!   \global\everypar=3D\toks0
  }
 =20
 =20
  % @refill is a no-op.
  \let\refill=3D\relax
 =20
! % @setfilename INFO-FILENAME - ignored
! \let\setfilename=3D\comment
 =20
  % @bye.
! \outer\def\bye{\chappager\pagelabels\tracingstats=3D1\ptexend}
 =20
 =20
  \message{pdf,}
***************
*** 1074,1087 ****
  \newtoks\toksC
  \newtoks\toksD
  \newbox\boxA
  \newcount\countA
  \newif\ifpdf
  \newif\ifpdfmakepagedest
 =20
  % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=3D=
1
! % can be set).  So we test for \relax and 0 as well as \undefined,
! % borrowed from ifpdf.sty.
! \ifx\pdfoutput\undefined
  \else
    \ifx\pdfoutput\relax
    \else
--- 1033,1130 ----
  \newtoks\toksC
  \newtoks\toksD
  \newbox\boxA
+ \newbox\boxB
  \newcount\countA
  \newif\ifpdf
  \newif\ifpdfmakepagedest
 =20
+ %
+ % For LuaTeX
+ %
+=20
+ \newif\iftxiuseunicodedestname
+ \txiuseunicodedestnamefalse % For pdfTeX etc.
+=20
+ \ifx\luatexversion\thisisundefined
+ \else
+   % Use Unicode destination names
+   \txiuseunicodedestnametrue
+   % Escape PDF strings with converting UTF-16 from UTF-8
+   \begingroup
+     \catcode`\%=3D12
+     \directlua{
+       function UTF16oct(str)
+         tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '37=
7')
+         for c in string.utfvalues(str) do
+           if c < 0x10000 then
+             tex.sprint(
+               string.format(string.char(0x5c) .. string.char(0x25) .. '03=
o' ..
+                             string.char(0x5c) .. string.char(0x25) .. '03=
o',
+                             math.floor(c / 256), math.floor(c % 256)))
+           else
+             c =3D c - 0x10000
+             local c_hi =3D c / 1024 + 0xd800
+             local c_lo =3D c % 1024 + 0xdc00
+             tex.sprint(
+               string.format(string.char(0x5c) .. string.char(0x25) .. '03=
o' ..
+                             string.char(0x5c) .. string.char(0x25) .. '03=
o' ..
+                             string.char(0x5c) .. string.char(0x25) .. '03=
o' ..
+                             string.char(0x5c) .. string.char(0x25) .. '03=
o',
+                             math.floor(c_hi / 256), math.floor(c_hi % 256=
),
+                             math.floor(c_lo / 256), math.floor(c_lo % 256=
)))
+           end
+         end
+       end
+     }
+   \endgroup
+   \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}=
')}}
+   % Escape PDF strings without converting
+   \begingroup
+     \directlua{
+       function PDFescstr(str)
+         for c in string.bytes(str) do
+           if c <=3D 0x20 or c >=3D 0x80 or c =3D=3D 0x28 or c =3D=3D 0x29=
 or c =3D=3D 0x5c then
+             tex.sprint(-2,
+               string.format(string.char(0x5c) .. string.char(0x25) .. '03=
o',
+                             c))
+           else
+             tex.sprint(-2, string.char(c))
+           end
+         end
+       end
+     }
+     % The -2 in the arguments here gives all the input to TeX catcode 12
+     % (other) or 10 (space), preventing undefined control sequence errors=
. See
+     % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.htm=
l
+     %
+   \endgroup
+   \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
+   \ifnum\luatexversion>84
+     % For LuaTeX >=3D 0.85
+     \def\pdfdest{\pdfextension dest}
+     \let\pdfoutput\outputmode
+     \def\pdfliteral{\pdfextension literal}
+     \def\pdfcatalog{\pdfextension catalog}
+     \def\pdftexversion{\numexpr\pdffeedback version\relax}
+     \let\pdfximage\saveimageresource
+     \let\pdfrefximage\useimageresource
+     \let\pdflastximage\lastsavedimageresourceindex
+     \def\pdfendlink{\pdfextension endlink\relax}
+     \def\pdfoutline{\pdfextension outline}
+     \def\pdfstartlink{\pdfextension startlink}
+     \def\pdffontattr{\pdfextension fontattr}
+     \def\pdfobj{\pdfextension obj}
+     \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
+     \let\pdfpagewidth\pagewidth
+     \let\pdfpageheight\pageheight
+     \edef\pdfhorigin{\pdfvariable horigin}
+     \edef\pdfvorigin{\pdfvariable vorigin}
+   \fi
+ \fi
+=20
  % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=3D=
1
! % can be set).  So we test for \relax and 0 as well as being undefined.
! \ifx\pdfoutput\thisisundefined
  \else
    \ifx\pdfoutput\relax
    \else
***************
*** 1092,1145 ****
    \fi
  \fi
 =20
  % PDF uses PostScript string constants for the names of xref targets,
  % for display in the outlines, and in other places.  Thus, we have to
  % double any backslashes.  Otherwise, a name like "\node" will be
  % interpreted as a newline (\n), followed by o, d, e.  Not good.
! % http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
! % (and related messages, the final outcome is that it is up to the TeX
! % user to double the backslashes and otherwise make the string valid, so
! % that's what we do).
!=20
! % double active backslashes.
! %
! {\catcode`\@=3D0 \catcode`\\=3D\active
!  @gdef@activebackslashdouble{%
!    @catcode`@\=3D@active
!    @let\=3D@doublebackslash}
! }
!=20
! % To handle parens, we must adopt a different approach, since parens are
! % not active characters.  hyperref.dtx (which has the same problem as
! % us) handles it with this amazing macro to replace tokens, with minor
! % changes for Texinfo.  It is included here under the GPL by permission
! % from the author, Heiko Oberdiek.
! %
! % #1 is the tokens to replace.
! % #2 is the replacement.
! % #3 is the control sequence with the string.
! %
! \def\HyPsdSubst#1#2#3{%
!   \def\HyPsdReplace##1#1##2\END{%
!     ##1%
!     \ifx\\##2\\%
!     \else
!       #2%
!       \HyReturnAfterFi{%
!         \HyPsdReplace##2\END
!       }%
!     \fi
!   }%
!   \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
! }
! \long\def\HyReturnAfterFi#1\fi{\fi#1}
!=20
! % #1 is a control sequence in which to do the replacements.
! \def\backslashparens#1{%
!   \xdef#1{#1}% redefine it as its expansion; the definition is simply
!              % \lastnode when called from \setref -> \pdfmkdest.
!   \HyPsdSubst{(}{\realbackslash(}{#1}%
!   \HyPsdSubst{)}{\realbackslash)}{#1}%
  }
 =20
  \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf imag=
es
--- 1135,1220 ----
    \fi
  \fi
 =20
+ \newif\ifpdforxetex
+ \pdforxetexfalse
+ \ifpdf
+   \pdforxetextrue
+ \fi
+ \ifx\XeTeXrevision\thisisundefined\else
+   \pdforxetextrue
+ \fi
+=20
+=20
+ % Output page labels information.
+ % See PDF reference v.1.7 p.594, section 8.3.1.
+ \ifpdf
+ \def\pagelabels{%
+   \def\title{0 << /P (T-) /S /D >>}%
+   \edef\roman{\the\romancount << /S /r >>}%
+   \edef\arabic{\the\arabiccount << /S /D >>}%
+   %
+   % Page label ranges must be increasing.  Remove any duplicates.
+   % (There is a slight chance of this being wrong if e.g. there is
+   % a @contents but no @titlepage, etc.)
+   %
+   \ifnum\romancount=3D0 \def\roman{}\fi
+   \ifnum\arabiccount=3D0 \def\title{}%
+   \else
+     \ifnum\romancount=3D\arabiccount \def\roman{}\fi
+   \fi
+   %
+   \ifnum\romancount<\arabiccount
+     \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax
+   \else
+     \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax
+   \fi
+ }
+ \else
+   \let\pagelabels\relax
+ \fi
+=20
+ \newcount\pagecount \pagecount=3D0
+ \newcount\romancount \romancount=3D0
+ \newcount\arabiccount \arabiccount=3D0
+ \ifpdf
+   \let\ptxadvancepageno\advancepageno
+   \def\advancepageno{%
+     \ptxadvancepageno\global\advance\pagecount by 1
+   }
+ \fi
+=20
+=20
  % PDF uses PostScript string constants for the names of xref targets,
  % for display in the outlines, and in other places.  Thus, we have to
  % double any backslashes.  Otherwise, a name like "\node" will be
  % interpreted as a newline (\n), followed by o, d, e.  Not good.
! %
! % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
! % related messages.  The final outcome is that it is up to the TeX user
! % to double the backslashes and otherwise make the string valid, so
! % that's what we do.  pdftex 1.30.0 (ca.2005) introduced a primitive to
! % do this reliably, so we use it.
!=20
! % #1 is a control sequence in which to do the replacements,
! % which we \xdef.
! \def\txiescapepdf#1{%
!   \ifx\pdfescapestring\thisisundefined
!     % No primitive available; should we give a warning or log?
!     % Many times it won't matter.
!     \xdef#1{#1}%
!   \else
!     % The expandable \pdfescapestring primitive escapes parentheses,
!     % backslashes, and other special chars.
!     \xdef#1{\pdfescapestring{#1}}%
!   \fi
! }
! \def\txiescapepdfutfsixteen#1{%
!   \ifx\pdfescapestrutfsixteen\thisisundefined
!     % No UTF-16 converting macro available.
!     \txiescapepdf{#1}%
!   \else
!     \xdef#1{\pdfescapestrutfsixteen{#1}}%
!   \fi
  }
 =20
  \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf imag=
es
***************
*** 1149,1169 ****
 =20
  \ifpdf
    %
!   % Color manipulation macros based on pdfcolor.tex,
    % except using rgb instead of cmyk; the latter is said to render as a
    % very dark gray on-screen and a very dark halftone in print, instead
!   % of actual black.
    \def\rgbDarkRed{0.50 0.09 0.12}
    \def\rgbBlack{0 0 0}
    %
!   % k sets the color for filling (usual text, etc.);
!   % K sets the color for stroking (thin rules, e.g., normal _'s).
    \def\pdfsetcolor#1{\pdfliteral{#1 rg  #1 RG}}
    %
    % Set color, and create a mark which defines \thiscolor accordingly,
    % so that \makeheadline knows which color to restore.
    \def\setcolor#1{%
!     \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
      \domark
      \pdfsetcolor{#1}%
    }
--- 1224,1246 ----
 =20
  \ifpdf
    %
!   % Color manipulation macros using ideas from pdfcolor.tex,
    % except using rgb instead of cmyk; the latter is said to render as a
    % very dark gray on-screen and a very dark halftone in print, instead
!   % of actual black. The dark red here is dark enough to print on paper a=
s
!   % nearly black, but still distinguishable for online viewing.  We use
!   % black by default, though.
    \def\rgbDarkRed{0.50 0.09 0.12}
    \def\rgbBlack{0 0 0}
    %
!   % rg sets the color for filling (usual text, etc.);
!   % RG sets the color for stroking (thin rules, e.g., normal _'s).
    \def\pdfsetcolor#1{\pdfliteral{#1 rg  #1 RG}}
    %
    % Set color, and create a mark which defines \thiscolor accordingly,
    % so that \makeheadline knows which color to restore.
    \def\setcolor#1{%
!     \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
      \domark
      \pdfsetcolor{#1}%
    }
***************
*** 1171,1177 ****
    \def\maincolor{\rgbBlack}
    \pdfsetcolor{\maincolor}
    \edef\thiscolor{\maincolor}
!   \def\lastcolordefs{}
    %
    \def\makefootline{%
      \baselineskip24pt
--- 1248,1254 ----
    \def\maincolor{\rgbBlack}
    \pdfsetcolor{\maincolor}
    \edef\thiscolor{\maincolor}
!   \def\currentcolordefs{}
    %
    \def\makefootline{%
      \baselineskip24pt
***************
*** 1198,1229 ****
    %
    % #1 is image name, #2 width (might be empty/whitespace), #3 height (di=
tto).
    \def\dopdfimage#1#2#3{%
!     \def\imagewidth{#2}\setbox0 =3D \hbox{\ignorespaces #2}%
!     \def\imageheight{#3}\setbox2 =3D \hbox{\ignorespaces #3}%
      %
!     % pdftex (and the PDF format) support .png, .jpg, .pdf (among
!     % others).  Let's try in that order.
      \let\pdfimgext=3D\empty
      \begingroup
!       \openin 1 #1.png \ifeof 1
!         \openin 1 #1.jpg \ifeof 1
!           \openin 1 #1.jpeg \ifeof 1
!             \openin 1 #1.JPG \ifeof 1
!               \openin 1 #1.pdf \ifeof 1
!                 \openin 1 #1.PDF \ifeof 1
                    \errhelp =3D \nopdfimagehelp
                    \errmessage{Could not find image file #1 for pdf}%
!                 \else \gdef\pdfimgext{PDF}%
                  \fi
!               \else \gdef\pdfimgext{pdf}%
                \fi
!             \else \gdef\pdfimgext{JPG}%
              \fi
!           \else \gdef\pdfimgext{jpeg}%
            \fi
!         \else \gdef\pdfimgext{jpg}%
          \fi
!       \else \gdef\pdfimgext{png}%
        \fi
        \closein 1
      \endgroup
--- 1275,1308 ----
    %
    % #1 is image name, #2 width (might be empty/whitespace), #3 height (di=
tto).
    \def\dopdfimage#1#2#3{%
!     \def\pdfimagewidth{#2}\setbox0 =3D \hbox{\ignorespaces #2}%
!     \def\pdfimageheight{#3}\setbox2 =3D \hbox{\ignorespaces #3}%
      %
!     % pdftex (and the PDF format) support .pdf, .png, .jpg (among
!     % others).  Let's try in that order, PDF first since if
!     % someone has a scalable image, presumably better to use that than a
!     % bitmap.
      \let\pdfimgext=3D\empty
      \begingroup
!       \openin 1 #1.pdf \ifeof 1
!         \openin 1 #1.PDF \ifeof 1
!           \openin 1 #1.png \ifeof 1
!             \openin 1 #1.jpg \ifeof 1
!               \openin 1 #1.jpeg \ifeof 1
!                 \openin 1 #1.JPG \ifeof 1
                    \errhelp =3D \nopdfimagehelp
                    \errmessage{Could not find image file #1 for pdf}%
!                 \else \gdef\pdfimgext{JPG}%
                  \fi
!               \else \gdef\pdfimgext{jpeg}%
                \fi
!             \else \gdef\pdfimgext{jpg}%
              \fi
!           \else \gdef\pdfimgext{png}%
            \fi
!         \else \gdef\pdfimgext{PDF}%
          \fi
!       \else \gdef\pdfimgext{pdf}%
        \fi
        \closein 1
      \endgroup
***************
*** 1235,1242 ****
      \else
        \immediate\pdfximage
      \fi
!       \ifdim \wd0 >0pt width \imagewidth \fi
!       \ifdim \wd2 >0pt height \imageheight \fi
        \ifnum\pdftexversion<13
           #1.\pdfimgext
         \else
--- 1314,1321 ----
      \else
        \immediate\pdfximage
      \fi
!       \ifdim \wd0 >0pt width \pdfimagewidth \fi
!       \ifdim \wd2 >0pt height \pdfimageheight \fi
        \ifnum\pdftexversion<13
           #1.\pdfimgext
         \else
***************
*** 1246,1270 ****
        \pdfrefximage \pdflastximage
      \fi}
    %
!   \def\pdfmkdest#1{{%
      % We have to set dummies so commands such as @code, and characters
      % such as \, aren't expanded when present in a section title.
      \indexnofonts
-     \turnoffactive
-     \activebackslashdouble
      \makevalueexpandable
      \def\pdfdestname{#1}%
!     \backslashparens\pdfdestname
!     \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
    }}
    %
    % used to mark target names; must be expandable.
    \def\pdfmkpgn#1{#1}
    %
!   % by default, use a color that is dark enough to print on paper as
!   % nearly black, but still distinguishable for online viewing.
!   \def\urlcolor{\rgbDarkRed}
!   \def\linkcolor{\rgbDarkRed}
    \def\endlink{\setcolor{\maincolor}\pdfendlink}
    %
    % Adding outlines to PDF; macros for calculating structure of outlines
--- 1325,1407 ----
        \pdfrefximage \pdflastximage
      \fi}
    %
!   \def\setpdfdestname#1{{%
      % We have to set dummies so commands such as @code, and characters
      % such as \, aren't expanded when present in a section title.
      \indexnofonts
      \makevalueexpandable
+     \turnoffactive
+     \iftxiuseunicodedestname
+       \ifx \declaredencoding \latone
+         % Pass through Latin-1 characters.
+         % LuaTeX with byte wise I/O converts Latin-1 characters to Unicod=
e.
+       \else
+         \ifx \declaredencoding \utfeight
+           % Pass through Unicode characters.
+         \else
+           % Use ASCII approximations in destination names.
+           \passthroughcharsfalse
+         \fi
+       \fi
+     \else
+       % Use ASCII approximations in destination names.
+       \passthroughcharsfalse
+     \fi
      \def\pdfdestname{#1}%
!     \txiescapepdf\pdfdestname
!   }}
!   %
!   \def\setpdfoutlinetext#1{{%
!     \indexnofonts
!     \makevalueexpandable
!     \turnoffactive
!     \ifx \declaredencoding \latone
!       % The PDF format can use an extended form of Latin-1 in bookmark
!       % strings.  See Appendix D of the PDF Reference, Sixth Edition, for
!       % the "PDFDocEncoding".
!       \passthroughcharstrue
!       % Pass through Latin-1 characters.
!       %   LuaTeX: Convert to Unicode
!       %   pdfTeX: Use Latin-1 as PDFDocEncoding
!       \def\pdfoutlinetext{#1}%
!     \else
!       \ifx \declaredencoding \utfeight
!         \ifx\luatexversion\thisisundefined
!           % For pdfTeX  with UTF-8.
!           % TODO: the PDF format can use UTF-16 in bookmark strings,
!           % but the code for this isn't done yet.
!           % Use ASCII approximations.
!           \passthroughcharsfalse
!           \def\pdfoutlinetext{#1}%
!         \else
!           % For LuaTeX with UTF-8.
!           % Pass through Unicode characters for title texts.
!           \passthroughcharstrue
!           \def\pdfoutlinetext{#1}%
!         \fi
!       \else
!         % For non-Latin-1 or non-UTF-8 encodings.
!         % Use ASCII approximations.
!         \passthroughcharsfalse
!         \def\pdfoutlinetext{#1}%
!       \fi
!     \fi
!     % LuaTeX: Convert to UTF-16
!     % pdfTeX: Use Latin-1 as PDFDocEncoding
!     \txiescapepdfutfsixteen\pdfoutlinetext
    }}
    %
+   \def\pdfmkdest#1{%
+     \setpdfdestname{#1}%
+     \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+   }
+   %
    % used to mark target names; must be expandable.
    \def\pdfmkpgn#1{#1}
    %
!   % by default, use black for everything.
!   \def\urlcolor{\rgbBlack}
!   \def\linkcolor{\rgbBlack}
    \def\endlink{\setcolor{\maincolor}\pdfendlink}
    %
    % Adding outlines to PDF; macros for calculating structure of outlines
***************
*** 1286,1313 ****
      % page number.  We could generate a destination for the section
      % text in the case where a section has no node, but it doesn't
      % seem worth the trouble, since most documents are normally structure=
d.
!     \def\pdfoutlinedest{#3}%
!     \ifx\pdfoutlinedest\empty
!       \def\pdfoutlinedest{#4}%
!     \else
!       % Doubled backslashes in the name.
!       {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
!        \backslashparens\pdfoutlinedest}%
      \fi
      %
!     % Also double the backslashes in the display string.
!     {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
!      \backslashparens\pdfoutlinetext}%
!     %
!     \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
    }
    %
    \def\pdfmakeoutlines{%
      \begingroup
-       % Thanh's hack / proper braces in bookmarks
-       \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=3D\mylbrace
-       \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=3D\myrbrace
-       %
        % Read toc silently, to get counts of subentries for \pdfoutline.
        \def\partentry##1##2##3##4{}% ignore parts in the outlines
        \def\numchapentry##1##2##3##4{%
--- 1423,1439 ----
      % page number.  We could generate a destination for the section
      % text in the case where a section has no node, but it doesn't
      % seem worth the trouble, since most documents are normally structure=
d.
!     \setpdfoutlinetext{#1}
!     \setpdfdestname{#3}
!     \ifx\pdfdestname\empty
!       \def\pdfdestname{#4}%
      \fi
      %
!     \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
    }
    %
    \def\pdfmakeoutlines{%
      \begingroup
        % Read toc silently, to get counts of subentries for \pdfoutline.
        \def\partentry##1##2##3##4{}% ignore parts in the outlines
        \def\numchapentry##1##2##3##4{%
***************
*** 1348,1354 ****
--- 1474,1486 ----
        % subentries, which we calculated on our first read of the .toc abo=
ve.
        %
        % We use the node names as the destinations.
+       %
+       % Currently we prefix the section name with the section number
+       % for chapter and appendix headings only in order to avoid too much
+       % horizontal space being required in the PDF viewer.
        \def\numchapentry##1##2##3##4{%
+         \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+       \def\unnchapentry##1##2##3##4{%
          \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
        \def\numsecentry##1##2##3##4{%
          \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
***************
*** 1363,1387 ****
        % Latin 2 (0xea) gets translated to a | character.  Info from
        % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
        %
!       % xx to do this right, we have to translate 8-bit characters to
!       % their "best" equivalent, based on the @documentencoding.  Right
!       % now, I guess we'll just let the pdf reader have its way.
        \indexnofonts
        \setupdatafile
        \catcode`\\=3D\active \otherbackslash
        \input \tocreadfilename
      \endgroup
    }
    %
    \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=3D0\expandafter\skipspaces#1|\relax}
    \ifnum\pdftexversion < 14
      \let \startlink \pdfannotlink
    \else
--- 1495,1535 ----
        % Latin 2 (0xea) gets translated to a | character.  Info from
        % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
        %
!       % TODO this right, we have to translate 8-bit characters to
!       % their "best" equivalent, based on the @documentencoding.  Too
!       % much work for too little return.  Just use the ASCII equivalents
!       % we use for the index sort strings.
!       %
        \indexnofonts
        \setupdatafile
+       % We can have normal brace characters in the PDF outlines, unlike
+       % Texinfo index files.  So set that up.
+       \def\{{\lbracecharliteral}%
+       \def\}{\rbracecharliteral}%
        \catcode`\\=3D\active \otherbackslash
        \input \tocreadfilename
      \endgroup
    }
+   {\catcode`[=3D1 \catcode`]=3D2
+    \catcode`{=3D\other \catcode`}=3D\other
+    \gdef\lbracecharliteral[{]%
+    \gdef\rbracecharliteral[}]%
+   ]
    %
    \def\skipspaces#1{\def\PP{#1}\def\D{|}%
      \ifx\PP\D\let\nextsp\relax
      \else\let\nextsp\skipspaces
!       \addtokens{\filename}{\PP}%
!       \advance\filenamelength by 1
      \fi
      \nextsp}
!   \def\getfilename#1{%
!     \filenamelength=3D0
!     % If we don't expand the argument now, \skipspaces will get
!     % snagged on things like "@value{foo}".
!     \edef\temp{#1}%
!     \expandafter\skipspaces\temp|\relax
!   }
    \ifnum\pdftexversion < 14
      \let \startlink \pdfannotlink
    \else
***************
*** 1407,1412 ****
--- 1555,1563 ----
        \startlink attr{/Border [0 0 0]}%
          user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
      \endgroup}
+   % \pdfgettoks - Surround page numbers in #1 with @pdflink.  #1 may
+   % be a simple number, or a list of numbers in the case of an index
+   % entry.
    \def\pdfgettoks#1.{\setbox\boxA=3D\hbox{\toksA=3D{#1.}\toksB=3D{}\maket=
oks}}
    \def\addtokens#1#2{\edef\addtoks{\noexpand#1=3D{\the#1#2}}\addtoks}
    \def\adn#1{\addtokens{\toksC}{#1}\global\countA=3D1\let\next=3D\maketok=
s}
***************
*** 1442,1531 ****
    \let\pdfmakeoutlines =3D \relax
  \fi  % \ifx\pdfoutput
 =20
-=20
- \message{fonts,}
-=20
- % Change the current font style to #1, remembering it in \curfontstyle.
- % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
- % italics, not bold italics.
- %
- \def\setfontstyle#1{%
-   \def\curfontstyle{#1}% not as a control sequence, because we are \edef'=
d.
-   \csname ten#1\endcsname  % change the current font
- }
-=20
- % Select #1 fonts with the current style.
- %
- \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsna=
me}
-=20
- \def\rm{\fam=3D0 \setfontstyle{rm}}
- \def\it{\fam=3D\itfam \setfontstyle{it}}
- \def\sl{\fam=3D\slfam \setfontstyle{sl}}
- \def\bf{\fam=3D\bffam \setfontstyle{bf}}\def\bfstylename{bf}
- \def\tt{\fam=3D\ttfam \setfontstyle{tt}}
-=20
- % Unfortunately, we have to override this for titles and the like, since
- % in those cases "rm" is bold.  Sigh.
- \def\rmisbold{\rm\def\curfontstyle{bf}}
-=20
- % Texinfo sort of supports the sans serif font style, which plain TeX doe=
s not.
- % So we set up a \sf.
- \newfam\sffam
- \def\sf{\fam=3D\sffam \setfontstyle{sf}}
- \let\li =3D \sf % Sometimes we call it \li, not \sf.
-=20
- % We don't need math for this font style.
- \def\ttsl{\setfontstyle{ttsl}}
-=20
-=20
- % Default leading.
- \newdimen\textleading  \textleading =3D 13.2pt
-=20
- % Set the baselineskip to #1, and the lineskip and strut size
- % correspondingly.  There is no deep meaning behind these magic numbers
- % used as factors; they just match (closely enough) what Knuth defined.
- %
- \def\lineskipfactor{.08333}
- \def\strutheightpercent{.70833}
- \def\strutdepthpercent {.29167}
- %
- % can get a sort of poor man's double spacing by redefining this.
- \def\baselinefactor{1}
  %
! \def\setleading#1{%
!   \dimen0 =3D #1\relax
!   \normalbaselineskip =3D \baselinefactor\dimen0
!   \normallineskip =3D \lineskipfactor\normalbaselineskip
!   \normalbaselines
!   \setbox\strutbox =3D\hbox{%
!     \vrule width0pt height\strutheightpercent\baselineskip
!                     depth \strutdepthpercent \baselineskip
!   }%
! }
!=20
! % PDF CMaps.  See also LaTeX's t1.cmap.
  %
! % do nothing with this by default.
! \expandafter\let\csname cmapOT1\endcsname\gobble
! \expandafter\let\csname cmapOT1IT\endcsname\gobble
! \expandafter\let\csname cmapOT1TT\endcsname\gobble
!=20
! % if we are producing pdf, and we have \pdffontattr, then define cmaps.
! % (\pdffontattr was introduced many years ago, but people still run
! % older pdftex's; it's easy to conditionalize, so we do.)
! \ifpdf \ifx\pdffontattr\undefined \else
!   \begingroup
!     \catcode`\^^M=3D\active \def^^M{^^J}% Output line endings as the ^^J =
char.
!     \catcode`\%=3D12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CM=
ap
! %%DocumentNeededResources: ProcSet (CIDInit)
! %%IncludeResource: ProcSet (CIDInit)
! %%BeginResource: CMap (TeX-OT1-0)
! %%Title: (TeX-OT1-0 TeX OT1 0)
! %%Version: 1.000
! %%EndComments
! /CIDInit /ProcSet findresource begin
! 12 dict begin
! begincmap
  /CIDSystemInfo
  << /Registry (TeX)
  /Ordering (OT1)
--- 1593,1945 ----
    \let\pdfmakeoutlines =3D \relax
  \fi  % \ifx\pdfoutput
 =20
  %
! % For XeTeX
  %
! \ifx\XeTeXrevision\thisisundefined
! \else
!   %
!   % XeTeX version check
!   %
!   \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1
!     % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307.
!     % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941)=
.
!     % For avoiding PDF destination name replacement, we use this special
!     % instead of xdvipdfmx's command line option `-C 0x0010'.
!     \special{dvipdfmx:config C 0x0010}
!     % XeTeX 0.99995+ comes with xdvipdfmx 20160307+.
!     % It can handle Unicode destination names for PDF.
!     \txiuseunicodedestnametrue
!   \else
!     % XeTeX < 0.99996 (TeX Live < 2016) cannot use the
!     % `dvipdfmx:config' special.
!     % So for avoiding PDF destination name replacement,
!     % xdvipdfmx's command line option `-C 0x0010' is necessary.
!     %
!     % XeTeX < 0.99995 can not handle Unicode destination names for PDF
!     % because xdvipdfmx 20150315 has a UTF-16 conversion issue.
!     % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
!     \txiuseunicodedestnamefalse
!   \fi
!   %
!   % Color support
!   %
!   \def\rgbDarkRed{0.50 0.09 0.12}
!   \def\rgbBlack{0 0 0}
!   %
!   \def\pdfsetcolor#1{\special{pdf:scolor [#1]}}
!   %
!   % Set color, and create a mark which defines \thiscolor accordingly,
!   % so that \makeheadline knows which color to restore.
!   \def\setcolor#1{%
!     \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
!     \domark
!     \pdfsetcolor{#1}%
!   }
!   %
!   \def\maincolor{\rgbBlack}
!   \pdfsetcolor{\maincolor}
!   \edef\thiscolor{\maincolor}
!   \def\currentcolordefs{}
!   %
!   \def\makefootline{%
!     \baselineskip24pt
!     \line{\pdfsetcolor{\maincolor}\the\footline}%
!   }
!   %
!   \def\makeheadline{%
!     \vbox to 0pt{%
!       \vskip-22.5pt
!       \line{%
!         \vbox to8.5pt{}%
!         % Extract \thiscolor definition from the marks.
!         \getcolormarks
!         % Typeset the headline with \maincolor, then restore the color.
!         \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
!       }%
!       \vss
!     }%
!     \nointerlineskip
!   }
!   %
!   % PDF outline support
!   %
!   % Emulate pdfTeX primitive
!   \def\pdfdest name#1 xyz{%
!     \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}%
!   }
!   %
!   \def\setpdfdestname#1{{%
!     % We have to set dummies so commands such as @code, and characters
!     % such as \, aren't expanded when present in a section title.
!     \indexnofonts
!     \makevalueexpandable
!     \turnoffactive
!     \iftxiuseunicodedestname
!       % Pass through Unicode characters.
!     \else
!       % Use ASCII approximations in destination names.
!       \passthroughcharsfalse
!     \fi
!     \def\pdfdestname{#1}%
!     \txiescapepdf\pdfdestname
!   }}
!   %
!   \def\setpdfoutlinetext#1{{%
!     \turnoffactive
!     % Always use Unicode characters in title texts.
!     \def\pdfoutlinetext{#1}%
!     % For XeTeX, xdvipdfmx converts to UTF-16.
!     % So we do not convert.
!     \txiescapepdf\pdfoutlinetext
!   }}
!   %
!   \def\pdfmkdest#1{%
!     \setpdfdestname{#1}%
!     \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
!   }
!   %
!   % by default, use black for everything.
!   \def\urlcolor{\rgbBlack}
!   \def\linkcolor{\rgbBlack}
!   \def\endlink{\setcolor{\maincolor}\pdfendlink}
!   %
!   \def\dopdfoutline#1#2#3#4{%
!     \setpdfoutlinetext{#1}
!     \setpdfdestname{#3}
!     \ifx\pdfdestname\empty
!       \def\pdfdestname{#4}%
!     \fi
!     %
!     \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
!       << /S /GoTo /D (\pdfdestname) >> >> }%
!   }
!   %
!   \def\pdfmakeoutlines{%
!     \begingroup
!       %
!       % For XeTeX, counts of subentries are not necessary.
!       % Therefore, we read toc only once.
!       %
!       % We use node names as destinations.
!       %
!       % Currently we prefix the section name with the section number
!       % for chapter and appendix headings only in order to avoid too much
!       % horizontal space being required in the PDF viewer.
!       \def\partentry##1##2##3##4{}% ignore parts in the outlines
!       \def\numchapentry##1##2##3##4{%
!         \dopdfoutline{##2 ##1}{1}{##3}{##4}}%
!       \def\numsecentry##1##2##3##4{%
!         \dopdfoutline{##1}{2}{##3}{##4}}%
!       \def\numsubsecentry##1##2##3##4{%
!         \dopdfoutline{##1}{3}{##3}{##4}}%
!       \def\numsubsubsecentry##1##2##3##4{%
!         \dopdfoutline{##1}{4}{##3}{##4}}%
!       %
!       \let\appentry\numchapentry%
!       \let\appsecentry\numsecentry%
!       \let\appsubsecentry\numsubsecentry%
!       \let\appsubsubsecentry\numsubsubsecentry%
!       \def\unnchapentry##1##2##3##4{%
!         \dopdfoutline{##1}{1}{##3}{##4}}%
!       \let\unnsecentry\numsecentry%
!       \let\unnsubsecentry\numsubsecentry%
!       \let\unnsubsubsecentry\numsubsubsecentry%
!       %
!       % For XeTeX, xdvipdfmx converts strings to UTF-16.
!       % Therefore, the encoding and the language may not be considered.
!       %
!       \indexnofonts
!       \setupdatafile
!       % We can have normal brace characters in the PDF outlines, unlike
!       % Texinfo index files.  So set that up.
!       \def\{{\lbracecharliteral}%
!       \def\}{\rbracecharliteral}%
!       \catcode`\\=3D\active \otherbackslash
!       \input \tocreadfilename
!     \endgroup
!   }
!   {\catcode`[=3D1 \catcode`]=3D2
!    \catcode`{=3D\other \catcode`}=3D\other
!    \gdef\lbracecharliteral[{]%
!    \gdef\rbracecharliteral[}]%
!   ]
!=20
!   \special{pdf:docview << /PageMode /UseOutlines >> }
!   % ``\special{pdf:tounicode ...}'' is not necessary
!   % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
!   % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315,
!   % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings.
!   % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
! %
!   \def\skipspaces#1{\def\PP{#1}\def\D{|}%
!     \ifx\PP\D\let\nextsp\relax
!     \else\let\nextsp\skipspaces
!       \addtokens{\filename}{\PP}%
!       \advance\filenamelength by 1
!     \fi
!     \nextsp}
!   \def\getfilename#1{%
!     \filenamelength=3D0
!     % If we don't expand the argument now, \skipspaces will get
!     % snagged on things like "@value{foo}".
!     \edef\temp{#1}%
!     \expandafter\skipspaces\temp|\relax
!   }
!   % make a live url in pdf output.
!   \def\pdfurl#1{%
!     \begingroup
!       % it seems we really need yet another set of dummies; have not
!       % tried to figure out what each command should do in the context
!       % of @url.  for now, just make @/ a no-op, that's the only one
!       % people have actually reported a problem with.
!       %
!       \normalturnoffactive
!       \def\@{@}%
!       \let\/=3D\empty
!       \makevalueexpandable
!       % do we want to go so far as to use \indexnofonts instead of just
!       % special-casing \var here?
!       \def\var##1{##1}%
!       %
!       \leavevmode\setcolor{\urlcolor}%
!       \special{pdf:bann << /Border [0 0 0]
!         /Subtype /Link /A << /S /URI /URI (#1) >> >>}%
!     \endgroup}
!   \def\endlink{\setcolor{\maincolor}\special{pdf:eann}}
!   \def\pdfgettoks#1.{\setbox\boxA=3D\hbox{\toksA=3D{#1.}\toksB=3D{}\maket=
oks}}
!   \def\addtokens#1#2{\edef\addtoks{\noexpand#1=3D{\the#1#2}}\addtoks}
!   \def\adn#1{\addtokens{\toksC}{#1}\global\countA=3D1\let\next=3D\maketok=
s}
!   \def\poptoks#1#2|ENDTOKS|{\let\first=3D#1\toksD=3D{#1}\toksA=3D{#2}}
!   \def\maketoks{%
!     \expandafter\poptoks\the\toksA|ENDTOKS|\relax
!     \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=3D\countA\else\makelink\fi
!       \ifx\first.\let\next=3D\done\else
!         \let\next=3D\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=3D{}\global\countA=3D0}
!   \def\pdflink#1{%
!     \special{pdf:bann << /Border [0 0 0]
!       /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
!     \setcolor{\linkcolor}#1\endlink}
!   \def\done{\edef\st{\global\noexpand\toksA=3D{\the\toksB}}\st}
! %
!   %
!   % @image support
!   %
!   % #1 is image name, #2 width (might be empty/whitespace), #3 height (di=
tto).
!   \def\doxeteximage#1#2#3{%
!     \def\xeteximagewidth{#2}\setbox0 =3D \hbox{\ignorespaces #2}%
!     \def\xeteximageheight{#3}\setbox2 =3D \hbox{\ignorespaces #3}%
!     %
!     % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among
!     % others).  Let's try in that order, PDF first since if
!     % someone has a scalable image, presumably better to use that than a
!     % bitmap.
!     \let\xeteximgext=3D\empty
!     \begingroup
!       \openin 1 #1.pdf \ifeof 1
!         \openin 1 #1.PDF \ifeof 1
!           \openin 1 #1.png \ifeof 1
!             \openin 1 #1.jpg \ifeof 1
!               \openin 1 #1.jpeg \ifeof 1
!                 \openin 1 #1.JPG \ifeof 1
!                   \errmessage{Could not find image file #1 for XeTeX}%
!                 \else \gdef\xeteximgext{JPG}%
!                 \fi
!               \else \gdef\xeteximgext{jpeg}%
!               \fi
!             \else \gdef\xeteximgext{jpg}%
!             \fi
!           \else \gdef\xeteximgext{png}%
!           \fi
!         \else \gdef\xeteximgext{PDF}%
!         \fi
!       \else \gdef\xeteximgext{pdf}%
!       \fi
!       \closein 1
!     \endgroup
!     %
!     % Putting an \hbox around the image can prevent an over-long line
!     % after the image.
!     \hbox\bgroup
!       \def\xetexpdfext{pdf}%
!       \ifx\xeteximgext\xetexpdfext
!         \XeTeXpdffile "#1".\xeteximgext ""
!       \else
!         \def\xetexpdfext{PDF}%
!         \ifx\xeteximgext\xetexpdfext
!           \XeTeXpdffile "#1".\xeteximgext ""
!         \else
!           \XeTeXpicfile "#1".\xeteximgext ""
!         \fi
!       \fi
!       \ifdim \wd0 >0pt width \xeteximagewidth \fi
!       \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
!     \egroup
!   }
! \fi
!=20
!=20
! %
! \message{fonts,}
!=20
! % Set the baselineskip to #1, and the lineskip and strut size
! % correspondingly.  There is no deep meaning behind these magic numbers
! % used as factors; they just match (closely enough) what Knuth defined.
! %
! \def\lineskipfactor{.08333}
! \def\strutheightpercent{.70833}
! \def\strutdepthpercent {.29167}
! %
! % can get a sort of poor man's double spacing by redefining this.
! \def\baselinefactor{1}
! %
! \newdimen\textleading
! \def\setleading#1{%
!   \dimen0 =3D #1\relax
!   \normalbaselineskip =3D \baselinefactor\dimen0
!   \normallineskip =3D \lineskipfactor\normalbaselineskip
!   \normalbaselines
!   \setbox\strutbox =3D\hbox{%
!     \vrule width0pt height\strutheightpercent\baselineskip
!                     depth \strutdepthpercent \baselineskip
!   }%
! }
!=20
! % PDF CMaps.  See also LaTeX's t1.cmap.
! %
! % do nothing with this by default.
! \expandafter\let\csname cmapOT1\endcsname\gobble
! \expandafter\let\csname cmapOT1IT\endcsname\gobble
! \expandafter\let\csname cmapOT1TT\endcsname\gobble
!=20
! % if we are producing pdf, and we have \pdffontattr, then define cmaps.
! % (\pdffontattr was introduced many years ago, but people still run
! % older pdftex's; it's easy to conditionalize, so we do.)
! \ifpdf \ifx\pdffontattr\thisisundefined \else
!   \begingroup
!     \catcode`\^^M=3D\active \def^^M{^^J}% Output line endings as the ^^J =
char.
!     \catcode`\%=3D12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CM=
ap
! %%DocumentNeededResources: ProcSet (CIDInit)
! %%IncludeResource: ProcSet (CIDInit)
! %%BeginResource: CMap (TeX-OT1-0)
! %%Title: (TeX-OT1-0 TeX OT1 0)
! %%Version: 1.000
! %%EndComments
! /CIDInit /ProcSet findresource begin
! 12 dict begin
! begincmap
  /CIDSystemInfo
  << /Registry (TeX)
  /Ordering (OT1)
***************
*** 1764,1791 ****
  \fi\fi
 =20
 =20
! % Set the font macro #1 to the font named #2, adding on the
! % specified font prefix (normally `cm').
  % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
! % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
! % empty to omit).
  \def\setfont#1#2#3#4#5{%
    \font#1=3D\fontprefix#2#3 scaled #4
    \csname cmap#5\endcsname#1%
  }
  % This is what gets called when #5 of \setfont is empty.
  \let\cmap\gobble
! % emacs-page end of cmaps
 =20
  % Use cm as the default font prefix.
  % To specify the font prefix, you must define \fontprefix
  % before you read in texinfo.tex.
! \ifx\fontprefix\undefined
  \def\fontprefix{cm}
  \fi
  % Support font families that don't use the same naming scheme as CM.
  \def\rmshape{r}
! \def\rmbshape{bx}               %where the normal face is bold
  \def\bfshape{b}
  \def\bxshape{bx}
  \def\ttshape{tt}
--- 2178,2211 ----
  \fi\fi
 =20
 =20
! % Set the font macro #1 to the font named \fontprefix#2.
  % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
! % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
! % Example:
! % #1 =3D \textrm
! % #2 =3D \rmshape
! % #3 =3D 10
! % #4 =3D \mainmagstep
! % #5 =3D OT1
! %
  \def\setfont#1#2#3#4#5{%
    \font#1=3D\fontprefix#2#3 scaled #4
    \csname cmap#5\endcsname#1%
  }
  % This is what gets called when #5 of \setfont is empty.
  \let\cmap\gobble
! %
! % (end of cmaps)
 =20
  % Use cm as the default font prefix.
  % To specify the font prefix, you must define \fontprefix
  % before you read in texinfo.tex.
! \ifx\fontprefix\thisisundefined
  \def\fontprefix{cm}
  \fi
  % Support font families that don't use the same naming scheme as CM.
  \def\rmshape{r}
! \def\rmbshape{bx}               % where the normal face is bold
  \def\bfshape{b}
  \def\bxshape{bx}
  \def\ttshape{tt}
***************
*** 1800,1807 ****
  \def\scshape{csc}
  \def\scbshape{csc}
 =20
! % Definitions for a main text size of 11pt.  This is the default in
! % Texinfo.
  %
  \def\definetextfontsizexi{%
  % Text fonts (11.2pt, magstep1).
--- 2220,2226 ----
  \def\scshape{csc}
  \def\scbshape{csc}
 =20
! % Definitions for a main text size of 11pt.  (The default in Texinfo.)
  %
  \def\definetextfontsizexi{%
  % Text fonts (11.2pt, magstep1).
***************
*** 1822,1829 ****
  % A few fonts for @defun names and args.
  \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
  \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
! \def\df{\let\tentt=3D\deftt \let\tenbf =3D \defbf \let\tenttsl=3D\defttsl=
 \bf}
 =20
  % Fonts for indices, footnotes, small examples (9pt).
  \def\smallnominalsize{9pt}
--- 2241,2250 ----
  % A few fonts for @defun names and args.
  \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
+ \setfont\defsl\slshape{10}{\magstep1}{OT1}
  \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
! \def\df{\let\ttfont=3D\deftt \let\bffont =3D \defbf
! \let\ttslfont=3D\defttsl \let\slfont=3D\defsl \bf}
 =20
  % Fonts for indices, footnotes, small examples (9pt).
  \def\smallnominalsize{9pt}
***************
*** 1853,1858 ****
--- 2274,2293 ----
  \font\smallersy=3Dcmsy8
  \def\smallerecsize{0800}
 =20
+ % Fonts for math mode superscripts (7pt).
+ \def\sevennominalsize{7pt}
+ \setfont\sevenrm\rmshape{7}{1000}{OT1}
+ \setfont\seventt\ttshape{10}{700}{OT1TT}
+ \setfont\sevenbf\bfshape{10}{700}{OT1}
+ \setfont\sevenit\itshape{7}{1000}{OT1IT}
+ \setfont\sevensl\slshape{10}{700}{OT1}
+ \setfont\sevensf\sfshape{10}{700}{OT1}
+ \setfont\sevensc\scshape{10}{700}{OT1}
+ \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+ \font\seveni=3Dcmmi7
+ \font\sevensy=3Dcmsy7
+ \def\sevenecsize{0700}
+=20
  % Fonts for title page (20.4pt):
  \def\titlenominalsize{20pt}
  \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
***************
*** 1884,1889 ****
--- 2319,2325 ----
  % Section fonts (14.4pt).
  \def\secnominalsize{14pt}
  \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
+ \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
  \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
  \setfont\secsl\slbshape{10}{\magstep2}{OT1}
  \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
***************
*** 1909,1915 ****
  \font\ssecsy=3Dcmsy10 scaled 1315
  \def\ssececsize{1200}
 =20
! % Reduced fonts for @acro in text (10pt).
  \def\reducednominalsize{10pt}
  \setfont\reducedrm\rmshape{10}{1000}{OT1}
  \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
--- 2345,2351 ----
  \font\ssecsy=3Dcmsy10 scaled 1315
  \def\ssececsize{1200}
 =20
! % Reduced fonts for @acronym in text (10pt).
  \def\reducednominalsize{10pt}
  \setfont\reducedrm\rmshape{10}{1000}{OT1}
  \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
***************
*** 1926,1932 ****
  \textleading =3D 13.2pt % line spacing for 11pt CM
  \textfonts            % reset the current fonts
  \rm
! } % end of 11pt text font size definitions
 =20
 =20
  % Definitions to make the main text be 10pt Computer Modern, with
--- 2362,2368 ----
  \textleading =3D 13.2pt % line spacing for 11pt CM
  \textfonts            % reset the current fonts
  \rm
! } % end of 11pt text font size definitions, \definetextfontsizexi
 =20
 =20
  % Definitions to make the main text be 10pt Computer Modern, with
***************
*** 1953,1960 ****
  % A few fonts for @defun names and args.
  \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
  \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
! \def\df{\let\tentt=3D\deftt \let\tenbf =3D \defbf \let\tenttsl=3D\defttsl=
 \bf}
 =20
  % Fonts for indices, footnotes, small examples (9pt).
  \def\smallnominalsize{9pt}
--- 2389,2398 ----
  % A few fonts for @defun names and args.
  \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
+ \setfont\defsl\slshape{10}{\magstephalf}{OT1}
  \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
! \def\df{\let\ttfont=3D\deftt \let\bffont =3D \defbf
! \let\slfont=3D\defsl \let\ttslfont=3D\defttsl \bf}
 =20
  % Fonts for indices, footnotes, small examples (9pt).
  \def\smallnominalsize{9pt}
***************
*** 1984,1989 ****
--- 2422,2441 ----
  \font\smallersy=3Dcmsy8
  \def\smallerecsize{0800}
 =20
+ % Fonts for math mode superscripts (7pt).
+ \def\sevennominalsize{7pt}
+ \setfont\sevenrm\rmshape{7}{1000}{OT1}
+ \setfont\seventt\ttshape{10}{700}{OT1TT}
+ \setfont\sevenbf\bfshape{10}{700}{OT1}
+ \setfont\sevenit\itshape{7}{1000}{OT1IT}
+ \setfont\sevensl\slshape{10}{700}{OT1}
+ \setfont\sevensf\sfshape{10}{700}{OT1}
+ \setfont\sevensc\scshape{10}{700}{OT1}
+ \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+ \font\seveni=3Dcmmi7
+ \font\sevensy=3Dcmsy7
+ \def\sevenecsize{0700}
+=20
  % Fonts for title page (20.4pt):
  \def\titlenominalsize{20pt}
  \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
***************
*** 2040,2046 ****
  \font\ssecsy=3Dcmsy10
  \def\ssececsize{1000}
 =20
! % Reduced fonts for @acro in text (9pt).
  \def\reducednominalsize{9pt}
  \setfont\reducedrm\rmshape{9}{1000}{OT1}
  \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
--- 2492,2498 ----
  \font\ssecsy=3Dcmsy10
  \def\ssececsize{1000}
 =20
! % Reduced fonts for @acronym in text (9pt).
  \def\reducednominalsize{9pt}
  \setfont\reducedrm\rmshape{9}{1000}{OT1}
  \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
***************
*** 2058,2064 ****
  \textleading =3D 12pt   % line spacing for 10pt CM
  \textfonts            % reset the current fonts
  \rm
! } % end of 10pt text font size definitions
 =20
 =20
  % We provide the user-level command
--- 2510,2522 ----
  \textleading =3D 12pt   % line spacing for 10pt CM
  \textfonts            % reset the current fonts
  \rm
! } % end of 10pt text font size definitions, \definetextfontsizex
!=20
! % Fonts for short table of contents.
! \setfont\shortcontrm\rmshape{12}{1000}{OT1}
! \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
! \setfont\shortcontsl\slshape{12}{1000}{OT1}
! \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
 =20
 =20
  % We provide the user-level command
***************
*** 2086,2187 ****
   \endgroup
  }
 =20
 =20
  % 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 except
! % in the main text, we don't bother to reset \scriptfont and
! % \scriptscriptfont (which would also require loading a lot more fonts).
  %
  \def\resetmathfonts{%
!   \textfont0=3D\tenrm \textfont1=3D\teni \textfont2=3D\tensy
!   \textfont\itfam=3D\tenit \textfont\slfam=3D\tensl \textfont\bffam=3D\te=
nbf
!   \textfont\ttfam=3D\tentt \textfont\sffam=3D\tensf
  }
 =20
! % The font-changing commands redefine the meanings of \tenSTYLE, instead
! % of just \STYLE.  We do this because \STYLE needs to also set the
! % current \fam for math mode.  Our \STYLE (e.g., \rm) commands hardwire
! % \tenSTYLE to set the current font.
  %
  % Each font-changing command also sets the names \lsize (one size lower)
! % and \lllsize (three sizes lower).  These relative commands are used in
! % the LaTeX logo and acronyms.
  %
  % This all needs generalizing, badly.
  %
- \def\textfonts{%
-   \let\tenrm=3D\textrm \let\tenit=3D\textit \let\tensl=3D\textsl
-   \let\tenbf=3D\textbf \let\tentt=3D\texttt \let\smallcaps=3D\textsc
-   \let\tensf=3D\textsf \let\teni=3D\texti \let\tensy=3D\textsy
-   \let\tenttsl=3D\textttsl
-   \def\curfontsize{text}%
-   \def\lsize{reduced}\def\lllsize{smaller}%
-   \resetmathfonts \setleading{\textleading}}
- \def\titlefonts{%
-   \let\tenrm=3D\titlerm \let\tenit=3D\titleit \let\tensl=3D\titlesl
-   \let\tenbf=3D\titlebf \let\tentt=3D\titlett \let\smallcaps=3D\titlesc
-   \let\tensf=3D\titlesf \let\teni=3D\titlei \let\tensy=3D\titlesy
-   \let\tenttsl=3D\titlettsl
-   \def\curfontsize{title}%
-   \def\lsize{chap}\def\lllsize{subsec}%
-   \resetmathfonts \setleading{27pt}}
- \def\titlefont#1{{\titlefonts\rmisbold #1}}
- \def\chapfonts{%
-   \let\tenrm=3D\chaprm \let\tenit=3D\chapit \let\tensl=3D\chapsl
-   \let\tenbf=3D\chapbf \let\tentt=3D\chaptt \let\smallcaps=3D\chapsc
-   \let\tensf=3D\chapsf \let\teni=3D\chapi \let\tensy=3D\chapsy
-   \let\tenttsl=3D\chapttsl
-   \def\curfontsize{chap}%
-   \def\lsize{sec}\def\lllsize{text}%
-   \resetmathfonts \setleading{19pt}}
- \def\secfonts{%
-   \let\tenrm=3D\secrm \let\tenit=3D\secit \let\tensl=3D\secsl
-   \let\tenbf=3D\secbf \let\tentt=3D\sectt \let\smallcaps=3D\secsc
-   \let\tensf=3D\secsf \let\teni=3D\seci \let\tensy=3D\secsy
-   \let\tenttsl=3D\secttsl
-   \def\curfontsize{sec}%
-   \def\lsize{subsec}\def\lllsize{reduced}%
-   \resetmathfonts \setleading{16pt}}
- \def\subsecfonts{%
-   \let\tenrm=3D\ssecrm \let\tenit=3D\ssecit \let\tensl=3D\ssecsl
-   \let\tenbf=3D\ssecbf \let\tentt=3D\ssectt \let\smallcaps=3D\ssecsc
-   \let\tensf=3D\ssecsf \let\teni=3D\sseci \let\tensy=3D\ssecsy
-   \let\tenttsl=3D\ssecttsl
-   \def\curfontsize{ssec}%
-   \def\lsize{text}\def\lllsize{small}%
-   \resetmathfonts \setleading{15pt}}
- \let\subsubsecfonts =3D \subsecfonts
- \def\reducedfonts{%
-   \let\tenrm=3D\reducedrm \let\tenit=3D\reducedit \let\tensl=3D\reducedsl
-   \let\tenbf=3D\reducedbf \let\tentt=3D\reducedtt \let\reducedcaps=3D\red=
ucedsc
-   \let\tensf=3D\reducedsf \let\teni=3D\reducedi \let\tensy=3D\reducedsy
-   \let\tenttsl=3D\reducedttsl
-   \def\curfontsize{reduced}%
-   \def\lsize{small}\def\lllsize{smaller}%
-   \resetmathfonts \setleading{10.5pt}}
- \def\smallfonts{%
-   \let\tenrm=3D\smallrm \let\tenit=3D\smallit \let\tensl=3D\smallsl
-   \let\tenbf=3D\smallbf \let\tentt=3D\smalltt \let\smallcaps=3D\smallsc
-   \let\tensf=3D\smallsf \let\teni=3D\smalli \let\tensy=3D\smallsy
-   \let\tenttsl=3D\smallttsl
-   \def\curfontsize{small}%
-   \def\lsize{smaller}\def\lllsize{smaller}%
-   \resetmathfonts \setleading{10.5pt}}
- \def\smallerfonts{%
-   \let\tenrm=3D\smallerrm \let\tenit=3D\smallerit \let\tensl=3D\smallersl
-   \let\tenbf=3D\smallerbf \let\tentt=3D\smallertt \let\smallcaps=3D\small=
ersc
-   \let\tensf=3D\smallersf \let\teni=3D\smalleri \let\tensy=3D\smallersy
-   \let\tenttsl=3D\smallerttsl
-   \def\curfontsize{smaller}%
-   \def\lsize{smaller}\def\lllsize{smaller}%
-   \resetmathfonts \setleading{9.5pt}}
 =20
! % Fonts for short table of contents.
! \setfont\shortcontrm\rmshape{12}{1000}{OT1}
! \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
! \setfont\shortcontsl\slshape{12}{1000}{OT1}
! \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
 =20
  % Define these just so they can be easily changed for other fonts.
  \def\angleleft{$\langle$}
--- 2544,2664 ----
   \endgroup
  }
 =20
+ %
+ % Change the current font style to #1, remembering it in \curfontstyle.
+ % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+ % italics, not bold italics.
+ %
+ \def\setfontstyle#1{%
+   \def\curfontstyle{#1}% not as a control sequence, because we are \edef'=
d.
+   \csname #1font\endcsname  % change the current font
+ }
+=20
+ \def\rm{\fam=3D0 \setfontstyle{rm}}
+ \def\it{\fam=3D\itfam \setfontstyle{it}}
+ \def\sl{\fam=3D\slfam \setfontstyle{sl}}
+ \def\bf{\fam=3D\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+ \def\tt{\fam=3D\ttfam \setfontstyle{tt}}\def\ttstylename{tt}
+=20
+ % Texinfo sort of supports the sans serif font style, which plain TeX doe=
s not.
+ % So we set up a \sf.
+ \newfam\sffam
+ \def\sf{\fam=3D\sffam \setfontstyle{sf}}
+=20
+ % We don't need math for this font style.
+ \def\ttsl{\setfontstyle{ttsl}}
+=20
 =20
  % In order for the font changes to affect most math symbols and letters,
! % we have to define the \textfont of the standard families.
! % We don't bother to reset \scriptscriptfont; awaiting user need.
  %
  \def\resetmathfonts{%
!   \textfont0=3D\rmfont \textfont1=3D\ifont \textfont2=3D\syfont
!   \textfont\itfam=3D\itfont \textfont\slfam=3D\slfont \textfont\bffam=3D\=
bffont
!   \textfont\ttfam=3D\ttfont \textfont\sffam=3D\sffont
!   %
!   % Fonts for superscript.  Note that the 7pt fonts are used regardless
!   % of the current font size.
!   \scriptfont0=3D\sevenrm \scriptfont1=3D\seveni \scriptfont2=3D\sevensy
!   \scriptfont\itfam=3D\sevenit \scriptfont\slfam=3D\sevensl
!   \scriptfont\bffam=3D\sevenbf \scriptfont\ttfam=3D\seventt
!   \scriptfont\sffam=3D\sevensf
  }
 =20
! %
!=20
! % The font-changing commands (all called \...fonts) redefine the meanings
! % of \STYLEfont, instead of just \STYLE.  We do this because \STYLE needs
! % to also set the current \fam for math mode.  Our \STYLE (e.g., \rm)
! % commands hardwire \STYLEfont to set the current font.
! %
! % The fonts used for \ifont are for "math italics"  (\itfont is for itali=
cs
! % in regular text).  \syfont is also used in math mode only.
  %
  % Each font-changing command also sets the names \lsize (one size lower)
! % and \lllsize (three sizes lower).  These relative commands are used
! % in, e.g., the LaTeX logo and acronyms.
  %
  % This all needs generalizing, badly.
  %
 =20
! \def\assignfonts#1{%
!   \expandafter\let\expandafter\rmfont\csname #1rm\endcsname
!   \expandafter\let\expandafter\itfont\csname #1it\endcsname
!   \expandafter\let\expandafter\slfont\csname #1sl\endcsname
!   \expandafter\let\expandafter\bffont\csname #1bf\endcsname
!   \expandafter\let\expandafter\ttfont\csname #1tt\endcsname
!   \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname
!   \expandafter\let\expandafter\sffont  \csname #1sf\endcsname
!   \expandafter\let\expandafter\ifont   \csname #1i\endcsname
!   \expandafter\let\expandafter\syfont  \csname #1sy\endcsname
!   \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname
! }
!=20
! \newif\ifrmisbold
!=20
! % Select smaller font size with the current style.  Used to change font s=
ize
! % in, e.g., the LaTeX logo and acronyms.  If we are using bold fonts for
! % normal roman text, also use bold fonts for roman text in the smaller si=
ze.
! \def\switchtolllsize{%
!    \expandafter\assignfonts\expandafter{\lllsize}%
!    \ifrmisbold
!      \let\rmfont\bffont
!    \fi
!    \csname\curfontstyle\endcsname
! }%
!=20
! \def\switchtolsize{%
!    \expandafter\assignfonts\expandafter{\lsize}%
!    \ifrmisbold
!      \let\rmfont\bffont
!    \fi
!    \csname\curfontstyle\endcsname
! }%
!=20
! \def\definefontsetatsize#1#2#3#4#5{%
! \expandafter\def\csname #1fonts\endcsname{%
!   \def\curfontsize{#1}%
!   \def\lsize{#2}\def\lllsize{#3}%
!   \csname rmisbold#5\endcsname
!   \assignfonts{#1}%
!   \resetmathfonts
!   \setleading{#4}%
! }}
!=20
! \definefontsetatsize{text}   {reduced}{smaller}{\textleading}{false}
! \definefontsetatsize{title}  {chap}   {subsec} {27pt}  {true}
! \definefontsetatsize{chap}   {sec}    {text}   {19pt}  {true}
! \definefontsetatsize{sec}    {subsec} {reduced}{17pt}  {true}
! \definefontsetatsize{ssec}   {text}   {small}  {15pt}  {true}
! \definefontsetatsize{reduced}{small}  {smaller}{10.5pt}{false}
! \definefontsetatsize{small}  {smaller}{smaller}{10.5pt}{false}
! \definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false}
!=20
! \def\titlefont#1{{\titlefonts\rm #1}}
! \let\subsecfonts =3D \ssecfonts
! \let\subsubsecfonts =3D \ssecfonts
 =20
  % Define these just so they can be easily changed for other fonts.
  \def\angleleft{$\langle$}
***************
*** 2207,2214 ****
  \definetextfontsizexi
 =20
 =20
- \message{markup,}
-=20
  % 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
--- 2684,2689 ----
***************
*** 2216,2310 ****
  %
  \def\ifmonospace{\ifdim\fontdimen3\font=3D0pt }
 =20
- % Markup style infrastructure.  \defmarkupstylesetup\INITMACRO will
- % define and register \INITMACRO to be called on markup style changes.
- % \INITMACRO can check \currentmarkupstyle for the innermost
- % style and the set of \ifmarkupSTYLE switches for all styles
- % currently in effect.
- \newif\ifmarkupvar
- \newif\ifmarkupsamp
- \newif\ifmarkupkey
- %\newif\ifmarkupfile % @file =3D=3D @samp.
- %\newif\ifmarkupoption % @option =3D=3D @samp.
- \newif\ifmarkupcode
- \newif\ifmarkupkbd
- %\newif\ifmarkupenv % @env =3D=3D @code.
- %\newif\ifmarkupcommand % @command =3D=3D @code.
- \newif\ifmarkuptex % @tex (and part of @math, for now).
- \newif\ifmarkupexample
- \newif\ifmarkupverb
- \newif\ifmarkupverbatim
-=20
- \let\currentmarkupstyle\empty
-=20
- \def\setupmarkupstyle#1{%
-   \csname markup#1true\endcsname
-   \def\currentmarkupstyle{#1}%
-   \markupstylesetup
- }
-=20
- \let\markupstylesetup\empty
-=20
- \def\defmarkupstylesetup#1{%
-   \expandafter\def\expandafter\markupstylesetup
-     \expandafter{\markupstylesetup #1}%
-   \def#1%
- }
-=20
- % Markup style setup for left and right quotes.
- \defmarkupstylesetup\markupsetuplq{%
-   \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkups=
tyle\endcsname
-   \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
- }
-=20
- \defmarkupstylesetup\markupsetuprq{%
-   \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkups=
tyle\endcsname
-   \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
- }
-=20
  {
  \catcode`\'=3D\active
  \catcode`\`=3D\active
 =20
! \gdef\markupsetuplqdefault{\let`\lq}
! \gdef\markupsetuprqdefault{\let'\rq}
!=20
! \gdef\markupsetcodequoteleft{\let`\codequoteleft}
! \gdef\markupsetcodequoteright{\let'\codequoteright}
!=20
! \gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
  }
 =20
! \let\markupsetuplqcode \markupsetcodequoteleft
! \let\markupsetuprqcode \markupsetcodequoteright
! %
! \let\markupsetuplqexample \markupsetcodequoteleft
! \let\markupsetuprqexample \markupsetcodequoteright
! %
! \let\markupsetuplqsamp \markupsetcodequoteleft
! \let\markupsetuprqsamp \markupsetcodequoteright
! %
! \let\markupsetuplqverb \markupsetcodequoteleft
! \let\markupsetuprqverb \markupsetcodequoteright
! %
! \let\markupsetuplqverbatim \markupsetcodequoteleft
! \let\markupsetuprqverbatim \markupsetcodequoteright
!=20
! \let\markupsetuplqkbd \markupsetnoligaturesquoteleft
!=20
! % Allow an option to not replace quotes with a regular directed right
! % quote/apostrophe (char 0x27), but instead use the undirected quote
! % from cmtt (char 0x0d).  The undirected quote is ugly, so don't make it
! % the default, but it works for pasting with more pdf viewers (at least
! % evince), the lilypond developers report.  xpdf does work with the
! % regular 0x27.
  %
  \def\codequoteright{%
!   \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
!     \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
!       '%
      \else \char'15 \fi
!   \else \char'15 \fi
  }
  %
  % and a similar option for the left quote char vs. a grave accent.
--- 2691,2720 ----
  %
  \def\ifmonospace{\ifdim\fontdimen3\font=3D0pt }
 =20
  {
  \catcode`\'=3D\active
  \catcode`\`=3D\active
 =20
! \gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
! \gdef\setregularquotes{\let`\lq \let'\rq}
  }
 =20
! % Allow an option to not use regular directed right quote/apostrophe
! % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
! % The undirected quote is ugly, so don't make it the default, but it
! % works for pasting with more pdf viewers (at least evince), the
! % lilypond developers report.  xpdf does work with the regular 0x27.
  %
  \def\codequoteright{%
!   \ifmonospace
!     \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
!       \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
!         '%
!       \else \char'15 \fi
      \else \char'15 \fi
!    \else
!      '%
!    \fi
  }
  %
  % and a similar option for the left quote char vs. a grave accent.
***************
*** 2312,2324 ****
  % the code environments to do likewise.
  %
  \def\codequoteleft{%
!   \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
!     \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
!       % [Knuth] pp. 380,381,391
!       % \relax disables Spanish ligatures ?` and !` of \tt font.
!       \relax`%
      \else \char'22 \fi
!   \else \char'22 \fi
  }
 =20
  % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt fon=
t.
--- 2722,2768 ----
  % the code environments to do likewise.
  %
  \def\codequoteleft{%
!   \ifmonospace
!     \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
!       \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
!         % [Knuth] pp. 380,381,391
!         % \relax disables Spanish ligatures ?` and !` of \tt font.
!         \relax`%
!       \else \char'22 \fi
      \else \char'22 \fi
!    \else
!      \relax`%
!    \fi
! }
!=20
! % Commands to set the quote options.
! %
! \parseargdef\codequoteundirected{%
!   \def\temp{#1}%
!   \ifx\temp\onword
!     \expandafter\let\csname SETtxicodequoteundirected\endcsname
!       =3D t%
!   \else\ifx\temp\offword
!     \expandafter\let\csname SETtxicodequoteundirected\endcsname
!       =3D \relax
!   \else
!     \errhelp =3D \EMsimple
!     \errmessage{Unknown @codequoteundirected value `\temp', must be on|of=
f}%
!   \fi\fi
! }
! %
! \parseargdef\codequotebacktick{%
!   \def\temp{#1}%
!   \ifx\temp\onword
!     \expandafter\let\csname SETtxicodequotebacktick\endcsname
!       =3D t%
!   \else\ifx\temp\offword
!     \expandafter\let\csname SETtxicodequotebacktick\endcsname
!       =3D \relax
!   \else
!     \errhelp =3D \EMsimple
!     \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}=
%
!   \fi\fi
  }
 =20
  % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt fon=
t.
***************
*** 2333,2339 ****
  % If we are in a monospaced environment, however, 1) always use \ttsl,
  % and 2) do not add an italic correction.
  \def\dosmartslant#1#2{%
!   \ifusingtt=20
      {{\ttsl #2}\let\next=3D\relax}%
      {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
    \next
--- 2777,2783 ----
  % If we are in a monospaced environment, however, 1) always use \ttsl,
  % and 2) do not add an italic correction.
  \def\dosmartslant#1#2{%
!   \ifusingtt
      {{\ttsl #2}\let\next=3D\relax}%
      {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
    \next
***************
*** 2347,2366 ****
    \ifx\next,%
    \else\ifx\next-%
    \else\ifx\next.%
    \else\ptexslash
!   \fi\fi\fi}
 =20
! % like \smartslanted except unconditionally uses \ttsl, and no ic.
! % @var is set to this for defun arguments.
  \def\ttslanted#1{{\ttsl #1}}
 =20
  % @cite is like \smartslanted except unconditionally use \sl.  We never w=
ant
  % ttsl for book titles, do we?
  \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
 =20
  \let\i=3D\smartitalic
  \let\slanted=3D\smartslanted
- \def\var#1{\smartslanted{#1}}
  \let\dfn=3D\smartslanted
  \let\emph=3D\smartitalic
 =20
--- 2791,2819 ----
    \ifx\next,%
    \else\ifx\next-%
    \else\ifx\next.%
+   \else\ifx\next\.%
+   \else\ifx\next\comma%
    \else\ptexslash
!   \fi\fi\fi\fi\fi
!   \aftersmartic
! }
 =20
! % Unconditional use \ttsl, and no ic.  @var is set to this for defuns.
  \def\ttslanted#1{{\ttsl #1}}
 =20
  % @cite is like \smartslanted except unconditionally use \sl.  We never w=
ant
  % ttsl for book titles, do we?
  \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
 =20
+ \def\aftersmartic{}
+ \def\var#1{%
+   \let\saveaftersmartic =3D \aftersmartic
+   \def\aftersmartic{\null\let\aftersmartic=3D\saveaftersmartic}%
+   \smartslanted{#1}%
+ }
+=20
  \let\i=3D\smartitalic
  \let\slanted=3D\smartslanted
  \let\dfn=3D\smartslanted
  \let\emph=3D\smartitalic
 =20
***************
*** 2389,2396 ****
  %
  \catcode`@=3D11
    \def\plainfrenchspacing{%
!     \sfcode\dotChar  =3D\@m \sfcode\questChar=3D\@m \sfcode\exclamChar=3D=
\@m
!     \sfcode\colonChar=3D\@m \sfcode\semiChar =3D\@m \sfcode\commaChar =3D=
\@m
      \def\endofsentencespacefactor{1000}% for @. and friends
    }
    \def\plainnonfrenchspacing{%
--- 2842,2849 ----
  %
  \catcode`@=3D11
    \def\plainfrenchspacing{%
!     \sfcode`\.=3D\@m \sfcode`\?=3D\@m \sfcode`\!=3D\@m
!     \sfcode`\:=3D\@m \sfcode`\;=3D\@m \sfcode`\,=3D\@m
      \def\endofsentencespacefactor{1000}% for @. and friends
    }
    \def\plainnonfrenchspacing{%
***************
*** 2403,2443 ****
 =20
  % @t, explicit typewriter.
  \def\t#1{%
!   {\tt \rawbackslash \plainfrenchspacing #1}%
    \null
  }
 =20
  % @samp.
! \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
!=20
! % definition of @key that produces a lozenge.  Doesn't adjust to text siz=
e.
! %\setfont\keyrm\rmshape{8}{1000}{OT1}
! %\font\keysy=3Dcmsy9
! %\def\key#1{{\keyrm\textfont2=3D\keysy \leavevmode\hbox{%
! %  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
! %    \vbox{\hrule\kern-0.4pt
! %     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
! %    \kern-0.4pt\hrule}%
! %  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
!=20
! % definition of @key with no lozenge.  If the current font is already
! % monospace, don't change it; that way, we respect @kbdinputstyle.  But
! % if it isn't monospace, then use \tt.
! %
! \def\key#1{{\setupmarkupstyle{key}%
!   \nohyphenation
!   \ifmonospace\else\tt\fi
!   #1}\null}
!=20
! % ctrl is no longer a Texinfo command.
! \def\ctrl #1{{\tt \rawbackslash \hat}#1}
 =20
! % @file, @option are the same as @samp.
! \let\file=3D\samp
! \let\option=3D\samp
 =20
! % @code is a modification of @t,
! % which makes spaces the same size as normal in the surrounding text.
  \def\tclose#1{%
    {%
      % Change normal interword space to be same as for the current font.
--- 2856,2874 ----
 =20
  % @t, explicit typewriter.
  \def\t#1{%
!   {\tt \plainfrenchspacing #1}%
    \null
  }
 =20
  % @samp.
! \def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}}
 =20
! % @indicateurl is \samp, that is, with quotes.
! \let\indicateurl=3D\samp
 =20
! % @code (and similar) prints in typewriter, but with spaces the same
! % size as normal in the surrounding text, without hyphenation, etc.
! % This is a subroutine for that.
  \def\tclose#1{%
    {%
      % Change normal interword space to be same as for the current font.
***************
*** 2452,2495 ****
      % Turn off hyphenation.
      \nohyphenation
      %
-     \rawbackslash
      \plainfrenchspacing
      #1%
    }%
!   \null
  }
 =20
  % We *must* turn on hyphenation at `-' and `_' in @code.
  % Otherwise, it is too hard to avoid overfull hboxes
  % in the Emacs manual, the Library manual, etc.
!=20
  % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  % both hyphenation at - and hyphenation within words.
  % We must therefore turn them both off (\tclose does that)
! % and arrange explicitly to hyphenate at a dash.
! %  -- rms.
  {
    \catcode`\-=3D\active \catcode`\_=3D\active
    \catcode`\'=3D\active \catcode`\`=3D\active
    \global\let'=3D\rq \global\let`=3D\lq  % default definitions
    %
    \global\def\code{\begingroup
!     \setupmarkupstyle{code}%
!     % The following should really be moved into \setupmarkupstyle handler=
s.
      \catcode\dashChar=3D\active  \catcode\underChar=3D\active
      \ifallowcodebreaks
       \let-\codedash
       \let_\codeunder
      \else
!      \let-\realdash
       \let_\realunder
      \fi
      \codex
    }
  }
 =20
- \def\realdash{-}
- \def\codedash{-\discretionary{}{}{}}
  \def\codeunder{%
    % this is all so @math{@code{var_name}+1} can work.  In math mode, _
    % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
--- 2883,2947 ----
      % Turn off hyphenation.
      \nohyphenation
      %
      \plainfrenchspacing
      #1%
    }%
!   \null % reset spacefactor to 1000
  }
 =20
  % We *must* turn on hyphenation at `-' and `_' in @code.
+ % (But see \codedashfinish below.)
  % Otherwise, it is too hard to avoid overfull hboxes
  % in the Emacs manual, the Library manual, etc.
! %
  % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  % both hyphenation at - and hyphenation within words.
  % We must therefore turn them both off (\tclose does that)
! % and arrange explicitly to hyphenate at a dash. -- rms.
  {
    \catcode`\-=3D\active \catcode`\_=3D\active
    \catcode`\'=3D\active \catcode`\`=3D\active
    \global\let'=3D\rq \global\let`=3D\lq  % default definitions
    %
    \global\def\code{\begingroup
!     \setcodequotes
      \catcode\dashChar=3D\active  \catcode\underChar=3D\active
      \ifallowcodebreaks
       \let-\codedash
       \let_\codeunder
      \else
!      \let-\normaldash
       \let_\realunder
      \fi
+     % Given -foo (with a single dash), we do not want to allow a break
+     % after the hyphen.
+     \global\let\codedashprev=3D\codedash
+     %
      \codex
    }
+   %
+   \gdef\codedash{\futurelet\next\codedashfinish}
+   \gdef\codedashfinish{%
+     \normaldash % always output the dash character itself.
+     %
+     % Now, output a discretionary to allow a line break, unless
+     % (a) the next character is a -, or
+     % (b) the preceding character is a -.
+     % E.g., given --posix, we do not want to allow a break after either -=
.
+     % Given --foo-bar, we do want to allow a break between the - and the =
b.
+     \ifx\next\codedash \else
+       \ifx\codedashprev\codedash
+       \else \discretionary{}{}{}\fi
+     \fi
+     % we need the space after the =3D for the case when \next itself is a
+     % space token; it would get swallowed otherwise.  As in @code{- a}.
+     \global\let\codedashprev=3D \next
+   }
  }
+ \def\normaldash{-}
+ %
+ \def\codex #1{\tclose{#1}\endgroup}
 =20
  \def\codeunder{%
    % this is all so @math{@code{var_name}+1} can work.  In math mode, _
    % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
***************
*** 2501,2512 ****
               \discretionary{}{}{}}%
              {\_}%
  }
- \def\codex #1{\tclose{#1}\endgroup}
 =20
  % An additional complication: the above will allow breaks after, e.g.,
! % each of the four underscores in __typeof__.  This is undesirable in
! % some manuals, especially if they don't have long identifiers in
! % general.  @allowcodebreaks provides a way to control this.
  %
  \newif\ifallowcodebreaks  \allowcodebreakstrue
 =20
--- 2953,2963 ----
               \discretionary{}{}{}}%
              {\_}%
  }
 =20
  % An additional complication: the above will allow breaks after, e.g.,
! % each of the four underscores in __typeof__.  This is bad.
! % @allowcodebreaks provides a document-level way to turn breaking at -
! % and _ on and off.
  %
  \newif\ifallowcodebreaks  \allowcodebreakstrue
 =20
***************
*** 2521,2533 ****
      \allowcodebreaksfalse
    \else
      \errhelp =3D \EMsimple
!     \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
    \fi\fi
  }
 =20
! % @kbd is like @code, except that if the argument is just one @key comman=
d,
! % then @kbd has no effect.
! \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??=
\par}}
 =20
  % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always)=
,
  %   `example' (@kbd uses ttsl only inside of @example and friends),
--- 2972,3152 ----
      \allowcodebreaksfalse
    \else
      \errhelp =3D \EMsimple
!     \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|f=
alse}%
    \fi\fi
  }
 =20
! % For @command, @env, @file, @option quotes seem unnecessary,
! % so use \code rather than \samp.
! \let\command=3D\code
! \let\env=3D\code
! \let\file=3D\code
! \let\option=3D\code
!=20
! % @uref (abbreviation for `urlref') aka @url 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.
!=20
! % TeX-only option to allow changing PDF output to show only the second
! % arg (if given), and not the url (which is then just the link target).
! \newif\ifurefurlonlylink
!=20
! % The default \pretolerance setting stops the penalty inserted in
! % \urefallowbreak being a discouragement to line breaking.  Set it to
! % a negative value for this paragraph only.  Hopefully this does not
! % conflict with redefinitions of \par done elsewhere.
! \def\nopretolerance{%
! \pretolerance=3D-1
! \def\par{\endgraf\pretolerance=3D100 \let\par\endgraf}%
! }
!=20
! % The main macro is \urefbreak, which allows breaking at expected
! % places within the url.
! \def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak}
! \let\uref=3D\urefbreak
! %
! \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
! \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
!   \unsepspaces
!   \pdfurl{#1}%
!   \setbox0 =3D \hbox{\ignorespaces #3}%
!   \ifdim\wd0 > 0pt
!     \unhbox0 % third arg given, show only that
!   \else
!     \setbox0 =3D \hbox{\ignorespaces #2}% look for second arg
!     \ifdim\wd0 > 0pt
!       \ifpdf
!         % For pdfTeX and LuaTeX
!         \ifurefurlonlylink
!           % PDF plus option to not display url, show just arg
!           \unhbox0
!         \else
!           % PDF, normally display both arg and url for consistency,
!           % visibility, if the pdf is eventually used to print, etc.
!           \unhbox0\ (\urefcode{#1})%
!         \fi
!       \else
!         \ifx\XeTeXrevision\thisisundefined
!           \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
!         \else
!           % For XeTeX
!           \ifurefurlonlylink
!             % PDF plus option to not display url, show just arg
!             \unhbox0
!           \else
!             % PDF, normally display both arg and url for consistency,
!             % visibility, if the pdf is eventually used to print, etc.
!             \unhbox0\ (\urefcode{#1})%
!           \fi
!         \fi
!       \fi
!     \else
!       \urefcode{#1}% only url given, so show it
!     \fi
!   \fi
!   \endlink
! \endgroup}
!=20
! % Allow line breaks around only a few characters (only).
! \def\urefcatcodes{%
!   \catcode`\&=3D\active \catcode`\.=3D\active
!   \catcode`\#=3D\active \catcode`\?=3D\active
!   \catcode`\/=3D\active
! }
! {
!   \urefcatcodes
!   %
!   \global\def\urefcode{\begingroup
!     \setcodequotes
!     \urefcatcodes
!     \let&\urefcodeamp
!     \let.\urefcodedot
!     \let#\urefcodehash
!     \let?\urefcodequest
!     \let/\urefcodeslash
!     \codex
!   }
!   %
!   % By default, they are just regular characters.
!   \global\def&{\normalamp}
!   \global\def.{\normaldot}
!   \global\def#{\normalhash}
!   \global\def?{\normalquest}
!   \global\def/{\normalslash}
! }
!=20
! \def\urefcodeamp{\urefprebreak \&\urefpostbreak}
! \def\urefcodedot{\urefprebreak .\urefpostbreak}
! \def\urefcodehash{\urefprebreak \#\urefpostbreak}
! \def\urefcodequest{\urefprebreak ?\urefpostbreak}
! \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
! {
!   \catcode`\/=3D\active
!   \global\def\urefcodeslashfinish{%
!     \urefprebreak \slashChar
!     % Allow line break only after the final / in a sequence of
!     % slashes, to avoid line break between the slashes in http://.
!     \ifx\next/\else \urefpostbreak \fi
!   }
! }
!=20
! % By default we'll break after the special characters, but some people li=
ke to
! % break before the special chars, so allow that.  Also allow no breaking =
at
! % all, for manual control.
! %
! \parseargdef\urefbreakstyle{%
!   \def\txiarg{#1}%
!   \ifx\txiarg\wordnone
!     \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
!   \else\ifx\txiarg\wordbefore
!     \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
!   \else\ifx\txiarg\wordafter
!     \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
!   \else
!     \errhelp =3D \EMsimple
!     \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
!   \fi\fi\fi
! }
! \def\wordafter{after}
! \def\wordbefore{before}
! \def\wordnone{none}
!=20
! % Allow a ragged right output to aid breaking long URL's.  There can
! % be a break at the \allowbreak with no extra glue (if the existing stret=
ch in
! % the line is sufficient), a break at the \penalty with extra glue added
! % at the end of the line, or no break at all here.
! %   Changing the value of the penalty and/or the amount of stretch affect=
s how
! % preferable one choice is over the other.
! \def\urefallowbreak{%
!   \penalty0\relax
!   \hskip 0pt plus 2 em\relax
!   \penalty1000\relax
!   \hskip 0pt plus -2 em\relax
! }
!=20
! \urefbreakstyle after
!=20
! % @url synonym for @uref, since that's how everyone uses it.
! %
! \let\url=3D\uref
!=20
! % 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}
! \ifpdforxetex
!   \def\email#1{\doemail#1,,\finish}
!   \def\doemail#1,#2,#3\finish{\begingroup
!     \unsepspaces
!     \pdfurl{mailto:#1}%
!     \setbox0 =3D \hbox{\ignorespaces #2}%
!     \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
!     \endlink
!   \endgroup}
! \else
!   \let\email=3D\uref
! \fi
 =20
  % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always)=
,
  %   `example' (@kbd uses ttsl only inside of @example and friends),
***************
*** 2542,2548 ****
      \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
    \else
      \errhelp =3D \EMsimple
!     \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
    \fi\fi\fi
  }
  \def\worddistinct{distinct}
--- 3161,3167 ----
      \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
    \else
      \errhelp =3D \EMsimple
!     \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
    \fi\fi\fi
  }
  \def\worddistinct{distinct}
***************
*** 2552,2567 ****
  % Default is `distinct'.
  \kbdinputstyle distinct
 =20
  \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{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
! \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
 =20
! % For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
! \let\indicateurl=3D\code
! \let\env=3D\code
! \let\command=3D\code
 =20
  % @clicksequence{File @click{} Open ...}
  \def\clicksequence#1{\begingroup #1\endgroup}
--- 3171,3206 ----
  % Default is `distinct'.
  \kbdinputstyle distinct
 =20
+ % @kbd is like @code, except that if the argument is just one @key comman=
d,
+ % then @kbd has no effect.
+ \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
+=20
  \def\xkey{\key}
! \def\kbdsub#1#2#3\par{%
!   \def\one{#1}\def\three{#3}\def\threex{??}%
!   \ifx\one\xkey\ifx\threex\three \key{#2}%
!   \else{\tclose{\kbdfont\setcodequotes\look}}\fi
!   \else{\tclose{\kbdfont\setcodequotes\look}}\fi
! }
 =20
! % definition of @key that produces a lozenge.  Doesn't adjust to text siz=
e.
! %\setfont\keyrm\rmshape{8}{1000}{OT1}
! %\font\keysy=3Dcmsy9
! %\def\key#1{{\keyrm\textfont2=3D\keysy \leavevmode\hbox{%
! %  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
! %    \vbox{\hrule\kern-0.4pt
! %     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
! %    \kern-0.4pt\hrule}%
! %  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
!=20
! % definition of @key with no lozenge.  If the current font is already
! % monospace, don't change it; that way, we respect @kbdinputstyle.  But
! % if it isn't monospace, then use \tt.
! %
! \def\key#1{{\setregularquotes
!   \nohyphenation
!   \ifmonospace\else\tt\fi
!   #1}\null}
 =20
  % @clicksequence{File @click{} Open ...}
  \def\clicksequence#1{\begingroup #1\endgroup}
***************
*** 2570,2645 ****
  \parseargdef\clickstyle{\def\click{#1}}
  \def\click{\arrow}
 =20
- % @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 =3D \hbox{\ignorespaces #3}%
-   \ifdim\wd0 > 0pt
-     \unhbox0 % third arg given, show only that
-   \else
-     \setbox0 =3D \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}
-=20
- % @url synonym for @uref, since that's how everyone uses it.
- %
- \let\url=3D\uref
-=20
- % 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 =3D \hbox{\ignorespaces #2}%
-     \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
-     \endlink
-   \endgroup}
- \else
-   \let\email=3D\uref
- \fi
-=20
  % 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.
  %
  \def\dmn#1{\thinspace #1}
 =20
- % @l was never documented to mean ``switch to the Lisp font'',
- % and it is not used as such in any manual I can find.  We need it for
- % Polish suppressed-l.  --karl, 22sep96.
- %\def\l#1{{\li #1}\null}
-=20
  % @acronym for "FBI", "NATO", and the like.
  % We print this one point size smaller, since it's intended for
  % all-uppercase.
  %
  \def\acronym#1{\doacronym #1,,\finish}
  \def\doacronym#1,#2,#3\finish{%
!   {\selectfonts\lsize #1}%
    \def\temp{#2}%
    \ifx\temp\empty \else
      \space ({\unsepspaces \ignorespaces \temp \unskip})%
    \fi
  }
 =20
  % @abbr for "Comput. J." and the like.
--- 3209,3231 ----
  \parseargdef\clickstyle{\def\click{#1}}
  \def\click{\arrow}
 =20
  % 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.
  %
  \def\dmn#1{\thinspace #1}
 =20
  % @acronym for "FBI", "NATO", and the like.
  % We print this one point size smaller, since it's intended for
  % all-uppercase.
  %
  \def\acronym#1{\doacronym #1,,\finish}
  \def\doacronym#1,#2,#3\finish{%
!   {\switchtolsize #1}%
    \def\temp{#2}%
    \ifx\temp\empty \else
      \space ({\unsepspaces \ignorespaces \temp \unskip})%
    \fi
+   \null % reset \spacefactor=3D1000
  }
 =20
  % @abbr for "Comput. J." and the like.
***************
*** 2652,2657 ****
--- 3238,3244 ----
    \ifx\temp\empty \else
      \space ({\unsepspaces \ignorespaces \temp \unskip})%
    \fi
+   \null % reset \spacefactor=3D1000
  }
 =20
  % @asis just yields its argument.  Used with @table, for example.
***************
*** 2679,2699 ****
  \def\mathbackslash{\ifnum\fam=3D\ttfam \mathchar"075C \else\backslash \fi=
}
  %
  \def\math{%
!   \tex
!   \mathunderscore
!   \let\\ =3D \mathbackslash
!   \mathactive
!   % make the texinfo accent commands work in math mode
!   \let\"=3D\ddot
!   \let\'=3D\acute
!   \let\=3D=3D\bar
!   \let\^=3D\hat
!   \let\`=3D\grave
!   \let\u=3D\breve
!   \let\v=3D\check
!   \let\~=3D\tilde
!   \let\dotaccent=3D\dot
!   $\finishmath
  }
  \def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
 =20
--- 3266,3289 ----
  \def\mathbackslash{\ifnum\fam=3D\ttfam \mathchar"075C \else\backslash \fi=
}
  %
  \def\math{%
!   \ifmmode\else % only go into math if not in math mode already
!     \tex
!     \mathunderscore
!     \let\\ =3D \mathbackslash
!     \mathactive
!     % make the texinfo accent commands work in math mode
!     \let\"=3D\ddot
!     \let\'=3D\acute
!     \let\=3D=3D\bar
!     \let\^=3D\hat
!     \let\`=3D\grave
!     \let\u=3D\breve
!     \let\v=3D\check
!     \let\~=3D\tilde
!     \let\dotaccent=3D\dot
!     % have to provide another name for sup operator
!     \let\mathopsup=3D\sup
!   $\expandafter\finishmath\fi
  }
  \def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
 =20
***************
*** 2716,2746 ****
    }
  }
 =20
 =20
  \message{glyphs,}
  % and logos.
 =20
! % @@ prints an @.
  \def\@{\char64 }
 =20
! % Used to generate quoted braces.  Unless we're in typewriter, use
! % \ecfont because the CM text fonts do not have braces, and we don't
! % want to switch into math.
! \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
! \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
! \let\{=3D\mylbrace
! \let\}=3D\myrbrace
! \begingroup
!   % Definitions to produce \{ and \} commands for indices,
!   % and @{ and @} for the aux/toc files.
!   \catcode`\{ =3D \other \catcode`\} =3D \other
!   \catcode`\[ =3D 1 \catcode`\] =3D 2
!   \catcode`\! =3D 0 \catcode`\\ =3D \other
!   !gdef!lbracecmd[\{]%
!   !gdef!rbracecmd[\}]%
!   !gdef!lbraceatcmd[@{]%
!   !gdef!rbraceatcmd[@}]%
! !endgroup
 =20
  % @comma{} to avoid , parsing problems.
  \let\comma =3D ,
--- 3306,3412 ----
    }
  }
 =20
+ % for @sub and @sup, if in math mode, just do a normal sub/superscript.
+ % If in text, use math to place as sub/superscript, but switch
+ % into text mode, with smaller fonts.  This is a different font than the
+ % one used for real math sub/superscripts (8pt vs. 7pt), but let's not
+ % fix it (significant additions to font machinery) until someone notices.
+ %
+ \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
+ \def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}%
+ %
+ \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
+ \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
+=20
+ % provide this command from LaTeX as it is very common
+ \def\frac#1#2{{{#1}\over{#2}}}
+=20
+ % @displaymath.
+ % \globaldefs is needed to recognize the end lines in \tex and
+ % \end tex.  Set \thisenv as @end displaymath is seen before @end tex.
+ {\obeylines
+ \globaldefs=3D1
+ \envdef\displaymath{%
+ \tex%
+ \def\thisenv{\displaymath}%
+ \begingroup\let\end\displaymathend%
+ $$%
+ }
+=20
+ \def\displaymathend{$$\endgroup\end}%
+=20
+ \def\Edisplaymath{%
+ \def\thisenv{\tex}%
+ \end tex
+ }}
+=20
+=20
+ % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
+ % Ignore unless FMTNAME =3D=3D tex; then it is like @iftex and @tex,
+ % except specified as a normal braced arg, so no newlines to worry about.
+ %
+ \def\outfmtnametex{tex}
+ %
+ \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
+ \long\def\doinlinefmt#1,#2,\finish{%
+   \def\inlinefmtname{#1}%
+   \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
+ }
+ %
+ % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
+ % FMTNAME is tex, else ELSE-TEXT.
+ \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
+ \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
+   \def\inlinefmtname{#1}%
+   \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3=
\fi
+ }
+ %
+ % For raw, must switch into @tex before parsing the argument, to avoid
+ % setting catcodes prematurely.  Doing it this way means that, for
+ % example, @inlineraw{html, foo{bar} gets a parse error instead of being
+ % ignored.  But this isn't important because if people want a literal
+ % *right* brace they would have to use a command anyway, so they may as
+ % well use a command to get a left brace too.  We could re-use the
+ % delimiter character idea from \verb, but it seems like overkill.
+ %
+ \long\def\inlineraw{\tex \doinlineraw}
+ \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
+ \def\doinlinerawtwo#1,#2,\finish{%
+   \def\inlinerawname{#1}%
+   \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
+   \endgroup % close group opened by \tex.
+ }
+=20
+ % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
+ %
+ \long\def\inlineifset#1{\doinlineifset #1,\finish}
+ \long\def\doinlineifset#1,#2,\finish{%
+   \def\inlinevarname{#1}%
+   \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
+   \else\ignorespaces#2\fi
+ }
+=20
+ % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
+ %
+ \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
+ \long\def\doinlineifclear#1,#2,\finish{%
+   \def\inlinevarname{#1}%
+   \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces=
#2\fi
+ }
+=20
 =20
  \message{glyphs,}
  % and logos.
 =20
! % @@ prints an @, as does @atchar{}.
  \def\@{\char64 }
+ \let\atchar=3D\@
 =20
! % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
! \def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}}
! \def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}}
! \let\{=3D\lbracechar
! \let\}=3D\rbracechar
 =20
  % @comma{} to avoid , parsing problems.
  \let\comma =3D ,
***************
*** 2758,2765 ****
  % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  \def\questiondown{?`}
  \def\exclamdown{!`}
! \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
! \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
 =20
  % Dotless i and dotless j, used for accents.
  \def\imacro{i}
--- 3424,3431 ----
  % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  \def\questiondown{?`}
  \def\exclamdown{!`}
! \def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}}
! \def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}}
 =20
  % Dotless i and dotless j, used for accents.
  \def\imacro{i}
***************
*** 2788,2799 ****
    {\setbox0=3D\hbox{T}%
     \vbox to \ht0{\hbox{%
       \ifx\textnominalsize\xwordpt
!        % for 10pt running text, \lllsize (8pt) is too small for the A in =
LaTeX.
         % Revert to plain's \scriptsize, which is 7pt.
         \count255=3D\the\fam $\fam\count255 \scriptstyle A$%
       \else
         % For 11pt, we can use our lllsize.
!        \selectfonts\lllsize A%
       \fi
       }%
       \vss
--- 3454,3465 ----
    {\setbox0=3D\hbox{T}%
     \vbox to \ht0{\hbox{%
       \ifx\textnominalsize\xwordpt
!        % for 10pt running text, lllsize (8pt) is too small for the A in L=
aTeX.
         % Revert to plain's \scriptsize, which is 7pt.
         \count255=3D\the\fam $\fam\count255 \scriptstyle A$%
       \else
         % For 11pt, we can use our lllsize.
!        \switchtolllsize A%
       \fi
       }%
       \vss
***************
*** 2802,2812 ****
    \TeX
  }
 =20
! % Some math mode symbols.
! \def\bullet{$\ptexbullet$}
! \def\geq{\ifmmode \ge\else $\ge$\fi}
! \def\leq{\ifmmode \le\else $\le$\fi}
! \def\minus{\ifmmode -\else $-$\fi}
 =20
  % @dots{} outputs an ellipsis using the current font.
  % We do .5em per period so that it has the same spacing in the cm
--- 3468,3483 ----
    \TeX
  }
 =20
! % Some math mode symbols.  Define \ensuremath to switch into math mode
! % unless we are already there.  Expansion tricks may not be needed here,
! % but safer, and can't hurt.
! \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath =
\fi}
! \def\ensuredmath#1{$\relax#1$}
! %
! \def\bullet{\ensuremath\ptexbullet}
! \def\geq{\ensuremath\ge}
! \def\leq{\ensuremath\le}
! \def\minus{\ensuremath-}
 =20
  % @dots{} outputs an ellipsis using the current font.
  % We do .5em per period so that it has the same spacing in the cm
***************
*** 2854,2863 ****
  %
  \newbox\errorbox
  %
! {\tentt \global\dimen0 =3D 3em}% Width of the box.
  \dimen2 =3D .55pt % Thickness of rules
  % The text. (`r' is open on the right, `e' somewhat less so on the left.)
! \setbox0 =3D \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
  %
  \setbox\errorbox=3D\hbox to \dimen0{\hfil
     \hsize =3D \dimen0 \advance\hsize by -5.8pt % Space to left+right.
--- 3525,3534 ----
  %
  \newbox\errorbox
  %
! {\ttfont \global\dimen0 =3D 3em}% Width of the box.
  \dimen2 =3D .55pt % Thickness of rules
  % The text. (`r' is open on the right, `e' somewhat less so on the left.)
! \setbox0 =3D \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
  %
  \setbox\errorbox=3D\hbox to \dimen0{\hfil
     \hsize =3D \dimen0 \advance\hsize by -5.8pt % Space to left+right.
***************
*** 2874,2880 ****
 =20
  % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  %
! \def\pounds{{\it\$}}
 =20
  % @euro{} comes from a separate font, depending on the current style.
  % We use the free feym* fonts from the eurosym package by Henrik
--- 3545,3551 ----
 =20
  % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  %
! \def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi}
 =20
  % @euro{} comes from a separate font, depending on the current style.
  % We use the free feym* fonts from the eurosym package by Henrik
***************
*** 2970,2989 ****
  \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  %
! % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
! \def\ecfont{%
    % We can't distinguish serif/sans and italic/slanted, but this
    % is used for crude hacks anyway (like adding French and German
    % quotes to documents typeset with CM, where we lose kerning), so
    % hopefully nobody will notice/care.
    \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
    \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
!   \ifx\curfontstyle\bfstylename
!     % bold:
!     \font\thisecfont =3D ecb\ifusingit{i}{x}\ecsize \space at \nominalsiz=
e
!   \else
!     % regular:
!     \font\thisecfont =3D ec\ifusingit{ti}{rm}\ecsize \space at \nominalsi=
ze
    \fi
    \thisecfont
  }
--- 3641,3672 ----
  \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  %
! % Use the European Computer Modern fonts (cm-super in outline format)
! % for non-CM glyphs.  That is ec* for regular text and tc* for the text
! % companion symbols (LaTeX TS1 encoding).  Both are part of the ec
! % package and follow the same conventions.
! %
! \def\ecfont{\etcfont{e}}
! \def\tcfont{\etcfont{t}}
! %
! \def\etcfont#1{%
    % We can't distinguish serif/sans and italic/slanted, but this
    % is used for crude hacks anyway (like adding French and German
    % quotes to documents typeset with CM, where we lose kerning), so
    % hopefully nobody will notice/care.
    \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
    \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
!   \ifmonospace
!     % typewriter:
!     \font\thisecfont =3D #1ctt\ecsize \space at \nominalsize
!   \else
!     \ifx\curfontstyle\bfstylename
!       % bold:
!       \font\thisecfont =3D #1cb\ifusingit{i}{x}\ecsize \space at \nominal=
size
!     \else
!       % regular:
!       \font\thisecfont =3D #1c\ifusingit{ti}{rm}\ecsize \space at \nomina=
lsize
!     \fi
    \fi
    \thisecfont
  }
***************
*** 2993,2999 ****
  % Adapted from the plain.tex definition of \copyright.
  %
  \def\registeredsymbol{%
!   $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
                 \hfil\crcr\Orb}}%
      }$%
  }
--- 3676,3682 ----
  % Adapted from the plain.tex definition of \copyright.
  %
  \def\registeredsymbol{%
!   $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}%
                 \hfil\crcr\Orb}}%
      }$%
  }
***************
*** 3006,3021 ****
  %  Textures 1.7.7 (preloaded format=3Dplain 93.10.14)  (68K)  16 APR 2004=
 02:38
  % so we'll define it if necessary.
  %
! \ifx\Orb\undefined
  \def\Orb{\mathhexbox20D}
  \fi
 =20
  % Quotes.
- \chardef\quotedblleft=3D"5C
- \chardef\quotedblright=3D`\"
  \chardef\quoteleft=3D`\`
  \chardef\quoteright=3D`\'
 =20
 =20
  \message{page headings,}
 =20
--- 3689,3712 ----
  %  Textures 1.7.7 (preloaded format=3Dplain 93.10.14)  (68K)  16 APR 2004=
 02:38
  % so we'll define it if necessary.
  %
! \ifx\Orb\thisisundefined
  \def\Orb{\mathhexbox20D}
  \fi
 =20
  % Quotes.
  \chardef\quoteleft=3D`\`
  \chardef\quoteright=3D`\'
 =20
+ % only change font for tt for correct kerning and to avoid using
+ % \ecfont unless necessary.
+ \def\quotedblleft{%
+   \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi
+ }
+=20
+ \def\quotedblright{%
+   \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi
+ }
+=20
 =20
  \message{page headings,}
 =20
***************
*** 3026,3041 ****
  \newif\ifseenauthor
  \newif\iffinishedtitlepage
 =20
! % Do an implicit @contents or @shortcontents after @end titlepage if the
! % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage=
.
! %
! \newif\ifsetcontentsaftertitlepage
!  \let\setcontentsaftertitlepage =3D \setcontentsaftertitlepagetrue
! \newif\ifsetshortcontentsaftertitlepage
!  \let\setshortcontentsaftertitlepage =3D \setshortcontentsaftertitlepaget=
rue
!=20
! \parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \cente=
rline{#1}%
!         \endgroup\page\hbox{}\page}
 =20
  \envdef\titlepage{%
    % Open one extra group, as we want to close it in the middle of \Etitle=
page.
--- 3717,3736 ----
  \newif\ifseenauthor
  \newif\iffinishedtitlepage
 =20
! % @setcontentsaftertitlepage used to do an implicit @contents or
! % @shortcontents after @end titlepage, but it is now obsolete.
! \def\setcontentsaftertitlepage{%
!   \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
!               command; move your @contents command if you want the conten=
ts
!               after the title page.}}%
! \def\setshortcontentsaftertitlepage{%
!   \errmessage{@setshortcontentsaftertitlepage has been removed as a Texin=
fo
!               command; move your @shortcontents and @contents commands if=
 you
!               want the contents after the title page.}}%
!=20
! \parseargdef\shorttitlepage{%
!   \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
!   \endgroup\page\hbox{}\page}
 =20
  \envdef\titlepage{%
    % Open one extra group, as we want to close it in the middle of \Etitle=
page.
***************
*** 3073,3092 ****
    % Need this before the \...aftertitlepage checks so that if they are
    % in effect the toc pages will come out with page numbers.
    \HEADINGSon
-   %
-   % If they want short, they certainly want long too.
-   \ifsetshortcontentsaftertitlepage
-     \shortcontents
-     \contents
-     \global\let\shortcontents =3D \relax
-     \global\let\contents =3D \relax
-   \fi
-   %
-   \ifsetcontentsaftertitlepage
-     \contents
-     \global\let\contents =3D \relax
-     \global\let\shortcontents =3D \relax
-   \fi
  }
 =20
  \def\finishtitlepage{%
--- 3768,3773 ----
***************
*** 3095,3108 ****
    \finishedtitlepagetrue
  }
 =20
! %%% Macros to be used within @titlepage:
 =20
! \let\subtitlerm=3D\tenrm
  \def\subtitlefont{\subtitlerm \normalbaselineskip =3D 13pt \normalbaselin=
es}
 =20
  \parseargdef\title{%
    \checkenv\titlepage
!   \leftline{\titlefonts\rmisbold #1}
    % print a rule at the page bottom also.
    \finishedtitlepagefalse
    \vskip4pt \hrule height 4pt width \hsize \vskip4pt
--- 3776,3802 ----
    \finishedtitlepagetrue
  }
 =20
! % Settings used for typesetting titles: no hyphenation, no indentation,
! % don't worry much about spacing, ragged right.  This should be used
! % inside a \vbox, and fonts need to be set appropriately first. \par shou=
ld
! % be specified before the end of the \vbox, since a vbox is a group.
! %
! \def\raggedtitlesettings{%
!   \rm
!   \hyphenpenalty=3D10000
!   \parindent=3D0pt
!   \tolerance=3D5000
!   \ptexraggedright
! }
!=20
! % Macros to be used within @titlepage:
 =20
! \let\subtitlerm=3D\rmfont
  \def\subtitlefont{\subtitlerm \normalbaselineskip =3D 13pt \normalbaselin=
es}
 =20
  \parseargdef\title{%
    \checkenv\titlepage
!   \vbox{\titlefonts \raggedtitlesettings #1\par}%
    % print a rule at the page bottom also.
    \finishedtitlepagefalse
    \vskip4pt \hrule height 4pt width \hsize \vskip4pt
***************
*** 3123,3145 ****
    \else
      \checkenv\titlepage
      \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
!     {\secfonts\rmisbold \leftline{#1}}%
    \fi
  }
 =20
 =20
! %%% Set up page headings and footings.
 =20
  \let\thispage=3D\folio
 =20
  \newtoks\evenheadline    % headline on even pages
  \newtoks\oddheadline     % headline on odd pages
  \newtoks\evenfootline    % footline on even pages
  \newtoks\oddfootline     % footline on odd pages
 =20
! % Now make TeX use those variables
! \headline=3D{{\textfonts\rm \ifodd\pageno \the\oddheadline
!                             \else \the\evenheadline \fi}}
  \footline=3D{{\textfonts\rm \ifodd\pageno \the\oddfootline
                              \else \the\evenfootline \fi}\HEADINGShook}
  \let\HEADINGShook=3D\relax
--- 3817,3846 ----
    \else
      \checkenv\titlepage
      \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
!     {\secfonts\rm \leftline{#1}}%
    \fi
  }
 =20
 =20
! % Set up page headings and footings.
 =20
  \let\thispage=3D\folio
 =20
  \newtoks\evenheadline    % headline on even pages
  \newtoks\oddheadline     % headline on odd pages
+ \newtoks\evenchapheadline% headline on even pages with a new chapter
+ \newtoks\oddchapheadline % headline on odd pages with a new chapter
  \newtoks\evenfootline    % footline on even pages
  \newtoks\oddfootline     % footline on odd pages
 =20
! % Now make \makeheadline and \makefootline in Plain TeX use those variabl=
es
! \headline=3D{{\textfonts\rm
!             \ifchapterpage
!               \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline=
\fi
!             \else
!               \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi
!             \fi}}
!=20
  \footline=3D{{\textfonts\rm \ifodd\pageno \the\oddfootline
                              \else \the\evenfootline \fi}\HEADINGShook}
  \let\HEADINGShook=3D\relax
***************
*** 3155,3166 ****
  \def\evenheading{\parsearg\evenheadingxxx}
  \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
! \global\evenheadline=3D{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
 =20
  \def\oddheading{\parsearg\oddheadingxxx}
  \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
! \global\oddheadline=3D{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
 =20
  \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
 =20
--- 3856,3869 ----
  \def\evenheading{\parsearg\evenheadingxxx}
  \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
!   \global\evenheadline=3D{\rlap{\centerline{#2}}\line{#1\hfil#3}}
!   \global\evenchapheadline=3D\evenheadline}
 =20
  \def\oddheading{\parsearg\oddheadingxxx}
  \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
!   \global\oddheadline=3D{\rlap{\centerline{#2}}\line{#1\hfil#3}}%
!   \global\oddchapheadline=3D\oddheadline}
 =20
  \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
 =20
***************
*** 3176,3182 ****
    %
    % Leave some space for the footline.  Hopefully ok to assume
    % @evenfooting will not be used by itself.
!   \global\advance\pageheight by -12pt
    \global\advance\vsize by -12pt
  }
 =20
--- 3879,3885 ----
    %
    % Leave some space for the footline.  Hopefully ok to assume
    % @evenfooting will not be used by itself.
!   \global\advance\txipageheight by -12pt
    \global\advance\vsize by -12pt
  }
 =20
***************
*** 3193,3205 ****
  % @everyheadingmarks
  % @everyfootingmarks
 =20
  \def\evenheadingmarks{\headingmarks{even}{heading}}
  \def\oddheadingmarks{\headingmarks{odd}{heading}}
  \def\evenfootingmarks{\headingmarks{even}{footing}}
  \def\oddfootingmarks{\headingmarks{odd}{footing}}
! \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
                            \headingmarks{odd}{heading}{#1} }
! \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
                            \headingmarks{odd}{footing}{#1} }
  % #1 =3D even/odd, #2 =3D heading/footing, #3 =3D top/bottom.
  \def\headingmarks#1#2#3 {%
--- 3896,3912 ----
  % @everyheadingmarks
  % @everyfootingmarks
 =20
+ % These define \getoddheadingmarks, \getevenheadingmarks,
+ % \getoddfootingmarks, and \getevenfootingmarks, each to one of
+ % \gettopheadingmarks, \getbottomheadingmarks.
+ %
  \def\evenheadingmarks{\headingmarks{even}{heading}}
  \def\oddheadingmarks{\headingmarks{odd}{heading}}
  \def\evenfootingmarks{\headingmarks{even}{footing}}
  \def\oddfootingmarks{\headingmarks{odd}{footing}}
! \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
                            \headingmarks{odd}{heading}{#1} }
! \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
                            \headingmarks{odd}{footing}{#1} }
  % #1 =3D even/odd, #2 =3D heading/footing, #3 =3D top/bottom.
  \def\headingmarks#1#2#3 {%
***************
*** 3220,3259 ****
  % By default, they are off at the start of a document,
  % and turned `on' after @end titlepage.
 =20
! \def\headings #1 {\csname HEADINGS#1\endcsname}
 =20
  \def\headingsoff{% non-global headings elimination
!   \evenheadline=3D{\hfil}\evenfootline=3D{\hfil}%
!    \oddheadline=3D{\hfil}\oddfootline=3D{\hfil}%
  }
 =20
  \def\HEADINGSoff{{\globaldefs=3D1 \headingsoff}} % global setting
  \HEADINGSoff  % it's the default
 =20
  % When we turn headings on, set the page number to 1.
  % For double-sided printing, put current file name in lower left corner,
  % chapter name on inside top of right hand pages, document
  % title on inside top of left hand pages, and page numbers on outside top
  % edge of all pages.
  \def\HEADINGSdouble{%
! \global\pageno=3D1
! \global\evenfootline=3D{\hfil}
! \global\oddfootline=3D{\hfil}
! \global\evenheadline=3D{\line{\folio\hfil\thistitle}}
! \global\oddheadline=3D{\line{\thischapter\hfil\folio}}
! \global\let\contentsalignmacro =3D \chapoddpage
  }
  \let\contentsalignmacro =3D \chappager
 =20
  % For single-sided printing, chapter title goes across top left of page,
  % page number on top right.
  \def\HEADINGSsingle{%
! \global\pageno=3D1
! \global\evenfootline=3D{\hfil}
! \global\oddfootline=3D{\hfil}
! \global\evenheadline=3D{\line{\thischapter\hfil\folio}}
! \global\oddheadline=3D{\line{\thischapter\hfil\folio}}
! \global\let\contentsalignmacro =3D \chappager
  }
  \def\HEADINGSon{\HEADINGSdouble}
 =20
--- 3927,3963 ----
  % By default, they are off at the start of a document,
  % and turned `on' after @end titlepage.
 =20
! \parseargdef\headings{\csname HEADINGS#1\endcsname}
 =20
  \def\headingsoff{% non-global headings elimination
!   \evenheadline=3D{\hfil}\evenfootline=3D{\hfil}\evenchapheadline=3D{\hfi=
l}%
!    \oddheadline=3D{\hfil}\oddfootline=3D{\hfil}\oddchapheadline=3D{\hfil}=
%
  }
 =20
  \def\HEADINGSoff{{\globaldefs=3D1 \headingsoff}} % global setting
  \HEADINGSoff  % it's the default
 =20
  % When we turn headings on, set the page number to 1.
+ \def\pageone{
+   \global\pageno=3D1
+   \global\arabiccount =3D \pagecount
+ }
+=20
  % For double-sided printing, put current file name in lower left corner,
  % chapter name on inside top of right hand pages, document
  % title on inside top of left hand pages, and page numbers on outside top
  % edge of all pages.
  \def\HEADINGSdouble{%
! \pageone
! \HEADINGSdoublex
  }
  \let\contentsalignmacro =3D \chappager
 =20
  % For single-sided printing, chapter title goes across top left of page,
  % page number on top right.
  \def\HEADINGSsingle{%
! \pageone
! \HEADINGSsinglex
  }
  \def\HEADINGSon{\HEADINGSdouble}
 =20
***************
*** 3264,3269 ****
--- 3968,3975 ----
  \global\oddfootline=3D{\hfil}
  \global\evenheadline=3D{\line{\folio\hfil\thistitle}}
  \global\oddheadline=3D{\line{\thischapter\hfil\folio}}
+ \global\evenchapheadline=3D{\line{\folio\hfil}}
+ \global\oddchapheadline=3D{\line{\hfil\folio}}
  \global\let\contentsalignmacro =3D \chapoddpage
  }
 =20
***************
*** 3273,3278 ****
--- 3979,3998 ----
  \global\oddfootline=3D{\hfil}
  \global\evenheadline=3D{\line{\thischapter\hfil\folio}}
  \global\oddheadline=3D{\line{\thischapter\hfil\folio}}
+ \global\evenchapheadline=3D{\line{\hfil\folio}}
+ \global\oddchapheadline=3D{\line{\hfil\folio}}
+ \global\let\contentsalignmacro =3D \chappager
+ }
+=20
+ % for @setchapternewpage off
+ \def\HEADINGSsinglechapoff{%
+ \pageone
+ \global\evenfootline=3D{\hfil}
+ \global\oddfootline=3D{\hfil}
+ \global\evenheadline=3D{\line{\thischapter\hfil\folio}}
+ \global\oddheadline=3D{\line{\thischapter\hfil\folio}}
+ \global\evenchapheadline=3D\evenheadline
+ \global\oddchapheadline=3D\oddheadline
  \global\let\contentsalignmacro =3D \chappager
  }
 =20
***************
*** 3280,3286 ****
  % This produces Day Month Year style of output.
  % Only define if not already defined, in case a txi-??.tex file has set
  % up a different format (e.g., txi-cs.tex does this).
! \ifx\today\undefined
  \def\today{%
    \number\day\space
    \ifcase\month
--- 4000,4006 ----
  % This produces Day Month Year style of output.
  % Only define if not already defined, in case a txi-??.tex file has set
  % up a different format (e.g., txi-cs.tex does this).
! \ifx\today\thisisundefined
  \def\today{%
    \number\day\space
    \ifcase\month
***************
*** 3450,3456 ****
    \parskip=3D\smallskipamount
    \ifdim\parskip=3D0pt \parskip=3D2pt \fi
    %
!   % Try typesetting the item mark that if the document erroneously says
    % something like @itemize @samp (intending @table), there's an error
    % right away at the @itemize.  It's not the best error message in the
    % world, but it's better than leaving it to the @item.  This means if
--- 4170,4176 ----
    \parskip=3D\smallskipamount
    \ifdim\parskip=3D0pt \parskip=3D2pt \fi
    %
!   % Try typesetting the item mark so that if the document erroneously say=
s
    % something like @itemize @samp (intending @table), there's an error
    % right away at the @itemize.  It's not the best error message in the
    % world, but it's better than leaving it to the @item.  This means if
***************
*** 3482,3488 ****
     \noindent
     \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
     %
!    \vadjust{\penalty 1200}}% not good to break after first line of item.
    \flushcr
  }
 =20
--- 4202,4213 ----
     \noindent
     \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
     %
!    \ifinner\else
!      \vadjust{\penalty 1200}% not good to break after first line of item.
!    \fi
!    % We can be in inner vertical mode in a footnote, although an
!    % @itemize looks awful there.
!   }%
    \flushcr
  }
 =20
***************
*** 3576,3657 ****
    \doitemize{#1.}\flushcr
  }
 =20
- % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
- % to @enumerate.
- %
- \def\alphaenumerate{\enumerate{a}}
- \def\capsenumerate{\enumerate{A}}
- \def\Ealphaenumerate{\Eenumerate}
- \def\Ecapsenumerate{\Eenumerate}
-=20
 =20
  % @multitable macros
- % Amy Hendrickson, 8/18/94, 3/6/96
- %
- % @multitable ... @end multitable will make as many columns as desired.
- % Contents of each column will wrap at width given in preamble.  Width
- % can be specified either with sample text given in a template line,
- % or in percent of \hsize, the current width of text on page.
-=20
- % Table can continue over pages but will only break between lines.
-=20
- % To make preamble:
- %
- % Either define widths of columns in terms of percent of \hsize:
- %   @multitable @columnfractions .25 .3 .45
- %   @item ...
- %
- %   Numbers following @columnfractions are the percent of the total
- %   current hsize to be used for each column. You may use as many
- %   columns as desired.
-=20
-=20
- % Or use a template:
- %   @multitable {Column 1 template} {Column 2 template} {Column 3 templat=
e}
- %   @item ...
- %   using the widest term desired in each column.
-=20
- % 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.
-=20
- % @item, @tab do not need to be on their own lines, but it will not hurt
- % if they are.
-=20
- % Sample multitable:
-=20
- %   @multitable {Column 1 template} {Column 2 template} {Column 3 templat=
e}
- %   @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
- %   @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
-=20
- % Default dimensions may be reset by user.
- % @multitableparskip is vertical space between paragraphs in table.
- % @multitableparindent is paragraph indent in table.
- % @multitablecolmargin is horizontal space to be left between columns.
- % @multitablelinespace is space to leave between table items, baseline
- %                                                            to baseline.
- %   0pt means it depends on current normal line spacing.
- %
- \newskip\multitableparskip
- \newskip\multitableparindent
- \newdimen\multitablecolspace
- \newskip\multitablelinespace
- \multitableparskip=3D0pt
- \multitableparindent=3D6pt
- \multitablecolspace=3D12pt
- \multitablelinespace=3D0pt
 =20
  % Macros used to set up halign preamble:
  %
--- 4301,4308 ----
***************
*** 3699,3726 ****
    \go
  }
 =20
! % multitable-only commands.
! %
! % @headitem starts a heading row, which we typeset in bold.
! % Assignments have to be global since we are inside the implicit group
! % of an alignment entry.  \everycr resets \everytab so we don't have to
  % undo it ourselves.
  \def\headitemfont{\b}% for people to use in the template row; not changea=
ble
  \def\headitem{%
    \checkenv\multitable
    \crcr
    \global\everytab=3D{\bf}% can't use \headitemfont since the parsing dif=
fers
    \the\everytab % for the first item
  }%
  %
! % A \tab used to include \hskip1sp.  But then the space in a template
! % line is not enough.  That is bad.  So let's go back to just `&' until
! % we again encounter the problem the 1sp was intended to solve.
! %=09=09=09=09=09--karl, [email protected], 20apr99.
  \def\tab{\checkenv\multitable &\the\everytab}%
 =20
- % @multitable ... @end multitable definitions:
- %
  \newtoks\everytab  % insert after every tab.
  %
  \envdef\multitable{%
--- 4350,4373 ----
    \go
  }
 =20
! % @headitem starts a heading row, which we typeset in bold.  Assignments
! % have to be global since we are inside the implicit group of an
! % alignment entry.  \everycr below resets \everytab so we don't have to
  % undo it ourselves.
  \def\headitemfont{\b}% for people to use in the template row; not changea=
ble
  \def\headitem{%
    \checkenv\multitable
    \crcr
+   \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headi=
ngs
    \global\everytab=3D{\bf}% can't use \headitemfont since the parsing dif=
fers
    \the\everytab % for the first item
  }%
  %
! % default for tables with no headings.
! \let\headitemcrhook=3D\relax
! %
  \def\tab{\checkenv\multitable &\the\everytab}%
 =20
  \newtoks\everytab  % insert after every tab.
  %
  \envdef\multitable{%
***************
*** 3735,3757 ****
    %
    \tolerance=3D9500
    \hbadness=3D9500
!   \setmultitablespacing
!   \parskip=3D\multitableparskip
!   \parindent=3D\multitableparindent
    \overfullrule=3D0pt
    \global\colcount=3D0
    %
    \everycr =3D {%
      \noalign{%
!       \global\everytab=3D{}%
        \global\colcount=3D0 % Reset the column counter.
!       % Check for saved footnotes, etc.
        \checkinserts
!       % Keeps underfull box messages off when table breaks over pages.
!       %\filbreak
! =09% Maybe so, but it also creates really weird page breaks when the
! =09% table breaks over pages. Wouldn't \vfil be better?  Wait until the
! =09% problem manifests itself, so it can be fixed for real --karl.
      }%
    }%
    %
--- 4382,4403 ----
    %
    \tolerance=3D9500
    \hbadness=3D9500
!   \parskip=3D0pt
!   \parindent=3D6pt
    \overfullrule=3D0pt
    \global\colcount=3D0
    %
    \everycr =3D {%
      \noalign{%
!       \global\everytab=3D{}% Reset from possible headitem.
        \global\colcount=3D0 % Reset the column counter.
!       %
!       % Check for saved footnotes, etc.:
        \checkinserts
!       %
!       % Perhaps a \nobreak, then reset:
!       \headitemcrhook
!       \global\let\headitemcrhook=3D\relax
      }%
    }%
    %
***************
*** 3767,3813 ****
    % continue for many paragraphs if desired.
    \halign\bgroup &%
      \global\advance\colcount by 1
!     \multistrut
      \vtop{%
!       % Use the current \colcount to find the correct column width:
        \hsize=3D\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 aft=
er
-       % 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 wil=
l
-       % 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=3D0pt
        \ifnum\colcount=3D1
! =09% The first column will be indented with the surrounding text.
! =09\advance\hsize by\leftskip
        \else
! =09\ifsetpercent \else
! =09  % If user has not set preamble in terms of percent of \hsize
! =09  % we will advance \hsize by \multitablecolspace.
! =09  \advance\hsize by \multitablecolspace
! =09\fi
!        % In either case we will make \leftskip=3D\multitablecolspace:
!       \leftskip=3D\multitablecolspace
        \fi
!       % Ignoring space at the beginning and end avoids an occasional spur=
ious
!       % blank line, when TeX decides to break the line at the space befor=
e 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 cou=
ntry.
!       % Is automatically provided with highlighting sequences respectivel=
y
!       % marking characters.
!       \noindent\ignorespaces##\unskip\multistrut
      }\cr
  }
  \def\Emultitable{%
--- 4413,4436 ----
    % continue for many paragraphs if desired.
    \halign\bgroup &%
      \global\advance\colcount by 1
!     \strut
      \vtop{%
!       \advance\hsize by -1\leftskip
!       % Find the correct column width
        \hsize=3D\expandafter\csname col\the\colcount\endcsname
        %
        \rightskip=3D0pt
        \ifnum\colcount=3D1
!         \advance\hsize by\leftskip % Add indent of surrounding text
        \else
!         % In order to keep entries from bumping into each other.
!         \leftskip=3D12pt
!         \ifsetpercent \else
!           % If a template has been used
!           \advance\hsize by \leftskip
!         \fi
        \fi
!       \noindent\ignorespaces##\unskip\strut
      }\cr
  }
  \def\Emultitable{%
***************
*** 3816,3846 ****
    \global\setpercentfalse
  }
 =20
- \def\setmultitablespacing{%
-   \def\multistrut{\strut}% just use the standard line spacing
-   %
-   % Compute \multitablelinespace (if not defined by user) for use in
-   % \multitableparskip calculation.  We used define \multistrut based on
-   % this, but (ironically) that caused the spacing to be off.
-   % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +010=
0.
- \ifdim\multitablelinespace=3D0pt
- \setbox0=3D\vbox{X}\global\multitablelinespace=3D\the\baselineskip
- \global\advance\multitablelinespace by-\ht0
- \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=3D\multitablelinespace
- \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
-                                       %% than skip between lines in the t=
able.
- \fi%
- \ifdim\multitableparskip=3D0pt
- \global\multitableparskip=3D\multitablelinespace
- \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
-                                       %% than skip between lines in the t=
able.
- \fi}
-=20
 =20
  \message{conditionals,}
 =20
--- 4439,4444 ----
***************
*** 3990,3996 ****
  \def\value{\begingroup\makevalueexpandable\valuexxx}
  \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  {
!   \catcode`\- =3D \active \catcode`\_ =3D \active
    %
    \gdef\makevalueexpandable{%
      \let\value =3D \expandablevalue
--- 4588,4594 ----
  \def\value{\begingroup\makevalueexpandable\valuexxx}
  \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  {
!   \catcode`\-=3D\active \catcode`\_=3D\active
    %
    \gdef\makevalueexpandable{%
      \let\value =3D \expandablevalue
***************
*** 3999,4016 ****
      % ..., but we might end up with active ones in the argument if
      % we're called from @code, as @code{@value{foo-bar_}}, though.
      % So \let them to their normal equivalents.
!     \let-\realdash \let_\normalunderscore
    }
  }
 =20
- % We have this subroutine so that we can handle at least some @value's
- % properly in indexes (we call \makevalueexpandable in \indexdummies).
- % The command has to be fully expandable (if the variable is set), 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'']}%
--- 4597,4606 ----
      % ..., but we might end up with active ones in the argument if
      % we're called from @code, as @code{@value{foo-bar_}}, though.
      % So \let them to their normal equivalents.
!     \let-\normaldash \let_\normalunderscore
    }
  }
 =20
  \def\expandablevalue#1{%
    \expandafter\ifx\csname SET#1\endcsname\relax
      {[No value for ``#1'']}%
***************
*** 4020,4029 ****
    \fi
  }
 =20
  % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  % with @set.
  %
! % To get special treatment of `@end ifset,' call \makeond and the redefin=
e.
  %
  \makecond{ifset}
  \def\ifset{\parsearg{\doifset{\let\next=3D\ifsetfail}}}
--- 4610,4645 ----
    \fi
  }
 =20
+ % Like \expandablevalue, but completely expandable (the \message in the
+ % definition above operates at the execution level of TeX).  Used when
+ % writing to auxiliary files, due to the expansion that \write does.
+ % If flag is undefined, pass through an unexpanded @value command: maybe =
it
+ % will be set by the time it is read back in.
+ %
+ % NB flag names containing - or _ may not work here.
+ \def\dummyvalue#1{%
+   \expandafter\ifx\csname SET#1\endcsname\relax
+     \string\value{#1}%
+   \else
+     \csname SET#1\endcsname
+   \fi
+ }
+=20
+ % Used for @value's in index entries to form the sort key: expand the @va=
lue
+ % if possible, otherwise sort late.
+ \def\indexnofontsvalue#1{%
+   \expandafter\ifx\csname SET#1\endcsname\relax
+     ZZZZZZZ%
+   \else
+     \csname SET#1\endcsname
+   \fi
+ }
+=20
  % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  % with @set.
  %
! % To get the special treatment we need for `@end ifset,' we call
! % \makecond and then redefine.
  %
  \makecond{ifset}
  \def\ifset{\parsearg{\doifset{\let\next=3D\ifsetfail}}}
***************
*** 4039,4045 ****
  }
  \def\ifsetfail{\doignore{ifset}}
 =20
! % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
  % defined with @set, or has been undefined with @clear.
  %
  % The `\else' inside the `\doifset' parameter is a trick to reuse the
--- 4655,4661 ----
  }
  \def\ifsetfail{\doignore{ifset}}
 =20
! % @ifclear VAR ... @end executes the `...' iff VAR has never been
  % defined with @set, or has been undefined with @clear.
  %
  % The `\else' inside the `\doifset' parameter is a trick to reuse the
***************
*** 4050,4055 ****
--- 4666,4700 ----
  \def\ifclear{\parsearg{\doifset{\else \let\next=3D\ifclearfail}}}
  \def\ifclearfail{\doignore{ifclear}}
 =20
+ % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
+ % without the @) is in fact defined.  We can only feasibly check at the
+ % TeX level, so something like `mathcode' is going to considered
+ % defined even though it is not a Texinfo command.
+ %
+ \makecond{ifcommanddefined}
+ \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=3D\ifcmddefined=
fail}}}
+ %
+ \def\doifcmddefined#1#2{{%
+     \makevalueexpandable
+     \let\next=3D\empty
+     \expandafter\ifx\csname #2\endcsname\relax
+       #1% If not defined, \let\next as above.
+     \fi
+     \expandafter
+   }\next
+ }
+ \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
+=20
+ % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
+ \makecond{ifcommandnotdefined}
+ \def\ifcommandnotdefined{%
+   \parsearg{\doifcmddefined{\else \let\next=3D\ifcmdnotdefinedfail}}}
+ \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
+=20
+ % Set the `txicommandconditionals' variable, so documents have a way to
+ % test if the @ifcommand...defined conditionals are available.
+ \set txicommandconditionals
+=20
  % @dircategory CATEGORY  -- specify a category of the dir file
  % which this file should belong to.  Ignore this in TeX.
  \let\dircategory=3D\comment
***************
*** 4065,4083 ****
  % except not \outer, so it can be used within macros and \if's.
  \edef\newwrite{\makecsname{ptexnewwrite}}
 =20
! % \newindex {foo} defines an index named foo.
! % It automatically defines \fooindex such that
! % \fooindex ...rest of line... puts an entry in the index foo.
! % It also defines \fooindfile to be the number of the output channel for
! % 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{%
!   \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}}
  }
--- 4710,4725 ----
  % except not \outer, so it can be used within macros and \if's.
  \edef\newwrite{\makecsname{ptexnewwrite}}
 =20
! % \newindex {foo} defines an index named IX.
! % It automatically defines \IXindex such that
! % \IXindex ...rest of line... puts an entry in the index IX.
! % It also defines \IXindfile to be the number of the output channel for
! % the file that accumulates this index.  The file's extension is IX.
  % The name of an index should be no more than 2 characters long
  % for the sake of vms.
  %
  \def\newindex#1{%
!   \expandafter\chardef\csname#1indfile\endcsname=3D0
    \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
      \noexpand\doindex{#1}}
  }
***************
*** 4091,4104 ****
  \def\defcodeindex{\parsearg\newcodeindex}
  %
  \def\newcodeindex#1{%
!   \iflinks
!     \expandafter\newwrite \csname#1indfile\endcsname
!     \openout \csname#1indfile\endcsname \jobname.#1
!   \fi
    \expandafter\xdef\csname#1index\endcsname{%
      \noexpand\docodeindex{#1}}%
  }
 =20
 =20
  % @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 ind=
ex.
--- 4733,4751 ----
  \def\defcodeindex{\parsearg\newcodeindex}
  %
  \def\newcodeindex#1{%
!   \expandafter\chardef\csname#1indfile\endcsname=3D0
    \expandafter\xdef\csname#1index\endcsname{%
      \noexpand\docodeindex{#1}}%
  }
 =20
+ % The default indices:
+ \newindex{cp}%      concepts,
+ \newcodeindex{fn}%  functions,
+ \newcodeindex{vr}%  variables,
+ \newcodeindex{tp}%  types,
+ \newcodeindex{ky}%  keys
+ \newcodeindex{pg}%  and programs.
+=20
 =20
  % @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 ind=
ex.
***************
*** 4112,4125 ****
  % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  % #3 the target index (bar).
  \def\dosynindex#1#2#3{%
!   % Only do \closeout if we haven't already done it, else we'll end up
!   % closing the target index.
!   \expandafter \ifx\csname donesynindex#2\endcsname \relax
!     % The \closeout helps reduce unnecessary open files; the limit on the
!     % Acorn RISC OS is a mere 16 files.
!     \expandafter\closeout\csname#2indfile\endcsname
!     \expandafter\let\csname donesynindex#2\endcsname =3D 1
!   \fi
    % redefine \fooindfile:
    \expandafter\let\expandafter\temp\expandafter=3D\csname#3indfile\endcsn=
ame
    \expandafter\let\csname#2indfile\endcsname=3D\temp
--- 4759,4765 ----
  % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  % #3 the target index (bar).
  \def\dosynindex#1#2#3{%
!   \requireopenindexfile{#3}%
    % redefine \fooindfile:
    \expandafter\let\expandafter\temp\expandafter=3D\csname#3indfile\endcsn=
ame
    \expandafter\let\csname#2indfile\endcsname=3D\temp
***************
*** 4127,4234 ****
    \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  }
 =20
! % Define \doindex, the driver for all \fooindex macros.
  % Argument #1 is generated by the calling \fooindex macro,
! %  and it is "foo", the name of the index.
!=20
! % \doindex just uses \parsearg; it calls \doind for the actual work.
! % This is because \doind is more useful to call from other macros.
 =20
! % There is also \dosubind {index}{topic}{subtopic}
! % which makes an entry in a two-level index such as the operation index.
!=20
! \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
! \def\singleindexer #1{\doind{\indexname}{#1}}
 =20
  % like the previous two, but they put @code around the argument.
! \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
! \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
 =20
- % Take care of Texinfo commands that can appear in an index entry.
- % Since there are some commands we want to expand, and others we don't,
- % we have to laboriously prevent expansion for those that we don't.
- %
- \def\indexdummies{%
-   \escapechar =3D `\\     % use backslash in output files.
-   \def\@{@}% change to @@ when we switch to @ as escape char in index fil=
es.
-   \def\ {\realbackslash\space }%
-   %
-   % Need these unexpandable (because we define \tt as a dummy)
-   % definitions when @{ or @} appear in index entry text.  Also, more
-   % complicated, when \tex is in effect and \{ is a \delimiter again.
-   % We can't use \lbracecmd and \rbracecmd because texindex assumes
-   % braces and backslashes are used only as delimiters.  Perhaps we
-   % should define @lbrace and @rbrace commands a la @comma.
-   \def\{{{\tt\char123}}%
-   \def\}{{\tt\char125}}%
-   %
-   % I don't entirely understand this, but when an index entry is
-   % generated from a macro call, the \endinput which \scanmacro inserts
-   % causes processing to be prematurely terminated.  This is,
-   % apparently, because \indexsorttmp is fully expanded, and \endinput
-   % is an expandable command.  The redefinition below makes \endinput
-   % disappear altogether for that purpose -- although logging shows that
-   % processing continues to some further point.  On the other hand, it
-   % seems \endinput does not hurt in the printed index arg, since that
-   % is still getting written without apparent harm.
-   %
-   % Sample source (mac-idx3.tex, reported by Graham Percival to
-   % help-texinfo, 22may06):
-   % @macro funindex {WORD}
-   % @findex xyz
-   % @end macro
-   % ...
-   % @funindex commtest
-   %
-   % The above is not enough to reproduce the bug, but it gives the flavor=
.
-   %
-   % Sample whatsit resulting:
-   % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
-   %
-   % So:
-   \let\endinput =3D \empty
-   %
-   % Do the redefinitions.
-   \commondummies
- }
 =20
! % For the aux and toc files, @ is the escape character.  So we want to
! % redefine everything using @ as the escape character (instead of
! % \realbackslash, still used for index files).  When everything uses @,
! % this will be simpler.
  %
  \def\atdummies{%
!   \def\@{@@}%
!   \def\ {@ }%
!   \let\{ =3D \lbraceatcmd
!   \let\} =3D \rbraceatcmd
    %
    % Do the redefinitions.
!   \commondummies
    \otherbackslash
  }
 =20
! % Called from \indexdummies and \atdummies.
! %
! \def\commondummies{%
!   %
!   % \definedummyword defines \#1 as \string\#1\space, thus effectively
!   % preventing its expansion.  This is used only for control words,
!   % not control letters, because the \space would be incorrect for
!   % control characters, but is needed to separate the control word
!   % from whatever follows.
!   %
!   % For control letters, we have \definedummyletter, which omits the
!   % space.
!   %
!   % These can be used both for control words that take an argument and
!   % those that do not.  If it is followed by {arg} in the input, then
!   % that will dutifully get written to the index (or wherever).
!   %
!   \def\definedummyword  ##1{\def##1{\string##1\space}}%
!   \def\definedummyletter##1{\def##1{\string##1}}%
!   \let\definedummyaccent\definedummyletter
!   %
    \commondummiesnofonts
    %
    \definedummyletter\_%
--- 4767,4823 ----
    \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  }
 =20
! % Define \doindex, the driver for all index macros.
  % Argument #1 is generated by the calling \fooindex macro,
! % and it is the two-letter name of the index.
 =20
! \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
! \def\doindexxxx #1{\doind{\indexname}{#1}}
 =20
  % like the previous two, but they put @code around the argument.
! \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
! \def\docodeindexxxx #1{\docind{\indexname}{#1}}
 =20
 =20
! % Used for the aux, toc and index files to prevent expansion of Texinfo
! % commands.
  %
  \def\atdummies{%
!   \definedummyletter\@%
!   \definedummyletter\ %
!   \definedummyletter\{%
!   \definedummyletter\}%
!   \definedummyletter\&%
    %
    % Do the redefinitions.
!   \definedummies
    \otherbackslash
  }
 =20
! % \definedummyword defines \#1 as \string\#1\space, thus effectively
! % preventing its expansion.  This is used only for control words,
! % not control letters, because the \space would be incorrect for
! % control characters, but is needed to separate the control word
! % from whatever follows.
! %
! % These can be used both for control words that take an argument and
! % those that do not.  If it is followed by {arg} in the input, then
! % that will dutifully get written to the index (or wherever).
! %
! % For control letters, we have \definedummyletter, which omits the
! % space.
! %
! \def\definedummyword  #1{\def#1{\string#1\space}}%
! \def\definedummyletter#1{\def#1{\string#1}}%
! \let\definedummyaccent\definedummyletter
!=20
! % Called from \atdummies to prevent the expansion of commands.
! %
! \def\definedummies{%
!   %
!   \let\commondummyword\definedummyword
!   \let\commondummyletter\definedummyletter
!   \let\commondummyaccent\definedummyaccent
    \commondummiesnofonts
    %
    \definedummyletter\_%
***************
*** 4269,4275 ****
--- 4858,4867 ----
    \definedummyword\TeX
    %
    % Assorted special characters.
+   \definedummyword\ampchar
+   \definedummyword\atchar
    \definedummyword\arrow
+   \definedummyword\backslashchar
    \definedummyword\bullet
    \definedummyword\comma
    \definedummyword\copyright
***************
*** 4286,4292 ****
--- 4878,4886 ----
    \definedummyword\guillemetright
    \definedummyword\guilsinglleft
    \definedummyword\guilsinglright
+   \definedummyword\lbracechar
    \definedummyword\leq
+   \definedummyword\mathopsup
    \definedummyword\minus
    \definedummyword\ogonek
    \definedummyword\pounds
***************
*** 4298,4382 ****
    \definedummyword\quoteleft
    \definedummyword\quoteright
    \definedummyword\quotesinglbase
    \definedummyword\result
    \definedummyword\textdegree
    %
    % We want to disable all macros so that they are not expanded by \write=
.
    \macrolist
    %
    \normalturnoffactive
-   %
-   % Handle some cases of @value -- where it does not contain any
-   % (non-fully-expandable) commands.
-   \makevalueexpandable
  }
 =20
! % \commondummiesnofonts: common to \commondummies and \indexnofonts.
  %
  \def\commondummiesnofonts{%
    % Control letters and accents.
!   \definedummyletter\!%
!   \definedummyaccent\"%
!   \definedummyaccent\'%
!   \definedummyletter\*%
!   \definedummyaccent\,%
!   \definedummyletter\.%
!   \definedummyletter\/%
!   \definedummyletter\:%
!   \definedummyaccent\=3D%
!   \definedummyletter\?%
!   \definedummyaccent\^%
!   \definedummyaccent\`%
!   \definedummyaccent\~%
!   \definedummyword\u
!   \definedummyword\v
!   \definedummyword\H
!   \definedummyword\dotaccent
!   \definedummyword\ogonek
!   \definedummyword\ringaccent
!   \definedummyword\tieaccent
!   \definedummyword\ubaraccent
!   \definedummyword\udotaccent
!   \definedummyword\dotless
    %
    % Texinfo font commands.
!   \definedummyword\b
!   \definedummyword\i
!   \definedummyword\r
!   \definedummyword\sansserif
!   \definedummyword\sc
!   \definedummyword\slanted
!   \definedummyword\t
    %
    % Commands that take arguments.
!   \definedummyword\acronym
!   \definedummyword\cite
!   \definedummyword\code
!   \definedummyword\command
!   \definedummyword\dfn
!   \definedummyword\dmn
!   \definedummyword\email
!   \definedummyword\emph
!   \definedummyword\env
!   \definedummyword\file
!   \definedummyword\indicateurl
!   \definedummyword\kbd
!   \definedummyword\key
!   \definedummyword\math
!   \definedummyword\option
!   \definedummyword\pxref
!   \definedummyword\ref
!   \definedummyword\samp
!   \definedummyword\strong
!   \definedummyword\tie
!   \definedummyword\uref
!   \definedummyword\url
!   \definedummyword\var
!   \definedummyword\verb
!   \definedummyword\w
!   \definedummyword\xref
  }
 =20
  % \indexnofonts is used when outputting the strings to sort the index
  % by, and when constructing control sequence names.  It eliminates all
  % control sequences and just writes whatever the best ASCII sort string
--- 4892,5028 ----
    \definedummyword\quoteleft
    \definedummyword\quoteright
    \definedummyword\quotesinglbase
+   \definedummyword\rbracechar
    \definedummyword\result
+   \definedummyword\sub
+   \definedummyword\sup
    \definedummyword\textdegree
    %
+   \definedummyword\subentry
+   %
    % We want to disable all macros so that they are not expanded by \write=
.
    \macrolist
+   \let\value\dummyvalue
    %
    \normalturnoffactive
  }
 =20
! % \commondummiesnofonts: common to \definedummies and \indexnofonts.
! % Define \commondummyletter, \commondummyaccent and \commondummyword befo=
re
! % using.  Used for accents, font commands, and various control letters.
  %
  \def\commondummiesnofonts{%
    % Control letters and accents.
!   \commondummyletter\!%
!   \commondummyaccent\"%
!   \commondummyaccent\'%
!   \commondummyletter\*%
!   \commondummyaccent\,%
!   \commondummyletter\.%
!   \commondummyletter\/%
!   \commondummyletter\:%
!   \commondummyaccent\=3D%
!   \commondummyletter\?%
!   \commondummyaccent\^%
!   \commondummyaccent\`%
!   \commondummyaccent\~%
!   \commondummyword\u
!   \commondummyword\v
!   \commondummyword\H
!   \commondummyword\dotaccent
!   \commondummyword\ogonek
!   \commondummyword\ringaccent
!   \commondummyword\tieaccent
!   \commondummyword\ubaraccent
!   \commondummyword\udotaccent
!   \commondummyword\dotless
    %
    % Texinfo font commands.
!   \commondummyword\b
!   \commondummyword\i
!   \commondummyword\r
!   \commondummyword\sansserif
!   \commondummyword\sc
!   \commondummyword\slanted
!   \commondummyword\t
    %
    % Commands that take arguments.
!   \commondummyword\abbr
!   \commondummyword\acronym
!   \commondummyword\anchor
!   \commondummyword\cite
!   \commondummyword\code
!   \commondummyword\command
!   \commondummyword\dfn
!   \commondummyword\dmn
!   \commondummyword\email
!   \commondummyword\emph
!   \commondummyword\env
!   \commondummyword\file
!   \commondummyword\image
!   \commondummyword\indicateurl
!   \commondummyword\inforef
!   \commondummyword\kbd
!   \commondummyword\key
!   \commondummyword\math
!   \commondummyword\option
!   \commondummyword\pxref
!   \commondummyword\ref
!   \commondummyword\samp
!   \commondummyword\strong
!   \commondummyword\tie
!   \commondummyword\U
!   \commondummyword\uref
!   \commondummyword\url
!   \commondummyword\var
!   \commondummyword\verb
!   \commondummyword\w
!   \commondummyword\xref
! }
!=20
! \let\indexlbrace\relax
! \let\indexrbrace\relax
! \let\indexatchar\relax
! \let\indexbackslash\relax
!=20
! {\catcode`\@=3D0
! \catcode`\\=3D13
!   @gdef@backslashdisappear{@def\{}}
! }
!=20
! {
! \catcode`\<=3D13
! \catcode`\-=3D13
! \catcode`\`=3D13
!   \gdef\indexnonalnumdisappear{%
!     \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
!       % @set txiindexlquoteignore makes us ignore left quotes in the sort=
 term.
!       % (Introduced for FSFS 2nd ed.)
!       \let`=3D\empty
!     \fi
!     %
!     \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\el=
se
!       \backslashdisappear
!     \fi
!     %
!     \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
!       \def-{}%
!     \fi
!     \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\els=
e
!       \def<{}%
!     \fi
!     \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
!       \def\@{}%
!     \fi
!   }
!=20
!   \gdef\indexnonalnumreappear{%
!     \let-\normaldash
!     \let<\normalless
!   }
  }
 =20
+=20
  % \indexnofonts is used when outputting the strings to sort the index
  % by, and when constructing control sequence names.  It eliminates all
  % control sequences and just writes whatever the best ASCII sort string
***************
*** 4384,4395 ****
  %
  \def\indexnofonts{%
    % Accent commands should become @asis.
!   \def\definedummyaccent##1{\let##1\asis}%
    % We can just ignore other control letters.
!   \def\definedummyletter##1{\let##1\empty}%
    % All control words become @asis by default; overrides below.
!   \let\definedummyword\definedummyaccent
!   %
    \commondummiesnofonts
    %
    % Don't no-op \tt, since it isn't a user-level command
--- 5030,5040 ----
  %
  \def\indexnofonts{%
    % Accent commands should become @asis.
!   \def\commondummyaccent##1{\let##1\asis}%
    % We can just ignore other control letters.
!   \def\commondummyletter##1{\let##1\empty}%
    % All control words become @asis by default; overrides below.
!   \let\commondummyword\commondummyaccent
    \commondummiesnofonts
    %
    % Don't no-op \tt, since it isn't a user-level command
***************
*** 4402,4412 ****
    \def\_{\normalunderscore}%
    \def\-{}% @- shouldn't affect sorting
    %
!   % Unfortunately, texindex is not prepared to handle braces in the
!   % content at all.  So for index sorting, we map @{ and @} to strings
!   % starting with |, since that ASCII character is between ASCII { and }.
!   \def\{{|a}%
!   \def\}{|b}%
    %
    % Non-English letters.
    \def\AA{AA}%
--- 5047,5056 ----
    \def\_{\normalunderscore}%
    \def\-{}% @- shouldn't affect sorting
    %
!   \uccode`\1=3D`\{ \uppercase{\def\{{1}}%
!   \uccode`\1=3D`\} \uppercase{\def\}{1}}%
!   \let\lbracechar\{%
!   \let\rbracechar\}%
    %
    % Non-English letters.
    \def\AA{AA}%
***************
*** 4415,4421 ****
    \def\L{L}%
    \def\OE{OE}%
    \def\O{O}%
!   \def\TH{ZZZ}%
    \def\aa{aa}%
    \def\ae{ae}%
    \def\dh{dzz}%
--- 5059,5065 ----
    \def\L{L}%
    \def\OE{OE}%
    \def\O{O}%
!   \def\TH{TH}%
    \def\aa{aa}%
    \def\ae{ae}%
    \def\dh{dzz}%
***************
*** 4427,4471 ****
    \def\o{o}%
    \def\questiondown{?}%
    \def\ss{ss}%
!   \def\th{zzz}%
    %
!   \def\LaTeX{LaTeX}%
!   \def\TeX{TeX}%
    %
!   % Assorted special characters.
!   % (The following {} will end up in the sort string, but that's ok.)
!   \def\arrow{->}%
!   \def\bullet{bullet}%
!   \def\comma{,}%
!   \def\copyright{copyright}%
!   \def\dots{...}%
!   \def\enddots{...}%
!   \def\equiv{=3D=3D}%
!   \def\error{error}%
!   \def\euro{euro}%
!   \def\expansion{=3D=3D>}%
!   \def\geq{>=3D}%
!   \def\guillemetleft{<<}%
!   \def\guillemetright{>>}%
!   \def\guilsinglleft{<}%
!   \def\guilsinglright{>}%
!   \def\leq{<=3D}%
!   \def\minus{-}%
!   \def\point{.}%
!   \def\pounds{pounds}%
!   \def\print{-|}%
!   \def\quotedblbase{"}%
!   \def\quotedblleft{"}%
!   \def\quotedblright{"}%
!   \def\quoteleft{`}%
!   \def\quoteright{'}%
!   \def\quotesinglbase{,}%
!   \def\registeredsymbol{R}%
!   \def\result{=3D>}%
!   \def\textdegree{o}%
    %
!   \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
!   \else \indexlquoteignore \fi
    %
    % We need to get rid of all macros, leaving only the arguments (if pres=
ent).
    % Of course this is not nearly correct, but it is the best we can do fo=
r now.
--- 5071,5116 ----
    \def\o{o}%
    \def\questiondown{?}%
    \def\ss{ss}%
!   \def\th{th}%
    %
!   \let\do\indexnofontsdef
    %
!   \do\LaTeX{LaTeX}%
!   \do\TeX{TeX}%
    %
!   % Assorted special characters.
!   \do\atchar{@}%
!   \do\arrow{->}%
!   \do\bullet{bullet}%
!   \do\comma{,}%
!   \do\copyright{copyright}%
!   \do\dots{...}%
!   \do\enddots{...}%
!   \do\equiv{=3D=3D}%
!   \do\error{error}%
!   \do\euro{euro}%
!   \do\expansion{=3D=3D>}%
!   \do\geq{>=3D}%
!   \do\guillemetleft{<<}%
!   \do\guillemetright{>>}%
!   \do\guilsinglleft{<}%
!   \do\guilsinglright{>}%
!   \do\leq{<=3D}%
!   \do\lbracechar{\{}%
!   \do\minus{-}%
!   \do\point{.}%
!   \do\pounds{pounds}%
!   \do\print{-|}%
!   \do\quotedblbase{"}%
!   \do\quotedblleft{"}%
!   \do\quotedblright{"}%
!   \do\quoteleft{`}%
!   \do\quoteright{'}%
!   \do\quotesinglbase{,}%
!   \do\rbracechar{\}}%
!   \do\registeredsymbol{R}%
!   \do\result{=3D>}%
!   \do\textdegree{o}%
    %
    % We need to get rid of all macros, leaving only the arguments (if pres=
ent).
    % Of course this is not nearly correct, but it is the best we can do fo=
r now.
***************
*** 4478,4552 ****
    % goes to end-of-line is not handled.
    %
    \macrolist
  }
 =20
! % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
! % ignore left quotes in the sort term.
! {\catcode`\`=3D\active
!  \gdef\indexlquoteignore{\let`=3D\empty}}
 =20
- \let\indexbackslash=3D0  %overridden during \printindex.
- \let\SETmarginindex=3D\relax % put index entries in margin (undocumented)=
?
 =20
- % Most index entries go through here, but \dosubind is the general case.
  % #1 is the index name, #2 is the entry text.
! \def\doind#1#2{\dosubind{#1}{#2}{}}
 =20
! % 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 most defuns, which call us directly).
! %
! \def\dosubind#1#2#3{%
    \iflinks
    {%
-     % Store the main index entry text (including the third arg).
-     \toks0 =3D {#2}%
-     % If third arg is present, precede it with a space.
-     \def\thirdarg{#3}%
-     \ifx\thirdarg\empty \else
-       \toks0 =3D \expandafter{\the\toks0 \space #3}%
-     \fi
      %
      \edef\writeto{\csname#1indfile\endcsname}%
      %
!     \safewhatsit\dosubindwrite
    }%
    \fi
  }
 =20
! % Write the entry in \toks0 to the index file:
  %
! \def\dosubindwrite{%
!   % Put the index entry in the margin if desired.
!   \ifx\SETmarginindex\relax\else
!     \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
    \fi
    %
!   % Remember, we are within a group.
!   \indexdummies % Must do this here, since \bf, etc expand at this stage
!   \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined n=
ow
!       % so it will be output as is; and it will print as backslash.
!   %
!   % Process the index entry with all font commands turned off, to
!   % get the string to sort by.
!   {\indexnofonts
!    \edef\temp{\the\toks0}% need full expansion
!    \xdef\indexsorttmp{\temp}%
!   }%
    %
    % 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 (four in the
    % subentry case), texindex reduces to two when writing the .??s
    % sorted result.
    \edef\temp{%
      \write\writeto{%
!       \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
    }%
    \temp
  }
 =20
  % Take care of unwanted page breaks/skips around a whatsit:
  %
  % If a skip is the last thing on the list now, preserve it
--- 5123,5347 ----
    % goes to end-of-line is not handled.
    %
    \macrolist
+   \let\value\indexnofontsvalue
  }
 =20
! % Give the control sequence a definition that removes the {} that follows
! % its use, e.g. @AA{} -> AA
! \def\indexnofontsdef#1#2{\def#1##1{#2}}%
!=20
!=20
 =20
 =20
  % #1 is the index name, #2 is the entry text.
! \def\doind#1#2{%
!   \iflinks
!   {%
!     %
!     \requireopenindexfile{#1}%
!     \edef\writeto{\csname#1indfile\endcsname}%
!     %
!     \def\indextext{#2}%
!     \safewhatsit\doindwrite
!   }%
!   \fi
! }
 =20
! % Same as \doind, but for code indices
! \def\docind#1#2{%
    \iflinks
    {%
      %
+     \requireopenindexfile{#1}%
      \edef\writeto{\csname#1indfile\endcsname}%
      %
!     \def\indextext{#2}%
!     \safewhatsit\docindwrite
    }%
    \fi
  }
 =20
! % Check if an index file has been opened, and if not, open it.
! \def\requireopenindexfile#1{%
! \ifnum\csname #1indfile\endcsname=3D0
!   \expandafter\newwrite \csname#1indfile\endcsname
!   \edef\suffix{#1}%
!   % A .fls suffix would conflict with the file extension for the output
!   % of -recorder, so use .f1s instead.
!   \ifx\suffix\indexisfl\def\suffix{f1}\fi
!   % Open the file
!   \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
!   % Using \immediate above here prevents an object entering into the curr=
ent
!   % box, which could confound checks such as those in \safewhatsit for
!   % preceding skips.
!   \typeout{Writing index file \jobname.\suffix}%
! \fi}
! \def\indexisfl{fl}
!=20
! % Definition for writing index entry sort key.
! {
! \catcode`\-=3D13
! \gdef\indexwritesortas{%
!   \begingroup
!   \indexnonalnumreappear
!   \indexwritesortasxxx}
! \gdef\indexwritesortasxxx#1{%
!   \xdef\indexsortkey{#1}\endgroup}
! }
!=20
! \def\indexwriteseealso#1{
!   \gdef\pagenumbertext{\string\seealso{#1}}%
! }
! \def\indexwriteseeentry#1{
!   \gdef\pagenumbertext{\string\seeentry{#1}}%
! }
!=20
! % The default definitions
! \def\sortas#1{}%
! \def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
! \def\putwordSeeAlso{See also}
! \def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
!=20
!=20
! % Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
! %   * Set \bracedtext to "{aaa}{bbb}"
! %   * Set \fullindexsortkey to "aaa @subentry ZZZ"
! %   * If @seealso occurs, set \pagenumbertext
  %
! \def\splitindexentry#1{%
!   \gdef\fullindexsortkey{}%
!   \xdef\bracedtext{}%
!   \def\sep{}%
!   \def\seealso##1{}%
!   \def\seeentry##1{}%
!   \expandafter\doindexsegment#1\subentry\finish\subentry
! }
!=20
! % append the results from the next segment
! \def\doindexsegment#1\subentry{%
!   \def\segment{#1}%
!   \ifx\segment\isfinish
!   \else
!     %
!     % Fully expand the segment, throwing away any @sortas directives, and
!     % trim spaces.
!     \edef\trimmed{\segment}%
!     \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
!     \ifincodeindex
!       \edef\trimmed{\noexpand\code{\trimmed}}%
!     \fi
!     %
!     \xdef\bracedtext{\bracedtext{\trimmed}}%
!     %
!     % Get the string to sort by.  Process the segment with all
!     % font commands turned off.
!     \bgroup
!       \let\sortas\indexwritesortas
!       \let\seealso\indexwriteseealso
!       \let\seeentry\indexwriteseeentry
!       \indexnofonts
!       % The braces around the commands are recognized by texindex.
!       \def\lbracechar{{\string\indexlbrace}}%
!       \def\rbracechar{{\string\indexrbrace}}%
!       \let\{=3D\lbracechar
!       \let\}=3D\rbracechar
!       \def\@{{\string\indexatchar}}%
!       \def\atchar##1{\@}%
!       \def\backslashchar{{\string\indexbackslash}}%
!       \uccode`\~=3D`\\ \uppercase{\let~\backslashchar}%
!       %
!       \let\indexsortkey\empty
!       \global\let\pagenumbertext\empty
!       % Execute the segment and throw away the typeset output.  This exec=
utes
!       % any @sortas or @seealso commands in this segment.
!       \setbox\dummybox =3D \hbox{\segment}%
!       \ifx\indexsortkey\empty{%
!         \indexnonalnumdisappear
!         \xdef\trimmed{\segment}%
!         \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
!         \xdef\indexsortkey{\trimmed}%
!         \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
!       }\fi
!       %
!       % Append to \fullindexsortkey.
!       \edef\tmp{\gdef\noexpand\fullindexsortkey{%
!                   \fullindexsortkey\sep\indexsortkey}}%
!       \tmp
!     \egroup
!     \def\sep{\subentry}%
!     %
!     \expandafter\doindexsegment
!   \fi
! }
! \def\isfinish{\finish}%
! \newbox\dummybox % used above
!=20
! \let\subentry\relax
!=20
! % Use \ instead of @ in index files.  To support old texi2dvi and texinde=
x.
! % This works without changing the escape character used in the toc or aux
! % files because the index entries are fully expanded here, and \string us=
es
! % the current value of \escapechar.
! \def\escapeisbackslash{\escapechar=3D`\\}
!=20
! % Use \ in index files by default.  texi2dvi didn't support @ as the esca=
pe
! % character (as it checked for "\entry" in the files, and not "@entry"). =
 When
! % the new version of texi2dvi has had a chance to become more prevalent, =
then
! % the escape character can change back to @ again.  This should be an eas=
y
! % change to make now because both @ and \ are only used as escape charact=
ers in
! % index files, never standing for themselves.
! %
! \set txiindexescapeisbackslash
!=20
! % Write the entry in \indextext to the index file.
! %
!=20
! \newif\ifincodeindex
! \def\doindwrite{\incodeindexfalse\doindwritex}
! \def\docindwrite{\incodeindextrue\doindwritex}
!=20
! \def\doindwritex{%
!   \maybemarginindex
!   %
!   \atdummies
!   %
!   \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\el=
se
!     \escapeisbackslash
    \fi
    %
!   % For texindex which always views { and } as separators.
!   \def\{{\lbracechar{}}%
!   \def\}{\rbracechar{}}%
!   \uccode`\~=3D`\\ \uppercase{\def~{\backslashchar{}}}%
!   %
!   % Split the entry into primary entry and any subentries, and get the in=
dex
!   % sort key.
!   \splitindexentry\indextext
    %
    % 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 (four in the
    % subentry case), texindex reduces to two when writing the .??s
    % sorted result.
+   %
    \edef\temp{%
      \write\writeto{%
!       \string\entry{\fullindexsortkey}%
!         {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}=
%
!         \bracedtext}%
    }%
    \temp
  }
 =20
+ % Put the index entry in the margin if desired (undocumented).
+ \def\maybemarginindex{%
+   \ifx\SETmarginindex\relax\else
+     \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indext=
ext}}%
+   \fi
+ }
+ \let\SETmarginindex=3D\relax
+=20
+=20
  % Take care of unwanted page breaks/skips around a whatsit:
  %
  % If a skip is the last thing on the list now, preserve it
***************
*** 4582,4591 ****
  %
  % ..., ready, GO:
  %
! \def\safewhatsit#1{%
! \ifhmode
    #1%
! \else
    % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
    \whatsitskip =3D \lastskip
    \edef\lastskipmacro{\the\lastskip}%
--- 5377,5385 ----
  %
  % ..., ready, GO:
  %
! \def\safewhatsit#1{\ifhmode
    #1%
!  \else
    % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
    \whatsitskip =3D \lastskip
    \edef\lastskipmacro{\the\lastskip}%
***************
*** 4609,4615 ****
      % to re-insert the same penalty (values >10000 are used for various
      % signals); since we just inserted a non-discardable item, any
      % following glue (such as a \parskip) would be a breakpoint.  For exa=
mple:
-     %
      %   @deffn deffn-whatever
      %   @vindex index-whatever
      %   Description.
--- 5403,5408 ----
***************
*** 4622,4629 ****
      % (the whatsit from the \write), so we must insert a \nobreak.
      \nobreak\vskip\whatsitskip
    \fi
! \fi
! }
 =20
  % The index entry written in the file actually looks like
  %  \entry {sortstring}{page}{topic}
--- 5415,5421 ----
      % (the whatsit from the \write), so we must insert a \nobreak.
      \nobreak\vskip\whatsitskip
    \fi
! \fi}
 =20
  % The index entry written in the file actually looks like
  %  \entry {sortstring}{page}{topic}
***************
*** 4636,4644 ****
--- 5428,5441 ----
  %  \entry {topic}{pagelist}
  %     for a topic that is used without subtopics
  %  \primary {topic}
+ %  \entry {topic}{}
  %     for the beginning of a topic that is used with subtopics
  %  \secondary {subtopic}{pagelist}
  %     for each subtopic.
+ %  \secondary {subtopic}{}
+ %     for a subtopic with sub-subtopics
+ %  \tertiary {subtopic}{subsubtopic}{pagelist}
+ %     for each sub-subtopic.
 =20
  % Define the user-accessible indexing commands
  % @findex, @vindex, @kindex, @cindex.
***************
*** 4650,4660 ****
  \def\tindex {\tpindex}
  \def\pindex {\pgindex}
 =20
- \def\cindexsub {\begingroup\obeylines\cindexsub}
- {\obeylines %
- \gdef\cindexsub "#1" #2^^M{\endgroup %
- \dosubind{cp}{#2}{#1}}}
-=20
  % Define the macros used in formatting output of the sorted index materia=
l.
 =20
  % @printindex causes a particular index (the ??s file) to get printed.
--- 5447,5452 ----
***************
*** 4668,4724 ****
    \plainfrenchspacing
    \everypar =3D {}% don't want the \kern\-parindent from indentation supp=
ression.
    %
    % 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`\@ =3D 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.
      \putwordIndexNonexistent
    \else
-     %
      % If the index file exists but is empty, then \openin leaves \ifeof
      % false.  We have to make TeX try to read something from the file, so
      % it can discover if there is anything in it.
!     \read 1 to \temp
      \ifeof 1
        \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 cha=
nge
!       % to make right now.
!       \def\indexbackslash{\backslashcurfont}%
!       \catcode`\\ =3D 0
!       \escapechar =3D `\\
        \begindoublecolumns
!       \input \jobname.#1s
        \enddoublecolumns
      \fi
    \fi
!   \closein 1
! \endgroup}
 =20
  % These macros are used by the sorted index file itself.
  % Change them to control the appearance of the index.
 =20
! \def\initial#1{{%
!   % Some minor font changes for the special characters.
!   \let\tentt=3D\sectt \let\tt=3D\sectt \let\sf=3D\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.
    \nobreak
!   \vskip 0pt plus 3\baselineskip
!   \penalty 0
!   \vskip 0pt plus -3\baselineskip
    %
    % Typeset the initial.  Making this add up to a whole number of
    % baselineskips increases the chance of the dots lining up from column
--- 5460,5586 ----
    \plainfrenchspacing
    \everypar =3D {}% don't want the \kern\-parindent from indentation supp=
ression.
    %
+   % See comment in \requireopenindexfile.
+   \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
+   %
    % See if the index file exists and is nonempty.
!   \openin 1 \jobname.\indexname s
    \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.
      \putwordIndexNonexistent
+     \typeout{No file \jobname.\indexname s.}%
    \else
      % If the index file exists but is empty, then \openin leaves \ifeof
      % false.  We have to make TeX try to read something from the file, so
      % it can discover if there is anything in it.
!     \read 1 to \thisline
      \ifeof 1
        \putwordIndexIsEmpty
      \else
!       \expandafter\printindexzz\thisline\relax\relax\finish%
!     \fi
!   \fi
!   \closein 1
! \endgroup}
!=20
! % If the index file starts with a backslash, forgo reading the index
! % file altogether.  If somebody upgrades texinfo.tex they may still have
! % old index files using \ as the escape character.  Reading this would
! % at best lead to typesetting garbage, at worst a TeX syntax error.
! \def\printindexzz#1#2\finish{%
!   \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax
!     \uccode`\~=3D`\\ \uppercase{\if\noexpand~}\noexpand#1
!       \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname=
\relax
! \errmessage{%
! ERROR: A sorted index file in an obsolete format was skipped.
! To fix this problem, please upgrade your version of 'texi2dvi'
! or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
! If you are using an old version of 'texindex' (part of the Texinfo
! distribution), you may also need to upgrade to a newer version (at least =
6.0).
! You may be able to typeset the index if you run
! 'texindex \jobname.\indexname' yourself.
! You could also try setting the 'txiindexescapeisbackslash' flag by
! running a command like
! 'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'.  If you do
! this, Texinfo will try to use index files in the old format.
! If you continue to have problems, deleting the index files and starting a=
gain
! might help (with 'rm \jobname.?? \jobname.??s')%
! }%
!       \else
!         (Skipped sorted index file in obsolete format)
!       \fi
!     \else
        \begindoublecolumns
!       \input \jobname.\indexname s
        \enddoublecolumns
      \fi
+   \else
+     \begindoublecolumns
+     \catcode`\\=3D0\relax
+     %
+     % Make @ an escape character to give macros a chance to work.  This
+     % should work because we (hopefully) don't otherwise use @ in index f=
iles.
+     %\catcode`\@=3D12\relax
+     \catcode`\@=3D0\relax
+     \input \jobname.\indexname s
+     \enddoublecolumns
    \fi
! }
 =20
  % These macros are used by the sorted index file itself.
  % Change them to control the appearance of the index.
 =20
! {\catcode`\/=3D13 \catcode`\-=3D13 \catcode`\^=3D13 \catcode`\~=3D13 \cat=
code`\_=3D13
! \catcode`\|=3D13 \catcode`\<=3D13 \catcode`\>=3D13 \catcode`\+=3D13 \catc=
ode`\"=3D13
! \catcode`\$=3D3
! \gdef\initialglyphs{%
!   % special control sequences used in the index sort key
!   \let\indexlbrace\{%
!   \let\indexrbrace\}%
!   \let\indexatchar\@%
!   \def\indexbackslash{\math{\backslash}}%
!   %
!   % Some changes for non-alphabetic characters.  Using the glyphs from th=
e
!   % math fonts looks more consistent than the typewriter font used elsewh=
ere
!   % for these characters.
!   \uccode`\~=3D`\\ \uppercase{\def~{\math{\backslash}}}
!   %
!   % In case @\ is used for backslash
!   \uppercase{\let\\=3D~}
!   % Can't get bold backslash so don't use bold forward slash
!   \catcode`\/=3D13
!   \def/{{\secrmnotbold \normalslash}}%
!   \def-{{\normaldash\normaldash}}% en dash `--'
!   \def^{{\chapbf \normalcaret}}%
!   \def~{{\chapbf \normaltilde}}%
!   \def\_{%
!      \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em=
 }%
!   \def|{$\vert$}%
!   \def<{$\less$}%
!   \def>{$\gtr$}%
!   \def+{$\normalplus$}%
! }}
!=20
! \def\initial{%
!   \bgroup
!   \initialglyphs
!   \initialx
! }
!=20
! \def\initialx#1{%
    % Remove any glue we may have, we'll be inserting our own.
    \removelastskip
    %
    % We like breaks before the index initials, so insert a bonus.
+   % The glue before the bonus allows a little bit of space at the
+   % bottom of a column to reduce an increase in inter-line spacing.
    \nobreak
!   \vskip 0pt plus 5\baselineskip
!   \penalty -300
!   \vskip 0pt plus -5\baselineskip
    %
    % Typeset the initial.  Making this add up to a whole number of
    % baselineskips increases the chance of the dots lining up from column
***************
*** 4726,4749 ****
    % 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}%
    % Do our best not to break after the initial.
    \nobreak
    \vskip .33\baselineskip plus .1\baselineskip
! }}
 =20
  % \entry typesets a paragraph consisting of the text (#1), dot leaders, a=
nd
  % then page number (#2) flushed to the right margin.  It is used for inde=
x
  % and table of contents entries.  The paragraph is indented by \leftskip.
  %
- % A straightforward implementation would start like this:
- %=09\def\entry#1#2{...
- % But this freezes the catcodes in the argument, and can cause problems t=
o
- % @code, which sets - active.  This problem was fixed by a kludge---
- % ``-'' was active throughout whole index, but this isn't really right.
- % The right solution is to prevent \entry from swallowing the whole text.
- %                                 --kasal, 21nov03
  \def\entry{%
    \begingroup
      %
--- 5588,5611 ----
    % we need before each entry, but it's better.
    %
    % No shrink because it confuses \balancecolumns.
!   \vskip 1.67\baselineskip plus 1\baselineskip
!   \leftline{\secfonts \kern-0.05em \secbf #1}%
!   % \secfonts is inside the argument of \leftline so that the change of
!   % \baselineskip will not affect any glue inserted before the vbox that
!   % \leftline creates.
    % Do our best not to break after the initial.
    \nobreak
    \vskip .33\baselineskip plus .1\baselineskip
!   \egroup % \initialglyphs
! }
!=20
! \newdimen\entryrightmargin
! \entryrightmargin=3D0pt
 =20
  % \entry typesets a paragraph consisting of the text (#1), dot leaders, a=
nd
  % then page number (#2) flushed to the right margin.  It is used for inde=
x
  % and table of contents entries.  The paragraph is indented by \leftskip.
  %
  \def\entry{%
    \begingroup
      %
***************
*** 4751,4788 ****
      % affect previous text.
      \par
      %
-     % Do not fill out the last line with white space.
-     \parfillskip =3D 0in
-     %
      % No extra space above this paragraph.
      \parskip =3D 0in
      %
-     % Do not prefer a separate line ending with a hyphen to fewer lines.
-     \finalhyphendemerits =3D 0
-     %
-     % \hangindent is only relevant when the entry text and page number
-     % don't both fit on one line.  In that case, bob suggests starting th=
e
-     % dots pretty far over on the line.  Unfortunately, a large
-     % indentation looks wrong when the entry text itself is broken across
-     % lines.  So we use a small indentation and put up with long leaders.
-     %
-     % \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 =3D 2em
-     %
-     % When the entry text needs to be broken, just fill out the first lin=
e
-     % with blank space.
-     \rightskip =3D 0pt plus1fil
-     %
-     % A bit of stretch before each entry for the benefit of balancing
-     % columns.
-     \vskip 0pt plus1pt
-     %
      % When reading the text of entry, convert explicit line breaks
      % from @* into spaces.  The user might give these in long section
      % titles, for instance.
      \def\*{\unskip\space\ignorespaces}%
!     \def\entrybreak{\hfil\break}%
      %
      % Swallow the left brace of the text (first parameter):
      \afterassignment\doentry
--- 5613,5626 ----
      % affect previous text.
      \par
      %
      % No extra space above this paragraph.
      \parskip =3D 0in
      %
      % When reading the text of entry, convert explicit line breaks
      % from @* into spaces.  The user might give these in long section
      % titles, for instance.
      \def\*{\unskip\space\ignorespaces}%
!     \def\entrybreak{\hfil\break}% An undocumented command
      %
      % Swallow the left brace of the text (first parameter):
      \afterassignment\doentry
***************
*** 4790,4874 ****
  }
  \def\entrybreak{\unskip\space\ignorespaces}%
  \def\doentry{%
      \bgroup % Instead of the swallowed brace.
        \noindent
        \aftergroup\finishentry
        % And now comes the text of the entry.
  }
! \def\finishentry#1{%
!     % #1 is the page number.
!     %
!     % The following is kludged to not output a line of dots in the index =
if
!     % there are no page numbers.  The next person who breaks this will be
!     % cursed by a Unix daemon.
!     \setbox\boxA =3D \hbox{#1}%
!     \ifdim\wd\boxA =3D 0pt
!       \ %
!     \else
        %
!       % If we must, put the page number on a line of its own, and fill ou=
t
!       % this line with blank space.  (The \hfil is overwhelmed with the
!       % fill leaders glue in \indexdotfill if the page number does fit.)
!       \hfil\penalty50
!       \null\nobreak\indexdotfill % Have leaders before the page number.
!       %
!       % The `\ ' here is removed by the implicit \unskip that TeX does as
!       % part of (the primitive) \par.  Without it, a spurious underfull
!       % \hbox ensues.
!       \ifpdf
! =09\pdfgettoks#1.%
! =09\ \the\toksA
        \else
! =09\ #1%
        \fi
      \fi
-     \par
    \endgroup
! }
 =20
  % Like plain.tex's \dotfill, except uses up at least 1 em.
  \def\indexdotfill{\cleaders
!   \hbox{$\mathsurround=3D0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fi=
ll}
 =20
  \def\primary #1{\line{#1\hfil}}
 =20
! \newskip\secondaryindent \secondaryindent=3D0.5cm
! \def\secondary#1#2{{%
!   \parfillskip=3D0in
!   \parskip=3D0in
!   \hangindent=3D1in
!   \hangafter=3D1
!   \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
!   \ifpdf
!     \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
!   \else
!     #2
!   \fi
!   \par
! }}
 =20
  % Define two-column mode, which we use to typeset indexes.
  % Adapted from the TeXbook, page 416, which is to say,
  % the manmac.tex format used to print the TeXbook itself.
! \catcode`\@=3D11
 =20
  \newbox\partialpage
  \newdimen\doublecolumnhsize
 =20
  \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
    % Grab any single-column material above us.
    \output =3D {%
!     %
!     % 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 =3D \vbox{%
        % Unvbox the main output page.
--- 5628,5775 ----
  }
  \def\entrybreak{\unskip\space\ignorespaces}%
  \def\doentry{%
+     % Save the text of the entry
+     \global\setbox\boxA=3D\hbox\bgroup
      \bgroup % Instead of the swallowed brace.
        \noindent
        \aftergroup\finishentry
        % And now comes the text of the entry.
+       % Not absorbing as a macro argument reduces the chance of problems
+       % with catcodes occurring.
  }
! {\catcode`\@=3D11
! \gdef\finishentry#1{%
!     \egroup % end box A
!     \dimen@ =3D \wd\boxA % Length of text of entry
!     \global\setbox\boxA=3D\hbox\bgroup
!       \unhbox\boxA
!       % #1 is the page number.
        %
!       % Get the width of the page numbers, and only use
!       % leaders if they are present.
!       \global\setbox\boxB =3D \hbox{#1}%
!       \ifdim\wd\boxB =3D 0pt
!         \null\nobreak\hfill\ %
!       \else
!         %
!         \null\nobreak\indexdotfill % Have leaders before the page number.
!         %
!         \ifpdforxetex
!           \pdfgettoks#1.%
!           \hskip\skip\thinshrinkable\the\toksA
!         \else
!           \hskip\skip\thinshrinkable #1%
!         \fi
!       \fi
!     \egroup % end \boxA
!     \ifdim\wd\boxB =3D 0pt
!       \noindent\unhbox\boxA\par
!       \nobreak
!     \else\bgroup
!       % We want the text of the entries to be aligned to the left, and th=
e
!       % page numbers to be aligned to the right.
!       %
!       \parindent =3D 0pt
!       \advance\leftskip by 0pt plus 1fil
!       \advance\leftskip by 0pt plus -1fill
!       \rightskip =3D 0pt plus -1fil
!       \advance\rightskip by 0pt plus 1fill
!       % Cause last line, which could consist of page numbers on their own
!       % if the list of page numbers is long, to be aligned to the right.
!       \parfillskip=3D0pt plus -1fill
!       %
!       \advance\rightskip by \entryrightmargin
!       % Determine how far we can stretch into the margin.
!       % This allows, e.g., "Appendix H  GNU Free Documentation License" t=
o
!       % fit on one line in @letterpaper format.
!       \ifdim\entryrightmargin>2.1em
!         \dimen@i=3D2.1em
        \else
!         \dimen@i=3D0em
        \fi
+       \advance \parfillskip by 0pt minus 1\dimen@i
+       %
+       \dimen@ii =3D \hsize
+       \advance\dimen@ii by -1\leftskip
+       \advance\dimen@ii by -1\entryrightmargin
+       \advance\dimen@ii by 1\dimen@i
+       \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
+       \ifdim\dimen@ > 0.8\dimen@ii   % due to long index text
+         % Try to split the text roughly evenly.  \dimen@ will be the leng=
th of
+         % the first line.
+         \dimen@ =3D 0.7\dimen@
+         \dimen@ii =3D \hsize
+         \ifnum\dimen@>\dimen@ii
+           % If the entry is too long (for example, if it needs more than
+           % two lines), use all the space in the first line.
+           \dimen@ =3D \dimen@ii
+         \fi
+         \advance\leftskip by 0pt plus 1fill % ragged right
+         \advance \dimen@ by 1\rightskip
+         \parshape =3D 2 0pt \dimen@ 0em \dimen@ii
+         % Ideally we'd add a finite glue at the end of the first line onl=
y,
+         % instead of using \parshape with explicit line lengths, but TeX
+         % doesn't seem to provide a way to do such a thing.
+         %
+         % Indent all lines but the first one.
+         \advance\leftskip by 1em
+         \advance\parindent by -1em
+       \fi\fi
+       \indent % start paragraph
+       \unhbox\boxA
+       %
+       % Do not prefer a separate line ending with a hyphen to fewer lines=
.
+       \finalhyphendemerits =3D 0
+       %
+       % Word spacing - no stretch
+       \spaceskip=3D\fontdimen2\font minus \fontdimen4\font
+       %
+       \linepenalty=3D1000  % Discourage line breaks.
+       \hyphenpenalty=3D5000  % Discourage hyphenation.
+       %
+       \par % format the paragraph
+     \egroup % The \vbox
      \fi
    \endgroup
! }}
!=20
! \newskip\thinshrinkable
! \skip\thinshrinkable=3D.15em minus .15em
 =20
  % Like plain.tex's \dotfill, except uses up at least 1 em.
+ % The filll stretch here overpowers both the fil and fill stretch to push
+ % the page number to the right.
  \def\indexdotfill{\cleaders
!   \hbox{$\mathsurround=3D0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fi=
lll}
!=20
 =20
  \def\primary #1{\line{#1\hfil}}
 =20
! \def\secondary{\indententry{0.5cm}}
! \def\tertiary{\indententry{1cm}}
!=20
! \def\indententry#1#2#3{%
!   \bgroup
!   \leftskip=3D#1
!   \entry{#2}{#3}%
!   \egroup
! }
 =20
  % Define two-column mode, which we use to typeset indexes.
  % Adapted from the TeXbook, page 416, which is to say,
  % the manmac.tex format used to print the TeXbook itself.
! \catcode`\@=3D11  % private names
 =20
  \newbox\partialpage
  \newdimen\doublecolumnhsize
 =20
  \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+   % If not much space left on page, start a new page.
+   \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
+   %
    % Grab any single-column material above us.
    \output =3D {%
!     \savetopmark
      %
      \global\setbox\partialpage =3D \vbox{%
        % Unvbox the main output page.
***************
*** 4902,4928 ****
      \divide\doublecolumnhsize by 2
    \hsize =3D \doublecolumnhsize
    %
!   % Double the \vsize as well.  (We don't need a separate register here,
!   % since nobody clobbers \vsize.)
    \vsize =3D 2\vsize
  }
 =20
  % The double-column output routine for all double-column pages except
! % the last.
  %
  \def\doublecolumnout{%
    \splittopskip=3D\topskip \splitmaxdepth=3D\maxdepth
-   % Get the available space for the double columns -- the normal
-   % (undoubled) page height minus any material left over from the
-   % previous page.
    \dimen@ =3D \vsize
    \divide\dimen@ by 2
-   \advance\dimen@ by -\ht\partialpage
    %
    % box0 will be the left-hand column, box2 the right.
!   \setbox0=3D\vsplit255 to\dimen@ \setbox2=3D\vsplit255 to\dimen@
!   \onepageout\pagesofar
!   \unvbox255
    \penalty\outputpenalty
  }
  %
--- 5803,5833 ----
      \divide\doublecolumnhsize by 2
    \hsize =3D \doublecolumnhsize
    %
!   % Get the available space for the double columns -- the normal
!   % (undoubled) page height minus any material left over from the
!   % previous page.
!   \advance\vsize by -\ht\partialpage
    \vsize =3D 2\vsize
+   %
+   % For the benefit of balancing columns
+   \advance\baselineskip by 0pt plus 0.5pt
  }
 =20
  % The double-column output routine for all double-column pages except
! % the last, which is done by \balancecolumns.
  %
  \def\doublecolumnout{%
+   %
+   \savetopmark
    \splittopskip=3D\topskip \splitmaxdepth=3D\maxdepth
    \dimen@ =3D \vsize
    \divide\dimen@ by 2
    %
    % box0 will be the left-hand column, box2 the right.
!   \setbox0=3D\vsplit\PAGE to\dimen@ \setbox2=3D\vsplit\PAGE to\dimen@
!   \global\advance\vsize by 2\ht\partialpage
!   \onepageout\pagesofar % empty except for the first time we are called
!   \unvbox\PAGE
    \penalty\outputpenalty
  }
  %
***************
*** 4933,4942 ****
    %
    \hsize =3D \doublecolumnhsize
    \wd0=3D\hsize \wd2=3D\hsize
!   \hbox to\pagewidth{\box0\hfil\box2}%
  }
! %
! % All done with double columns.
  \def\enddoublecolumns{%
    % The following penalty ensures that the page builder is exercised
    % _before_ we change the output routine.  This is necessary in the
--- 5838,5848 ----
    %
    \hsize =3D \doublecolumnhsize
    \wd0=3D\hsize \wd2=3D\hsize
!   \hbox to\txipagewidth{\box0\hfil\box2}%
  }
!=20
!=20
! % Finished with double columns.
  \def\enddoublecolumns{%
    % The following penalty ensures that the page builder is exercised
    % _before_ we change the output routine.  This is necessary in the
***************
*** 4959,4965 ****
    % goal.  When TeX sees \eject from below which follows the final
    % section, it invokes the new output routine that we've set after
    % \balancecolumns below; \onepageout will try to fit the two columns
!   % and the final section into the vbox of \pageheight (see
    % \pagebody), causing an overfull box.
    %
    % Note that glue won't work here, because glue does not exercise the
--- 5865,5871 ----
    % goal.  When TeX sees \eject from below which follows the final
    % section, it invokes the new output routine that we've set after
    % \balancecolumns below; \onepageout will try to fit the two columns
!   % and the final section into the vbox of \txipageheight (see
    % \pagebody), causing an overfull box.
    %
    % Note that glue won't work here, because glue does not exercise the
***************
*** 4967,5019 ****
    \penalty0
    %
    \output =3D {%
!     % 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 =3D {\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 =3D \vsize
  }
  %
! % Called at the end of the double column material.
  \def\balancecolumns{%
!   \setbox0 =3D \vbox{\unvbox255}% like \box255 but more efficient, see p.=
120.
    \dimen@ =3D \ht0
!   \advance\dimen@ by \topskip
!   \advance\dimen@ by-\baselineskip
!   \divide\dimen@ by 2 % target to split to
!   %debug\message{final 2-column material height=3D\the\ht0, target=3D\the=
\dimen@.}%
!   \splittopskip =3D \topskip
!   % Loop until we get a decent breakpoint.
!   {%
!     \vbadness =3D 10000
!     \loop
!       \global\setbox3 =3D \copy0
!       \global\setbox1 =3D \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=3D\vbox to\dimen@{\unvbox1}%
!   \setbox2=3D\vbox to\dimen@{\unvbox3}%
    %
-   \pagesofar
  }
  \catcode`\@ =3D \other
 =20
--- 5873,5960 ----
    \penalty0
    %
    \output =3D {%
!     % Split the last of the double-column material.
!     \savetopmark
      \balancecolumns
    }%
!   \eject % call the \output just set
!   \ifdim\pagetotal=3D0pt
!     % Having called \balancecolumns once, we do not
!     % want to call it again.  Therefore, reset \output to its normal
!     % definition right away.
!     \global\output=3D\expandafter{\the\defaultoutput}
!     %
!     \endgroup % started in \begindoublecolumns
!     % Leave the double-column material on the current page, no automatic
!     % page break.
!     \box\balancedcolumns
!     %
!     % \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.
!     \global\vsize =3D \txipageheight %
!     \pagegoal =3D \txipageheight %
!   \else
!     % We had some left-over material.  This might happen when \doublecolu=
mnout
!     % is called in \balancecolumns.  Try again.
!     \expandafter\enddoublecolumns
!   \fi
  }
+ \newbox\balancedcolumns
+ \setbox\balancedcolumns=3D\vbox{shouldnt see this}%
  %
! % Only called for the last of the double column material.  \doublecolumno=
ut
! % does the others.
  \def\balancecolumns{%
!   \setbox0 =3D \vbox{\unvbox\PAGE}% like \box255 but more efficient, see =
p.120.
    \dimen@ =3D \ht0
!   \ifdim\dimen@<7\baselineskip
!     % Don't split a short final column in two.
!     \setbox2=3D\vbox{}%
!     \global\setbox\balancedcolumns=3D\vbox{\pagesofar}%
!   \else
!     % double the leading vertical space
!     \advance\dimen@ by \topskip
!     \advance\dimen@ by-\baselineskip
!     \divide\dimen@ by 2 % target to split to
!     \dimen@ii =3D \dimen@
!     \splittopskip =3D \topskip
!     % Loop until left column is at least as high as the right column.
!     {%
!       \vbadness =3D 10000
!       \loop
!         \global\setbox3 =3D \copy0
!         \global\setbox1 =3D \vsplit3 to \dimen@
!       \ifdim\ht1<\ht3
!         \global\advance\dimen@ by 1pt
!       \repeat
!     }%
!     % Now the left column is in box 1, and the right column in box 3.
!     %
!     % Check whether the left column has come out higher than the page its=
elf.
!     % (Note that we have doubled \vsize for the double columns, so
!     % the actual height of the page is 0.5\vsize).
!     \ifdim2\ht1>\vsize
!       % It appears that we have been called upon to balance too much mate=
rial.
!       % Output some of it with \doublecolumnout, leaving the rest on the =
page.
!       \setbox\PAGE=3D\box0
!       \doublecolumnout
!     \else
!       % Compare the heights of the two columns.
!       \ifdim4\ht1>5\ht3
!         % Column heights are too different, so don't make their bottoms
!         % flush with each other.
!         \setbox2=3D\vbox to \ht1 {\unvbox3\vfill}%
!         \setbox0=3D\vbox to \ht1 {\unvbox1\vfill}%
!       \else
!         % Make column bottoms flush with each other.
!         \setbox2=3D\vbox to\ht1{\unvbox3\unskip}%
!         \setbox0=3D\vbox to\ht1{\unvbox1\unskip}%
!       \fi
!       \global\setbox\balancedcolumns=3D\vbox{\pagesofar}%
!     \fi
!   \fi
    %
  }
  \catcode`\@ =3D \other
 =20
***************
*** 5028,5037 ****
    \null
    \vskip.3\vsize  % move it down on the page a bit
    \begingroup
!     \noindent \titlefonts\rmisbold #1\par % the text
      \let\lastnode=3D\empty      % no node to associate with
      \writetocentry{part}{#1}{}% but put it in the toc
      \headingsoff              % no headline or footline on the part page
      \chapoddpage
    \endgroup
  }
--- 5969,5982 ----
    \null
    \vskip.3\vsize  % move it down on the page a bit
    \begingroup
!     \noindent \titlefonts\rm #1\par % the text
      \let\lastnode=3D\empty      % no node to associate with
      \writetocentry{part}{#1}{}% but put it in the toc
      \headingsoff              % no headline or footline on the part page
+     % This outputs a mark at the end of the page that clears \thischapter
+     % and \thissection, as is done in \startcontents.
+     \let\pchapsepmacro\relax
+     \chapmacro{}{Yomitfromtoc}{}%
      \chapoddpage
    \endgroup
  }
***************
*** 5105,5115 ****
 =20
  % @raisesections: treat @section as chapter, @subsection as section, etc.
  \def\raisesections{\global\advance\secbase by -1}
- \let\up=3D\raisesections % original BFox name
 =20
  % @lowersections: treat @chapter as section, @section as subsection, etc.
  \def\lowersections{\global\advance\secbase by 1}
- \let\down=3D\lowersections % original BFox name
 =20
  % we only have subsub.
  \chardef\maxseclevel =3D 3
--- 6050,6058 ----
***************
*** 5243,5249 ****
    \global\let\subsubsection =3D \appendixsubsubsec
  }
 =20
! \outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls =
unnumberedzzz
  \def\unnumberedzzz#1{%
    \global\secno=3D0 \global\subsecno=3D0 \global\subsubsecno=3D0
      \global\advance\unnumberedno by 1
--- 6186,6193 ----
    \global\let\subsubsection =3D \appendixsubsubsec
  }
 =20
! % normally unnmhead0 calls unnumberedzzz:
! \outer\parseargdef\unnumbered{\unnmhead0{#1}}
  \def\unnumberedzzz#1{%
    \global\secno=3D0 \global\subsecno=3D0 \global\subsubsecno=3D0
      \global\advance\unnumberedno by 1
***************
*** 5275,5283 ****
 =20
  % @centerchap is like @unnumbered, but the heading is centered.
  \outer\parseargdef\centerchap{%
-   % Well, we could do the following in a group, but that would break
-   % an assumption that \chapmacro is called at the outermost level.
-   % Thus we are safer this way:=09=09--kasal, 24feb04
    \let\centerparametersmaybe =3D \centerparameters
    \unnmhead0{#1}%
    \let\centerparametersmaybe =3D \relax
--- 6219,6224 ----
***************
*** 5287,5326 ****
  \let\top\unnumbered
 =20
  % Sections.
  \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  \def\seczzz#1{%
    \global\subsecno=3D0 \global\subsubsecno=3D0  \global\advance\secno by =
1
    \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  }
 =20
! \outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls append=
ixsectionzzz
  \def\appendixsectionzzz#1{%
    \global\subsecno=3D0 \global\subsubsecno=3D0  \global\advance\secno by =
1
    \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  }
  \let\appendixsec\appendixsection
 =20
! \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumbe=
redseczzz
  \def\unnumberedseczzz#1{%
    \global\subsecno=3D0 \global\subsubsecno=3D0  \global\advance\secno by =
1
    \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  }
 =20
  % Subsections.
! \outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numbere=
dsubseczzz
  \def\numberedsubseczzz#1{%
    \global\subsubsecno=3D0  \global\advance\subsecno by 1
    \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subs=
ecno}%
  }
 =20
! \outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendi=
xsubseczzz
  \def\appendixsubseczzz#1{%
    \global\subsubsecno=3D0  \global\advance\subsecno by 1
    \sectionheading{#1}{subsec}{Yappendix}%
                   {\appendixletter.\the\secno.\the\subsecno}%
  }
 =20
! \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnum=
beredsubseczzz
  \def\unnumberedsubseczzz#1{%
    \global\subsubsecno=3D0  \global\advance\subsecno by 1
    \sectionheading{#1}{subsec}{Ynothing}%
--- 6228,6274 ----
  \let\top\unnumbered
 =20
  % Sections.
+ %
  \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  \def\seczzz#1{%
    \global\subsecno=3D0 \global\subsubsecno=3D0  \global\advance\secno by =
1
    \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  }
 =20
! % normally calls appendixsectionzzz:
! \outer\parseargdef\appendixsection{\apphead1{#1}}
  \def\appendixsectionzzz#1{%
    \global\subsecno=3D0 \global\subsubsecno=3D0  \global\advance\secno by =
1
    \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  }
  \let\appendixsec\appendixsection
 =20
! % normally calls unnumberedseczzz:
! \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
  \def\unnumberedseczzz#1{%
    \global\subsecno=3D0 \global\subsubsecno=3D0  \global\advance\secno by =
1
    \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  }
 =20
  % Subsections.
! %
! % normally calls numberedsubseczzz:
! \outer\parseargdef\numberedsubsec{\numhead2{#1}}
  \def\numberedsubseczzz#1{%
    \global\subsubsecno=3D0  \global\advance\subsecno by 1
    \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subs=
ecno}%
  }
 =20
! % normally calls appendixsubseczzz:
! \outer\parseargdef\appendixsubsec{\apphead2{#1}}
  \def\appendixsubseczzz#1{%
    \global\subsubsecno=3D0  \global\advance\subsecno by 1
    \sectionheading{#1}{subsec}{Yappendix}%
                   {\appendixletter.\the\secno.\the\subsecno}%
  }
 =20
! % normally calls unnumberedsubseczzz:
! \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
  \def\unnumberedsubseczzz#1{%
    \global\subsubsecno=3D0  \global\advance\subsecno by 1
    \sectionheading{#1}{subsec}{Ynothing}%
***************
*** 5328,5348 ****
  }
 =20
  % Subsubsections.
! \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsu=
bsubseczzz
  \def\numberedsubsubseczzz#1{%
    \global\advance\subsubsecno by 1
    \sectionheading{#1}{subsubsec}{Ynumbered}%
                   {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  }
 =20
! \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsu=
bsubseczzz
  \def\appendixsubsubseczzz#1{%
    \global\advance\subsubsecno by 1
    \sectionheading{#1}{subsubsec}{Yappendix}%
                   {\appendixletter.\the\secno.\the\subsecno.\the\subsubsec=
no}%
  }
 =20
! \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumber=
edsubsubseczzz
  \def\unnumberedsubsubseczzz#1{%
    \global\advance\subsubsecno by 1
    \sectionheading{#1}{subsubsec}{Ynothing}%
--- 6276,6300 ----
  }
 =20
  % Subsubsections.
! %
! % normally numberedsubsubseczzz:
! \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
  \def\numberedsubsubseczzz#1{%
    \global\advance\subsubsecno by 1
    \sectionheading{#1}{subsubsec}{Ynumbered}%
                   {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  }
 =20
! % normally appendixsubsubseczzz:
! \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
  \def\appendixsubsubseczzz#1{%
    \global\advance\subsubsecno by 1
    \sectionheading{#1}{subsubsec}{Yappendix}%
                   {\appendixletter.\the\secno.\the\subsecno.\the\subsubsec=
no}%
  }
 =20
! % normally unnumberedsubsubseczzz:
! \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
  \def\unnumberedsubsubseczzz#1{%
    \global\advance\subsubsecno by 1
    \sectionheading{#1}{subsubsec}{Ynothing}%
***************
*** 5358,5371 ****
 =20
  % Define @majorheading, @heading and @subheading
 =20
- % 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
- %          heading is obnoxious; this forbids it.
- %       3) Likewise, headings look best if no \parindent is used, and
- %          if justification is not attempted.  Hence \raggedright.
-=20
  \def\majorheading{%
    {\advance\chapheadingskip by 10pt \chapbreak }%
    \parsearg\chapheadingzzz
--- 6310,6315 ----
***************
*** 5373,5382 ****
 =20
  \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  \def\chapheadingzzz#1{%
!   {\chapfonts \vbox{\hyphenpenalty=3D10000\tolerance=3D5000
!                     \parindent=3D0pt\ptexraggedright
!                     \rmisbold #1\hfill}}%
!   \bigskip \par\penalty 200\relax
    \suppressfirstparagraphindent
  }
 =20
--- 6317,6324 ----
 =20
  \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  \def\chapheadingzzz#1{%
!   \vbox{\chapfonts \raggedtitlesettings #1\par}%
!   \nobreak\bigskip \nobreak
    \suppressfirstparagraphindent
  }
 =20
***************
*** 5392,5407 ****
  % (including whitespace, linebreaking, etc. around it),
  % given all the information in convenient, parsed form.
 =20
! %%% Args are the skip and penalty (usually negative)
  \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\=
fi}
 =20
- %%% Define plain chapter starts, and page on/off switching for it
  % Parameter controlling skip before chapter headings (if needed)
-=20
  \newskip\chapheadingskip
 =20
  \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  \def\chappager{\par\vfill\supereject}
  % Because \domark is called before \chapoddpage, the filler page will
  % get the headings for the next chapter, which is wrong.  But we don't
  % care -- we just disable all headings on the filler page.
--- 6334,6352 ----
  % (including whitespace, linebreaking, etc. around it),
  % given all the information in convenient, parsed form.
 =20
! % Args are the skip and penalty (usually negative)
  \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\=
fi}
 =20
  % Parameter controlling skip before chapter headings (if needed)
  \newskip\chapheadingskip
 =20
+ % Define plain chapter starts, and page on/off switching for it.
  \def\chapbreak{\dobreak \chapheadingskip {-4000}}
+=20
+ % Start a new page
  \def\chappager{\par\vfill\supereject}
+=20
+ % \chapoddpage - start on an odd page for a new chapter
  % Because \domark is called before \chapoddpage, the filler page will
  % get the headings for the next chapter, which is wrong.  But we don't
  % care -- we just disable all headings on the filler page.
***************
*** 5416,5469 ****
    \fi
  }
 =20
! \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
 =20
  \def\CHAPPAGoff{%
  \global\let\contentsalignmacro =3D \chappager
  \global\let\pchapsepmacro=3D\chapbreak
! \global\let\pagealignmacro=3D\chappager}
 =20
  \def\CHAPPAGon{%
  \global\let\contentsalignmacro =3D \chappager
  \global\let\pchapsepmacro=3D\chappager
- \global\let\pagealignmacro=3D\chappager
  \global\def\HEADINGSon{\HEADINGSsingle}}
 =20
  \def\CHAPPAGodd{%
  \global\let\contentsalignmacro =3D \chapoddpage
  \global\let\pchapsepmacro=3D\chapoddpage
- \global\let\pagealignmacro=3D\chapoddpage
  \global\def\HEADINGSon{\HEADINGSdouble}}
 =20
  \CHAPPAGon
 =20
! % Chapter opening.
  %
  % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  % Yappendix, Yomitfromtoc), #3 the chapter number.
  %
  % To test against our argument.
  \def\Ynothingkeyword{Ynothing}
- \def\Yomitfromtockeyword{Yomitfromtoc}
  \def\Yappendixkeyword{Yappendix}
  %
  \def\chapmacro#1#2#3{%
    % Insert the first mark before the heading break (see notes for \domark=
).
!   \let\prevchapterdefs=3D\lastchapterdefs
!   \let\prevsectiondefs=3D\lastsectiondefs
!   \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
                          \gdef\thissection{}}%
    %
    \def\temptype{#2}%
    \ifx\temptype\Ynothingkeyword
!     \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}=
%
                            \gdef\thischapter{\thischaptername}}%
    \else\ifx\temptype\Yomitfromtockeyword
!     \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}=
%
                            \gdef\thischapter{}}%
    \else\ifx\temptype\Yappendixkeyword
      \toks0=3D{#1}%
!     \xdef\lastchapterdefs{%
        \gdef\noexpand\thischaptername{\the\toks0}%
        \gdef\noexpand\thischapternum{\appendixletter}%
        % \noexpand\putwordAppendix avoids expanding indigestible
--- 6361,6416 ----
    \fi
  }
 =20
! \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
 =20
  \def\CHAPPAGoff{%
  \global\let\contentsalignmacro =3D \chappager
  \global\let\pchapsepmacro=3D\chapbreak
! \global\def\HEADINGSon{\HEADINGSsinglechapoff}}
 =20
  \def\CHAPPAGon{%
  \global\let\contentsalignmacro =3D \chappager
  \global\let\pchapsepmacro=3D\chappager
  \global\def\HEADINGSon{\HEADINGSsingle}}
 =20
  \def\CHAPPAGodd{%
  \global\let\contentsalignmacro =3D \chapoddpage
  \global\let\pchapsepmacro=3D\chapoddpage
  \global\def\HEADINGSon{\HEADINGSdouble}}
 =20
  \CHAPPAGon
 =20
! % \chapmacro - Chapter opening.
  %
  % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  % Yappendix, Yomitfromtoc), #3 the chapter number.
+ % Not used for @heading series.
  %
  % To test against our argument.
  \def\Ynothingkeyword{Ynothing}
  \def\Yappendixkeyword{Yappendix}
+ \def\Yomitfromtockeyword{Yomitfromtoc}
  %
  \def\chapmacro#1#2#3{%
+   \expandafter\ifx\thisenv\titlepage\else
+     \checkenv{}% chapters, etc., should not start inside an environment.
+   \fi
    % Insert the first mark before the heading break (see notes for \domark=
).
!   \let\prevchapterdefs=3D\currentchapterdefs
!   \let\prevsectiondefs=3D\currentsectiondefs
!   \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
                          \gdef\thissection{}}%
    %
    \def\temptype{#2}%
    \ifx\temptype\Ynothingkeyword
!     \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternu=
m{}%
                            \gdef\thischapter{\thischaptername}}%
    \else\ifx\temptype\Yomitfromtockeyword
!     \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternu=
m{}%
                            \gdef\thischapter{}}%
    \else\ifx\temptype\Yappendixkeyword
      \toks0=3D{#1}%
!     \xdef\currentchapterdefs{%
        \gdef\noexpand\thischaptername{\the\toks0}%
        \gdef\noexpand\thischapternum{\appendixletter}%
        % \noexpand\putwordAppendix avoids expanding indigestible
***************
*** 5474,5480 ****
      }%
    \else
      \toks0=3D{#1}%
!     \xdef\lastchapterdefs{%
        \gdef\noexpand\thischaptername{\the\toks0}%
        \gdef\noexpand\thischapternum{\the\chapno}%
        % \noexpand\putwordChapter avoids expanding indigestible
--- 6421,6427 ----
      }%
    \else
      \toks0=3D{#1}%
!     \xdef\currentchapterdefs{%
        \gdef\noexpand\thischaptername{\the\toks0}%
        \gdef\noexpand\thischapternum{\the\chapno}%
        % \noexpand\putwordChapter avoids expanding indigestible
***************
*** 5494,5510 ****
    %
    % Now the second mark, after the heading break.  No break points
    % between here and the heading.
!   \let\prevchapterdefs=3D\lastchapterdefs
!   \let\prevsectiondefs=3D\lastsectiondefs
    \domark
    %
    {%
!     \chapfonts \rmisbold
      %
!     % Have to define \lastsection before calling \donoderef, because the
      % xref code eventually uses it.  On the other hand, it has to be call=
ed
      % after \pchapsepmacro, or the headline will change too soon.
!     \gdef\lastsection{#1}%
      %
      % Only insert the separating space if we have a chapter/appendix
      % number, and don't print the unnumbered ``number''.
--- 6441,6458 ----
    %
    % Now the second mark, after the heading break.  No break points
    % between here and the heading.
!   \let\prevchapterdefs=3D\currentchapterdefs
!   \let\prevsectiondefs=3D\currentsectiondefs
    \domark
    %
    {%
!     \chapfonts \rm
!     \let\footnote=3D\errfootnoteheading % give better error message
      %
!     % Have to define \currentsection before calling \donoderef, because t=
he
      % xref code eventually uses it.  On the other hand, it has to be call=
ed
      % after \pchapsepmacro, or the headline will change too soon.
!     \gdef\currentsection{#1}%
      %
      % Only insert the separating space if we have a chapter/appendix
      % number, and don't print the unnumbered ``number''.
***************
*** 5536,5543 ****
      %
      % Typeset the actual heading.
      \nobreak % Avoid page breaks at the interline glue.
!     \vbox{\hyphenpenalty=3D10000 \tolerance=3D5000 \parindent=3D0pt \ptex=
raggedright
!           \hangindent=3D\wd0 \centerparametersmaybe
            \unhbox0 #1\par}%
    }%
    \nobreak\bigskip % no page break after a chapter title
--- 6484,6490 ----
      %
      % Typeset the actual heading.
      \nobreak % Avoid page breaks at the interline glue.
!     \vbox{\raggedtitlesettings \hangindent=3D\wd0 \centerparametersmaybe
            \unhbox0 #1\par}%
    }%
    \nobreak\bigskip % no page break after a chapter title
***************
*** 5553,5582 ****
  }
 =20
 =20
- % I don't think this chapter style is supported any more, so I'm not
- % updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
- %
- \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
- %
- \def\unnchfopen #1{%
- \chapoddpage {\chapfonts \vbox{\hyphenpenalty=3D10000\tolerance=3D5000
-                        \parindent=3D0pt\ptexraggedright
-                        \rmisbold #1\hfill}}\bigskip \par\nobreak
- }
- \def\chfopen #1#2{\chapoddpage {\chapfonts
- \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfi=
l}}%
- \par\penalty 5000 %
- }
- \def\centerchfopen #1{%
- \chapoddpage {\chapfonts \vbox{\hyphenpenalty=3D10000\tolerance=3D5000
-                        \parindent=3D0pt
-                        \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
- }
- \def\CHAPFopen{%
-   \global\let\chapmacro=3D\chfopen
-   \global\let\centerchapmacro=3D\centerchfopen}
-=20
-=20
  % Section titles.  These macros combine the section number parts and
  % call the generic \sectionheading to do the printing.
  %
--- 6500,6505 ----
***************
*** 5594,5618 ****
 =20
  % Print any size, any type, section title.
  %
! % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
! % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
! % section number.
  %
  \def\seckeyword{sec}
  %
  \def\sectionheading#1#2#3#4{%
    {%
-     % Switch to the right set of fonts.
-     \csname #2fonts\endcsname \rmisbold
-     %
      \def\sectionlevel{#2}%
      \def\temptype{#3}%
      %
      % Insert first mark before the heading break (see notes for \domark).
!     \let\prevsectiondefs=3D\lastsectiondefs
      \ifx\temptype\Ynothingkeyword
        \ifx\sectionlevel\seckeyword
!         \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionn=
um{}%
                                \gdef\thissection{\thissectionname}}%
        \fi
      \else\ifx\temptype\Yomitfromtockeyword
--- 6517,6550 ----
 =20
  % Print any size, any type, section title.
  %
! % #1 is the text of the title,
! % #2 is the section level (sec/subsec/subsubsec),
! % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
! % #4 is the section number.
  %
  \def\seckeyword{sec}
  %
  \def\sectionheading#1#2#3#4{%
    {%
      \def\sectionlevel{#2}%
      \def\temptype{#3}%
      %
+     % It is ok for the @heading series commands to appear inside an
+     % environment (it's been historically allowed, though the logic is
+     % dubious), but not the others.
+     \ifx\temptype\Yomitfromtockeyword\else
+       \checkenv{}% non-@*heading should not be in an environment.
+     \fi
+     \let\footnote=3D\errfootnoteheading
+     %
+     % Switch to the right set of fonts.
+     \csname #2fonts\endcsname \rm
+     %
      % Insert first mark before the heading break (see notes for \domark).
!     \let\prevsectiondefs=3D\currentsectiondefs
      \ifx\temptype\Ynothingkeyword
        \ifx\sectionlevel\seckeyword
!         \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissecti=
onnum{}%
                                \gdef\thissection{\thissectionname}}%
        \fi
      \else\ifx\temptype\Yomitfromtockeyword
***************
*** 5620,5626 ****
      \else\ifx\temptype\Yappendixkeyword
        \ifx\sectionlevel\seckeyword
          \toks0=3D{#1}%
!         \xdef\lastsectiondefs{%
            \gdef\noexpand\thissectionname{\the\toks0}%
            \gdef\noexpand\thissectionnum{#4}%
            % \noexpand\putwordSection avoids expanding indigestible
--- 6552,6558 ----
      \else\ifx\temptype\Yappendixkeyword
        \ifx\sectionlevel\seckeyword
          \toks0=3D{#1}%
!         \xdef\currentsectiondefs{%
            \gdef\noexpand\thissectionname{\the\toks0}%
            \gdef\noexpand\thissectionnum{#4}%
            % \noexpand\putwordSection avoids expanding indigestible
***************
*** 5633,5639 ****
      \else
        \ifx\sectionlevel\seckeyword
          \toks0=3D{#1}%
!         \xdef\lastsectiondefs{%
            \gdef\noexpand\thissectionname{\the\toks0}%
            \gdef\noexpand\thissectionnum{#4}%
            % \noexpand\putwordSection avoids expanding indigestible
--- 6565,6571 ----
      \else
        \ifx\sectionlevel\seckeyword
          \toks0=3D{#1}%
!         \xdef\currentsectiondefs{%
            \gdef\noexpand\thissectionname{\the\toks0}%
            \gdef\noexpand\thissectionnum{#4}%
            % \noexpand\putwordSection avoids expanding indigestible
***************
*** 5659,5686 ****
      %
      % Now the second mark, after the heading break.  No break points
      % between here and the heading.
!     \let\prevsectiondefs=3D\lastsectiondefs
      \domark
      %
      % Only insert the space after the number if we have a section number.
      \ifx\temptype\Ynothingkeyword
        \setbox0 =3D \hbox{}%
        \def\toctype{unn}%
!       \gdef\lastsection{#1}%
      \else\ifx\temptype\Yomitfromtockeyword
        % for @headings -- no section number, don't include in toc,
!       % and don't redefine \lastsection.
        \setbox0 =3D \hbox{}%
        \def\toctype{omit}%
        \let\sectionlevel=3D\empty
      \else\ifx\temptype\Yappendixkeyword
        \setbox0 =3D \hbox{#4\enspace}%
        \def\toctype{app}%
!       \gdef\lastsection{#1}%
      \else
        \setbox0 =3D \hbox{#4\enspace}%
        \def\toctype{num}%
!       \gdef\lastsection{#1}%
      \fi\fi\fi
      %
      % Write the toc entry (before \donoderef).  See comments in \chapmacr=
o.
--- 6591,6618 ----
      %
      % Now the second mark, after the heading break.  No break points
      % between here and the heading.
!     \global\let\prevsectiondefs=3D\currentsectiondefs
      \domark
      %
      % Only insert the space after the number if we have a section number.
      \ifx\temptype\Ynothingkeyword
        \setbox0 =3D \hbox{}%
        \def\toctype{unn}%
!       \gdef\currentsection{#1}%
      \else\ifx\temptype\Yomitfromtockeyword
        % for @headings -- no section number, don't include in toc,
!       % and don't redefine \currentsection.
        \setbox0 =3D \hbox{}%
        \def\toctype{omit}%
        \let\sectionlevel=3D\empty
      \else\ifx\temptype\Yappendixkeyword
        \setbox0 =3D \hbox{#4\enspace}%
        \def\toctype{app}%
!       \gdef\currentsection{#1}%
      \else
        \setbox0 =3D \hbox{#4\enspace}%
        \def\toctype{num}%
!       \gdef\currentsection{#1}%
      \fi\fi\fi
      %
      % Write the toc entry (before \donoderef).  See comments in \chapmacr=
o.
***************
*** 5713,5727 ****
    %
    % We'll almost certainly start a paragraph next, so don't let that
    % glue accumulate.  (Not a breakpoint because it's preceded by a
!   % discardable item.)
    \vskip-\parskip
    %
!   % This is purely so the last item on the list is a known \penalty >
!   % 10000.  This is so \startdefun can avoid allowing breakpoints after
!   % section headings.  Otherwise, it would insert a valid breakpoint betw=
een:
!   %
!   %   @section sec-whatever
!   %   @deffn def-whatever
    \penalty 10001
  }
 =20
--- 6645,6659 ----
    %
    % We'll almost certainly start a paragraph next, so don't let that
    % glue accumulate.  (Not a breakpoint because it's preceded by a
!   % discardable item.)  However, when a paragraph is not started next
!   % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
!   % or the negative glue will cause weirdly wrong output, typically
!   % obscuring the section heading with something else.
    \vskip-\parskip
    %
!   % This is so the last item on the main vertical list is a known
!   % \penalty > 10000, so \startdefun, etc., can recognize the situation
!   % and do the needful.
    \penalty 10001
  }
 =20
***************
*** 5770,5776 ****
    % 1 and 2 (the page numbers aren't printed), and so are the first
    % two pages of the document.  Thus, we'd have two destinations named
    % `1', and two named `2'.
!   \ifpdf \global\pdfmakepagedesttrue \fi
  }
 =20
 =20
--- 6702,6710 ----
    % 1 and 2 (the page numbers aren't printed), and so are the first
    % two pages of the document.  Thus, we'd have two destinations named
    % `1', and two named `2'.
!   \ifpdforxetex
!     \global\pdfmakepagedesttrue
!   \fi
  }
 =20
 =20
***************
*** 5806,5814 ****
  %
  \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 <[email protected]>
    \contentsalignmacro
    \immediate\closeout\tocfile
    %
--- 6740,6746 ----
  %
  \def\startcontents#1{%
    % If @setchapternewpage on, and @headings double, the contents should
!   % start on an odd page, unlike chapters.
    \contentsalignmacro
    \immediate\closeout\tocfile
    %
***************
*** 5819,5828 ****
    \savepageno =3D \pageno
    \begingroup                  % Set up to handle contents files properly=
.
      \raggedbottom              % Worry more about breakpoints than the bo=
ttom.
!     \advance\hsize by -\contentsrightmargin % Don't use the full line len=
gth.
      %
      % Roman numerals for page numbers.
      \ifnum \pageno>0 \global\pageno =3D \lastnegativepageno \fi
  }
 =20
  % redefined for the two-volume lispref.  We always output on
--- 6751,6763 ----
    \savepageno =3D \pageno
    \begingroup                  % Set up to handle contents files properly=
.
      \raggedbottom              % Worry more about breakpoints than the bo=
ttom.
!     \entryrightmargin=3D\contentsrightmargin % Don't use the full line le=
ngth.
      %
      % Roman numerals for page numbers.
      \ifnum \pageno>0 \global\pageno =3D \lastnegativepageno \fi
+     \def\thistitle{}% no title in double-sided headings
+     % Record where the Roman numerals started.
+     \ifnum\romancount=3D0 \global\romancount=3D\pagecount \fi
  }
 =20
  % redefined for the two-volume lispref.  We always output on
***************
*** 5845,5852 ****
      \fi
      \closein 1
    \endgroup
!   \lastnegativepageno =3D \pageno
!   \global\pageno =3D \savepageno
  }
 =20
  % And just the chapters.
--- 6780,6786 ----
      \fi
      \closein 1
    \endgroup
!   \contentsendroman
  }
 =20
  % And just the chapters.
***************
*** 5881,5890 ****
      \vfill \eject
      \contentsalignmacro % in case @setchapternewpage odd is in effect
    \endgroup
    \lastnegativepageno =3D \pageno
    \global\pageno =3D \savepageno
  }
- \let\shortcontents =3D \summarycontents
 =20
  % Typeset the label for a chapter or appendix for the short contents.
  % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
--- 6815,6834 ----
      \vfill \eject
      \contentsalignmacro % in case @setchapternewpage odd is in effect
    \endgroup
+   \contentsendroman
+ }
+ \let\shortcontents =3D \summarycontents
+=20
+ % Get ready to use Arabic numerals again
+ \def\contentsendroman{%
    \lastnegativepageno =3D \pageno
    \global\pageno =3D \savepageno
+   %
+   % If \romancount > \arabiccount, the contents are at the end of the
+   % document.  Otherwise, advance where the Arabic numerals start for
+   % the page numbers.
+   \ifnum\romancount>\arabiccount\else\global\arabiccount=3D\pagecount\fi
  }
 =20
  % Typeset the label for a chapter or appendix for the short contents.
  % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
***************
*** 5913,5919 ****
  % exist, with an empty box.  Let's hope all the numbers have the same wid=
th.
  % Also ignore the page number, which is conventionally not printed.
  \def\numeralbox{\setbox0=3D\hbox{8}\hbox to \wd0{\hfil}}
! \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
  %
  % Parts, in the short toc.
  \def\shortpartentry#1#2#3#4{%
--- 6857,6871 ----
  % exist, with an empty box.  Let's hope all the numbers have the same wid=
th.
  % Also ignore the page number, which is conventionally not printed.
  \def\numeralbox{\setbox0=3D\hbox{8}\hbox to \wd0{\hfil}}
! \def\partentry#1#2#3#4{%
!   % Add stretch and a bonus for breaking the page before the part heading=
.
!   % This reduces the chance of the page being broken immediately after th=
e
!   % part heading, before a following chapter heading.
!   \vskip 0pt plus 5\baselineskip
!   \penalty-300
!   \vskip 0pt plus -5\baselineskip
!   \dochapentry{\numeralbox\labelspace#1}{}%
! }
  %
  % Parts, in the short toc.
  \def\shortpartentry#1#2#3#4{%
***************
*** 5924,5930 ****
 =20
  % Chapters, in the main contents.
  \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
! %
  % Chapters, in the short toc.
  % See comments in \dochapentry re vbox and related settings.
  \def\shortchapentry#1#2#3#4{%
--- 6876,6882 ----
 =20
  % Chapters, in the main contents.
  \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
!=20
  % Chapters, in the short toc.
  % See comments in \dochapentry re vbox and related settings.
  \def\shortchapentry#1#2#3#4{%
***************
*** 5939,5945 ****
    \setbox0 =3D \hbox{\putwordAppendix{} M}%
    \hbox to \wd0{\putwordAppendix{} #1\hss}}
  %
! \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
 =20
  % Unnumbered chapters.
  \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
--- 6891,6897 ----
    \setbox0 =3D \hbox{\putwordAppendix{} M}%
    \hbox to \wd0{\putwordAppendix{} #1\hss}}
  %
! \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}}
 =20
  % Unnumbered chapters.
  \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
***************
*** 5972,5977 ****
--- 6924,6931 ----
  \def\dochapentry#1#2{%
     \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baseli=
neskip
     \begingroup
+      % Move the page numbers slightly to the right
+      \advance\entryrightmargin by -0.05em
       \chapentryfonts
       \tocentry{#1}{\dopageno\bgroup#2\egroup}%
     \endgroup
***************
*** 6016,6022 ****
  % But \@ or @@ will get a plain @ character.
 =20
  \envdef\tex{%
!   \setupmarkupstyle{tex}%
    \catcode `\\=3D0 \catcode `\{=3D1 \catcode `\}=3D2
    \catcode `\$=3D3 \catcode `\&=3D4 \catcode `\#=3D6
    \catcode `\^=3D7 \catcode `\_=3D8 \catcode `\~=3D\active \let~=3D\tie
--- 6970,6976 ----
  % But \@ or @@ will get a plain @ character.
 =20
  \envdef\tex{%
!   \setregularquotes
    \catcode `\\=3D0 \catcode `\{=3D1 \catcode `\}=3D2
    \catcode `\$=3D3 \catcode `\&=3D4 \catcode `\#=3D6
    \catcode `\^=3D7 \catcode `\_=3D8 \catcode `\~=3D\active \let~=3D\tie
***************
*** 6026,6039 ****
    \catcode `\|=3D\other
    \catcode `\<=3D\other
    \catcode `\>=3D\other
!   \catcode`\`=3D\other
!   \catcode`\'=3D\other
!   \escapechar=3D`\\
    %
    % ' is active in math mode (mathcode"8000).  So reset it, and all our
    % other math active characters (just in case), to plain's definitions.
    \mathactive
    %
    \let\b=3D\ptexb
    \let\bullet=3D\ptexbullet
    \let\c=3D\ptexc
--- 6980,6993 ----
    \catcode `\|=3D\other
    \catcode `\<=3D\other
    \catcode `\>=3D\other
!   \catcode `\`=3D\other
!   \catcode `\'=3D\other
    %
    % ' is active in math mode (mathcode"8000).  So reset it, and all our
    % other math active characters (just in case), to plain's definitions.
    \mathactive
    %
+   % Inverse of the list at the beginning of the file.
    \let\b=3D\ptexb
    \let\bullet=3D\ptexbullet
    \let\c=3D\ptexc
***************
*** 6049,6057 ****
    \let\+=3D\tabalign
    \let\}=3D\ptexrbrace
    \let\/=3D\ptexslash
    \let\*=3D\ptexstar
    \let\t=3D\ptext
!   \expandafter \let\csname top\endcsname=3D\ptextop  % outer
    \let\frenchspacing=3D\plainfrenchspacing
    %
    \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
--- 7003,7013 ----
    \let\+=3D\tabalign
    \let\}=3D\ptexrbrace
    \let\/=3D\ptexslash
+   \let\sp=3D\ptexsp
    \let\*=3D\ptexstar
+   %\let\sup=3D\ptexsup % do not redefine, we want @sup to work in math mo=
de
    \let\t=3D\ptext
!   \expandafter \let\csname top\endcsname=3D\ptextop  % we've made it oute=
r
    \let\frenchspacing=3D\plainfrenchspacing
    %
    \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
***************
*** 6088,6093 ****
--- 7044,7067 ----
      \endgraf
      \ifdim\lastskip<\envskipamount
        \removelastskip
+       \ifnum\lastpenalty<10000
+         % Penalize breaking before the environment, because preceding tex=
t
+         % often leads into it.
+         \penalty100
+       \fi
+       \vskip\envskipamount
+     \fi
+   \fi
+ }}
+=20
+ \def\afterenvbreak{{%
+   % =3D10000 instead of <10000 because of a special case in \itemzzz and
+   % \sectionheading, q.v.
+   \ifnum \lastpenalty=3D10000 \else
+     \advance\envskipamount by \parskip
+     \endgraf
+     \ifdim\lastskip<\envskipamount
+       \removelastskip
        % it's not a good place to break if the last penalty was \nobreak
        % or better ...
        \ifnum\lastpenalty<10000 \penalty-50 \fi
***************
*** 6096,6114 ****
    \fi
  }}
 =20
- \let\afterenvbreak =3D \aboveenvbreak
-=20
  % \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins; it w=
ill
  % also clear it, so that its embedded environments do the narrowing again=
.
  \let\nonarrowing=3D\relax
 =20
  % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  % environment contents.
! \font\circle=3Dlcircle10
! \newdimen\circthick
! \newdimen\cartouter\newdimen\cartinner
! \newskip\normbskip\newskip\normpskip\newskip\normlskip
! \circthick=3D\fontdimen8\circle
  %
  \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  \def\ctr{{\hskip 6pt\circle\char'010}}
--- 7070,7082 ----
    \fi
  }}
 =20
  % \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins; it w=
ill
  % also clear it, so that its embedded environments do the narrowing again=
.
  \let\nonarrowing=3D\relax
 =20
  % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  % environment contents.
!=20
  %
  \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  \def\ctr{{\hskip 6pt\circle\char'010}}
***************
*** 6123,6129 ****
--- 7091,7108 ----
  %
  \newskip\lskip\newskip\rskip
 =20
+ % only require the font if @cartouche is actually used
+ \def\cartouchefontdefs{%
+   \font\circle=3Dlcircle10\relax
+   \circthick=3D\fontdimen8\circle
+ }
+ \newdimen\circthick
+ \newdimen\cartouter\newdimen\cartinner
+ \newskip\normbskip\newskip\normpskip\newskip\normlskip
+=20
+=20
  \envdef\cartouche{%
+   \cartouchefontdefs
    \ifhmode\par\fi  % can't be in the midst of a paragraph.
    \startsavinginserts
    \lskip=3D\leftskip \rskip=3D\rightskip
***************
*** 6135,6143 ****
  =09=09=09=09% side, and for 6pt waste from
  =09=09=09=09% each corner char, and rule thickness
    \normbskip=3D\baselineskip \normpskip=3D\parskip \normlskip=3D\lineskip
!   % Flag to tell @lisp, etc., not to narrow margin.
!   \let\nonarrowing =3D t%
!   \vbox\bgroup
        \baselineskip=3D0pt\parskip=3D0pt\lineskip=3D0pt
        \carttop
        \hbox\bgroup
--- 7114,7126 ----
  =09=09=09=09% side, and for 6pt waste from
  =09=09=09=09% each corner char, and rule thickness
    \normbskip=3D\baselineskip \normpskip=3D\parskip \normlskip=3D\lineskip
!   %
!   % If this cartouche directly follows a sectioning command, we need the
!   % \parskip glue (backspaced over by default) or the cartouche can
!   % collide with the section heading.
!   \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
!   %
!   \setbox\groupbox=3D\vbox\bgroup
        \baselineskip=3D0pt\parskip=3D0pt\lineskip=3D0pt
        \carttop
        \hbox\bgroup
***************
*** 6150,6156 ****
  =09      \lineskip=3D\normlskip
  =09      \parskip=3D\normpskip
  =09      \vskip -\parskip
! =09      \comment % For explanation, see the end of \def\group.
  }
  \def\Ecartouche{%
                \ifhmode\par\fi
--- 7133,7139 ----
  =09      \lineskip=3D\normlskip
  =09      \parskip=3D\normpskip
  =09      \vskip -\parskip
! =09      \comment % For explanation, see the end of def\group.
  }
  \def\Ecartouche{%
                \ifhmode\par\fi
***************
*** 6161,6166 ****
--- 7144,7150 ----
        \egroup
        \cartbot
    \egroup
+   \addgroupbox
    \checkinserts
  }
 =20
***************
*** 6170,6176 ****
  \newdimen\nonfillparindent
  \def\nonfillstart{%
    \aboveenvbreak
!   \hfuzz =3D 12pt % Don't be fussy
    \sepspaces % Make spaces be word-separators rather than space tokens.
    \let\par =3D \lisppar % don't ignore blank lines
    \obeylines % each line of input is a line of output
--- 7154,7160 ----
  \newdimen\nonfillparindent
  \def\nonfillstart{%
    \aboveenvbreak
!   \ifdim\hfuzz < 12pt \hfuzz =3D 12pt \fi % Don't be fussy
    \sepspaces % Make spaces be word-separators rather than space tokens.
    \let\par =3D \lisppar % don't ignore blank lines
    \obeylines % each line of input is a line of output
***************
*** 6212,6218 ****
  % If you want all examples etc. small: @set dispenvsize small.
  % If you want even small examples the full size: @set dispenvsize nosmall=
.
  % This affects the following displayed environments:
! %    @example, @display, @format, @lisp
  %
  \def\smallword{small}
  \def\nosmallword{nosmall}
--- 7196,7202 ----
  % If you want all examples etc. small: @set dispenvsize small.
  % If you want even small examples the full size: @set dispenvsize nosmall=
.
  % This affects the following displayed environments:
! %    @example, @display, @format, @lisp, @verbatim
  %
  \def\smallword{small}
  \def\nosmallword{nosmall}
***************
*** 6258,6266 ****
  %
  \maketwodispenvdef{lisp}{example}{%
    \nonfillstart
!   \tt\setupmarkupstyle{example}%
    \let\kbdfont =3D \kbdexamplefont % Allow @kbd to do something special.
!   \gobble % eat return
  }
  % @display/@smalldisplay: same as @lisp except keep current font.
  %
--- 7242,7250 ----
  %
  \maketwodispenvdef{lisp}{example}{%
    \nonfillstart
!   \tt\setcodequotes
    \let\kbdfont =3D \kbdexamplefont % Allow @kbd to do something special.
!   \parsearg\gobble
  }
  % @display/@smalldisplay: same as @lisp except keep current font.
  %
***************
*** 6299,6305 ****
  % @raggedright does more-or-less normal line breaking but no right
  % justification.  From plain.tex.
  \envdef\raggedright{%
!   \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
  }
  \let\Eraggedright\par
 =20
--- 7283,7289 ----
  % @raggedright does more-or-less normal line breaking but no right
  % justification.  From plain.tex.
  \envdef\raggedright{%
!   \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
  }
  \let\Eraggedright\par
 =20
***************
*** 6328,6343 ****
  \makedispenvdef{quotation}{\quotationstart}
  %
  \def\quotationstart{%
!   {\parskip=3D0pt \aboveenvbreak}% because \aboveenvbreak inserts \parski=
p
!   \parindent=3D0pt
!   %
!   % @cartouche defines \nonarrowing to inhibit narrowing at next level do=
wn.
    \ifx\nonarrowing\relax
-     \advance\leftskip by \lispnarrowing
      \advance\rightskip by \lispnarrowing
-     \exdentamount =3D \lispnarrowing
-   \else
-     \let\nonarrowing =3D \relax
    \fi
    \parsearg\quotationlabel
  }
--- 7312,7320 ----
  \makedispenvdef{quotation}{\quotationstart}
  %
  \def\quotationstart{%
!   \indentedblockstart % same as \indentedblock, but increase right margin=
 too.
    \ifx\nonarrowing\relax
      \advance\rightskip by \lispnarrowing
    \fi
    \parsearg\quotationlabel
  }
***************
*** 6347,6353 ****
  %
  \def\Equotation{%
    \par
!   \ifx\quotationauthor\undefined\else
      % indent a bit.
      \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
    \fi
--- 7324,7330 ----
  %
  \def\Equotation{%
    \par
!   \ifx\quotationauthor\thisisundefined\else
      % indent a bit.
      \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
    \fi
***************
*** 6363,6368 ****
--- 7340,7371 ----
    \fi
  }
 =20
+ % @indentedblock is like @quotation, but indents only on the left and
+ % has no optional argument.
+ %
+ \makedispenvdef{indentedblock}{\indentedblockstart}
+ %
+ \def\indentedblockstart{%
+   {\parskip=3D0pt \aboveenvbreak}% because \aboveenvbreak inserts \parski=
p
+   \parindent=3D0pt
+   %
+   % @cartouche defines \nonarrowing to inhibit narrowing at next level do=
wn.
+   \ifx\nonarrowing\relax
+     \advance\leftskip by \lispnarrowing
+     \exdentamount =3D \lispnarrowing
+   \else
+     \let\nonarrowing =3D \relax
+   \fi
+ }
+=20
+ % Keep a nonzero parskip for the environment, since we're doing normal fi=
lling.
+ %
+ \def\Eindentedblock{%
+   \par
+   {\parskip=3D0pt \afterenvbreak}%
+ }
+ \def\Esmallindentedblock{\Eindentedblock}
+=20
 =20
  % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
  % If we want to allow any <char> as delimiter,
***************
*** 6399,6405 ****
  \def\setupverb{%
    \tt  % easiest (and conventionally used) font for verbatim
    \def\par{\leavevmode\endgraf}%
!   \setupmarkupstyle{verb}%
    \tabeightspaces
    % Respect line breaks,
    % print special symbols as themselves, and
--- 7402,7408 ----
  \def\setupverb{%
    \tt  % easiest (and conventionally used) font for verbatim
    \def\par{\leavevmode\endgraf}%
!   \setcodequotes
    \tabeightspaces
    % Respect line breaks,
    % print special symbols as themselves, and
***************
*** 6414,6426 ****
  \newdimen\tabw \setbox0=3D\hbox{\tt\space} \tabw=3D8\wd0 % tab amount
  %
  % We typeset each line of the verbatim in an \hbox, so we can handle
! % tabs.  The \global is in case the verbatim line starts with an accent,
! % or some other command that starts with a begin-group.  Otherwise, the
! % entire \verbbox would disappear at the corresponding end-group, before
! % it is typeset.  Meanwhile, we can't have nested verbatim commands
! % (can we?), so the \global won't be overwriting itself.
  \newbox\verbbox
! \def\starttabbox{\global\setbox\verbbox=3D\hbox\bgroup}
  %
  \begingroup
    \catcode`\^^I=3D\active
--- 7417,7425 ----
  \newdimen\tabw \setbox0=3D\hbox{\tt\space} \tabw=3D8\wd0 % tab amount
  %
  % We typeset each line of the verbatim in an \hbox, so we can handle
! % tabs.
  \newbox\verbbox
! \def\starttabbox{\setbox\verbbox=3D\hbox\bgroup}
  %
  \begingroup
    \catcode`\^^I=3D\active
***************
*** 6431,6437 ****
        \divide\dimen\verbbox by\tabw
        \multiply\dimen\verbbox by\tabw % compute previous multiple of \tab=
w
        \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
!       \wd\verbbox=3D\dimen\verbbox \box\verbbox \starttabbox
      }%
    }
  \endgroup
--- 7430,7437 ----
        \divide\dimen\verbbox by\tabw
        \multiply\dimen\verbbox by\tabw % compute previous multiple of \tab=
w
        \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
!       \wd\verbbox=3D\dimen\verbbox
!       \leavevmode\box\verbbox \starttabbox
      }%
    }
  \endgroup
***************
*** 6441,6457 ****
    \let\nonarrowing =3D t%
    \nonfillstart
    \tt % easiest (and conventionally used) font for verbatim
!   % The \leavevmode here is for blank lines.  Otherwise, we would
!   % never \starttabox and the \egroup would end verbatim mode.
!   \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
    \tabexpand
!   \setupmarkupstyle{verbatim}%
    % Respect line breaks,
    % print special symbols as themselves, and
    % make each space count.
    % Must do in this order:
    \obeylines \uncatcodespecials \sepspaces
-   \everypar{\starttabbox}%
  }
 =20
  % Do the @verb magic: verbatim text is quoted by unique
--- 7441,7454 ----
    \let\nonarrowing =3D t%
    \nonfillstart
    \tt % easiest (and conventionally used) font for verbatim
!   \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}%
    \tabexpand
!   \setcodequotes
    % Respect line breaks,
    % print special symbols as themselves, and
    % make each space count.
    % Must do in this order:
    \obeylines \uncatcodespecials \sepspaces
  }
 =20
  % Do the @verb magic: verbatim text is quoted by unique
***************
*** 6486,6498 ****
    % ignore everything up to the first ^^M, that's the newline at the end
    % of the @verbatim input line itself.  Otherwise we get an extra blank
    % line in the output.
!   \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
    % We really want {...\end verbatim} in the body of the macro, but
    % without the active space; thus we have to use \xdef and \gobble.
  \endgroup
  %
  \envdef\verbatim{%
!     \setupverbatim\doverbatim
  }
  \let\Everbatim =3D \afterenvbreak
 =20
--- 7483,7498 ----
    % ignore everything up to the first ^^M, that's the newline at the end
    % of the @verbatim input line itself.  Otherwise we get an extra blank
    % line in the output.
!   \xdef\doverbatim#1^^M#2@end verbatim{%
!     \starttabbox#2\egroup\noexpand\end\gobble verbatim}%
    % We really want {...\end verbatim} in the body of the macro, but
    % without the active space; thus we have to use \xdef and \gobble.
+   % The \egroup ends the \verbbox started at the end of the last line in
+   % the block.
  \endgroup
  %
  \envdef\verbatim{%
!     \setnormaldispenv\setupverbatim\doverbatim
  }
  \let\Everbatim =3D \afterenvbreak
 =20
***************
*** 6505,6513 ****
    {%
      \makevalueexpandable
      \setupverbatim
!     \indexnofonts       % Allow `@@' and other weird things in file names=
.
!     \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
!     \input #1
      \afterenvbreak
    }%
  }
--- 7505,7516 ----
    {%
      \makevalueexpandable
      \setupverbatim
!     {%
!       \indexnofonts       % Allow `@@' and other weird things in file nam=
es.
!       \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
!       \edef\tmp{\noexpand\input #1 }
!       \expandafter
!     }\expandafter\starttabbox\tmp\egroup
      \afterenvbreak
    }%
  }
***************
*** 6520,6526 ****
  % typesetting commands (@smallbook, font changes, etc.) have to be done
  % beforehand -- and a) we want @copying to be done first in the source
  % file; b) letting users define the frontmatter in as flexible order as
! % possible is very desirable.
  %
  \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
--- 7523,7529 ----
  % typesetting commands (@smallbook, font changes, etc.) have to be done
  % beforehand -- and a) we want @copying to be done first in the source
  % file; b) letting users define the frontmatter in as flexible order as
! % possible is desirable.
  %
  \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
***************
*** 6556,6562 ****
      % commands also insert a nobreak penalty, and we don't want to allow
      % a break between a section heading and a defun.
      %
!     % As a minor refinement, we avoid "club" headers by signalling
      % with penalty of 10003 after the very first @deffn in the
      % sequence (see above), and penalty of 10002 after any following
      % @def command.
--- 7559,7565 ----
      % commands also insert a nobreak penalty, and we don't want to allow
      % a break between a section heading and a defun.
      %
!     % As a further refinement, we avoid "club" headers by signalling
      % with penalty of 10003 after the very first @deffn in the
      % sequence (see above), and penalty of 10002 after any following
      % @def command.
***************
*** 6615,6621 ****
    \temp
  }
 =20
! % \domakedefun \deffn \deffnx \deffnheader
  %
  % Define \deffn and \deffnx, without parameters.
  % \deffnheader has to be defined explicitly.
--- 7618,7624 ----
    \temp
  }
 =20
! % \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) }
  %
  % Define \deffn and \deffnx, without parameters.
  % \deffnheader has to be defined explicitly.
***************
*** 6623,6635 ****
  \def\domakedefun#1#2#3{%
    \envdef#1{%
      \startdefun
      \parseargusing\activeparens{\printdefunline#3}%
    }%
    \def#2{\dodefunx#1}%
    \def#3%
  }
 =20
! %%% Untyped functions:
 =20
  % @deffn category name args
  \makedefun{deffn}{\deffngeneral{}}
--- 7626,7676 ----
  \def\domakedefun#1#2#3{%
    \envdef#1{%
      \startdefun
+     \doingtypefnfalse    % distinguish typed functions from all else
      \parseargusing\activeparens{\printdefunline#3}%
    }%
    \def#2{\dodefunx#1}%
    \def#3%
  }
 =20
! \newif\ifdoingtypefn       % doing typed function?
! \newif\ifrettypeownline    % typeset return type on its own line?
!=20
! % @deftypefnnewline on|off says whether the return type of typed function=
s
! % are printed on their own line.  This affects @deftypefn, @deftypefun,
! % @deftypeop, and @deftypemethod.
! %
! \parseargdef\deftypefnnewline{%
!   \def\temp{#1}%
!   \ifx\temp\onword
!     \expandafter\let\csname SETtxideftypefnnl\endcsname
!       =3D \empty
!   \else\ifx\temp\offword
!     \expandafter\let\csname SETtxideftypefnnl\endcsname
!       =3D \relax
!   \else
!     \errhelp =3D \EMsimple
!     \errmessage{Unknown @txideftypefnnl value `\temp',
!                 must be on|off}%
!   \fi\fi
! }
!=20
! % \dosubind {index}{topic}{subtopic}
! %
! % If SUBTOPIC is present, precede it with a space, and call \doind.
! % (At some time during the 20th century, this made a two-level entry in a=
n
! % index such as the operation index.  Nobody seemed to notice the change =
in
! % behaviour though.)
! \def\dosubind#1#2#3{%
!   \def\thirdarg{#3}%
!   \ifx\thirdarg\empty
!     \doind{#1}{#2}%
!   \else
!     \doind{#1}{#2\space#3}%
!   \fi
! }
!=20
! % Untyped functions:
 =20
  % @deffn category name args
  \makedefun{deffn}{\deffngeneral{}}
***************
*** 6643,6654 ****
  % \deffngeneral {subind}category name args
  %
  \def\deffngeneral#1#2 #3 #4\endheader{%
-   % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
    \dosubind{fn}{\code{#3}}{#1}%
    \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  }
 =20
! %%% Typed functions:
 =20
  % @deftypefn category type name args
  \makedefun{deftypefn}{\deftypefngeneral{}}
--- 7684,7694 ----
  % \deffngeneral {subind}category name args
  %
  \def\deffngeneral#1#2 #3 #4\endheader{%
    \dosubind{fn}{\code{#3}}{#1}%
    \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  }
 =20
! % Typed functions:
 =20
  % @deftypefn category type name args
  \makedefun{deftypefn}{\deftypefngeneral{}}
***************
*** 6663,6672 ****
  %
  \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
    \dosubind{fn}{\code{#4}}{#1}%
    \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  }
 =20
! %%% Typed variables:
 =20
  % @deftypevr category type var args
  \makedefun{deftypevr}{\deftypecvgeneral{}}
--- 7703,7713 ----
  %
  \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
    \dosubind{fn}{\code{#4}}{#1}%
+   \doingtypefntrue
    \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  }
 =20
! % Typed variables:
 =20
  % @deftypevr category type var args
  \makedefun{deftypevr}{\deftypecvgeneral{}}
***************
*** 6684,6690 ****
    \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  }
 =20
! %%% Untyped variables:
 =20
  % @defvr category var args
  \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
--- 7725,7731 ----
    \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  }
 =20
! % Untyped variables:
 =20
  % @defvr category var args
  \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
***************
*** 6695,6701 ****
  % \defcvof {category of}class var args
  \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
 =20
! %%% Type:
  % @deftp category name args
  \makedefun{deftp}#1 #2 #3\endheader{%
    \doind{tp}{\code{#2}}%
--- 7736,7743 ----
  % \defcvof {category of}class var args
  \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
 =20
! % Types:
!=20
  % @deftp category name args
  \makedefun{deftp}#1 #2 #3\endheader{%
    \doind{tp}{\code{#2}}%
***************
*** 6723,6747 ****
  % We are followed by (but not passed) the arguments, if any.
  %
  \def\defname#1#2#3{%
    % Get the values of \leftskip and \rightskip as they were outside the @=
def...
    \advance\leftskip by -\defbodyindent
    %
!   % How we'll format the type name.  Putting it in brackets helps
    % distinguish it from the body text that may end up on the next line
    % just below it.
    \def\temp{#1}%
    \setbox0=3D\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]=
\fi}
    %
!   % Figure out line sizes for the paragraph shape.
    % The first line needs space for \box0; but if \rightskip is nonzero,
    % we need only space for the part of \box0 which exceeds it:
    \dimen0=3D\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightsk=
ip
    % The continuations:
    \dimen2=3D\hsize  \advance\dimen2 by -\defargsindent
-   % (plain.tex says that \dimen1 should be used only as global.)
-   \parshape 2 0in \dimen0 \defargsindent \dimen2
    %
!   % Put the type name to the right margin.
    \noindent
    \hbox to 0pt{%
      \hfil\box0 \kern-\hsize
--- 7765,7813 ----
  % We are followed by (but not passed) the arguments, if any.
  %
  \def\defname#1#2#3{%
+   \par
    % Get the values of \leftskip and \rightskip as they were outside the @=
def...
    \advance\leftskip by -\defbodyindent
    %
!   % Determine if we are typesetting the return type of a typed function
!   % on a line by itself.
!   \rettypeownlinefalse
!   \ifdoingtypefn  % doing a typed function specifically?
!     % then check user option for putting return type on its own line:
!     \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
!       \rettypeownlinetrue
!     \fi
!   \fi
!   %
!   % How we'll format the category name.  Putting it in brackets helps
    % distinguish it from the body text that may end up on the next line
    % just below it.
    \def\temp{#1}%
    \setbox0=3D\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]=
\fi}
    %
!   % Figure out line sizes for the paragraph shape.  We'll always have at
!   % least two.
!   \tempnum =3D 2
!   %
    % The first line needs space for \box0; but if \rightskip is nonzero,
    % we need only space for the part of \box0 which exceeds it:
    \dimen0=3D\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightsk=
ip
+   %
+   % If doing a return type on its own line, we'll have another line.
+   \ifrettypeownline
+     \advance\tempnum by 1
+     \def\maybeshapeline{0in \hsize}%
+   \else
+     \def\maybeshapeline{}%
+   \fi
+   %
    % The continuations:
    \dimen2=3D\hsize  \advance\dimen2 by -\defargsindent
    %
!   % The final paragraph shape:
!   \parshape \tempnum  0in \dimen0  \maybeshapeline  \defargsindent \dimen=
2
!   %
!   % Put the category name at the right margin.
    \noindent
    \hbox to 0pt{%
      \hfil\box0 \kern-\hsize
***************
*** 6763,6773 ****
      % . this still does not fix the ?` and !` ligatures, but so far no
      %   one has made identifiers using them :).
      \df \tt
!     \def\temp{#2}% return value type
!     \ifx\temp\empty\else \tclose{\temp} \fi
      #3% output function name
    }%
!   {\rm\enskip}% hskip 0.5 em of \tenrm
    %
    \boldbrax
    % arguments will be output next, if any.
--- 7829,7847 ----
      % . this still does not fix the ?` and !` ligatures, but so far no
      %   one has made identifiers using them :).
      \df \tt
!     \def\temp{#2}% text of the return type
!     \ifx\temp\empty\else
!       \tclose{\temp}% typeset the return type
!       \ifrettypeownline
!         % put return type on its own line; prohibit line break following:
!         \hfil\vadjust{\nobreak}\break
!       \else
!         \space  % type on same line, so just followed by a space
!       \fi
!     \fi           % no return type
      #3% output function name
    }%
!   {\rm\enskip}% hskip 0.5 em of \rmfont
    %
    \boldbrax
    % arguments will be output next, if any.
***************
*** 6784,6791 ****
    \df \sl \hyphenchar\font=3D0
    %
    % On the other hand, if an argument has two dashes (for instance), we
!   % want a way to get ttsl.  Let's try @var for that.
!   \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
    #1%
    \sl\hyphenchar\font=3D45
  }
--- 7858,7868 ----
    \df \sl \hyphenchar\font=3D0
    %
    % On the other hand, if an argument has two dashes (for instance), we
!   % want a way to get ttsl.  We used to recommend @var for that, so
!   % leave the code in, but it's strange for @var to lead to typewriter.
!   % Nowadays we recommend @code, since the difference between a ttsl hyph=
en
!   % and a tt hyphen is pretty tiny.  @code also disables ?` !`.
!   \def\var##1{{\setregularquotes\ttslanted{##1}}}%
    #1%
    \sl\hyphenchar\font=3D45
  }
***************
*** 6813,6818 ****
--- 7890,7896 ----
    \gdef\boldbrax{\let(=3D\opnr\let)=3D\clnr\let[=3D\lbrb\let]=3D\rbrb}
    \gdef\magicamp{\let&=3D\amprm}
  }
+ \let\ampchar\&
 =20
  \newcount\parencount
 =20
***************
*** 6882,6888 ****
 =20
  % 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\scantokens#1{%
      \toks0=3D{#1}%
--- 7960,7966 ----
 =20
  % 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\thisisundefined
    \newwrite\macscribble
    \def\scantokens#1{%
      \toks0=3D{#1}%
***************
*** 6893,6924 ****
    }
  \fi
 =20
! \def\scanmacro#1{\begingroup
    \newlinechar`\^^M
!   \let\xeatspaces\eatspaces
!   %
!   % Undo catcode changes of \startcontents and \doprintindex
!   % When called from @insertcopying or (short)caption, we need active
!   % backslash to get it printed correctly.  Previously, we had
!   % \catcode`\\=3D\other instead.  We'll see whether a problem appears
!   % with macro expansion.=09=09=09=09--kasal, 19aug04
!   \catcode`\@=3D0 \catcode`\\=3D\active \escapechar=3D`\@
    %
!   % ... and for \example:
!   \spaceisspace
    %
!   % The \empty here causes a following catcode 5 newline to be eaten
!   % as part of reading whitespace after a control sequence.  It does
!   % not eat a catcode 13 newline.  There's no good way to handle the
!   % two cases.  See the Macro Details node in the manual for the
!   % workaround we currently have to recommend for macros and
!   % line-oriented commands.
!   \scantokens{#1\empty}%
! \endgroup}
 =20
  \def\scanexp#1{%
!   \edef\temp{\noexpand\scanmacro{#1}}%
!   \temp
  }
 =20
  \newcount\paramno   % Count of parameters
--- 7971,8000 ----
    }
  \fi
 =20
! \let\E=3D\expandafter
!=20
! % Used at the time of macro expansion.
! % Argument is macro body with arguments substituted
! \def\scanmacro#1{%
    \newlinechar`\^^M
!   % expand the expansion of \eatleadingcr twice to maybe remove a leading
!   % newline (and \else and \fi tokens), then call \eatspaces on the resul=
t.
!   \def\xeatspaces##1{%
!     \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1%
!   }}%
!   \def\xempty##1{}%
    %
!   % Process the macro body under the current catcode regime.
!   \scantokens{#1@comment}%
    %
!   % The \comment is to remove the \newlinechar added by \scantokens, and
!   % can be noticed by \parsearg.  Note \c isn't used because this means c=
edilla
!   % in math mode.
! }
 =20
+ % Used for copying and captions
  \def\scanexp#1{%
!   \expandafter\scanmacro\expandafter{#1}%
  }
 =20
  \newcount\paramno   % Count of parameters
***************
*** 6926,6932 ****
  \newif\ifrecursive  % Is it recursive?
 =20
  % List of all defined macros in the form
! %    \definedummyword\macro1\definedummyword\macro2...
  % Currently is also contains all @aliases; the list can be split
  % if there is a need.
  \def\macrolist{}
--- 8002,8008 ----
  \newif\ifrecursive  % Is it recursive?
 =20
  % List of all defined macros in the form
! %    \commondummyword\macro1\commondummyword\macro2...
  % Currently is also contains all @aliases; the list can be split
  % if there is a need.
  \def\macrolist{}
***************
*** 6934,6940 ****
  % Add the macro to \macrolist
  \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname=
}
  \def\addtomacrolistxxx#1{%
!      \toks0 =3D \expandafter{\macrolist\definedummyword#1}%
       \xdef\macrolist{\the\toks0}%
  }
 =20
--- 8010,8016 ----
  % Add the macro to \macrolist
  \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname=
}
  \def\addtomacrolistxxx#1{%
!      \toks0 =3D \expandafter{\macrolist\commondummyword#1}%
       \xdef\macrolist{\the\toks0}%
  }
 =20
***************
*** 6959,6964 ****
--- 8035,8045 ----
  \unbrace{\gdef\trim@@@ #1 } #2@{#1}
  }
 =20
+ {\catcode`\^^M=3D\other%
+ \gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}%
+ % Warning: this won't work for a delimited argument
+ % or for an empty argument
+=20
  % Trim a single trailing ^^M off a string.
  {\catcode`\^^M=3D\other \catcode`\Q=3D3%
  \gdef\eatcr #1{\eatcra #1Q^^MQ}%
***************
*** 6984,7031 ****
    \catcode`\+=3D\other
    \catcode`\<=3D\other
    \catcode`\>=3D\other
-   \catcode`\@=3D\other
    \catcode`\^=3D\other
    \catcode`\_=3D\other
    \catcode`\|=3D\other
    \catcode`\~=3D\other
!   \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\oth=
er \fi
  }
 =20
  \def\scanargctxt{% used for copying and captions, not macros.
    \scanctxt
    \catcode`\\=3D\other
    \catcode`\^^M=3D\other
  }
 =20
  \def\macrobodyctxt{% used for @macro definitions
    \scanctxt
    \catcode`\{=3D\other
    \catcode`\}=3D\other
    \catcode`\^^M=3D\other
    \usembodybackslash
  }
 =20
! \def\macroargctxt{% used when scanning invocations
    \scanctxt
!   \catcode`\\=3D0
  }
- % why catcode 0 for \ in the above?  To recognize \\ \{ \} as "escapes"
- % for the single characters \ { }.  Thus, we end up with the "commands"
- % that would be written @\ @{ @} in a Texinfo document.
- %=20
- % We already have @{ and @}.  For @\, we define it here, and only for
- % this purpose, to produce a typewriter backslash (so, the @\ that we
- % define for @math can't be used with @macro calls):
- %
- \def\\{\normalbackslash}%
- %=20
- % We would like to do this for \, too, since that is what makeinfo does.
- % But it is not possible, because Texinfo already has a command @, for a
- % cedilla accent.  Documents must use @comma{} instead.
- %
- % \anythingelse will almost certainly be an error of some kind.
 =20
 =20
  % \mbodybackslash is the definition of \ in @macro bodies.
  % It maps \foo\ =3D> \csname macarg.foo\endcsname =3D> #N
--- 8065,8111 ----
    \catcode`\+=3D\other
    \catcode`\<=3D\other
    \catcode`\>=3D\other
    \catcode`\^=3D\other
    \catcode`\_=3D\other
    \catcode`\|=3D\other
    \catcode`\~=3D\other
!   \passthroughcharstrue
  }
 =20
  \def\scanargctxt{% used for copying and captions, not macros.
    \scanctxt
+   \catcode`\@=3D\other
    \catcode`\\=3D\other
    \catcode`\^^M=3D\other
  }
 =20
  \def\macrobodyctxt{% used for @macro definitions
    \scanctxt
+   \catcode`\ =3D\other
+   \catcode`\@=3D\other
    \catcode`\{=3D\other
    \catcode`\}=3D\other
    \catcode`\^^M=3D\other
    \usembodybackslash
  }
 =20
! % Used when scanning braced macro arguments.  Note, however, that catcode
! % changes here are ineffectual if the macro invocation was nested inside
! % an argument to another Texinfo command.
! \def\macroargctxt{%
    \scanctxt
!   \catcode`\ =3D\active
!   \catcode`\@=3D\other
!   \catcode`\^^M=3D\other
!   \catcode`\\=3D\active
  }
 =20
+ \def\macrolineargctxt{% used for whole-line arguments without braces
+   \scanctxt
+   \catcode`\@=3D\other
+   \catcode`\{=3D\other
+   \catcode`\}=3D\other
+ }
 =20
  % \mbodybackslash is the definition of \ in @macro bodies.
  % It maps \foo\ =3D> \csname macarg.foo\endcsname =3D> #N
***************
*** 7047,7055 ****
  \def\macroxxx#1{%
    \getargs{#1}% now \macname is the macname and \argl the arglist
    \ifx\argl\empty       % no arguments
!      \paramno=3D0
    \else
       \expandafter\parsemargdef \argl;%
    \fi
    \if1\csname ismacro.\the\macname\endcsname
       \message{Warning: redefining \the\macname}%
--- 8127,8141 ----
  \def\macroxxx#1{%
    \getargs{#1}% now \macname is the macname and \argl the arglist
    \ifx\argl\empty       % no arguments
!      \paramno=3D0\relax
    \else
       \expandafter\parsemargdef \argl;%
+      \if\paramno>256\relax
+        \ifx\eTeXversion\thisisundefined
+          \errhelp =3D \EMsimple
+          \errmessage{You need eTeX to compile a file with macros with mor=
e than 256 arguments}
+        \fi
+      \fi
    \fi
    \if1\csname ismacro.\the\macname\endcsname
       \message{Warning: redefining \the\macname}%
***************
*** 7072,7078 ****
      % Remove the macro name from \macrolist:
      \begingroup
        \expandafter\let\csname#1\endcsname \relax
!       \let\definedummyword\unmacrodo
        \xdef\macrolist{\macrolist}%
      \endgroup
    \else
--- 8158,8164 ----
      % Remove the macro name from \macrolist:
      \begingroup
        \expandafter\let\csname#1\endcsname \relax
!       \let\commondummyword\unmacrodo
        \xdef\macrolist{\macrolist}%
      \endgroup
    \else
***************
*** 7087,7215 ****
    \ifx #1\relax
      % remove this
    \else
!     \noexpand\definedummyword \noexpand#1%
    \fi
  }
 =20
! % 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=3D{#1}}
  \def\getmacargs#1{\def\argl{#1}}
 =20
! % 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.
-=20
  \def\parsemargdef#1;{%
    \paramno=3D0\def\paramlist{}%
    \let\hash\relax
    \let\xeatspaces\relax
    \parsemargdefxxx#1,;,%
  }
  \def\parsemargdefxxx#1,{%
    \if#1;\let\next=3D\relax
    \else \let\next=3D\parsemargdefxxx
      \advance\paramno by 1
      \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
!         {\xeatspaces{\hash\the\paramno}}%
      \edef\paramlist{\paramlist\hash\the\paramno,}%
    \fi\next}
 =20
! % 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}%
!=20
! % 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=3D##% 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}
 =20
  \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
 =20
! % \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).
! %=20
  \def\braceorline#1{\let\macnamexxx=3D#1\futurelet\nchar\braceorlinexxx}
  \def\braceorlinexxx{%
!   \ifx\nchar\bgroup\else
!     \expandafter\parsearg
    \fi \macnamexxx}
 =20
 =20
--- 8173,8632 ----
    \ifx #1\relax
      % remove this
    \else
!     \noexpand\commondummyword \noexpand#1%
    \fi
  }
 =20
! % \getargs -- Parse the arguments to a @macro line.  Set \macname to
! % the name of the macro, and \argl to the braced argument list.
  \def\getargs#1{\getargsxxx#1{}}
  \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
  \def\getmacname#1 #2\relax{\macname=3D{#1}}
  \def\getmacargs#1{\def\argl{#1}}
+ % This made use of the 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.
 =20
! % Parse the optional {params} list to @macro or @rmacro.
! % Set \paramno to the number of arguments,
! % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
! % three-param macro.)  Define \macarg.BLAH for each BLAH in the params
! % list to some hook where the argument is to be expanded.  If there are
! % less than 10 arguments that hook is to be replaced by ##N where N
! % is the position in that list, that is to say the macro arguments are to=
 be
! % defined `a la TeX in the macro body.
! %
  % That gets used by \mbodybackslash (above).
  %
! % If there are 10 or more arguments, a different technique is used: see
! % \parsemmanyargdef.
  %
  \def\parsemargdef#1;{%
    \paramno=3D0\def\paramlist{}%
    \let\hash\relax
+   % \hash is redefined to `#' later to get it into definitions
    \let\xeatspaces\relax
+   \let\xempty\relax
    \parsemargdefxxx#1,;,%
+   \ifnum\paramno<10\relax\else
+     \paramno0\relax
+     \parsemmanyargdef@@#1,;,% 10 or more arguments
+   \fi
  }
  \def\parsemargdefxxx#1,{%
    \if#1;\let\next=3D\relax
    \else \let\next=3D\parsemargdefxxx
      \advance\paramno by 1
      \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
!         {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}%
      \edef\paramlist{\paramlist\hash\the\paramno,}%
    \fi\next}
+ % the \xempty{} is to give \eatleadingcr an argument in the case of an
+ % empty macro argument.
+=20
+ % \parsemacbody, \parsermacbody
+ %
+ % Read recursive and nonrecursive macro bodies. (They're different since
+ % rec and nonrec macros end differently.)
+ %
+ % We are in \macrobodyctxt, and the \xdef causes backslashshes in the mac=
ro
+ % body to be transformed.
+ % Set \macrobody to the body of the macro, and call \defmacro.
+ %
+ {\catcode`\ =3D\other\long\gdef\parsemacbody#1@end macro{%
+ \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
+ {\catcode`\ =3D\other\long\gdef\parsermacbody#1@end rmacro{%
+ \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
+=20
+ % Make @ a letter, so that we can make private-to-Texinfo macro names.
+ \edef\texiatcatcode{\the\catcode`\@}
+ \catcode `@=3D11\relax
+=20
+ %%%%%%%%%%%%%% Code for > 10 arguments only   %%%%%%%%%%%%%%%%%%
+=20
+ % If there are 10 or more arguments, a different technique is used, where=
 the
+ % hook remains in the body, and when macro is to be expanded the body is
+ % processed again to replace the arguments.
+ %
+ % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to=
 the
+ % argument N value and then \edef the body (nothing else will expand beca=
use of
+ % the catcode regime under which the body was input).
+ %
+ % If you compile with TeX (not eTeX), and you have macros with 10 or more
+ % arguments, no macro can have more than 256 arguments (else error).
+ %
+ % In case that there are 10 or more arguments we parse again the argument=
s
+ % list to set new definitions for the \macarg.BLAH macros corresponding t=
o
+ % each BLAH argument. It was anyhow needed to parse already once this lis=
t
+ % in order to count the arguments, and as macros with at most 9 arguments
+ % are by far more frequent than macro with 10 or more arguments, defining
+ % twice the \macarg.BLAH macros does not cost too much processing power.
+ \def\parsemmanyargdef@@#1,{%
+   \if#1;\let\next=3D\relax
+   \else
+     \let\next=3D\parsemmanyargdef@@
+     \edef\tempb{\eatspaces{#1}}%
+     \expandafter\def\expandafter\tempa
+        \expandafter{\csname macarg.\tempb\endcsname}%
+     % Note that we need some extra \noexpand\noexpand, this is because we
+     % don't want \the  to be expanded in the \parsermacbody  as it uses a=
n
+     % \xdef .
+     \expandafter\edef\tempa
+       {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
+     \advance\paramno by 1\relax
+   \fi\next}
+=20
+=20
+ \let\endargs@\relax
+ \let\nil@\relax
+ \def\nilm@{\nil@}%
+ \long\def\nillm@{\nil@}%
+=20
+ % This macro is expanded during the Texinfo macro expansion, not during i=
ts
+ % definition.  It gets all the arguments' values and assigns them to macr=
os
+ % macarg.ARGNAME
+ %
+ % #1 is the macro name
+ % #2 is the list of argument names
+ % #3 is the list of argument values
+ \def\getargvals@#1#2#3{%
+   \def\macargdeflist@{}%
+   \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
+   \def\paramlist{#2,\nil@}%
+   \def\macroname{#1}%
+   \begingroup
+   \macroargctxt
+   \def\argvaluelist{#3,\nil@}%
+   \def\@tempa{#3}%
+   \ifx\@tempa\empty
+     \setemptyargvalues@
+   \else
+     \getargvals@@
+   \fi
+ }
+ \def\getargvals@@{%
+   \ifx\paramlist\nilm@
+       % Some sanity check needed here that \argvaluelist is also empty.
+       \ifx\argvaluelist\nillm@
+       \else
+         \errhelp =3D \EMsimple
+         \errmessage{Too many arguments in macro `\macroname'!}%
+       \fi
+       \let\next\macargexpandinbody@
+   \else
+     \ifx\argvaluelist\nillm@
+        % No more arguments values passed to macro.  Set remaining named-a=
rg
+        % macros to empty.
+        \let\next\setemptyargvalues@
+     \else
+       % pop current arg name into \@tempb
+       \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
+       \expandafter\@tempa\expandafter{\paramlist}%
+        % pop current argument value into \@tempc
+       \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
+       \expandafter\@tempa\expandafter{\argvaluelist}%
+        % Here \@tempb is the current arg name and \@tempc is the current =
arg value.
+        % First place the new argument macro definition into \@tempd
+        \expandafter\macname\expandafter{\@tempc}%
+        \expandafter\let\csname macarg.\@tempb\endcsname\relax
+        \expandafter\def\expandafter\@tempe\expandafter{%
+          \csname macarg.\@tempb\endcsname}%
+        \edef\@tempd{\long\def\@tempe{\the\macname}}%
+        \push@\@tempd\macargdeflist@
+        \let\next\getargvals@@
+     \fi
+   \fi
+   \next
+ }
+=20
+ \def\push@#1#2{%
+   \expandafter\expandafter\expandafter\def
+   \expandafter\expandafter\expandafter#2%
+   \expandafter\expandafter\expandafter{%
+   \expandafter#1#2}%
+ }
+=20
+ % Replace arguments by their values in the macro body, and place the resu=
lt
+ % in macro \@tempa.
+ %
+ \def\macvalstoargs@{%
+   %  To do this we use the property that token registers that are \the'ed
+   % within an \edef  expand only once. So we are going to place all argum=
ent
+   % values into respective token registers.
+   %
+   % First we save the token context, and initialize argument numbering.
+   \begingroup
+     \paramno0\relax
+     % Then, for each argument number #N, we place the corresponding argum=
ent
+     % value into a new token list register \toks#N
+     \expandafter\putargsintokens@\saveparamlist@,;,%
+     % Then, we expand the body so that argument are replaced by their
+     % values. The trick for values not to be expanded themselves is that =
they
+     % are within tokens and that tokens expand only once in an \edef .
+     \edef\@tempc{\csname mac.\macroname .body\endcsname}%
+     % Now we restore the token stack pointer to free the token list regis=
ters
+     % which we have used, but we make sure that expanded body is saved af=
ter
+     % group.
+     \expandafter
+   \endgroup
+   \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
+   }
+=20
+ % Define the named-macro outside of this group and then close this group.
+ %
+ \def\macargexpandinbody@{%
+   \expandafter
+   \endgroup
+   \macargdeflist@
+   % First the replace in body the macro arguments by their values, the re=
sult
+   % is in \@tempa .
+   \macvalstoargs@
+   % Then we point at the \norecurse or \gobble (for recursive) macro valu=
e
+   % with \@tempb .
+   \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endc=
sname
+   % Depending on whether it is recursive or not, we need some tailing
+   % \egroup .
+   \ifx\@tempb\gobble
+      \let\@tempc\relax
+   \else
+      \let\@tempc\egroup
+   \fi
+   % And now we do the real job:
+   \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@=
tempc}%
+   \@tempd
+ }
+=20
+ \def\putargsintokens@#1,{%
+   \if#1;\let\next\relax
+   \else
+     \let\next\putargsintokens@
+     % First we allocate the new token list register, and give it a tempor=
ary
+     % alias \@tempb .
+     \toksdef\@tempb\the\paramno
+     % Then we place the argument value into that token list register.
+     \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
+     \expandafter\@tempb\expandafter{\@tempa}%
+     \advance\paramno by 1\relax
+   \fi
+   \next
+ }
 =20
! % Trailing missing arguments are set to empty.
  %
! \def\setemptyargvalues@{%
!   \ifx\paramlist\nilm@
!     \let\next\macargexpandinbody@
!   \else
!     \expandafter\setemptyargvaluesparser@\paramlist\endargs@
!     \let\next\setemptyargvalues@
!   \fi
!   \next
! }
!=20
! \def\setemptyargvaluesparser@#1,#2\endargs@{%
!   \expandafter\def\expandafter\@tempa\expandafter{%
!     \expandafter\def\csname macarg.#1\endcsname{}}%
!   \push@\@tempa\macargdeflist@
!   \def\paramlist{#2}%
! }
!=20
! % #1 is the element target macro
! % #2 is the list macro
! % #3,#4\endargs@ is the list value
! \def\pop@#1#2#3,#4\endargs@{%
!    \def#1{#3}%
!    \def#2{#4}%
! }
! \long\def\longpop@#1#2#3,#4\endargs@{%
!    \long\def#1{#3}%
!    \long\def#2{#4}%
! }
!=20
!=20
! %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
!=20
!=20
! % This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
! %    \macrobody has the body of the macro in it, with placeholders for
! % its parameters, looking like "\xeatspaces{\hash 1}".
! %    \paramno is the number of parameters
! %    \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
! % There are four cases: macros of zero, one, up to nine, and many argumen=
ts.
  % \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=3D##% convert placeholders to macro parameter chars
!   \ifnum\paramno=3D1
!     \def\xeatspaces##1{##1}%
!     % This removes the pair of braces around the argument.  We don't
!     % use \eatspaces, because this can cause ends of lines to be lost
!     % when the argument to \eatspaces is read, leading to line-based
!     % commands like "@itemize" not being read correctly.
!   \else
!     \let\xeatspaces\relax % suppress expansion
!   \fi
!   \ifcase\paramno
!   % 0
!     \expandafter\xdef\csname\the\macname\endcsname{%
!       \bgroup
!         \noexpand\spaceisspace
!         \noexpand\endlineisspace
!         \noexpand\expandafter % skip any whitespace after the macro name.
!         \expandafter\noexpand\csname\the\macname @@@\endcsname}%
!     \expandafter\xdef\csname\the\macname @@@\endcsname{%
!       \egroup
!       \noexpand\scanmacro{\macrobody}}%
!   \or % 1
!     \expandafter\xdef\csname\the\macname\endcsname{%
!        \bgroup
!        \noexpand\braceorline
!        \expandafter\noexpand\csname\the\macname @@@\endcsname}%
!     \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
!       \egroup
!       \noexpand\scanmacro{\macrobody}%
!       }%
!   \else % at most 9
!     \ifnum\paramno<10\relax
!       % @MACNAME sets the context for reading the macro argument
!       % @MACNAME@@ gets the argument, processes backslashes and appends a
!       % comma.
!       % @MACNAME@@@ removes braces surrounding the argument list.
!       % @MACNAME@@@@ scans the macro body with arguments substituted.
        \expandafter\xdef\csname\the\macname\endcsname{%
!         \bgroup
!         \noexpand\expandafter  % This \expandafter skip any spaces after =
the
!         \noexpand\macroargctxt % macro before we change the catcode of sp=
ace.
!         \noexpand\expandafter
!         \expandafter\noexpand\csname\the\macname @@\endcsname}%
!       \expandafter\xdef\csname\the\macname @@\endcsname##1{%
!           \noexpand\passargtomacro
!           \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
!       \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
!           \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
        \expandafter\expandafter
        \expandafter\xdef
        \expandafter\expandafter
!         \csname\the\macname @@@@\endcsname\paramlist{%
!           \egroup\noexpand\scanmacro{\macrobody}}%
!     \else % 10 or more:
        \expandafter\xdef\csname\the\macname\endcsname{%
!         \noexpand\getargvals@{\the\macname}{\argl}%
!       }%
!       \global\expandafter\let\csname mac.\the\macname .body\endcsname\mac=
robody
!       \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\=
gobble
      \fi
    \fi}
 =20
+ \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
+=20
  \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
 =20
!=20
! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
! %
! {\catcode`\@=3D0 \catcode`\\=3D13  % We need to manipulate \ so use @ as =
escape
! @catcode`@_=3D11  % private names
! @catcode`@!=3D11  % used as argument separator
!=20
! % \passargtomacro#1#2 -
! % Call #1 with a list of tokens #2, with any doubled backslashes in #2
! % compressed to one.
! %
! % This implementation works by expansion, and not execution (so we cannot=
 use
! % \def or similar).  This reduces the risk of this failing in contexts wh=
ere
! % complete expansion is done with no execution (for example, in writing o=
ut to
! % an auxiliary file for an index entry).
! %
! % State is kept in the input stream: the argument passed to
! % @look_ahead, @gobble_and_check_finish and @add_segment is
! %
! % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN  (... rest of input)
! %
! % where:
! % THE_MACRO - name of the macro we want to call
! % ARG_RESULT - argument list we build to pass to that macro
! % PENDING_BS - either a backslash or nothing
! % NEXT_TOKEN - used to look ahead in the input stream to see what's comin=
g next
!=20
! @gdef@passargtomacro#1#2{%
!   @add_segment #1!{}@relax#2\@_finish\%
! }
! @gdef@_finish{@_finishx} @global@let@_finishx@relax
!=20
! % #1 - THE_MACRO ARG_RESULT
! % #2 - PENDING_BS
! % #3 - NEXT_TOKEN
! % #4 used to look ahead
! %
! % If the next token is not a backslash, process the rest of the argument;
! % otherwise, remove the next token.
! @gdef@look_ahead#1!#2#3#4{%
!   @ifx#4\%
!    @expandafter@gobble_and_check_finish
!   @else
!    @expandafter@add_segment
!   @fi#1!{#2}#4#4%
! }
!=20
! % #1 - THE_MACRO ARG_RESULT
! % #2 - PENDING_BS
! % #3 - NEXT_TOKEN
! % #4 should be a backslash, which is gobbled.
! % #5 looks ahead
! %
! % Double backslash found.  Add a single backslash, and look ahead.
! @gdef@gobble_and_check_finish#1!#2#3#4#5{%
!   @add_segment#1\!{}#5#5%
! }
!=20
! @gdef@is_fi{@fi}
!=20
! % #1 - THE_MACRO ARG_RESULT
! % #2 - PENDING_BS
! % #3 - NEXT_TOKEN
! % #4 is input stream until next backslash
! %
! % Input stream is either at the start of the argument, or just after a
! % backslash sequence, either a lone backslash, or a doubled backslash.
! % NEXT_TOKEN contains the first token in the input stream: if it is \fini=
sh,
! % finish; otherwise, append to ARG_RESULT the segment of the argument up =
until
! % the next backslash.  PENDING_BACKSLASH contains a backslash to represen=
t
! % a backslash just before the start of the input stream that has not been
! % added to ARG_RESULT.
! @gdef@add_segment#1!#2#3#4\{%
! @ifx#3@_finish
!   @call_the_macro#1!%
! @else
!   % append the pending backslash to the result, followed by the next segm=
ent
!   @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
!   % this @fi is discarded by @look_ahead.
!   % we can't get rid of it with \expandafter because we don't know how
!   % long #4 is.
! }
!=20
! % #1 - THE_MACRO
! % #2 - ARG_RESULT
! % #3 discards the res of the conditional in @add_segment, and @is_fi ends=
 the
! % conditional.
! @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
!=20
! }
! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!=20
! % \braceorline MAC is used for a one-argument macro MAC.  It checks
! % whether the next non-whitespace character is a {.  It sets the context
! % for reading the argument (slightly different in the two cases).  Then,
! % to read the argument, in the whole-line case, it then calls the regular
! % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
! %
  \def\braceorline#1{\let\macnamexxx=3D#1\futurelet\nchar\braceorlinexxx}
  \def\braceorlinexxx{%
!   \ifx\nchar\bgroup
!     \macroargctxt
!     \expandafter\passargtomacro
!   \else
!     \macrolineargctxt\expandafter\parsearg
    \fi \macnamexxx}
 =20
 =20
***************
*** 7237,7243 ****
 =20
  % @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{}}}
 =20
  % @node's only job in TeX is to define \lastnode, which is used in
--- 8654,8661 ----
 =20
  % @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{}}}
 =20
  % @node's only job in TeX is to define \lastnode, which is used in
***************
*** 7251,7259 ****
  % also remove a trailing comma, in case of something like this:
  % @node Help-Cross,  ,  , Cross-refs
  \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
! \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
 =20
- \let\nwnode=3D\node
  \let\lastnode=3D\empty
 =20
  % Write a cross-reference definition for the current node.  #1 is the
--- 8669,8697 ----
  % also remove a trailing comma, in case of something like this:
  % @node Help-Cross,  ,  , Cross-refs
  \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
! \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
!=20
! % Used so that the @top node doesn't have to be wrapped in an @ifnottex
! % conditional.
! % \doignore goes to more effort to skip nested conditionals but we don't =
need
! % that here.
! \def\omittopnode{%
!    \ifx\lastnode\wordTop
!    \expandafter\ignorenode\fi
! }
! \def\wordTop{Top}
!=20
! % Until the next @node or @bye command, divert output to a box that is no=
t
! % output.
! \def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}%
! \ignorenodebye
! }
!=20
! {\let\bye\relax
! \gdef\ignorenodebye{\let\bye\ignorenodebyedef}
! \gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
! % The redefinition of \bye here is because it is declared \outer
 =20
  \let\lastnode=3D\empty
 =20
  % Write a cross-reference definition for the current node.  #1 is the
***************
*** 7276,7282 ****
 =20
  % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  % anchor), which consists of three parts:
! % 1) NAME-title - the current sectioning name taken from \lastsection,
  %                 or the anchor name.
  % 2) NAME-snt   - section number and type, passed as the SNT arg, or
  %                 empty for anchors.
--- 8714,8720 ----
 =20
  % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  % anchor), which consists of three parts:
! % 1) NAME-title - the current sectioning name taken from \currentsection,
  %                 or the anchor name.
  % 2) NAME-snt   - section number and type, passed as the SNT arg, or
  %                 empty for anchors.
***************
*** 7290,7337 ****
    \pdfmkdest{#1}%
    \iflinks
      {%
        \atdummies  % preserve commands, but don't expand them
        \edef\writexrdef##1##2{%
  =09\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  =09  ##1}{##2}}% these are parameters of \writexrdef
        }%
!       \toks0 =3D \expandafter{\lastsection}%
        \immediate \writexrdef{title}{\the\toks0 }%
        \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
!       \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, durin=
g \shipout
      }%
    \fi
  }
 =20
  % @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\printedrefname{\ignorespaces #3}%
!   \setbox1=3D\hbox{\printedmanual\unskip}%
!   \setbox0=3D\hbox{\printedrefname\unskip}%
!   \ifdim \wd0 =3D 0pt
      % No printed node name was explicitly given.
!     \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\rel=
ax
!       % Use the node name inside the square brackets.
        \def\printedrefname{\ignorespaces #1}%
      \else
!       % Use the actual chapter/section title appear inside
!       % the square brackets.  Use the real section title if we have it.
!       \ifdim \wd1 > 0pt
!         % It is in another manual, so we don't have it.
          \def\printedrefname{\ignorespaces #1}%
        \else
          \ifhavexrefs
!           % We know the real title if we have the xref values.
!           \def\printedrefname{\refx{#1-title}{}}%
          \else
            % Otherwise just copy the Info node name.
            \def\printedrefname{\ignorespaces #1}%
--- 8728,8817 ----
    \pdfmkdest{#1}%
    \iflinks
      {%
+       \requireauxfile
        \atdummies  % preserve commands, but don't expand them
+       % match definition in \xrdef, \refx, \xrefX.
+       \def\value##1{##1}%
        \edef\writexrdef##1##2{%
  =09\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  =09  ##1}{##2}}% these are parameters of \writexrdef
        }%
!       \toks0 =3D \expandafter{\currentsection}%
        \immediate \writexrdef{title}{\the\toks0 }%
        \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
!       \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \s=
hipout
      }%
    \fi
  }
 =20
+ % @xrefautosectiontitle on|off says whether @section(ing) names are used
+ % automatically in xrefs, if the third arg is not explicitly specified.
+ % This was provided as a "secret" @set xref-automatic-section-title
+ % variable, now it's official.
+ %
+ \parseargdef\xrefautomaticsectiontitle{%
+   \def\temp{#1}%
+   \ifx\temp\onword
+     \expandafter\let\csname SETxref-automatic-section-title\endcsname
+       =3D \empty
+   \else\ifx\temp\offword
+     \expandafter\let\csname SETxref-automatic-section-title\endcsname
+       =3D \relax
+   \else
+     \errhelp =3D \EMsimple
+     \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
+                 must be on|off}%
+   \fi\fi
+ }
+=20
+ %
  % @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{\putwordsee{} \xrefXX}
! \def\xref{\putwordSee{} \xrefXX}
! \def\ref{\xrefXX}
!=20
! \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
! \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
! %
! \newbox\toprefbox
! \newbox\printedrefnamebox
! \newbox\infofilenamebox
! \newbox\printedmanualbox
! %
  \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
    \unsepspaces
!   %
!   % Get args without leading/trailing spaces.
    \def\printedrefname{\ignorespaces #3}%
!   \setbox\printedrefnamebox =3D \hbox{\printedrefname\unskip}%
!   %
!   \def\infofilename{\ignorespaces #4}%
!   \setbox\infofilenamebox =3D \hbox{\infofilename\unskip}%
!   %
!   \def\printedmanual{\ignorespaces #5}%
!   \setbox\printedmanualbox  =3D \hbox{\printedmanual\unskip}%
!   %
!   % If the printed reference name (arg #3) was not explicitly given in
!   % the @xref, figure out what we want to use.
!   \ifdim \wd\printedrefnamebox =3D 0pt
      % No printed node name was explicitly given.
!     \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \re=
lax
!       % Not auto section-title: use node name inside the square brackets.
        \def\printedrefname{\ignorespaces #1}%
      \else
!       % Auto section-title: use chapter/section title inside
!       % the square brackets if we have it.
!       \ifdim \wd\printedmanualbox > 0pt
!         % It is in another manual, so we don't have it; use node name.
          \def\printedrefname{\ignorespaces #1}%
        \else
          \ifhavexrefs
!           % We (should) know the real title if we have the xref values.
!           \def\printedrefname{\refx{#1-title}}%
          \else
            % Otherwise just copy the Info node name.
            \def\printedrefname{\ignorespaces #1}%
***************
*** 7342,7429 ****
    %
    % Make link in pdf output.
    \ifpdf
      {\indexnofonts
       \turnoffactive
       % This expands tokens, so do it after making catcode changes, so _
!      % etc. don't get their TeX definitions.
       \getfilename{#4}%
       %
!      % See comments at \activebackslashdouble.
!      {\activebackslashdouble \xdef\pdfxrefdest{#1}%
!       \backslashparens\pdfxrefdest}%
       %
       \leavevmode
       \startlink attr{/Border [0 0 0]}%
       \ifnum\filenamelength>0
!        goto file{\the\filename.pdf} name{\pdfxrefdest}%
       \else
!        goto name{\pdfmkpgn{\pdfxrefdest}}%
       \fi
      }%
      \setcolor{\linkcolor}%
    \fi
-   %
-   % Float references are printed completely differently: "Figure 1.2"
-   % instead of "[somenode], p.3".  We distinguish them by the
-   % LABEL-title being set to a magic string.
    {%
      % Have to otherify everything special to allow the \csname to
      % include an _ in the xref name, etc.
      \indexnofonts
      \turnoffactive
      \expandafter\global\expandafter\let\expandafter\Xthisreftitle
        \csname XR#1-title\endcsname
    }%
    \iffloat\Xthisreftitle
      % If the user specified the print name (third arg) to the ref,
      % print it instead of our usual "Figure 1.2".
!     \ifdim\wd0 =3D 0pt
!       \refx{#1-snt}{}%
      \else
        \printedrefname
      \fi
      %
!     % if the user also gave the printed manual name (fifth arg), append
      % "in MANUALNAME".
!     \ifdim \wd1 > 0pt
        \space \putwordin{} \cite{\printedmanual}%
      \fi
    \else
      % node/anchor (non-float) references.
      %
!     % If we use \unhbox0 and \unhbox1 to print the node names, TeX does n=
ot
!     % insert empty discretionaries after hyphens, which means that it wil=
l
!     % not find a line break at a hyphen in a node names.  Since some manu=
als
!     % are best written with fairly long node names, containing hyphens, t=
his
!     % 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.
!     \ifdim \wd1 > 0pt
!       \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedma=
nual}%
      \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
!        % Only output a following space if the -snt ref is nonempty; for
!        % @unnumbered and @anchor, it won't be.
!        \setbox2 =3D \hbox{\ignorespaces \refx{#1-snt}{}}%
!        \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
!       }%
!       % output the `[mynode]' via a macro so it can be overridden.
!       \xrefprintnodename\printedrefname
        %
!       % But we always want a comma and a space:
!       ,\space
        %
!       % output the `page 3'.
!       \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
!     \fi
    \fi
    \endlink
  \endgroup}
 =20
  % This macro is called from \xrefX for the `[nodename]' part of xref
  % output.  It's a separate macro only so it can be changed more easily,
  % since square brackets don't work well in some documents.  Particularly
--- 8822,9000 ----
    %
    % Make link in pdf output.
    \ifpdf
+     % For pdfTeX and LuaTeX
      {\indexnofonts
+      \makevalueexpandable
       \turnoffactive
       % This expands tokens, so do it after making catcode changes, so _
!      % etc. don't get their TeX definitions.  This ignores all spaces in
!      % #4, including (wrongly) those in the middle of the filename.
       \getfilename{#4}%
       %
!      % This (wrongly) does not take account of leading or trailing
!      % spaces in #1, which should be ignored.
!      \setpdfdestname{#1}%
!      %
!      \ifx\pdfdestname\empty
!        \def\pdfdestname{Top}% no empty targets
!      \fi
       %
       \leavevmode
       \startlink attr{/Border [0 0 0]}%
       \ifnum\filenamelength>0
!        goto file{\the\filename.pdf} name{\pdfdestname}%
       \else
!        goto name{\pdfmkpgn{\pdfdestname}}%
       \fi
      }%
      \setcolor{\linkcolor}%
+   \else
+     \ifx\XeTeXrevision\thisisundefined
+     \else
+       % For XeTeX
+       {\indexnofonts
+        \makevalueexpandable
+        \turnoffactive
+        % This expands tokens, so do it after making catcode changes, so _
+        % etc. don't get their TeX definitions.  This ignores all spaces i=
n
+        % #4, including (wrongly) those in the middle of the filename.
+        \getfilename{#4}%
+        %
+        % This (wrongly) does not take account of leading or trailing
+        % spaces in #1, which should be ignored.
+        \setpdfdestname{#1}%
+        %
+        \ifx\pdfdestname\empty
+          \def\pdfdestname{Top}% no empty targets
+        \fi
+        %
+        \leavevmode
+        \ifnum\filenamelength>0
+          % With default settings,
+          % XeTeX (xdvipdfmx) replaces link destination names with integer=
s.
+          % In this case, the replaced destination names of
+          % remote PDFs are no longer known.  In order to avoid a replacem=
ent,
+          % you can use xdvipdfmx's command line option `-C 0x0010'.
+          % If you use XeTeX 0.99996+ (TeX Live 2016+),
+          % this command line option is no longer necessary
+          % because we can use the `dvipdfmx:config' special.
+          \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link=
 /A
+            << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}%
+        \else
+          \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link=
 /A
+            << /S /GoTo /D (\pdfdestname) >> >>}%
+        \fi
+       }%
+       \setcolor{\linkcolor}%
+     \fi
    \fi
    {%
      % Have to otherify everything special to allow the \csname to
      % include an _ in the xref name, etc.
      \indexnofonts
      \turnoffactive
+     \def\value##1{##1}%
      \expandafter\global\expandafter\let\expandafter\Xthisreftitle
        \csname XR#1-title\endcsname
    }%
+   %
+   % Float references are printed completely differently: "Figure 1.2"
+   % instead of "[somenode], p.3".  \iffloat distinguishes them by
+   % \Xthisreftitle being set to a magic string.
    \iffloat\Xthisreftitle
      % If the user specified the print name (third arg) to the ref,
      % print it instead of our usual "Figure 1.2".
!     \ifdim\wd\printedrefnamebox =3D 0pt
!       \refx{#1-snt}%
      \else
        \printedrefname
      \fi
      %
!     % If the user also gave the printed manual name (fifth arg), append
      % "in MANUALNAME".
!     \ifdim \wd\printedmanualbox > 0pt
        \space \putwordin{} \cite{\printedmanual}%
      \fi
    \else
      % node/anchor (non-float) references.
      %
!     % If we use \unhbox to print the node names, TeX does not insert
!     % empty discretionaries after hyphens, which means that it will not
!     % find a line break at a hyphen in a node names.  Since some manuals
!     % 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.
!     %
!     \ifdim \wd\printedmanualbox > 0pt
!       % Cross-manual reference with a printed manual name.
!       %
!       \crossmanualxref{\cite{\printedmanual\unskip}}%
!     %
!     \else\ifdim \wd\infofilenamebox > 0pt
!       % Cross-manual reference with only an info filename (arg 4), no
!       % printed manual name (arg 5).  This is essentially the same as
!       % the case above; we output the filename, since we have nothing els=
e.
!       %
!       \crossmanualxref{\code{\infofilename\unskip}}%
!     %
      \else
!       % Reference within this manual.
        %
!       % Only output a following space if the -snt ref is nonempty, as the=
 ref
!       % will be empty for @unnumbered and @anchor.
!       \setbox2 =3D \hbox{\ignorespaces \refx{#1-snt}}%
!       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
        %
!       % output the `[mynode]' via the macro below so it can be overridden=
.
!       \xrefprintnodename\printedrefname
!       %
!       \expandafter\ifx\csname SETtxiomitxrefpg\endcsname\relax
!         % But we always want a comma and a space:
!         ,\space
!         %
!         % output the `page 3'.
!         \turnoffactive \putwordpage\tie\refx{#1-pg}%
!         % Add a , if xref followed by a space
!         \if\space\noexpand\tokenafterxref ,%
!         \else\ifx\=09\tokenafterxref ,% @TAB
!         \else\ifx\*\tokenafterxref ,%   @*
!         \else\ifx\ \tokenafterxref ,%   @SPACE
!         \else\ifx\
!                   \tokenafterxref ,%    @NL
!         \else\ifx\tie\tokenafterxref ,% @tie
!         \fi\fi\fi\fi\fi\fi
!       \fi
!     \fi\fi
    \fi
    \endlink
  \endgroup}
 =20
+ % Output a cross-manual xref to #1.  Used just above (twice).
+ %
+ % Only include the text "Section ``foo'' in" if the foo is neither
+ % missing or Top.  Thus, @xref{,,,foo,The Foo Manual} outputs simply
+ % "see The Foo Manual", the idea being to refer to the whole manual.
+ %
+ % But, this being TeX, we can't easily compare our node name against the
+ % string "Top" while ignoring the possible spaces before and after in
+ % the input.  By adding the arbitrary 7sp below, we make it much less
+ % likely that a real node name would have the same width as "Top" (e.g.,
+ % in a monospaced font).  Hopefully it will never happen in practice.
+ %
+ % For the same basic reason, we retypeset the "Top" at every
+ % reference, since the current font is indeterminate.
+ %
+ \def\crossmanualxref#1{%
+   \setbox\toprefbox =3D \hbox{Top\kern7sp}%
+   \setbox2 =3D \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
+   \ifdim \wd2 > 7sp  % nonempty?
+     \ifdim \wd2 =3D \wd\toprefbox \else  % same as Top?
+       \putwordSection{} ``\printedrefname'' \putwordin{}\space
+     \fi
+   \fi
+   #1%
+ }
+=20
  % This macro is called from \xrefX for the `[nodename]' part of xref
  % output.  It's a separate macro only so it can be changed more easily,
  % since square brackets don't work well in some documents.  Particularly
***************
*** 7459,7471 ****
    \fi\fi\fi
  }
 =20
! % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named =
NAME.
! % If its value is nonempty, SUFFIX is output afterward.
! %
! \def\refx#1#2{%
    {%
      \indexnofonts
!     \otherbackslash
      \expandafter\global\expandafter\let\expandafter\thisrefX
        \csname XR#1\endcsname
    }%
--- 9030,9042 ----
    \fi\fi\fi
  }
 =20
! % \refx{NAME} - reference a cross-reference string named NAME.
! \def\refx#1{%
!   \requireauxfile
    {%
      \indexnofonts
!     \turnoffactive
!     \def\value##1{##1}%
      \expandafter\global\expandafter\let\expandafter\thisrefX
        \csname XR#1\endcsname
    }%
***************
*** 7487,7509 ****
      % It's defined, so just use it.
      \thisrefX
    \fi
-   #2% Output the suffix in any case.
  }
 =20
! % This is the macro invoked by entries in the aux file.  Usually it's
! % just a \def (we prepend XR to the control sequence name to avoid
! % collisions).  But if this is a float type, we have more work to do.
  %
  \def\xrdef#1#2{%
!   {% The node name might contain 8-bit characters, which in our current
!    % implementation are changed to commands like @'e.  Don't let these
!    % mess up the control sequence name.
      \indexnofonts
      \turnoffactive
      \xdef\safexrefname{#1}%
    }%
    %
!   \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this x=
ref
    %
    % Was that xref control sequence that we just defined for a float?
    \expandafter\iffloat\csname XR\safexrefname\endcsname
--- 9058,9087 ----
      % It's defined, so just use it.
      \thisrefX
    \fi
  }
 =20
! % This is the macro invoked by entries in the aux file.  Define a control
! % sequence for a cross-reference target (we prepend XR to the control seq=
uence
! % name to avoid collisions).  The value is the page number.  If this is a=
 float
! % type, we have more work to do.
  %
  \def\xrdef#1#2{%
!   {% Expand the node or anchor name to remove control sequences.
!    % \turnoffactive stops 8-bit characters being changed to commands
!    % like @'e.  \refx does the same to retrieve the value in the definiti=
on.
      \indexnofonts
      \turnoffactive
+     \def\value##1{##1}%
      \xdef\safexrefname{#1}%
    }%
    %
!   \bgroup
!     \expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
!   \egroup
!   % We put the \gdef inside a group to avoid the definitions building up =
on
!   % TeX's save stack, which can cause it to run out of space for aux file=
s with
!   % thousands of lines.  \gdef doesn't use the save stack, but \csname do=
es
!   % when it defines an unknown control sequence as \relax.
    %
    % Was that xref control sequence that we just defined for a float?
    \expandafter\iffloat\csname XR\safexrefname\endcsname
***************
*** 7526,7531 ****
--- 9104,9126 ----
    \fi
  }
 =20
+ % 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 at the beginning of the file.
+ %
+ \newif\iflinks \linkstrue % by default we want the aux files.
+ \let\novalidate =3D \linksfalse
+=20
+ % Used when writing to the aux file, or when using data from it.
+ \def\requireauxfile{%
+   \iflinks
+     \tryauxfile
+     % Open the new aux file.  TeX will close it automatically at exit.
+     \immediate\openout\auxfile=3D\jobname.aux
+   \fi
+   \global\let\requireauxfile=3D\relax   % Only do this once.
+ }
+=20
  % Read the last existing aux file, if any.  No error if none exists.
  %
  \def\tryauxfile{%
***************
*** 7565,7583 ****
    \catcode`\^^]=3D\other
    \catcode`\^^^=3D\other
    \catcode`\^^_=3D\other
-   % It was suggested to set the catcode of ^ to 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`\^=3D\other
    %
    % Special characters.  Should be turned off anyway, but...
--- 9160,9165 ----
***************
*** 7585,7618 ****
    \catcode`\[=3D\other
    \catcode`\]=3D\other
    \catcode`\"=3D\other
!   \catcode`\_=3D\other
!   \catcode`\|=3D\other
!   \catcode`\<=3D\other
!   \catcode`\>=3D\other
    \catcode`\$=3D\other
    \catcode`\#=3D\other
    \catcode`\&=3D\other
    \catcode`\%=3D\other
    \catcode`+=3D\other % avoid \+ for paranoia even though we've turned it=
 off
    %
!   % This is to support \ in node names and titles, since the \
!   % characters end up in a \csname.  It's easier than
!   % leaving it active and making its active definition an actual \
!   % character.  What I don't understand is why it works in the *value*
!   % of the xrdef.  Seems like it should be a catcode12 \, and that
!   % should not typeset properly.  But it works, so I'm moving on for
!   % now.  --karl, 15jan04.
!   \catcode`\\=3D\other
!   %
!   % Make the characters 128-255 be printing characters.
!   {%
!     \count1=3D128
!     \def\loop{%
!       \catcode\count1=3D\other
!       \advance\count1 by 1
!       \ifnum \count1<256 \loop \fi
!     }%
!   }%
    %
    % @ is our escape character in .aux files, and we need braces.
    \catcode`\{=3D1
--- 9167,9183 ----
    \catcode`\[=3D\other
    \catcode`\]=3D\other
    \catcode`\"=3D\other
!   \catcode`\_=3D\active
!   \catcode`\|=3D\active
!   \catcode`\<=3D\active
!   \catcode`\>=3D\active
    \catcode`\$=3D\other
    \catcode`\#=3D\other
    \catcode`\&=3D\other
    \catcode`\%=3D\other
    \catcode`+=3D\other % avoid \+ for paranoia even though we've turned it=
 off
    %
!   \catcode`\\=3D\active
    %
    % @ is our escape character in .aux files, and we need braces.
    \catcode`\{=3D1
***************
*** 7639,7653 ****
  % space to prevent strange expansion errors.)
  \def\supereject{\par\penalty -20000\footnoteno =3D0 }
 =20
! % @footnotestyle is meaningful for info output only.
  \let\footnotestyle=3D\comment
 =20
  {\catcode `\@=3D11
  %
  % Auto-number footnotes.  Otherwise like plain.
  \gdef\footnote{%
-   \let\indent=3D\ptexindent
-   \let\noindent=3D\ptexnoindent
    \global\advance\footnoteno by \@ne
    \edef\thisfootno{$^{\the\footnoteno}$}%
    %
--- 9204,9216 ----
  % space to prevent strange expansion errors.)
  \def\supereject{\par\penalty -20000\footnoteno =3D0 }
 =20
! % @footnotestyle is meaningful for Info output only.
  \let\footnotestyle=3D\comment
 =20
  {\catcode `\@=3D11
  %
  % Auto-number footnotes.  Otherwise like plain.
  \gdef\footnote{%
    \global\advance\footnoteno by \@ne
    \edef\thisfootno{$^{\the\footnoteno}$}%
    %
***************
*** 7671,7680 ****
  %
  \gdef\dofootnote{%
    \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.
!   \hsize=3D\pagewidth
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\ht\strutbox % top baseline for broken footnotes
    \splitmaxdepth\dp\strutbox
--- 9234,9248 ----
  %
  \gdef\dofootnote{%
    \insert\footins\bgroup
+   %
+   % Nested footnotes are not supported in TeX, that would take a lot
+   % more work.  (\startsavinginserts does not suffice.)
+   \let\footnote=3D\errfootnotenest
+   %
    % 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.
!   \hsize=3D\txipagewidth
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\ht\strutbox % top baseline for broken footnotes
    \splitmaxdepth\dp\strutbox
***************
*** 7702,7718 ****
    % expands into a box, it must come within the paragraph, lest it
    % provide a place where TeX can split the footnote.
    \footstrut
    \futurelet\next\fo@t
  }
  }%end \catcode `\@=3D11
 =20
  % In case a @footnote appears in a vbox, save the footnote text and creat=
e
  % the real \insert just after the vbox finished.  Otherwise, the insertio=
n
  % would be lost.
  % Similarly, if a @footnote appears inside an alignment, save the footnot=
e
  % text to a box and make the \insert when a row of the table is finished.
  % And the same can be done for other insert classes.  --kasal, 16nov03.
!=20
  % Replace the \insert primitive by a cheating macro.
  % Deeper inside, just make sure that the saved insertions are not spilled
  % out prematurely.
--- 9270,9299 ----
    % expands into a box, it must come within the paragraph, lest it
    % provide a place where TeX can split the footnote.
    \footstrut
+   %
+   % Invoke rest of plain TeX footnote routine.
    \futurelet\next\fo@t
  }
  }%end \catcode `\@=3D11
 =20
+ \def\errfootnotenest{%
+   \errhelp=3D\EMsimple
+   \errmessage{Nested footnotes not supported in texinfo.tex,
+     even though they work in makeinfo; sorry}
+ }
+=20
+ \def\errfootnoteheading{%
+   \errhelp=3D\EMsimple
+   \errmessage{Footnotes in chapters, sections, etc., are not supported}
+ }
+=20
  % In case a @footnote appears in a vbox, save the footnote text and creat=
e
  % the real \insert just after the vbox finished.  Otherwise, the insertio=
n
  % would be lost.
  % Similarly, if a @footnote appears inside an alignment, save the footnot=
e
  % text to a box and make the \insert when a row of the table is finished.
  % And the same can be done for other insert classes.  --kasal, 16nov03.
! %
  % Replace the \insert primitive by a cheating macro.
  % Deeper inside, just make sure that the saved insertions are not spilled
  % out prematurely.
***************
*** 7786,7795 ****
  \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 =3D \noepsfhelp
        \errmessage{epsf.tex not found, images will be ignored}%
--- 9367,9376 ----
  \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 https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex=
.}
  %
  \def\image#1{%
!   \ifx\epsfbox\thisisundefined
      \ifwarnednoepsf \else
        \errhelp =3D \noepsfhelp
        \errmessage{epsf.tex not found, images will be ignored}%
***************
*** 7810,7818 ****
--- 9391,9407 ----
  \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
    \catcode`\^^M =3D 5     % in case we're inside an example
    \normalturnoffactive  % allow _ et al. in names
+   \makevalueexpandable
    % If the image is by itself, center it.
    \ifvmode
      \imagevmodetrue
+   \else \ifx\centersub\centerV
+     % for @center @image, we need a vbox so we can have our vertical spac=
e
+     \imagevmodetrue
+     \vbox\bgroup % vbox has better behavior than vtop herev
+   \fi\fi
+   %
+   \ifimagevmode
      \nobreak\medskip
      % Usually we'll have text after the image which will insert
      % \parskip glue, so insert it here too to equalize the space
***************
*** 7822,7842 ****
    \fi
    %
    % Leave vertical mode so that indentation from an enclosing
!   % environment such as @quotation is respected.  On the other hand, if
!   % it's at the top level, we don't want the normal paragraph indentation=
.
!   \noindent
    %
    % Output the image.
    \ifpdf
      \dopdfimage{#1}{#2}{#3}%
    \else
!     % \epsfbox itself resets \epsf?size at each figure.
!     \setbox0 =3D \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=3D#2\=
relax \fi
!     \setbox0 =3D \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=3D#3\=
relax \fi
!     \epsfbox{#1.eps}%
    \fi
    %
!   \ifimagevmode \medskip \fi  % space after the standalone image
  \endgroup}
 =20
 =20
--- 9411,9447 ----
    \fi
    %
    % Leave vertical mode so that indentation from an enclosing
!   %  environment such as @quotation is respected.
!   % However, if we're at the top level, we don't want the
!   %  normal paragraph indentation.
!   % On the other hand, if we are in the case of @center @image, we don't
!   %  want to start a paragraph, which will create a hsize-width box and
!   %  eradicate the centering.
!   \ifx\centersub\centerV \else \imageindent \fi
    %
    % Output the image.
    \ifpdf
+     % For pdfTeX and LuaTeX <=3D 0.80
      \dopdfimage{#1}{#2}{#3}%
    \else
!     \ifx\XeTeXrevision\thisisundefined
!       % For epsf.tex
!       % \epsfbox itself resets \epsf?size at each figure.
!       \setbox0 =3D \hbox{\ignorespaces #2}%
!         \ifdim\wd0 > 0pt \epsfxsize=3D#2\relax \fi
!       \setbox0 =3D \hbox{\ignorespaces #3}%
!         \ifdim\wd0 > 0pt \epsfysize=3D#3\relax \fi
!       \epsfbox{#1.eps}%
!     \else
!       % For XeTeX
!       \doxeteximage{#1}{#2}{#3}%
!     \fi
    \fi
    %
!   \ifimagevmode
!     \medskip  % space after a standalone image
!   \fi
!   \ifx\centersub\centerV \egroup \fi
  \endgroup}
 =20
 =20
***************
*** 7903,7915 ****
        \global\advance\floatno by 1
        %
        {%
!         % This magic value for \lastsection is output by \setref as the
          % XREFLABEL-title value.  \xrefX uses it to distinguish float
          % labels (which have a completely different output format) from
          % node and anchor labels.  And \xrdef uses it to construct the
          % lists of floats.
          %
!         \edef\lastsection{\floatmagic=3D\safefloattype}%
          \setref{\floatlabel}{Yfloat}%
        }%
      \fi
--- 9508,9520 ----
        \global\advance\floatno by 1
        %
        {%
!         % This magic value for \currentsection is output by \setref as th=
e
          % XREFLABEL-title value.  \xrefX uses it to distinguish float
          % labels (which have a completely different output format) from
          % node and anchor labels.  And \xrdef uses it to construct the
          % lists of floats.
          %
!         \edef\currentsection{\floatmagic=3D\safefloattype}%
          \setref{\floatlabel}{Yfloat}%
        }%
      \fi
***************
*** 7952,7958 ****
      %
      \ifx\thiscaption\empty \else
        \ifx\floatident\empty \else
! =09\appendtomacro\captionline{: }% had ident, so need a colon between
        \fi
        %
        % caption text.
--- 9557,9563 ----
      %
      \ifx\thiscaption\empty \else
        \ifx\floatident\empty \else
!         \appendtomacro\captionline{: }% had ident, so need a colon betwee=
n
        \fi
        %
        % caption text.
***************
*** 7976,8007 ****
        % \floatlabel-lof.  Besides \floatident, we include the short
        % caption if specified, else the full caption if specified, else no=
thing.
        {%
          \atdummies
          %
!         % since we read the caption text in the macro world, where ^^M
!         % is turned into a normal character, we have to scan it back, so
!         % we don't write the literal three characters "^^M" into the aux =
file.
! =09\scanexp{%
! =09  \xdef\noexpand\gtemp{%
! =09    \ifx\thisshortcaption\empty
! =09      \thiscaption
! =09    \else
! =09      \thisshortcaption
! =09    \fi
! =09  }%
! =09}%
          \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
! =09  \ifx\gtemp\empty \else : \gtemp \fi}}%
        }%
      \fi
    \egroup  % end of \vtop
    %
-   % place the captured inserts
-   %
-   % BEWARE: when the floats start floating, we have to issue warning
-   % whenever an insert appears inside a float which could possibly
-   % float. --kasal, 26may04
-   %
    \checkinserts
  }
 =20
--- 9581,9600 ----
        % \floatlabel-lof.  Besides \floatident, we include the short
        % caption if specified, else the full caption if specified, else no=
thing.
        {%
+         \requireauxfile
          \atdummies
          %
!         \ifx\thisshortcaption\empty
!           \def\gtemp{\thiscaption}%
!         \else
!           \def\gtemp{\thisshortcaption}%
!         \fi
          \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
!           \ifx\gtemp\empty \else : \gtemp \fi}}%
        }%
      \fi
    \egroup  % end of \vtop
    %
    \checkinserts
  }
 =20
***************
*** 8044,8050 ****
 =20
  % #1 is the control sequence we are passed; we expand into a conditional
  % which is true if #1 represents a float ref.  That is, the magic
! % \lastsection value which we \setref above.
  %
  \def\iffloat#1{\expandafter\doiffloat#1=3D=3D\finish}
  %
--- 9637,9643 ----
 =20
  % #1 is the control sequence we are passed; we expand into a conditional
  % which is true if #1 represents a float ref.  That is, the magic
! % \currentsection value which we \setref above.
  %
  \def\iffloat#1{\expandafter\doiffloat#1=3D=3D\finish}
  %
***************
*** 8115,8134 ****
  {
    \catcode`\_ =3D \active
    \globaldefs=3D1
! \parseargdef\documentlanguage{\begingroup
!   \let_=3D\normalunderscore  % normal _ character for filenames
    \tex % read txi-??.tex file in plain TeX.
      % Read the file by the name they passed if it exists.
      \openin 1 txi-#1.tex
      \ifeof 1
!       \documentlanguagetrywithoutunderscore{#1_\finish}%
      \else
        \globaldefs =3D 1  % everything in the txi-LL files needs to persis=
t
        \input txi-#1.tex
      \fi
      \closein 1
    \endgroup % end raw TeX
! \endgroup}
  %
  % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  % try txi-de.tex.
--- 9708,9727 ----
  {
    \catcode`\_ =3D \active
    \globaldefs=3D1
! \parseargdef\documentlanguage{%
    \tex % read txi-??.tex file in plain TeX.
      % Read the file by the name they passed if it exists.
+     \let_ =3D \normalunderscore  % normal _ character for filename test
      \openin 1 txi-#1.tex
      \ifeof 1
!       \documentlanguagetrywithoutunderscore #1_\finish
      \else
        \globaldefs =3D 1  % everything in the txi-LL files needs to persis=
t
        \input txi-#1.tex
      \fi
      \closein 1
    \endgroup % end raw TeX
! }
  %
  % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  % try txi-de.tex.
***************
*** 8176,8181 ****
--- 9769,9838 ----
    \global\righthyphenmin =3D #3\relax
  }
 =20
+ % XeTeX and LuaTeX can handle Unicode natively.
+ % Their default I/O uses UTF-8 sequences instead of a byte-wise operation=
.
+ % Other TeX engines' I/O (pdfTeX, etc.) is byte-wise.
+ %
+ \newif\iftxinativeunicodecapable
+ \newif\iftxiusebytewiseio
+=20
+ \ifx\XeTeXrevision\thisisundefined
+   \ifx\luatexversion\thisisundefined
+     \txinativeunicodecapablefalse
+     \txiusebytewiseiotrue
+   \else
+     \txinativeunicodecapabletrue
+     \txiusebytewiseiofalse
+   \fi
+ \else
+   \txinativeunicodecapabletrue
+   \txiusebytewiseiofalse
+ \fi
+=20
+ % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
+ % for non-UTF-8 (byte-wise) encodings.
+ %
+ \def\setbytewiseio{%
+   \ifx\XeTeXrevision\thisisundefined
+   \else
+     \XeTeXdefaultencoding "bytes"  % For subsequent files to be read
+     \XeTeXinputencoding "bytes"  % For document root file
+     % Unfortunately, there seems to be no corresponding XeTeX command for
+     % output encoding.  This is a problem for auxiliary index and TOC fil=
es.
+     % The only solution would be perhaps to write out @U{...} sequences i=
n
+     % place of non-ASCII characters.
+   \fi
+=20
+   \ifx\luatexversion\thisisundefined
+   \else
+     \directlua{
+     local utf8_char, byte, gsub =3D unicode.utf8.char, string.byte, strin=
g.gsub
+     local function convert_char (char)
+       return utf8_char(byte(char))
+     end
+=20
+     local function convert_line (line)
+       return gsub(line, ".", convert_char)
+     end
+=20
+     callback.register("process_input_buffer", convert_line)
+=20
+     local function convert_line_out (line)
+       local line_out =3D ""
+       for c in string.utfvalues(line) do
+          line_out =3D line_out .. string.char(c)
+       end
+       return line_out
+     end
+=20
+     callback.register("process_output_buffer", convert_line_out)
+     }
+   \fi
+=20
+   \txiusebytewiseiotrue
+ }
+=20
+=20
  % Helpers for encodings.
  % Set the catcode of characters 128 through 255 to the specified number.
  %
***************
*** 8198,8204 ****
  % @documentencoding sets the definition of non-ASCII characters
  % according to the specified encoding.
  %
! \parseargdef\documentencoding{%
    % Encoding being declared for the document.
    \def\declaredencoding{\csname #1.enc\endcsname}%
    %
--- 9855,9863 ----
  % @documentencoding sets the definition of non-ASCII characters
  % according to the specified encoding.
  %
! \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz=
}
! \def\documentencodingzzz#1{%
!   %
    % Encoding being declared for the document.
    \def\declaredencoding{\csname #1.enc\endcsname}%
    %
***************
*** 8214,8248 ****
       \asciichardefs
    %
    \else \ifx \declaredencoding \lattwo
       \setnonasciicharscatcode\active
       \lattwochardefs
    %
    \else \ifx \declaredencoding \latone
       \setnonasciicharscatcode\active
       \latonechardefs
    %
    \else \ifx \declaredencoding \latnine
       \setnonasciicharscatcode\active
       \latninechardefs
    %
    \else \ifx \declaredencoding \utfeight
!      \setnonasciicharscatcode\active
!      \utfeightchardefs
    %
    \else
!     \message{Unknown document encoding #1, ignoring.}%
    %
    \fi % utfeight
    \fi % latnine
    \fi % latone
    \fi % lattwo
    \fi % ascii
  }
 =20
  % A message to be logged when using a character that isn't available
  % the default font encoding (OT1).
  %
! \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
 =20
  % Take account of \c (plain) vs. \, (Texinfo) difference.
  \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
--- 9873,9938 ----
       \asciichardefs
    %
    \else \ifx \declaredencoding \lattwo
+      \iftxinativeunicodecapable
+        \setbytewiseio
+      \fi
       \setnonasciicharscatcode\active
       \lattwochardefs
    %
    \else \ifx \declaredencoding \latone
+      \iftxinativeunicodecapable
+        \setbytewiseio
+      \fi
       \setnonasciicharscatcode\active
       \latonechardefs
    %
    \else \ifx \declaredencoding \latnine
+      \iftxinativeunicodecapable
+        \setbytewiseio
+      \fi
       \setnonasciicharscatcode\active
       \latninechardefs
    %
    \else \ifx \declaredencoding \utfeight
!      \iftxinativeunicodecapable
!        % For native Unicode handling (XeTeX and LuaTeX)
!        \nativeunicodechardefs
!      \else
!        % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX)
!        \setnonasciicharscatcode\active
!        % since we already invoked \utfeightchardefs at the top level
!        % (below), do not re-invoke it, otherwise our check for duplicated
!        % definitions gets triggered.  Making non-ascii chars active is
!        % sufficient.
!      \fi
    %
    \else
!     \message{Ignoring unknown document encoding: #1.}%
    %
    \fi % utfeight
    \fi % latnine
    \fi % latone
    \fi % lattwo
    \fi % ascii
+   %
+   \ifx\XeTeXrevision\thisisundefined
+   \else
+     \ifx \declaredencoding \utfeight
+     \else
+       \ifx \declaredencoding \ascii
+       \else
+         \message{Warning: XeTeX with non-UTF-8 encodings cannot handle %
+         non-ASCII characters in auxiliary files.}%
+       \fi
+     \fi
+   \fi
  }
 =20
+ % emacs-page
  % A message to be logged when using a character that isn't available
  % the default font encoding (OT1).
  %
! \def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
 =20
  % Take account of \c (plain) vs. \, (Texinfo) difference.
  \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
***************
*** 8252,8362 ****
  % macros containing the character definitions.
  \setnonasciicharscatcode\active
  %
  % Latin1 (ISO-8859-1) character definitions.
  \def\latonechardefs{%
!   \gdef^^a0{~}
!   \gdef^^a1{\exclamdown}
!   \gdef^^a2{\missingcharmsg{CENT SIGN}}
!   \gdef^^a3{{\pounds}}
!   \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
!   \gdef^^a5{\missingcharmsg{YEN SIGN}}
!   \gdef^^a6{\missingcharmsg{BROKEN BAR}}
!   \gdef^^a7{\S}
!   \gdef^^a8{\"{}}
!   \gdef^^a9{\copyright}
!   \gdef^^aa{\ordf}
!   \gdef^^ab{\guillemetleft}
!   \gdef^^ac{$\lnot$}
!   \gdef^^ad{\-}
!   \gdef^^ae{\registeredsymbol}
!   \gdef^^af{\=3D{}}
!   %
!   \gdef^^b0{\textdegree}
!   \gdef^^b1{$\pm$}
!   \gdef^^b2{$^2$}
!   \gdef^^b3{$^3$}
!   \gdef^^b4{\'{}}
!   \gdef^^b5{$\mu$}
!   \gdef^^b6{\P}
!   %
!   \gdef^^b7{$^.$}
!   \gdef^^b8{\cedilla\ }
!   \gdef^^b9{$^1$}
!   \gdef^^ba{\ordm}
!   %
!   \gdef^^bb{\guilletright}
!   \gdef^^bc{$1\over4$}
!   \gdef^^bd{$1\over2$}
!   \gdef^^be{$3\over4$}
!   \gdef^^bf{\questiondown}
!   %
!   \gdef^^c0{\`A}
!   \gdef^^c1{\'A}
!   \gdef^^c2{\^A}
!   \gdef^^c3{\~A}
!   \gdef^^c4{\"A}
!   \gdef^^c5{\ringaccent A}
!   \gdef^^c6{\AE}
!   \gdef^^c7{\cedilla C}
!   \gdef^^c8{\`E}
!   \gdef^^c9{\'E}
!   \gdef^^ca{\^E}
!   \gdef^^cb{\"E}
!   \gdef^^cc{\`I}
!   \gdef^^cd{\'I}
!   \gdef^^ce{\^I}
!   \gdef^^cf{\"I}
!   %
!   \gdef^^d0{\DH}
!   \gdef^^d1{\~N}
!   \gdef^^d2{\`O}
!   \gdef^^d3{\'O}
!   \gdef^^d4{\^O}
!   \gdef^^d5{\~O}
!   \gdef^^d6{\"O}
!   \gdef^^d7{$\times$}
!   \gdef^^d8{\O}
!   \gdef^^d9{\`U}
!   \gdef^^da{\'U}
!   \gdef^^db{\^U}
!   \gdef^^dc{\"U}
!   \gdef^^dd{\'Y}
!   \gdef^^de{\TH}
!   \gdef^^df{\ss}
!   %
!   \gdef^^e0{\`a}
!   \gdef^^e1{\'a}
!   \gdef^^e2{\^a}
!   \gdef^^e3{\~a}
!   \gdef^^e4{\"a}
!   \gdef^^e5{\ringaccent a}
!   \gdef^^e6{\ae}
!   \gdef^^e7{\cedilla c}
!   \gdef^^e8{\`e}
!   \gdef^^e9{\'e}
!   \gdef^^ea{\^e}
!   \gdef^^eb{\"e}
!   \gdef^^ec{\`{\dotless i}}
!   \gdef^^ed{\'{\dotless i}}
!   \gdef^^ee{\^{\dotless i}}
!   \gdef^^ef{\"{\dotless i}}
!   %
!   \gdef^^f0{\dh}
!   \gdef^^f1{\~n}
!   \gdef^^f2{\`o}
!   \gdef^^f3{\'o}
!   \gdef^^f4{\^o}
!   \gdef^^f5{\~o}
!   \gdef^^f6{\"o}
!   \gdef^^f7{$\div$}
!   \gdef^^f8{\o}
!   \gdef^^f9{\`u}
!   \gdef^^fa{\'u}
!   \gdef^^fb{\^u}
!   \gdef^^fc{\"u}
!   \gdef^^fd{\'y}
!   \gdef^^fe{\th}
!   \gdef^^ff{\"y}
  }
 =20
  % Latin9 (ISO-8859-15) encoding character definitions.
--- 9942,10060 ----
  % macros containing the character definitions.
  \setnonasciicharscatcode\active
  %
+=20
+ \def\gdefchar#1#2{%
+ \gdef#1{%
+    \ifpassthroughchars
+      \string#1%
+    \else
+      #2%
+    \fi
+ }}
+=20
  % Latin1 (ISO-8859-1) character definitions.
  \def\latonechardefs{%
!   \gdefchar^^a0{\tie}
!   \gdefchar^^a1{\exclamdown}
!   \gdefchar^^a2{{\tcfont \char162}} % cent
!   \gdefchar^^a3{\pounds{}}
!   \gdefchar^^a4{{\tcfont \char164}} % currency
!   \gdefchar^^a5{{\tcfont \char165}} % yen
!   \gdefchar^^a6{{\tcfont \char166}} % broken bar
!   \gdefchar^^a7{\S}
!   \gdefchar^^a8{\"{}}
!   \gdefchar^^a9{\copyright{}}
!   \gdefchar^^aa{\ordf}
!   \gdefchar^^ab{\guillemetleft{}}
!   \gdefchar^^ac{\ensuremath\lnot}
!   \gdefchar^^ad{\-}
!   \gdefchar^^ae{\registeredsymbol{}}
!   \gdefchar^^af{\=3D{}}
!   %
!   \gdefchar^^b0{\textdegree}
!   \gdefchar^^b1{$\pm$}
!   \gdefchar^^b2{$^2$}
!   \gdefchar^^b3{$^3$}
!   \gdefchar^^b4{\'{}}
!   \gdefchar^^b5{$\mu$}
!   \gdefchar^^b6{\P}
!   \gdefchar^^b7{\ensuremath\cdot}
!   \gdefchar^^b8{\cedilla\ }
!   \gdefchar^^b9{$^1$}
!   \gdefchar^^ba{\ordm}
!   \gdefchar^^bb{\guillemetright{}}
!   \gdefchar^^bc{$1\over4$}
!   \gdefchar^^bd{$1\over2$}
!   \gdefchar^^be{$3\over4$}
!   \gdefchar^^bf{\questiondown}
!   %
!   \gdefchar^^c0{\`A}
!   \gdefchar^^c1{\'A}
!   \gdefchar^^c2{\^A}
!   \gdefchar^^c3{\~A}
!   \gdefchar^^c4{\"A}
!   \gdefchar^^c5{\ringaccent A}
!   \gdefchar^^c6{\AE}
!   \gdefchar^^c7{\cedilla C}
!   \gdefchar^^c8{\`E}
!   \gdefchar^^c9{\'E}
!   \gdefchar^^ca{\^E}
!   \gdefchar^^cb{\"E}
!   \gdefchar^^cc{\`I}
!   \gdefchar^^cd{\'I}
!   \gdefchar^^ce{\^I}
!   \gdefchar^^cf{\"I}
!   %
!   \gdefchar^^d0{\DH}
!   \gdefchar^^d1{\~N}
!   \gdefchar^^d2{\`O}
!   \gdefchar^^d3{\'O}
!   \gdefchar^^d4{\^O}
!   \gdefchar^^d5{\~O}
!   \gdefchar^^d6{\"O}
!   \gdefchar^^d7{$\times$}
!   \gdefchar^^d8{\O}
!   \gdefchar^^d9{\`U}
!   \gdefchar^^da{\'U}
!   \gdefchar^^db{\^U}
!   \gdefchar^^dc{\"U}
!   \gdefchar^^dd{\'Y}
!   \gdefchar^^de{\TH}
!   \gdefchar^^df{\ss}
!   %
!   \gdefchar^^e0{\`a}
!   \gdefchar^^e1{\'a}
!   \gdefchar^^e2{\^a}
!   \gdefchar^^e3{\~a}
!   \gdefchar^^e4{\"a}
!   \gdefchar^^e5{\ringaccent a}
!   \gdefchar^^e6{\ae}
!   \gdefchar^^e7{\cedilla c}
!   \gdefchar^^e8{\`e}
!   \gdefchar^^e9{\'e}
!   \gdefchar^^ea{\^e}
!   \gdefchar^^eb{\"e}
!   \gdefchar^^ec{\`{\dotless i}}
!   \gdefchar^^ed{\'{\dotless i}}
!   \gdefchar^^ee{\^{\dotless i}}
!   \gdefchar^^ef{\"{\dotless i}}
!   %
!   \gdefchar^^f0{\dh}
!   \gdefchar^^f1{\~n}
!   \gdefchar^^f2{\`o}
!   \gdefchar^^f3{\'o}
!   \gdefchar^^f4{\^o}
!   \gdefchar^^f5{\~o}
!   \gdefchar^^f6{\"o}
!   \gdefchar^^f7{$\div$}
!   \gdefchar^^f8{\o}
!   \gdefchar^^f9{\`u}
!   \gdefchar^^fa{\'u}
!   \gdefchar^^fb{\^u}
!   \gdefchar^^fc{\"u}
!   \gdefchar^^fd{\'y}
!   \gdefchar^^fe{\th}
!   \gdefchar^^ff{\"y}
  }
 =20
  % Latin9 (ISO-8859-15) encoding character definitions.
***************
*** 8364,8482 ****
    % Encoding is almost identical to Latin1.
    \latonechardefs
    %
!   \gdef^^a4{\euro}
!   \gdef^^a6{\v S}
!   \gdef^^a8{\v s}
!   \gdef^^b4{\v Z}
!   \gdef^^b8{\v z}
!   \gdef^^bc{\OE}
!   \gdef^^bd{\oe}
!   \gdef^^be{\"Y}
  }
 =20
  % Latin2 (ISO-8859-2) character definitions.
  \def\lattwochardefs{%
!   \gdef^^a0{~}
!   \gdef^^a1{\ogonek{A}}
!   \gdef^^a2{\u{}}
!   \gdef^^a3{\L}
!   \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
!   \gdef^^a5{\v L}
!   \gdef^^a6{\'S}
!   \gdef^^a7{\S}
!   \gdef^^a8{\"{}}
!   \gdef^^a9{\v S}
!   \gdef^^aa{\cedilla S}
!   \gdef^^ab{\v T}
!   \gdef^^ac{\'Z}
!   \gdef^^ad{\-}
!   \gdef^^ae{\v Z}
!   \gdef^^af{\dotaccent Z}
!   %
!   \gdef^^b0{\textdegree}
!   \gdef^^b1{\ogonek{a}}
!   \gdef^^b2{\ogonek{ }}
!   \gdef^^b3{\l}
!   \gdef^^b4{\'{}}
!   \gdef^^b5{\v l}
!   \gdef^^b6{\'s}
!   \gdef^^b7{\v{}}
!   \gdef^^b8{\cedilla\ }
!   \gdef^^b9{\v s}
!   \gdef^^ba{\cedilla s}
!   \gdef^^bb{\v t}
!   \gdef^^bc{\'z}
!   \gdef^^bd{\H{}}
!   \gdef^^be{\v z}
!   \gdef^^bf{\dotaccent z}
!   %
!   \gdef^^c0{\'R}
!   \gdef^^c1{\'A}
!   \gdef^^c2{\^A}
!   \gdef^^c3{\u A}
!   \gdef^^c4{\"A}
!   \gdef^^c5{\'L}
!   \gdef^^c6{\'C}
!   \gdef^^c7{\cedilla C}
!   \gdef^^c8{\v C}
!   \gdef^^c9{\'E}
!   \gdef^^ca{\ogonek{E}}
!   \gdef^^cb{\"E}
!   \gdef^^cc{\v E}
!   \gdef^^cd{\'I}
!   \gdef^^ce{\^I}
!   \gdef^^cf{\v D}
!   %
!   \gdef^^d0{\DH}
!   \gdef^^d1{\'N}
!   \gdef^^d2{\v N}
!   \gdef^^d3{\'O}
!   \gdef^^d4{\^O}
!   \gdef^^d5{\H O}
!   \gdef^^d6{\"O}
!   \gdef^^d7{$\times$}
!   \gdef^^d8{\v R}
!   \gdef^^d9{\ringaccent U}
!   \gdef^^da{\'U}
!   \gdef^^db{\H U}
!   \gdef^^dc{\"U}
!   \gdef^^dd{\'Y}
!   \gdef^^de{\cedilla T}
!   \gdef^^df{\ss}
!   %
!   \gdef^^e0{\'r}
!   \gdef^^e1{\'a}
!   \gdef^^e2{\^a}
!   \gdef^^e3{\u a}
!   \gdef^^e4{\"a}
!   \gdef^^e5{\'l}
!   \gdef^^e6{\'c}
!   \gdef^^e7{\cedilla c}
!   \gdef^^e8{\v c}
!   \gdef^^e9{\'e}
!   \gdef^^ea{\ogonek{e}}
!   \gdef^^eb{\"e}
!   \gdef^^ec{\v e}
!   \gdef^^ed{\'{\dotless{i}}}
!   \gdef^^ee{\^{\dotless{i}}}
!   \gdef^^ef{\v d}
!   %
!   \gdef^^f0{\dh}
!   \gdef^^f1{\'n}
!   \gdef^^f2{\v n}
!   \gdef^^f3{\'o}
!   \gdef^^f4{\^o}
!   \gdef^^f5{\H o}
!   \gdef^^f6{\"o}
!   \gdef^^f7{$\div$}
!   \gdef^^f8{\v r}
!   \gdef^^f9{\ringaccent u}
!   \gdef^^fa{\'u}
!   \gdef^^fb{\H u}
!   \gdef^^fc{\"u}
!   \gdef^^fd{\'y}
!   \gdef^^fe{\cedilla t}
!   \gdef^^ff{\dotaccent{}}
  }
 =20
  % UTF-8 character definitions.
--- 10062,10180 ----
    % Encoding is almost identical to Latin1.
    \latonechardefs
    %
!   \gdefchar^^a4{\euro{}}
!   \gdefchar^^a6{\v S}
!   \gdefchar^^a8{\v s}
!   \gdefchar^^b4{\v Z}
!   \gdefchar^^b8{\v z}
!   \gdefchar^^bc{\OE}
!   \gdefchar^^bd{\oe}
!   \gdefchar^^be{\"Y}
  }
 =20
  % Latin2 (ISO-8859-2) character definitions.
  \def\lattwochardefs{%
!   \gdefchar^^a0{\tie}
!   \gdefchar^^a1{\ogonek{A}}
!   \gdefchar^^a2{\u{}}
!   \gdefchar^^a3{\L}
!   \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}}
!   \gdefchar^^a5{\v L}
!   \gdefchar^^a6{\'S}
!   \gdefchar^^a7{\S}
!   \gdefchar^^a8{\"{}}
!   \gdefchar^^a9{\v S}
!   \gdefchar^^aa{\cedilla S}
!   \gdefchar^^ab{\v T}
!   \gdefchar^^ac{\'Z}
!   \gdefchar^^ad{\-}
!   \gdefchar^^ae{\v Z}
!   \gdefchar^^af{\dotaccent Z}
!   %
!   \gdefchar^^b0{\textdegree{}}
!   \gdefchar^^b1{\ogonek{a}}
!   \gdefchar^^b2{\ogonek{ }}
!   \gdefchar^^b3{\l}
!   \gdefchar^^b4{\'{}}
!   \gdefchar^^b5{\v l}
!   \gdefchar^^b6{\'s}
!   \gdefchar^^b7{\v{}}
!   \gdefchar^^b8{\cedilla\ }
!   \gdefchar^^b9{\v s}
!   \gdefchar^^ba{\cedilla s}
!   \gdefchar^^bb{\v t}
!   \gdefchar^^bc{\'z}
!   \gdefchar^^bd{\H{}}
!   \gdefchar^^be{\v z}
!   \gdefchar^^bf{\dotaccent z}
!   %
!   \gdefchar^^c0{\'R}
!   \gdefchar^^c1{\'A}
!   \gdefchar^^c2{\^A}
!   \gdefchar^^c3{\u A}
!   \gdefchar^^c4{\"A}
!   \gdefchar^^c5{\'L}
!   \gdefchar^^c6{\'C}
!   \gdefchar^^c7{\cedilla C}
!   \gdefchar^^c8{\v C}
!   \gdefchar^^c9{\'E}
!   \gdefchar^^ca{\ogonek{E}}
!   \gdefchar^^cb{\"E}
!   \gdefchar^^cc{\v E}
!   \gdefchar^^cd{\'I}
!   \gdefchar^^ce{\^I}
!   \gdefchar^^cf{\v D}
!   %
!   \gdefchar^^d0{\DH}
!   \gdefchar^^d1{\'N}
!   \gdefchar^^d2{\v N}
!   \gdefchar^^d3{\'O}
!   \gdefchar^^d4{\^O}
!   \gdefchar^^d5{\H O}
!   \gdefchar^^d6{\"O}
!   \gdefchar^^d7{$\times$}
!   \gdefchar^^d8{\v R}
!   \gdefchar^^d9{\ringaccent U}
!   \gdefchar^^da{\'U}
!   \gdefchar^^db{\H U}
!   \gdefchar^^dc{\"U}
!   \gdefchar^^dd{\'Y}
!   \gdefchar^^de{\cedilla T}
!   \gdefchar^^df{\ss}
!   %
!   \gdefchar^^e0{\'r}
!   \gdefchar^^e1{\'a}
!   \gdefchar^^e2{\^a}
!   \gdefchar^^e3{\u a}
!   \gdefchar^^e4{\"a}
!   \gdefchar^^e5{\'l}
!   \gdefchar^^e6{\'c}
!   \gdefchar^^e7{\cedilla c}
!   \gdefchar^^e8{\v c}
!   \gdefchar^^e9{\'e}
!   \gdefchar^^ea{\ogonek{e}}
!   \gdefchar^^eb{\"e}
!   \gdefchar^^ec{\v e}
!   \gdefchar^^ed{\'{\dotless{i}}}
!   \gdefchar^^ee{\^{\dotless{i}}}
!   \gdefchar^^ef{\v d}
!   %
!   \gdefchar^^f0{\dh}
!   \gdefchar^^f1{\'n}
!   \gdefchar^^f2{\v n}
!   \gdefchar^^f3{\'o}
!   \gdefchar^^f4{\^o}
!   \gdefchar^^f5{\H o}
!   \gdefchar^^f6{\"o}
!   \gdefchar^^f7{$\div$}
!   \gdefchar^^f8{\v r}
!   \gdefchar^^f9{\ringaccent u}
!   \gdefchar^^fa{\'u}
!   \gdefchar^^fb{\H u}
!   \gdefchar^^fc{\"u}
!   \gdefchar^^fd{\'y}
!   \gdefchar^^fe{\cedilla t}
!   \gdefchar^^ff{\dotaccent{}}
  }
 =20
  % UTF-8 character definitions.
***************
*** 8506,8543 ****
    \fi
  }
 =20
  \begingroup
    \catcode`\~13
    \catcode`\"12
 =20
    \def\UTFviiiLoop{%
      \global\catcode\countUTFx\active
      \uccode`\~\countUTFx
      \uppercase\expandafter{\UTFviiiTmp}%
      \advance\countUTFx by 1
      \ifnum\countUTFx < \countUTFy
        \expandafter\UTFviiiLoop
      \fi}
 =20
    \countUTFx =3D "C2
    \countUTFy =3D "E0
    \def\UTFviiiTmp{%
!     \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
    \UTFviiiLoop
 =20
    \countUTFx =3D "E0
    \countUTFy =3D "F0
    \def\UTFviiiTmp{%
!     \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
    \UTFviiiLoop
 =20
    \countUTFx =3D "F0
    \countUTFy =3D "F4
    \def\UTFviiiTmp{%
!     \xdef~{\noexpand\UTFviiiFourOctets\string~}}
    \UTFviiiLoop
  \endgroup
 =20
  \begingroup
    \catcode`\"=3D12
    \catcode`\<=3D12
--- 10204,10297 ----
    \fi
  }
 =20
+ % Give non-ASCII bytes the active definitions for processing UTF-8 sequen=
ces
  \begingroup
    \catcode`\~13
+   \catcode`\$12
    \catcode`\"12
 =20
+   % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp
+   % substituting ~ and $ with a character token of that value.
    \def\UTFviiiLoop{%
      \global\catcode\countUTFx\active
      \uccode`\~\countUTFx
+     \uccode`\$\countUTFx
      \uppercase\expandafter{\UTFviiiTmp}%
      \advance\countUTFx by 1
      \ifnum\countUTFx < \countUTFy
        \expandafter\UTFviiiLoop
      \fi}
 =20
+   % For bytes other than the first in a UTF-8 sequence.  Not expected to
+   % be expanded except when writing to auxiliary files.
+   \countUTFx =3D "80
+   \countUTFy =3D "C2
+   \def\UTFviiiTmp{%
+     \gdef~{%
+         \ifpassthroughchars $\fi}}%
+   \UTFviiiLoop
+=20
    \countUTFx =3D "C2
    \countUTFy =3D "E0
    \def\UTFviiiTmp{%
!     \gdef~{%
!         \ifpassthroughchars $%
!         \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}%
    \UTFviiiLoop
 =20
    \countUTFx =3D "E0
    \countUTFy =3D "F0
    \def\UTFviiiTmp{%
!     \gdef~{%
!         \ifpassthroughchars $%
!         \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}%
    \UTFviiiLoop
 =20
    \countUTFx =3D "F0
    \countUTFy =3D "F4
    \def\UTFviiiTmp{%
!     \gdef~{%
!         \ifpassthroughchars $%
!         \else\expandafter\UTFviiiFourOctets\expandafter$\fi
!         }}%
    \UTFviiiLoop
  \endgroup
 =20
+ \def\globallet{\global\let} % save some \expandafter's below
+=20
+ % @U{xxxx} to produce U+xxxx, if we support it.
+ \def\U#1{%
+   \expandafter\ifx\csname uni:#1\endcsname \relax
+     \iftxinativeunicodecapable
+       % All Unicode characters can be used if native Unicode handling is
+       % active.  However, if the font does not have the glyph,
+       % letters are missing.
+       \begingroup
+         \uccode`\.=3D"#1\relax
+         \uppercase{.}
+       \endgroup
+     \else
+       \errhelp =3D \EMsimple
+       \errmessage{Unicode character U+#1 not supported, sorry}%
+     \fi
+   \else
+     \csname uni:#1\endcsname
+   \fi
+ }
+=20
+ % These macros are used here to construct the name of a control
+ % sequence to be defined.
+ \def\UTFviiiTwoOctetsName#1#2{%
+   \csname u8:#1\string #2\endcsname}%
+ \def\UTFviiiThreeOctetsName#1#2#3{%
+   \csname u8:#1\string #2\string #3\endcsname}%
+ \def\UTFviiiFourOctetsName#1#2#3#4{%
+   \csname u8:#1\string #2\string #3\string #4\endcsname}%
+=20
+ % For UTF-8 byte sequences (TeX, e-TeX and pdfTeX),
+ % provide a definition macro to replace a Unicode character;
+ % this gets used by the @U command
+ %
  \begingroup
    \catcode`\"=3D12
    \catcode`\<=3D12
***************
*** 8546,9010 ****
    \catcode`\;=3D12
    \catcode`\!=3D12
    \catcode`\~=3D13
!=20
!   \gdef\DeclareUnicodeCharacter#1#2{%
      \countUTFz =3D "#1\relax
-     %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTF=
z)}%
      \begingroup
        \parseXMLCharref
-       \def\UTFviiiTwoOctets##1##2{%
-         \csname u8:##1\string ##2\endcsname}%
-       \def\UTFviiiThreeOctets##1##2##3{%
-         \csname u8:##1\string ##2\string ##3\endcsname}%
-       \def\UTFviiiFourOctets##1##2##3##4{%
-         \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
-       \expandafter\expandafter\expandafter\expandafter
-        \expandafter\expandafter\expandafter
-        \gdef\UTFviiiTmp{#2}%
-     \endgroup}
 =20
    \gdef\parseXMLCharref{%
      \ifnum\countUTFz < "A0\relax
        \errhelp =3D \EMsimple
        \errmessage{Cannot define Unicode char value < 00A0}%
      \else\ifnum\countUTFz < "800\relax
        \parseUTFviiiA,%
!       \parseUTFviiiB C\UTFviiiTwoOctets.,%
      \else\ifnum\countUTFz < "10000\relax
        \parseUTFviiiA;%
        \parseUTFviiiA,%
!       \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
      \else
        \parseUTFviiiA;%
        \parseUTFviiiA,%
        \parseUTFviiiA!%
!       \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
      \fi\fi\fi
    }
 =20
    \gdef\parseUTFviiiA#1{%
      \countUTFx =3D \countUTFz
      \divide\countUTFz by 64
!     \countUTFy =3D \countUTFz
      \multiply\countUTFz by 64
      \advance\countUTFx by -\countUTFz
      \advance\countUTFx by 128
      \uccode `#1\countUTFx
      \countUTFz =3D \countUTFy}
 =20
    \gdef\parseUTFviiiB#1#2#3#4{%
      \advance\countUTFz by "#10\relax
      \uccode `#3\countUTFz
      \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  \endgroup
 =20
  \def\utfeightchardefs{%
!   \DeclareUnicodeCharacter{00A0}{\tie}
!   \DeclareUnicodeCharacter{00A1}{\exclamdown}
!   \DeclareUnicodeCharacter{00A3}{\pounds}
!   \DeclareUnicodeCharacter{00A8}{\"{ }}
!   \DeclareUnicodeCharacter{00A9}{\copyright}
!   \DeclareUnicodeCharacter{00AA}{\ordf}
!   \DeclareUnicodeCharacter{00AB}{\guillemetleft}
!   \DeclareUnicodeCharacter{00AD}{\-}
!   \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
!   \DeclareUnicodeCharacter{00AF}{\=3D{ }}
!=20
!   \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
!   \DeclareUnicodeCharacter{00B4}{\'{ }}
!   \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
!   \DeclareUnicodeCharacter{00BA}{\ordm}
!   \DeclareUnicodeCharacter{00BB}{\guillemetright}
!   \DeclareUnicodeCharacter{00BF}{\questiondown}
!=20
!   \DeclareUnicodeCharacter{00C0}{\`A}
!   \DeclareUnicodeCharacter{00C1}{\'A}
!   \DeclareUnicodeCharacter{00C2}{\^A}
!   \DeclareUnicodeCharacter{00C3}{\~A}
!   \DeclareUnicodeCharacter{00C4}{\"A}
!   \DeclareUnicodeCharacter{00C5}{\AA}
!   \DeclareUnicodeCharacter{00C6}{\AE}
!   \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
!   \DeclareUnicodeCharacter{00C8}{\`E}
!   \DeclareUnicodeCharacter{00C9}{\'E}
!   \DeclareUnicodeCharacter{00CA}{\^E}
!   \DeclareUnicodeCharacter{00CB}{\"E}
!   \DeclareUnicodeCharacter{00CC}{\`I}
!   \DeclareUnicodeCharacter{00CD}{\'I}
!   \DeclareUnicodeCharacter{00CE}{\^I}
!   \DeclareUnicodeCharacter{00CF}{\"I}
!=20
!   \DeclareUnicodeCharacter{00D0}{\DH}
!   \DeclareUnicodeCharacter{00D1}{\~N}
!   \DeclareUnicodeCharacter{00D2}{\`O}
!   \DeclareUnicodeCharacter{00D3}{\'O}
!   \DeclareUnicodeCharacter{00D4}{\^O}
!   \DeclareUnicodeCharacter{00D5}{\~O}
!   \DeclareUnicodeCharacter{00D6}{\"O}
!   \DeclareUnicodeCharacter{00D8}{\O}
!   \DeclareUnicodeCharacter{00D9}{\`U}
!   \DeclareUnicodeCharacter{00DA}{\'U}
!   \DeclareUnicodeCharacter{00DB}{\^U}
!   \DeclareUnicodeCharacter{00DC}{\"U}
!   \DeclareUnicodeCharacter{00DD}{\'Y}
!   \DeclareUnicodeCharacter{00DE}{\TH}
!   \DeclareUnicodeCharacter{00DF}{\ss}
!=20
!   \DeclareUnicodeCharacter{00E0}{\`a}
!   \DeclareUnicodeCharacter{00E1}{\'a}
!   \DeclareUnicodeCharacter{00E2}{\^a}
!   \DeclareUnicodeCharacter{00E3}{\~a}
!   \DeclareUnicodeCharacter{00E4}{\"a}
!   \DeclareUnicodeCharacter{00E5}{\aa}
!   \DeclareUnicodeCharacter{00E6}{\ae}
!   \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
!   \DeclareUnicodeCharacter{00E8}{\`e}
!   \DeclareUnicodeCharacter{00E9}{\'e}
!   \DeclareUnicodeCharacter{00EA}{\^e}
!   \DeclareUnicodeCharacter{00EB}{\"e}
!   \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
!   \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
!   \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
!   \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
!=20
!   \DeclareUnicodeCharacter{00F0}{\dh}
!   \DeclareUnicodeCharacter{00F1}{\~n}
!   \DeclareUnicodeCharacter{00F2}{\`o}
!   \DeclareUnicodeCharacter{00F3}{\'o}
!   \DeclareUnicodeCharacter{00F4}{\^o}
!   \DeclareUnicodeCharacter{00F5}{\~o}
!   \DeclareUnicodeCharacter{00F6}{\"o}
!   \DeclareUnicodeCharacter{00F8}{\o}
!   \DeclareUnicodeCharacter{00F9}{\`u}
!   \DeclareUnicodeCharacter{00FA}{\'u}
!   \DeclareUnicodeCharacter{00FB}{\^u}
!   \DeclareUnicodeCharacter{00FC}{\"u}
!   \DeclareUnicodeCharacter{00FD}{\'y}
!   \DeclareUnicodeCharacter{00FE}{\th}
!   \DeclareUnicodeCharacter{00FF}{\"y}
!=20
!   \DeclareUnicodeCharacter{0100}{\=3DA}
!   \DeclareUnicodeCharacter{0101}{\=3Da}
!   \DeclareUnicodeCharacter{0102}{\u{A}}
!   \DeclareUnicodeCharacter{0103}{\u{a}}
!   \DeclareUnicodeCharacter{0104}{\ogonek{A}}
!   \DeclareUnicodeCharacter{0105}{\ogonek{a}}
!   \DeclareUnicodeCharacter{0106}{\'C}
!   \DeclareUnicodeCharacter{0107}{\'c}
!   \DeclareUnicodeCharacter{0108}{\^C}
!   \DeclareUnicodeCharacter{0109}{\^c}
!   \DeclareUnicodeCharacter{0118}{\ogonek{E}}
!   \DeclareUnicodeCharacter{0119}{\ogonek{e}}
!   \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
!   \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
!   \DeclareUnicodeCharacter{010C}{\v{C}}
!   \DeclareUnicodeCharacter{010D}{\v{c}}
!   \DeclareUnicodeCharacter{010E}{\v{D}}
!=20
!   \DeclareUnicodeCharacter{0112}{\=3DE}
!   \DeclareUnicodeCharacter{0113}{\=3De}
!   \DeclareUnicodeCharacter{0114}{\u{E}}
!   \DeclareUnicodeCharacter{0115}{\u{e}}
!   \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
!   \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
!   \DeclareUnicodeCharacter{011A}{\v{E}}
!   \DeclareUnicodeCharacter{011B}{\v{e}}
!   \DeclareUnicodeCharacter{011C}{\^G}
!   \DeclareUnicodeCharacter{011D}{\^g}
!   \DeclareUnicodeCharacter{011E}{\u{G}}
!   \DeclareUnicodeCharacter{011F}{\u{g}}
!=20
!   \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
!   \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
!   \DeclareUnicodeCharacter{0124}{\^H}
!   \DeclareUnicodeCharacter{0125}{\^h}
!   \DeclareUnicodeCharacter{0128}{\~I}
!   \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
!   \DeclareUnicodeCharacter{012A}{\=3DI}
!   \DeclareUnicodeCharacter{012B}{\=3D{\dotless{i}}}
!   \DeclareUnicodeCharacter{012C}{\u{I}}
!   \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
!=20
!   \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
!   \DeclareUnicodeCharacter{0131}{\dotless{i}}
!   \DeclareUnicodeCharacter{0132}{IJ}
!   \DeclareUnicodeCharacter{0133}{ij}
!   \DeclareUnicodeCharacter{0134}{\^J}
!   \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
!   \DeclareUnicodeCharacter{0139}{\'L}
!   \DeclareUnicodeCharacter{013A}{\'l}
!=20
!   \DeclareUnicodeCharacter{0141}{\L}
!   \DeclareUnicodeCharacter{0142}{\l}
!   \DeclareUnicodeCharacter{0143}{\'N}
!   \DeclareUnicodeCharacter{0144}{\'n}
!   \DeclareUnicodeCharacter{0147}{\v{N}}
!   \DeclareUnicodeCharacter{0148}{\v{n}}
!   \DeclareUnicodeCharacter{014C}{\=3DO}
!   \DeclareUnicodeCharacter{014D}{\=3Do}
!   \DeclareUnicodeCharacter{014E}{\u{O}}
!   \DeclareUnicodeCharacter{014F}{\u{o}}
!=20
!   \DeclareUnicodeCharacter{0150}{\H{O}}
!   \DeclareUnicodeCharacter{0151}{\H{o}}
!   \DeclareUnicodeCharacter{0152}{\OE}
!   \DeclareUnicodeCharacter{0153}{\oe}
!   \DeclareUnicodeCharacter{0154}{\'R}
!   \DeclareUnicodeCharacter{0155}{\'r}
!   \DeclareUnicodeCharacter{0158}{\v{R}}
!   \DeclareUnicodeCharacter{0159}{\v{r}}
!   \DeclareUnicodeCharacter{015A}{\'S}
!   \DeclareUnicodeCharacter{015B}{\'s}
!   \DeclareUnicodeCharacter{015C}{\^S}
!   \DeclareUnicodeCharacter{015D}{\^s}
!   \DeclareUnicodeCharacter{015E}{\cedilla{S}}
!   \DeclareUnicodeCharacter{015F}{\cedilla{s}}
!=20
!   \DeclareUnicodeCharacter{0160}{\v{S}}
!   \DeclareUnicodeCharacter{0161}{\v{s}}
!   \DeclareUnicodeCharacter{0162}{\cedilla{t}}
!   \DeclareUnicodeCharacter{0163}{\cedilla{T}}
!   \DeclareUnicodeCharacter{0164}{\v{T}}
!=20
!   \DeclareUnicodeCharacter{0168}{\~U}
!   \DeclareUnicodeCharacter{0169}{\~u}
!   \DeclareUnicodeCharacter{016A}{\=3DU}
!   \DeclareUnicodeCharacter{016B}{\=3Du}
!   \DeclareUnicodeCharacter{016C}{\u{U}}
!   \DeclareUnicodeCharacter{016D}{\u{u}}
!   \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
!   \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
!=20
!   \DeclareUnicodeCharacter{0170}{\H{U}}
!   \DeclareUnicodeCharacter{0171}{\H{u}}
!   \DeclareUnicodeCharacter{0174}{\^W}
!   \DeclareUnicodeCharacter{0175}{\^w}
!   \DeclareUnicodeCharacter{0176}{\^Y}
!   \DeclareUnicodeCharacter{0177}{\^y}
!   \DeclareUnicodeCharacter{0178}{\"Y}
!   \DeclareUnicodeCharacter{0179}{\'Z}
!   \DeclareUnicodeCharacter{017A}{\'z}
!   \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
!   \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
!   \DeclareUnicodeCharacter{017D}{\v{Z}}
!   \DeclareUnicodeCharacter{017E}{\v{z}}
!=20
!   \DeclareUnicodeCharacter{01C4}{D\v{Z}}
!   \DeclareUnicodeCharacter{01C5}{D\v{z}}
!   \DeclareUnicodeCharacter{01C6}{d\v{z}}
!   \DeclareUnicodeCharacter{01C7}{LJ}
!   \DeclareUnicodeCharacter{01C8}{Lj}
!   \DeclareUnicodeCharacter{01C9}{lj}
!   \DeclareUnicodeCharacter{01CA}{NJ}
!   \DeclareUnicodeCharacter{01CB}{Nj}
!   \DeclareUnicodeCharacter{01CC}{nj}
!   \DeclareUnicodeCharacter{01CD}{\v{A}}
!   \DeclareUnicodeCharacter{01CE}{\v{a}}
!   \DeclareUnicodeCharacter{01CF}{\v{I}}
!=20
!   \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
!   \DeclareUnicodeCharacter{01D1}{\v{O}}
!   \DeclareUnicodeCharacter{01D2}{\v{o}}
!   \DeclareUnicodeCharacter{01D3}{\v{U}}
!   \DeclareUnicodeCharacter{01D4}{\v{u}}
!=20
!   \DeclareUnicodeCharacter{01E2}{\=3D{\AE}}
!   \DeclareUnicodeCharacter{01E3}{\=3D{\ae}}
!   \DeclareUnicodeCharacter{01E6}{\v{G}}
!   \DeclareUnicodeCharacter{01E7}{\v{g}}
!   \DeclareUnicodeCharacter{01E8}{\v{K}}
!   \DeclareUnicodeCharacter{01E9}{\v{k}}
!=20
!   \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
!   \DeclareUnicodeCharacter{01F1}{DZ}
!   \DeclareUnicodeCharacter{01F2}{Dz}
!   \DeclareUnicodeCharacter{01F3}{dz}
!   \DeclareUnicodeCharacter{01F4}{\'G}
!   \DeclareUnicodeCharacter{01F5}{\'g}
!   \DeclareUnicodeCharacter{01F8}{\`N}
!   \DeclareUnicodeCharacter{01F9}{\`n}
!   \DeclareUnicodeCharacter{01FC}{\'{\AE}}
!   \DeclareUnicodeCharacter{01FD}{\'{\ae}}
!   \DeclareUnicodeCharacter{01FE}{\'{\O}}
!   \DeclareUnicodeCharacter{01FF}{\'{\o}}
!=20
!   \DeclareUnicodeCharacter{021E}{\v{H}}
!   \DeclareUnicodeCharacter{021F}{\v{h}}
!=20
!   \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
!   \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
!   \DeclareUnicodeCharacter{0228}{\cedilla{E}}
!   \DeclareUnicodeCharacter{0229}{\cedilla{e}}
!   \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
!   \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
!=20
!   \DeclareUnicodeCharacter{0232}{\=3DY}
!   \DeclareUnicodeCharacter{0233}{\=3Dy}
!   \DeclareUnicodeCharacter{0237}{\dotless{j}}
!=20
!   \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
!=20
!   \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
!   \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
!   \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
!   \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
!   \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
!   \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
!   \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
!   \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
!   \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
!   \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
!   \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
!   \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
!=20
!   \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
!   \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
!=20
!   \DeclareUnicodeCharacter{1E20}{\=3DG}
!   \DeclareUnicodeCharacter{1E21}{\=3Dg}
!   \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
!   \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
!   \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
!   \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
!   \DeclareUnicodeCharacter{1E26}{\"H}
!   \DeclareUnicodeCharacter{1E27}{\"h}
!=20
!   \DeclareUnicodeCharacter{1E30}{\'K}
!   \DeclareUnicodeCharacter{1E31}{\'k}
!   \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
!   \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
!   \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
!   \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
!   \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
!   \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
!   \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
!   \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
!   \DeclareUnicodeCharacter{1E3E}{\'M}
!   \DeclareUnicodeCharacter{1E3F}{\'m}
!=20
!   \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
!   \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
!   \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
!   \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
!   \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
!   \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
!   \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
!   \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
!   \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
!   \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
!=20
!   \DeclareUnicodeCharacter{1E54}{\'P}
!   \DeclareUnicodeCharacter{1E55}{\'p}
!   \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
!   \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
!   \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
!   \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
!   \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
!   \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
!   \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
!   \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
!=20
!   \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
!   \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
!   \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
!   \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
!   \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
!   \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
!   \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
!   \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
!   \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
!   \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
!=20
!   \DeclareUnicodeCharacter{1E7C}{\~V}
!   \DeclareUnicodeCharacter{1E7D}{\~v}
!   \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
!   \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
!=20
!   \DeclareUnicodeCharacter{1E80}{\`W}
!   \DeclareUnicodeCharacter{1E81}{\`w}
!   \DeclareUnicodeCharacter{1E82}{\'W}
!   \DeclareUnicodeCharacter{1E83}{\'w}
!   \DeclareUnicodeCharacter{1E84}{\"W}
!   \DeclareUnicodeCharacter{1E85}{\"w}
!   \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
!   \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
!   \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
!   \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
!   \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
!   \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
!   \DeclareUnicodeCharacter{1E8C}{\"X}
!   \DeclareUnicodeCharacter{1E8D}{\"x}
!   \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
!   \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
!=20
!   \DeclareUnicodeCharacter{1E90}{\^Z}
!   \DeclareUnicodeCharacter{1E91}{\^z}
!   \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
!   \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
!   \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
!   \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
!   \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
!   \DeclareUnicodeCharacter{1E97}{\"t}
!   \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
!   \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
!=20
!   \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
!   \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
!=20
!   \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
!   \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
!   \DeclareUnicodeCharacter{1EBC}{\~E}
!   \DeclareUnicodeCharacter{1EBD}{\~e}
!=20
!   \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
!   \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
!   \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
!   \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
!=20
!   \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
!   \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
!=20
!   \DeclareUnicodeCharacter{1EF2}{\`Y}
!   \DeclareUnicodeCharacter{1EF3}{\`y}
!   \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
!=20
!   \DeclareUnicodeCharacter{1EF8}{\~Y}
!   \DeclareUnicodeCharacter{1EF9}{\~y}
!=20
!   \DeclareUnicodeCharacter{2013}{--}
!   \DeclareUnicodeCharacter{2014}{---}
!   \DeclareUnicodeCharacter{2018}{\quoteleft}
!   \DeclareUnicodeCharacter{2019}{\quoteright}
!   \DeclareUnicodeCharacter{201A}{\quotesinglbase}
!   \DeclareUnicodeCharacter{201C}{\quotedblleft}
!   \DeclareUnicodeCharacter{201D}{\quotedblright}
!   \DeclareUnicodeCharacter{201E}{\quotedblbase}
!   \DeclareUnicodeCharacter{2022}{\bullet}
!   \DeclareUnicodeCharacter{2026}{\dots}
!   \DeclareUnicodeCharacter{2039}{\guilsinglleft}
!   \DeclareUnicodeCharacter{203A}{\guilsinglright}
!   \DeclareUnicodeCharacter{20AC}{\euro}
!=20
!   \DeclareUnicodeCharacter{2192}{\expansion}
!   \DeclareUnicodeCharacter{21D2}{\result}
!=20
!   \DeclareUnicodeCharacter{2212}{\minus}
!   \DeclareUnicodeCharacter{2217}{\point}
!   \DeclareUnicodeCharacter{2261}{\equiv}
! }% end of \utfeightchardefs
 =20
 =20
  % US-ASCII character definitions.
  \def\asciichardefs{% nothing need be done
     \relax
  }
 =20
! % Make non-ASCII characters printable again for compatibility with
! % existing Texinfo documents that may use them, even without declaring a
! % document encoding.
! %
! \setnonasciicharscatcode \other
!=20
 =20
  \message{formatting,}
 =20
--- 10300,11139 ----
    \catcode`\;=3D12
    \catcode`\!=3D12
    \catcode`\~=3D13
!   \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
      \countUTFz =3D "#1\relax
      \begingroup
        \parseXMLCharref
 =20
+       % Give \u8:... its definition.  The sequence of seven \expandafter'=
s
+       % expands after the \gdef three times, e.g.
+       %
+       % 1.  \UTFviiTwoOctetsName B1 B2
+       % 2.  \csname u8:B1 \string B2 \endcsname
+       % 3.  \u8: B1 B2  (a single control sequence token)
+       %
+       \expandafter\expandafter
+       \expandafter\expandafter
+       \expandafter\expandafter
+       \expandafter\gdef       \UTFviiiTmp{#2}%
+       %
+       \expandafter\ifx\csname uni:#1\endcsname \relax \else
+        \message{Internal error, already defined: #1}%
+       \fi
+       %
+       % define an additional control sequence for this code point.
+       \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
+     \endgroup}
+   %
+   % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTm=
p
+   % to the corresponding UTF-8 sequence.
    \gdef\parseXMLCharref{%
      \ifnum\countUTFz < "A0\relax
        \errhelp =3D \EMsimple
        \errmessage{Cannot define Unicode char value < 00A0}%
      \else\ifnum\countUTFz < "800\relax
        \parseUTFviiiA,%
!       \parseUTFviiiB C\UTFviiiTwoOctetsName.,%
      \else\ifnum\countUTFz < "10000\relax
        \parseUTFviiiA;%
        \parseUTFviiiA,%
!       \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}%
      \else
        \parseUTFviiiA;%
        \parseUTFviiiA,%
        \parseUTFviiiA!%
!       \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}%
      \fi\fi\fi
    }
 =20
+   % Extract a byte from the end of the UTF-8 representation of \countUTFx=
.
+   % It must be a non-initial byte in the sequence.
+   % Change \uccode of #1 for it to be used in \parseUTFviiiB as one
+   % of the bytes.
    \gdef\parseUTFviiiA#1{%
      \countUTFx =3D \countUTFz
      \divide\countUTFz by 64
!     \countUTFy =3D \countUTFz  % Save to be the future value of \countUTF=
z.
      \multiply\countUTFz by 64
+=20
+     % \countUTFz is now \countUTFx with the last 5 bits cleared.  Subtrac=
t
+     % in order to get the last five bits.
      \advance\countUTFx by -\countUTFz
+=20
+     % Convert this to the byte in the UTF-8 sequence.
      \advance\countUTFx by 128
      \uccode `#1\countUTFx
      \countUTFz =3D \countUTFy}
 =20
+   % Used to put a UTF-8 byte sequence into \UTFviiiTmp
+   % #1 is the increment for \countUTFz to yield a the first byte of the U=
TF-8
+   %    sequence.
+   % #2 is one of the \UTFviii*OctetsName macros.
+   % #3 is always a full stop (.)
+   % #4 is a template for the other bytes in the sequence.  The values for=
 these
+   %    bytes is substituted in here with \uppercase using the \uccode's.
    \gdef\parseUTFviiiB#1#2#3#4{%
      \advance\countUTFz by "#10\relax
      \uccode `#3\countUTFz
      \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  \endgroup
 =20
+ % For native Unicode handling (XeTeX and LuaTeX),
+ % provide a definition macro that sets a catcode to `other' non-globally
+ %
+ \def\DeclareUnicodeCharacterNativeOther#1#2{%
+   \catcode"#1=3D\other
+ }
+=20
+ % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
+ % U+0000..U+007F =3D https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_b=
lock)
+ % U+0080..U+00FF =3D https://en.wikipedia.org/wiki/Latin-1_Supplement_(Un=
icode_block)
+ % U+0100..U+017F =3D https://en.wikipedia.org/wiki/Latin_Extended-A
+ % U+0180..U+024F =3D https://en.wikipedia.org/wiki/Latin_Extended-B
+ %
+ % Many of our renditions are less than wonderful, and all the missing
+ % characters are available somewhere.  Loading the necessary fonts
+ % awaits user request.  We can't truly support Unicode without
+ % reimplementing everything that's been done in LaTeX for many years,
+ % plus probably using luatex or xetex, and who knows what else.
+ % We won't be doing that here in this simple file.  But we can try to at
+ % least make most of the characters not bomb out.
+ %
+ \def\unicodechardefs{%
+   \DeclareUnicodeCharacter{00A0}{\tie}%
+   \DeclareUnicodeCharacter{00A1}{\exclamdown}%
+   \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=3Dcent
+   \DeclareUnicodeCharacter{00A3}{\pounds{}}%
+   \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=3Dcurrency
+   \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=3Dyen
+   \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=3Dbrokenbar
+   \DeclareUnicodeCharacter{00A7}{\S}%
+   \DeclareUnicodeCharacter{00A8}{\"{ }}%
+   \DeclareUnicodeCharacter{00A9}{\copyright{}}%
+   \DeclareUnicodeCharacter{00AA}{\ordf}%
+   \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}%
+   \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
+   \DeclareUnicodeCharacter{00AD}{\-}%
+   \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}%
+   \DeclareUnicodeCharacter{00AF}{\=3D{ }}%
+   %
+   \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}%
+   \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
+   \DeclareUnicodeCharacter{00B2}{$^2$}%
+   \DeclareUnicodeCharacter{00B3}{$^3$}%
+   \DeclareUnicodeCharacter{00B4}{\'{ }}%
+   \DeclareUnicodeCharacter{00B5}{$\mu$}%
+   \DeclareUnicodeCharacter{00B6}{\P}%
+   \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
+   \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
+   \DeclareUnicodeCharacter{00B9}{$^1$}%
+   \DeclareUnicodeCharacter{00BA}{\ordm}%
+   \DeclareUnicodeCharacter{00BB}{\guillemetright{}}%
+   \DeclareUnicodeCharacter{00BC}{$1\over4$}%
+   \DeclareUnicodeCharacter{00BD}{$1\over2$}%
+   \DeclareUnicodeCharacter{00BE}{$3\over4$}%
+   \DeclareUnicodeCharacter{00BF}{\questiondown}%
+   %
+   \DeclareUnicodeCharacter{00C0}{\`A}%
+   \DeclareUnicodeCharacter{00C1}{\'A}%
+   \DeclareUnicodeCharacter{00C2}{\^A}%
+   \DeclareUnicodeCharacter{00C3}{\~A}%
+   \DeclareUnicodeCharacter{00C4}{\"A}%
+   \DeclareUnicodeCharacter{00C5}{\AA}%
+   \DeclareUnicodeCharacter{00C6}{\AE}%
+   \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
+   \DeclareUnicodeCharacter{00C8}{\`E}%
+   \DeclareUnicodeCharacter{00C9}{\'E}%
+   \DeclareUnicodeCharacter{00CA}{\^E}%
+   \DeclareUnicodeCharacter{00CB}{\"E}%
+   \DeclareUnicodeCharacter{00CC}{\`I}%
+   \DeclareUnicodeCharacter{00CD}{\'I}%
+   \DeclareUnicodeCharacter{00CE}{\^I}%
+   \DeclareUnicodeCharacter{00CF}{\"I}%
+   %
+   \DeclareUnicodeCharacter{00D0}{\DH}%
+   \DeclareUnicodeCharacter{00D1}{\~N}%
+   \DeclareUnicodeCharacter{00D2}{\`O}%
+   \DeclareUnicodeCharacter{00D3}{\'O}%
+   \DeclareUnicodeCharacter{00D4}{\^O}%
+   \DeclareUnicodeCharacter{00D5}{\~O}%
+   \DeclareUnicodeCharacter{00D6}{\"O}%
+   \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
+   \DeclareUnicodeCharacter{00D8}{\O}%
+   \DeclareUnicodeCharacter{00D9}{\`U}%
+   \DeclareUnicodeCharacter{00DA}{\'U}%
+   \DeclareUnicodeCharacter{00DB}{\^U}%
+   \DeclareUnicodeCharacter{00DC}{\"U}%
+   \DeclareUnicodeCharacter{00DD}{\'Y}%
+   \DeclareUnicodeCharacter{00DE}{\TH}%
+   \DeclareUnicodeCharacter{00DF}{\ss}%
+   %
+   \DeclareUnicodeCharacter{00E0}{\`a}%
+   \DeclareUnicodeCharacter{00E1}{\'a}%
+   \DeclareUnicodeCharacter{00E2}{\^a}%
+   \DeclareUnicodeCharacter{00E3}{\~a}%
+   \DeclareUnicodeCharacter{00E4}{\"a}%
+   \DeclareUnicodeCharacter{00E5}{\aa}%
+   \DeclareUnicodeCharacter{00E6}{\ae}%
+   \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
+   \DeclareUnicodeCharacter{00E8}{\`e}%
+   \DeclareUnicodeCharacter{00E9}{\'e}%
+   \DeclareUnicodeCharacter{00EA}{\^e}%
+   \DeclareUnicodeCharacter{00EB}{\"e}%
+   \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
+   \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
+   \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
+   \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
+   %
+   \DeclareUnicodeCharacter{00F0}{\dh}%
+   \DeclareUnicodeCharacter{00F1}{\~n}%
+   \DeclareUnicodeCharacter{00F2}{\`o}%
+   \DeclareUnicodeCharacter{00F3}{\'o}%
+   \DeclareUnicodeCharacter{00F4}{\^o}%
+   \DeclareUnicodeCharacter{00F5}{\~o}%
+   \DeclareUnicodeCharacter{00F6}{\"o}%
+   \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
+   \DeclareUnicodeCharacter{00F8}{\o}%
+   \DeclareUnicodeCharacter{00F9}{\`u}%
+   \DeclareUnicodeCharacter{00FA}{\'u}%
+   \DeclareUnicodeCharacter{00FB}{\^u}%
+   \DeclareUnicodeCharacter{00FC}{\"u}%
+   \DeclareUnicodeCharacter{00FD}{\'y}%
+   \DeclareUnicodeCharacter{00FE}{\th}%
+   \DeclareUnicodeCharacter{00FF}{\"y}%
+   %
+   \DeclareUnicodeCharacter{0100}{\=3DA}%
+   \DeclareUnicodeCharacter{0101}{\=3Da}%
+   \DeclareUnicodeCharacter{0102}{\u{A}}%
+   \DeclareUnicodeCharacter{0103}{\u{a}}%
+   \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
+   \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
+   \DeclareUnicodeCharacter{0106}{\'C}%
+   \DeclareUnicodeCharacter{0107}{\'c}%
+   \DeclareUnicodeCharacter{0108}{\^C}%
+   \DeclareUnicodeCharacter{0109}{\^c}%
+   \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
+   \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
+   \DeclareUnicodeCharacter{010C}{\v{C}}%
+   \DeclareUnicodeCharacter{010D}{\v{c}}%
+   \DeclareUnicodeCharacter{010E}{\v{D}}%
+   \DeclareUnicodeCharacter{010F}{d'}%
+   %
+   \DeclareUnicodeCharacter{0110}{\DH}%
+   \DeclareUnicodeCharacter{0111}{\dh}%
+   \DeclareUnicodeCharacter{0112}{\=3DE}%
+   \DeclareUnicodeCharacter{0113}{\=3De}%
+   \DeclareUnicodeCharacter{0114}{\u{E}}%
+   \DeclareUnicodeCharacter{0115}{\u{e}}%
+   \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
+   \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
+   \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
+   \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
+   \DeclareUnicodeCharacter{011A}{\v{E}}%
+   \DeclareUnicodeCharacter{011B}{\v{e}}%
+   \DeclareUnicodeCharacter{011C}{\^G}%
+   \DeclareUnicodeCharacter{011D}{\^g}%
+   \DeclareUnicodeCharacter{011E}{\u{G}}%
+   \DeclareUnicodeCharacter{011F}{\u{g}}%
+   %
+   \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
+   \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
+   \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
+   \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
+   \DeclareUnicodeCharacter{0124}{\^H}%
+   \DeclareUnicodeCharacter{0125}{\^h}%
+   \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
+   \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
+   \DeclareUnicodeCharacter{0128}{\~I}%
+   \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
+   \DeclareUnicodeCharacter{012A}{\=3DI}%
+   \DeclareUnicodeCharacter{012B}{\=3D{\dotless{i}}}%
+   \DeclareUnicodeCharacter{012C}{\u{I}}%
+   \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
+   \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
+   \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
+   %
+   \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
+   \DeclareUnicodeCharacter{0131}{\dotless{i}}%
+   \DeclareUnicodeCharacter{0132}{IJ}%
+   \DeclareUnicodeCharacter{0133}{ij}%
+   \DeclareUnicodeCharacter{0134}{\^J}%
+   \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
+   \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
+   \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
+   \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
+   \DeclareUnicodeCharacter{0139}{\'L}%
+   \DeclareUnicodeCharacter{013A}{\'l}%
+   \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
+   \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
+   \DeclareUnicodeCharacter{013D}{L'}% should kern
+   \DeclareUnicodeCharacter{013E}{l'}% should kern
+   \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
+   %
+   \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
+   \DeclareUnicodeCharacter{0141}{\L}%
+   \DeclareUnicodeCharacter{0142}{\l}%
+   \DeclareUnicodeCharacter{0143}{\'N}%
+   \DeclareUnicodeCharacter{0144}{\'n}%
+   \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
+   \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
+   \DeclareUnicodeCharacter{0147}{\v{N}}%
+   \DeclareUnicodeCharacter{0148}{\v{n}}%
+   \DeclareUnicodeCharacter{0149}{'n}%
+   \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
+   \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
+   \DeclareUnicodeCharacter{014C}{\=3DO}%
+   \DeclareUnicodeCharacter{014D}{\=3Do}%
+   \DeclareUnicodeCharacter{014E}{\u{O}}%
+   \DeclareUnicodeCharacter{014F}{\u{o}}%
+   %
+   \DeclareUnicodeCharacter{0150}{\H{O}}%
+   \DeclareUnicodeCharacter{0151}{\H{o}}%
+   \DeclareUnicodeCharacter{0152}{\OE}%
+   \DeclareUnicodeCharacter{0153}{\oe}%
+   \DeclareUnicodeCharacter{0154}{\'R}%
+   \DeclareUnicodeCharacter{0155}{\'r}%
+   \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
+   \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
+   \DeclareUnicodeCharacter{0158}{\v{R}}%
+   \DeclareUnicodeCharacter{0159}{\v{r}}%
+   \DeclareUnicodeCharacter{015A}{\'S}%
+   \DeclareUnicodeCharacter{015B}{\'s}%
+   \DeclareUnicodeCharacter{015C}{\^S}%
+   \DeclareUnicodeCharacter{015D}{\^s}%
+   \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
+   \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
+   %
+   \DeclareUnicodeCharacter{0160}{\v{S}}%
+   \DeclareUnicodeCharacter{0161}{\v{s}}%
+   \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
+   \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
+   \DeclareUnicodeCharacter{0164}{\v{T}}%
+   \DeclareUnicodeCharacter{0165}{\v{t}}%
+   \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
+   \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
+   \DeclareUnicodeCharacter{0168}{\~U}%
+   \DeclareUnicodeCharacter{0169}{\~u}%
+   \DeclareUnicodeCharacter{016A}{\=3DU}%
+   \DeclareUnicodeCharacter{016B}{\=3Du}%
+   \DeclareUnicodeCharacter{016C}{\u{U}}%
+   \DeclareUnicodeCharacter{016D}{\u{u}}%
+   \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
+   \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
+   %
+   \DeclareUnicodeCharacter{0170}{\H{U}}%
+   \DeclareUnicodeCharacter{0171}{\H{u}}%
+   \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
+   \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
+   \DeclareUnicodeCharacter{0174}{\^W}%
+   \DeclareUnicodeCharacter{0175}{\^w}%
+   \DeclareUnicodeCharacter{0176}{\^Y}%
+   \DeclareUnicodeCharacter{0177}{\^y}%
+   \DeclareUnicodeCharacter{0178}{\"Y}%
+   \DeclareUnicodeCharacter{0179}{\'Z}%
+   \DeclareUnicodeCharacter{017A}{\'z}%
+   \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
+   \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
+   \DeclareUnicodeCharacter{017D}{\v{Z}}%
+   \DeclareUnicodeCharacter{017E}{\v{z}}%
+   \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
+   %
+   \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
+   \DeclareUnicodeCharacter{01C5}{D\v{z}}%
+   \DeclareUnicodeCharacter{01C6}{d\v{z}}%
+   \DeclareUnicodeCharacter{01C7}{LJ}%
+   \DeclareUnicodeCharacter{01C8}{Lj}%
+   \DeclareUnicodeCharacter{01C9}{lj}%
+   \DeclareUnicodeCharacter{01CA}{NJ}%
+   \DeclareUnicodeCharacter{01CB}{Nj}%
+   \DeclareUnicodeCharacter{01CC}{nj}%
+   \DeclareUnicodeCharacter{01CD}{\v{A}}%
+   \DeclareUnicodeCharacter{01CE}{\v{a}}%
+   \DeclareUnicodeCharacter{01CF}{\v{I}}%
+   %
+   \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
+   \DeclareUnicodeCharacter{01D1}{\v{O}}%
+   \DeclareUnicodeCharacter{01D2}{\v{o}}%
+   \DeclareUnicodeCharacter{01D3}{\v{U}}%
+   \DeclareUnicodeCharacter{01D4}{\v{u}}%
+   %
+   \DeclareUnicodeCharacter{01E2}{\=3D{\AE}}%
+   \DeclareUnicodeCharacter{01E3}{\=3D{\ae}}%
+   \DeclareUnicodeCharacter{01E6}{\v{G}}%
+   \DeclareUnicodeCharacter{01E7}{\v{g}}%
+   \DeclareUnicodeCharacter{01E8}{\v{K}}%
+   \DeclareUnicodeCharacter{01E9}{\v{k}}%
+   %
+   \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
+   \DeclareUnicodeCharacter{01F1}{DZ}%
+   \DeclareUnicodeCharacter{01F2}{Dz}%
+   \DeclareUnicodeCharacter{01F3}{dz}%
+   \DeclareUnicodeCharacter{01F4}{\'G}%
+   \DeclareUnicodeCharacter{01F5}{\'g}%
+   \DeclareUnicodeCharacter{01F8}{\`N}%
+   \DeclareUnicodeCharacter{01F9}{\`n}%
+   \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
+   \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
+   \DeclareUnicodeCharacter{01FE}{\'{\O}}%
+   \DeclareUnicodeCharacter{01FF}{\'{\o}}%
+   %
+   \DeclareUnicodeCharacter{021E}{\v{H}}%
+   \DeclareUnicodeCharacter{021F}{\v{h}}%
+   %
+   \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
+   \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
+   \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
+   \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
+   \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
+   \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
+   %
+   \DeclareUnicodeCharacter{0232}{\=3DY}%
+   \DeclareUnicodeCharacter{0233}{\=3Dy}%
+   \DeclareUnicodeCharacter{0237}{\dotless{j}}%
+   %
+   \DeclareUnicodeCharacter{02BC}{'}%
+   %
+   \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
+   %
+   % Greek letters upper case
+   \DeclareUnicodeCharacter{0391}{{\it A}}%
+   \DeclareUnicodeCharacter{0392}{{\it B}}%
+   \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
+   \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
+   \DeclareUnicodeCharacter{0395}{{\it E}}%
+   \DeclareUnicodeCharacter{0396}{{\it Z}}%
+   \DeclareUnicodeCharacter{0397}{{\it H}}%
+   \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
+   \DeclareUnicodeCharacter{0399}{{\it I}}%
+   \DeclareUnicodeCharacter{039A}{{\it K}}%
+   \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
+   \DeclareUnicodeCharacter{039C}{{\it M}}%
+   \DeclareUnicodeCharacter{039D}{{\it N}}%
+   \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
+   \DeclareUnicodeCharacter{039F}{{\it O}}%
+   \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
+   \DeclareUnicodeCharacter{03A1}{{\it P}}%
+   %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
+   \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
+   \DeclareUnicodeCharacter{03A4}{{\it T}}%
+   \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
+   \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
+   \DeclareUnicodeCharacter{03A7}{{\it X}}%
+   \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
+   \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
+   %
+   % Vowels with accents
+   \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
+   \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
+   \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
+   \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
+   \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
+   \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
+   %
+   % Standalone accent
+   \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
+   %
+   % Greek letters lower case
+   \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
+   \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
+   \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
+   \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
+   \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
+   \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
+   \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
+   \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
+   \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
+   \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
+   \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
+   \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
+   \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
+   \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
+   \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
+   \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
+   \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
+   \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
+   \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
+   \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
+   \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
+   \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
+   \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
+   \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
+   \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
+   %
+   % More Greek vowels with accents
+   \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
+   \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
+   \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
+   \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
+   \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
+   %
+   % Variant Greek letters
+   \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
+   \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
+   \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
+   %
+   \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
+   \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
+   \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
+   \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
+   \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
+   \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
+   \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
+   \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
+   \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
+   \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
+   \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
+   \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
+   %
+   \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
+   \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
+   %
+   \DeclareUnicodeCharacter{1E20}{\=3DG}%
+   \DeclareUnicodeCharacter{1E21}{\=3Dg}%
+   \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
+   \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
+   \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
+   \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
+   \DeclareUnicodeCharacter{1E26}{\"H}%
+   \DeclareUnicodeCharacter{1E27}{\"h}%
+   %
+   \DeclareUnicodeCharacter{1E30}{\'K}%
+   \DeclareUnicodeCharacter{1E31}{\'k}%
+   \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
+   \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
+   \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
+   \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
+   \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
+   \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
+   \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
+   \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
+   \DeclareUnicodeCharacter{1E3E}{\'M}%
+   \DeclareUnicodeCharacter{1E3F}{\'m}%
+   %
+   \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
+   \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
+   \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
+   \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
+   \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
+   \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
+   \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
+   \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
+   \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
+   \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
+   %
+   \DeclareUnicodeCharacter{1E54}{\'P}%
+   \DeclareUnicodeCharacter{1E55}{\'p}%
+   \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
+   \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
+   \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
+   \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
+   \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
+   \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
+   \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
+   \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
+   %
+   \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
+   \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
+   \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
+   \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
+   \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
+   \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
+   \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
+   \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
+   \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
+   \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
+   %
+   \DeclareUnicodeCharacter{1E7C}{\~V}%
+   \DeclareUnicodeCharacter{1E7D}{\~v}%
+   \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
+   \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
+   %
+   \DeclareUnicodeCharacter{1E80}{\`W}%
+   \DeclareUnicodeCharacter{1E81}{\`w}%
+   \DeclareUnicodeCharacter{1E82}{\'W}%
+   \DeclareUnicodeCharacter{1E83}{\'w}%
+   \DeclareUnicodeCharacter{1E84}{\"W}%
+   \DeclareUnicodeCharacter{1E85}{\"w}%
+   \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
+   \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
+   \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
+   \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
+   \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
+   \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
+   \DeclareUnicodeCharacter{1E8C}{\"X}%
+   \DeclareUnicodeCharacter{1E8D}{\"x}%
+   \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
+   \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
+   %
+   \DeclareUnicodeCharacter{1E90}{\^Z}%
+   \DeclareUnicodeCharacter{1E91}{\^z}%
+   \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
+   \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
+   \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
+   \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
+   \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
+   \DeclareUnicodeCharacter{1E97}{\"t}%
+   \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
+   \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
+   %
+   \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
+   \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
+   %
+   \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
+   \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
+   \DeclareUnicodeCharacter{1EBC}{\~E}%
+   \DeclareUnicodeCharacter{1EBD}{\~e}%
+   %
+   \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
+   \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
+   \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
+   \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
+   %
+   \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
+   \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
+   %
+   \DeclareUnicodeCharacter{1EF2}{\`Y}%
+   \DeclareUnicodeCharacter{1EF3}{\`y}%
+   \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
+   %
+   \DeclareUnicodeCharacter{1EF8}{\~Y}%
+   \DeclareUnicodeCharacter{1EF9}{\~y}%
+   %
+   % Punctuation
+   \DeclareUnicodeCharacter{2013}{--}%
+   \DeclareUnicodeCharacter{2014}{---}%
+   \DeclareUnicodeCharacter{2018}{\quoteleft{}}%
+   \DeclareUnicodeCharacter{2019}{\quoteright{}}%
+   \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}%
+   \DeclareUnicodeCharacter{201C}{\quotedblleft{}}%
+   \DeclareUnicodeCharacter{201D}{\quotedblright{}}%
+   \DeclareUnicodeCharacter{201E}{\quotedblbase{}}%
+   \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
+   \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
+   \DeclareUnicodeCharacter{2022}{\bullet{}}%
+   \DeclareUnicodeCharacter{202F}{\thinspace}%
+   \DeclareUnicodeCharacter{2026}{\dots{}}%
+   \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}%
+   \DeclareUnicodeCharacter{203A}{\guilsinglright{}}%
+   %
+   \DeclareUnicodeCharacter{20AC}{\euro{}}%
+   %
+   \DeclareUnicodeCharacter{2192}{\expansion{}}%
+   \DeclareUnicodeCharacter{21D2}{\result{}}%
+   %
+   % Mathematical symbols
+   \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
+   \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
+   \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
+   \DeclareUnicodeCharacter{2212}{\minus{}}%
+   \DeclareUnicodeCharacter{2217}{\ast}%
+   \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
+   \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
+   \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
+   \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
+   \DeclareUnicodeCharacter{2261}{\equiv{}}%
+   \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
+   \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
+   \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
+   \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
+   %
+   \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
+   \DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
+   \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
+   \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
+   \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
+   \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
+   \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
+   \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
+   \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
+   \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
+   \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
+   \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
+   \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
+   \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
+   \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
+   \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
+   \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
+   \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
+   \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
+   \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
+   \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
+   \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
+   \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
+   \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
+   \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
+   \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
+   \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
+   \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
+   \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
+   \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
+   \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
+   \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
+   \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
+   \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
+   \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
+   \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
+   \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
+   \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
+   \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
+   \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
+   \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
+   \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
+   \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
+   \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
+   \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
+   \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
+   \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
+   \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
+   \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
+   \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
+   \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
+   \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
+   \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
+   \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
+   \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
+   \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
+   \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
+   \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
+   \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
+   \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
+   \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
+   \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
+   \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
+   \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
+   \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
+   \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
+   \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
+   \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
+   \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
+   \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
+   \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
+   \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
+   \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
+   \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
+   \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
+   \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
+   \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
+   \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
+   \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
+   \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
+   \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
+   \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
+   \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
+   \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
+   \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
+   \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
+   \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
+   \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
+   \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
+   \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
+   \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
+   %
+   \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
+   \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
+   \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
+   \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
+   \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
+   \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
+   \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
+   \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
+   \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
+   \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
+   \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
+   \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
+   \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
+   \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
+   \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
+   \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
+   \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
+   \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
+   \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
+   \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
+   \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
+   \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
+   \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
+   \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
+   \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
+   \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
+   \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
+   \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
+   \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
+   %
+   \global\mathchardef\checkmark=3D"1370% actually the square root sign
+   \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
+ }% end of \unicodechardefs
+=20
+ % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
+ % It makes the setting that replace UTF-8 byte sequence.
  \def\utfeightchardefs{%
!   \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
!   \unicodechardefs
! }
!=20
! % Whether the active definitions of non-ASCII characters expand to
! % non-active tokens with the same character code.  This is used to
! % write characters literally, instead of using active definitions for
! % printing the correct glyphs.
! \newif\ifpassthroughchars
! \passthroughcharsfalse
!=20
! % For native Unicode handling (XeTeX and LuaTeX),
! % provide a definition macro to replace/pass-through a Unicode character
! %
! \def\DeclareUnicodeCharacterNative#1#2{%
!   \catcode"#1=3D\active
!   \def\dodeclareunicodecharacternative##1##2##3{%
!     \begingroup
!       \uccode`\~=3D"##2\relax
!       \uppercase{\gdef~}{%
!         \ifpassthroughchars
!           ##1%
!         \else
!           ##3%
!         \fi
!       }
!     \endgroup
!   }
!   \begingroup
!     \uccode`\.=3D"#1\relax
!     \uppercase{\def\UTFNativeTmp{.}}%
!     \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
!   \endgroup
! }
 =20
+ % Native Unicode handling (XeTeX and LuaTeX) character replacing definiti=
on.
+ % It activates the setting that replaces Unicode characters.
+ \def\nativeunicodechardefs{%
+   \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
+   \unicodechardefs
+ }
+=20
+ % For native Unicode handling (XeTeX and LuaTeX),
+ % make the character token expand
+ % to the sequences given in \unicodechardefs for printing.
+ \def\DeclareUnicodeCharacterNativeAtU#1#2{%
+   \def\UTFAtUTmp{#2}
+   \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
+ }
+=20
+ % @U command definitions for native Unicode handling (XeTeX and LuaTeX).
+ \def\nativeunicodechardefsatu{%
+   \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
+   \unicodechardefs
+ }
 =20
  % US-ASCII character definitions.
  \def\asciichardefs{% nothing need be done
     \relax
  }
 =20
! % Define all Unicode characters we know about.  This makes UTF-8 the defa=
ult
! % input encoding and allows @U to work.
! \iftxinativeunicodecapable
!   \nativeunicodechardefsatu
! \else
!   \utfeightchardefs
! \fi
 =20
  \message{formatting,}
 =20
***************
*** 9054,9065 ****
    \advance\vsize by \topskip
    \outervsize =3D \vsize
    \advance\outervsize by 2\topandbottommargin
!   \pageheight =3D \vsize
    %
    \hsize =3D #2\relax
    \outerhsize =3D \hsize
    \advance\outerhsize by 0.5in
!   \pagewidth =3D \hsize
    %
    \normaloffset =3D #4\relax
    \bindingoffset =3D #5\relax
--- 11183,11194 ----
    \advance\vsize by \topskip
    \outervsize =3D \vsize
    \advance\outervsize by 2\topandbottommargin
!   \txipageheight =3D \vsize
    %
    \hsize =3D #2\relax
    \outerhsize =3D \hsize
    \advance\outerhsize by 0.5in
!   \txipagewidth =3D \hsize
    %
    \normaloffset =3D #4\relax
    \bindingoffset =3D #5\relax
***************
*** 9071,9076 ****
--- 11200,11213 ----
      % whatever layout pdftex was dumped with.
      \pdfhorigin =3D 1 true in
      \pdfvorigin =3D 1 true in
+   \else
+     \ifx\XeTeXrevision\thisisundefined
+       \special{papersize=3D#8,#7}%
+     \else
+       \pdfpageheight #7\relax
+       \pdfpagewidth #8\relax
+       % XeTeX does not have \pdfhorigin and \pdfvorigin.
+     \fi
    \fi
    %
    \setleading{\textleading}
***************
*** 9103,9109 ****
    %
    \lispnarrowing =3D 0.3in
    \tolerance =3D 700
-   \hfuzz =3D 1pt
    \contentsrightmargin =3D 0pt
    \defbodyindent =3D .5cm
  }}
--- 11240,11245 ----
***************
*** 9121,9127 ****
    %
    \lispnarrowing =3D 0.25in
    \tolerance =3D 700
-   \hfuzz =3D 1pt
    \contentsrightmargin =3D 0pt
    \defbodyindent =3D .4cm
  }}
--- 11257,11262 ----
***************
*** 9147,9153 ****
                      {297mm}{210mm}%
    %
    \tolerance =3D 700
-   \hfuzz =3D 1pt
    \contentsrightmargin =3D 0pt
    \defbodyindent =3D 5mm
  }}
--- 11282,11287 ----
***************
*** 9166,9172 ****
    %
    \lispnarrowing =3D 0.2in
    \tolerance =3D 800
-   \hfuzz =3D 1.2pt
    \contentsrightmargin =3D 0pt
    \defbodyindent =3D 2mm
    \tableindent =3D 12mm
--- 11300,11305 ----
***************
*** 9194,9199 ****
--- 11327,11344 ----
    \globaldefs =3D 0
  }}
 =20
+ \def\bsixpaper{{\globaldefs =3D 1
+   \afourpaper
+   \internalpagesizes{140mm}{100mm}%
+                     {-6.35mm}{-12.7mm}%
+                     {\bindingoffset}{14pt}%
+                     {176mm}{125mm}%
+   \let\SETdispenvsize=3D\smallword
+   \lispnarrowing =3D 0.2in
+   \globaldefs =3D 0
+ }}
+=20
+=20
  % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  % Perhaps we should allow setting the margins, \topskip, \parskip,
  % and/or leading, also. Or perhaps we should compute them somehow.
***************
*** 9207,9216 ****
    \setleading{\textleading}%
    %
    \dimen0 =3D #1\relax
!   \advance\dimen0 by \voffset
    %
    \dimen2 =3D \hsize
!   \advance\dimen2 by \normaloffset
    %
    \internalpagesizes{#1}{\hsize}%
                      {\voffset}{\normaloffset}%
--- 11352,11363 ----
    \setleading{\textleading}%
    %
    \dimen0 =3D #1\relax
!   \advance\dimen0 by 2.5in % default 1in margin above heading line
!                            % and 1.5in to include heading, footing and
!                            % bottom margin
    %
    \dimen2 =3D \hsize
!   \advance\dimen2 by 2in % default to 1 inch margin on each side
    %
    \internalpagesizes{#1}{\hsize}%
                      {\voffset}{\normaloffset}%
***************
*** 9222,9252 ****
  %
  \letterpaper
 =20
 =20
  \message{and turning on texinfo input format.}
 =20
  % DEL is a comment character, in case @c does not suffice.
  \catcode`\^^? =3D 14
 =20
  % Define macros to output various characters with catcode for normal text=
.
! \catcode`\"=3D\other
! \catcode`\~=3D\other
! \catcode`\^=3D\other
! \catcode`\_=3D\other
! \catcode`\|=3D\other
! \catcode`\<=3D\other
! \catcode`\>=3D\other
! \catcode`\+=3D\other
! \catcode`\$=3D\other
! \def\normaldoublequote{"}
! \def\normaltilde{~}
! \def\normalcaret{^}
! \def\normalunderscore{_}
! \def\normalverticalbar{|}
! \def\normalless{<}
! \def\normalgreater{>}
! \def\normalplus{+}
! \def\normaldollar{$}%$ font-lock fix
 =20
  % This macro is used to make a character print one way in \tt
  % (where it can probably be output as-is), and another way in other fonts=
,
--- 11369,11395 ----
  %
  \letterpaper
 =20
+ % Default value of \hfuzz, for suppressing warnings about overfull hboxes=
.
+ \hfuzz =3D 1pt
+=20
 =20
  \message{and turning on texinfo input format.}
 =20
+ \def^^L{\par} % remove \outer, so ^L can appear in an @comment
+=20
  % DEL is a comment character, in case @c does not suffice.
  \catcode`\^^? =3D 14
 =20
  % Define macros to output various characters with catcode for normal text=
.
! \catcode`\"=3D\other \def\normaldoublequote{"}
! \catcode`\$=3D\other \def\normaldollar{$}%$ font-lock fix
! \catcode`\+=3D\other \def\normalplus{+}
! \catcode`\<=3D\other \def\normalless{<}
! \catcode`\>=3D\other \def\normalgreater{>}
! \catcode`\^=3D\other \def\normalcaret{^}
! \catcode`\_=3D\other \def\normalunderscore{_}
! \catcode`\|=3D\other \def\normalverticalbar{|}
! \catcode`\~=3D\other \def\normaltilde{~}
 =20
  % This macro is used to make a character print one way in \tt
  % (where it can probably be output as-is), and another way in other fonts=
,
***************
*** 9265,9308 ****
  % this is not a problem.
  \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
 =20
! % Turn off all special characters except @
! % (and those which the user can use as if they were ordinary).
  % Most of these we simply print from the \tt font, but for some, we can
  % use math or other variants that look better in normal text.
!=20
  \catcode`\"=3D\active
  \def\activedoublequote{{\tt\char34}}
  \let"=3D\activedoublequote
! \catcode`\~=3D\active
! \def~{{\tt\char126}}
! \chardef\hat=3D`\^
! \catcode`\^=3D\active
! \def^{{\tt \hat}}
 =20
  \catcode`\_=3D\active
  \def_{\ifusingtt\normalunderscore\_}
- \let\realunder=3D_
- % Subroutine for the previous macro.
  \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07=
em }
 =20
- \catcode`\|=3D\active
- \def|{{\tt\char124}}
  \chardef \less=3D`\<
! \catcode`\<=3D\active
! \def<{{\tt \less}}
  \chardef \gtr=3D`\>
! \catcode`\>=3D\active
! \def>{{\tt \gtr}}
! \catcode`\+=3D\active
! \def+{{\tt \char 43}}
! \catcode`\$=3D\active
! \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
!=20
! % If a .fmt file is being used, characters that might appear in a file
! % name cannot be active until we have parsed the command line.
! % So turn them off again, and have \everyjob (or @setfilename) turn them =
on.
! % \otherifyactive is called near the end of this file.
! \def\otherifyactive{\catcode`+=3D\other \catcode`\_=3D\other}
 =20
  % Used sometimes to turn off (effectively) the active characters even aft=
er
  % parsing them.
--- 11408,11454 ----
  % this is not a problem.
  \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
 =20
! % Set catcodes for Texinfo file
!=20
! % Active characters for printing the wanted glyph.
  % Most of these we simply print from the \tt font, but for some, we can
  % use math or other variants that look better in normal text.
! %
  \catcode`\"=3D\active
  \def\activedoublequote{{\tt\char34}}
  \let"=3D\activedoublequote
! \catcode`\~=3D\active \def\activetilde{{\tt\char126}} \let~ =3D \activeti=
lde
! \chardef\hatchar=3D`\^
! \catcode`\^=3D\active \def\activehat{{\tt \hatchar}} \let^ =3D \activehat
 =20
  \catcode`\_=3D\active
  \def_{\ifusingtt\normalunderscore\_}
  \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07=
em }
+ \let\realunder=3D_
+=20
+ \catcode`\|=3D\active \def|{{\tt\char124}}
 =20
  \chardef \less=3D`\<
! \catcode`\<=3D\active \def\activeless{{\tt \less}}\let< =3D \activeless
  \chardef \gtr=3D`\>
! \catcode`\>=3D\active \def\activegtr{{\tt \gtr}}\let> =3D \activegtr
! \catcode`\+=3D\active \def+{{\tt \char 43}}
! \catcode`\$=3D\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock=
 fix
! \catcode`\-=3D\active \let-=3D\normaldash
!=20
!=20
! % used for headline/footline in the output routine, in case the page
! % breaks in the middle of an @tex block.
! \def\texinfochars{%
!   \let< =3D \activeless
!   \let> =3D \activegtr
!   \let~ =3D \activetilde
!   \let^ =3D \activehat
!   \setregularquotes
!   \let\b =3D \strong
!   \let\i =3D \smartitalic
!   % in principle, all other definitions in \tex have to be undone too.
! }
 =20
  % Used sometimes to turn off (effectively) the active characters even aft=
er
  % parsing them.
***************
*** 9316,9389 ****
  % \backslashcurfont outputs one backslash character in current font,
  % as in \char`\\.
  \global\chardef\backslashcurfont=3D`\\
- \global\let\rawbackslashxx=3D\backslashcurfont  % let existing .??s files=
 work
 =20
! % \realbackslash is an actual character `\' with catcode other, and
! % \doublebackslash is two of them (for the pdf outlines).
! {\catcode`\\=3D\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
 =20
! % In texinfo, backslash is an active character; it prints the backslash
  % in fixed width font.
! \catcode`\\=3D\active
! @def@normalbackslash{{@tt@backslashcurfont}}
! % On startup, @fixbackslash assigns:
! %  @let \ =3D @normalbackslash
 =20
- % \rawbackslash defines an active \ to do \backslashcurfont.
  % \otherbackslash defines an active \ to be a literal `\' character with
  % catcode other.
- @gdef@rawbackslash{@let\=3D@backslashcurfont}
  @gdef@otherbackslash{@let\=3D@realbackslash}
 =20
  % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  % the literal character `\'.
  %
! @def@normalturnoffactive{%
!   @let\=3D@normalbackslash
!   @let"=3D@normaldoublequote
!   @let~=3D@normaltilde
!   @let^=3D@normalcaret
!   @let_=3D@normalunderscore
!   @let|=3D@normalverticalbar
!   @let<=3D@normalless
!   @let>=3D@normalgreater
!   @let+=3D@normalplus
!   @let$=3D@normaldollar %$ font-lock fix
!   @markupsetuplqdefault
!   @markupsetuprqdefault
!   @unsepspaces
! }
!=20
! % Make _ and + \other characters, temporarily.
! % This is canceled by @fixbackslash.
! @otherifyactive
 =20
  % If a .fmt file is being used, we don't want the `\input texinfo' to sho=
w up.
  % That is what \eatinput is for; after that, the `\' should revert to pri=
nting
  % a backslash.
! %
! @gdef@eatinput input texinfo{@fixbackslash}
! @global@let\ =3D @eatinput
 =20
- % On the other hand, perhaps the file did not have a `\input texinfo'. Th=
en
- % the first `\' in the file would cause an error. This macro tries to fix
- % that, assuming it is called before the first `\' could plausibly occur.
- % Also turn back on active characters that might appear in the input
- % file name, in case not using a pre-dumped format.
- %
  @gdef@fixbackslash{%
!   @ifx\@eatinput @let\ =3D @normalbackslash @fi
    @catcode`+=3D@active
    @catcode`@_=3D@active
  }
 =20
  % Say @foo, not \foo, in error messages.
  @escapechar =3D `@@
 =20
  % These look ok in all fonts, so just make them not special.
! @catcode`@& =3D @other
! @catcode`@# =3D @other
! @catcode`@% =3D @other
 =20
  @c Finally, make ` and ' active, so that txicodequoteundirected and
  @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
--- 11462,11594 ----
  % \backslashcurfont outputs one backslash character in current font,
  % as in \char`\\.
  \global\chardef\backslashcurfont=3D`\\
 =20
! % \realbackslash is an actual character `\' with catcode other.
! {\catcode`\\=3D\other @gdef@realbackslash{\}}
 =20
! % In Texinfo, backslash is an active character; it prints the backslash
  % in fixed width font.
! \catcode`\\=3D\active  % @ for escape char from now on.
!=20
! % Print a typewriter backslash.  For math mode, we can't simply use
! % \backslashcurfont: the story here is that in math mode, the \char
! % of \backslashcurfont ends up printing the roman \ from the math symbol
! % font (because \char in math mode uses the \mathcode, and plain.tex
! % sets \mathcode`\\=3D"026E).  Hence we use an explicit \mathchar,
! % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
! % ignored family value; char position "5C).  We can't use " for the
! % usual hex value because it has already been made active.
!=20
! @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi=
}}
! @let@backslashchar =3D @ttbackslash % @backslashchar{} is for user docume=
nts.
 =20
  % \otherbackslash defines an active \ to be a literal `\' character with
  % catcode other.
  @gdef@otherbackslash{@let\=3D@realbackslash}
 =20
  % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  % the literal character `\'.
  %
! {@catcode`- =3D @active
!  @gdef@normalturnoffactive{%
!    @passthroughcharstrue
!    @let-=3D@normaldash
!    @let"=3D@normaldoublequote
!    @let$=3D@normaldollar %$ font-lock fix
!    @let+=3D@normalplus
!    @let<=3D@normalless
!    @let>=3D@normalgreater
!    @let^=3D@normalcaret
!    @let_=3D@normalunderscore
!    @let|=3D@normalverticalbar
!    @let~=3D@normaltilde
!    @let\=3D@ttbackslash
!    @setregularquotes
!    @unsepspaces
!  }
! }
 =20
+ % If a .fmt file is being used, characters that might appear in a file
+ % name cannot be active until we have parsed the command line.
+ % So turn them off again, and have @fixbackslash turn them back on.
+ @catcode`+=3D@other @catcode`@_=3D@other
+=20
+ % \enablebackslashhack - allow file to begin `\input texinfo'
+ %
  % If a .fmt file is being used, we don't want the `\input texinfo' to sho=
w up.
  % That is what \eatinput is for; after that, the `\' should revert to pri=
nting
  % a backslash.
! % If the file did not have a `\input texinfo', then it is turned off afte=
r
! % the first line; otherwise the first `\' in the file would cause an erro=
r.
! % This is used on the very last line of this file, texinfo.tex.
! % We also use @c to call @fixbackslash, in case ends of lines are hidden.
! {
! @catcode`@^=3D7
! @catcode`@^^M=3D13@gdef@enablebackslashhack{%
!   @global@let\ =3D @eatinput%
!   @catcode`@^^M=3D13%
!   @def@c{@fixbackslash@c}%
!   % Definition for the newline at the end of this file.
!   @def ^^M{@let^^M@secondlinenl}%
!   % Definition for a newline in the main Texinfo file.
!   @gdef @secondlinenl{@fixbackslash}%
!   % In case the first line has a whole-line command on it
!   @let@originalparsearg@parsearg
!   @def@parsearg{@fixbackslash@originalparsearg}
! }}
!=20
! {@catcode`@^=3D7 @catcode`@^^M=3D13%
! @gdef@eatinput input texinfo#1^^M{@fixbackslash}}
!=20
! % Emergency active definition of newline, in case an active newline token
! % appears by mistake.
! {@catcode`@^=3D7 @catcode13=3D13%
! @gdef@enableemergencynewline{%
!   @gdef^^M{%
!     @par%
!     %<warning: active newline>@par%
! }}}
!=20
 =20
  @gdef@fixbackslash{%
!   @ifx\@eatinput @let\ =3D @ttbackslash @fi
!   @catcode13=3D5 % regular end of line
!   @enableemergencynewline
!   @let@c=3D@comment
!   @let@parsearg@originalparsearg
!   % Also turn back on active characters that might appear in the input
!   % file name, in case not using a pre-dumped format.
    @catcode`+=3D@active
    @catcode`@_=3D@active
+   %
+   % If texinfo.cnf is present on the system, read it.
+   % Useful for site-wide @afourpaper, etc.  This macro, @fixbackslash, ge=
ts
+   % called at the beginning of every Texinfo file.  Not opening texinfo.c=
nf
+   % directly in this file, texinfo.tex, makes it possible to make a forma=
t
+   % file for Texinfo.
+   %
+   @openin 1 texinfo.cnf
+   @ifeof 1 @else @input texinfo.cnf @fi
+   @closein 1
  }
 =20
+=20
  % Say @foo, not \foo, in error messages.
  @escapechar =3D `@@
 =20
+ % These (along with & and #) are made active for url-breaking, so need
+ % active definitions as the normal characters.
+ @def@normaldot{.}
+ @def@normalquest{?}
+ @def@normalslash{/}
+=20
  % These look ok in all fonts, so just make them not special.
! % @hashchar{} gets its own user-level command, because of #line.
! @catcode`@& =3D @other @def@normalamp{&}
! @catcode`@# =3D @other @def@normalhash{#}
! @catcode`@% =3D @other @def@normalpercent{%}
!=20
! @let @hashchar =3D @normalhash
 =20
  @c Finally, make ` and ' active, so that txicodequoteundirected and
  @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
***************
*** 9391,9402 ****
  @c Do this last of all since we use ` in the previous @catcode assignment=
s.
  @catcode`@'=3D@active
  @catcode`@`=3D@active
! @markupsetuplqdefault
! @markupsetuprqdefault
 =20
  @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: "}"
--- 11596,11606 ----
  @c Do this last of all since we use ` in the previous @catcode assignment=
s.
  @catcode`@'=3D@active
  @catcode`@`=3D@active
! @setregularquotes
 =20
  @c Local variables:
! @c eval: (add-hook 'before-save-hook 'time-stamp)
! @c page-delimiter: "^\\\\message\\|emacs-page"
  @c time-stamp-start: "def\\\\texinfoversion{"
  @c time-stamp-format: "%:y-%02m-%02d.%02H"
  @c time-stamp-end: "}"
***************
*** 9404,9409 ****
 =20
  @c vim:sw=3D2:
 =20
! @ignore
!    arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
! @end ignore
--- 11608,11612 ----
 =20
  @c vim:sw=3D2:
 =20
! @enablebackslashhack
!=20
Index: gtags-cscope/command.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /sources/global/global/gtags-cscope/command.c,v
retrieving revision 1.15
diff -c -r1.15 command.c
*** gtags-cscope/command.c=0915 Mar 2018 00:44:29 -0000=091.15
--- gtags-cscope/command.c=094 May 2024 18:43:05 -0000
***************
*** 1,7 ****
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation=20
   All rights reserved.
! =20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
--- 1,7 ----
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation
   All rights reserved.
!=20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
***************
*** 14,20 ****
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.=20
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
--- 14,20 ----
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
***************
*** 27,33 ****
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.=20
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
  /*
--- 27,33 ----
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
  /*
***************
*** 111,117 ****
  =09rebuild();
  =09postmsg("");
  =09totallines =3D 0;
! =09disprefs =3D 0;=09
  =09topline =3D nextline =3D 1;
  =09selecting =3D 0;
  =09break;
--- 111,117 ----
  =09rebuild();
  =09postmsg("");
  =09totallines =3D 0;
! =09disprefs =3D 0;
  =09topline =3D nextline =3D 1;
  =09selecting =3D 0;
  =09break;
***************
*** 127,133 ****
  =09if (p->button =3D=3D '0') {
  =09    scrollbar(p);
  =09    break;
! =09}=20
  =09/* ignore a sweep */
  =09if (p->x2 >=3D 0) {
  =09    return(NO);
--- 127,133 ----
  =09if (p->button =3D=3D '0') {
  =09    scrollbar(p);
  =09    break;
! =09}
  =09/* ignore a sweep */
  =09if (p->x2 >=3D 0) {
  =09    return(NO);
***************
*** 183,189 ****
      case ctrl('N'):
  #ifdef KEY_DOWN
      case KEY_DOWN:
! #endif=09=09
  #ifdef KEY_RIGHT
      case KEY_RIGHT:
  #endif
--- 183,189 ----
      case ctrl('N'):
  #ifdef KEY_DOWN
      case KEY_DOWN:
! #endif
  #ifdef KEY_RIGHT
      case KEY_RIGHT:
  #endif
***************
*** 206,212 ****
  #ifdef KEY_UP
      case KEY_UP:
  #endif
! #ifdef KEY_LEFT=09=09
      case KEY_LEFT:
  #endif
  =09if (selecting) {
--- 206,212 ----
  #ifdef KEY_UP
      case KEY_UP:
  #endif
! #ifdef KEY_LEFT
      case KEY_LEFT:
  #endif
  =09if (selecting) {
***************
*** 262,268 ****
  =09if (totallines =3D=3D 0) {
  =09    return(NO);
  =09}
! =09/* note: seekline() is not used to move to the next=20
  =09 * page because display() leaves the file pointer at
  =09 * the next page to optimize paging forward
  =09 */
--- 262,268 ----
  =09if (totallines =3D=3D 0) {
  =09    return(NO);
  =09}
! =09/* note: seekline() is not used to move to the next
  =09 * page because display() leaves the file pointer at
  =09 * the next page to optimize paging forward
  =09 */
***************
*** 314,320 ****
  =09=09c =3D '\0';
  =09=09s =3D "a";
  =09    }
! =09    if (c !=3D '\r' &&=20
  =09=09mygetline("", newpat,
  =09=09=09  COLS - sizeof(appendprompt), c, NO) > 0
  =09=09) {
--- 314,320 ----
  =09=09c =3D '\0';
  =09=09s =3D "a";
  =09    }
! =09    if (c !=3D '\r' &&
  =09=09mygetline("", newpat,
  =09=09=09  COLS - sizeof(appendprompt), c, NO) > 0
  =09=09) {
***************
*** 459,465 ****
  =09return(NO);
 =20
      case '!':=09/* shell escape */
! =09execute(shell, shell, NULL);
  =09seekline(topline);
  =09break;
 =20
--- 459,465 ----
  =09return(NO);
 =20
      case '!':=09/* shell escape */
!         execute(shell, NULL, NULL);
  =09seekline(topline);
  =09break;
 =20
***************
*** 577,583 ****
  =09=09=09return(changestring());
  =09=09    }
 =20
! =09=09} else if (field =3D=3D FILENAME &&=20
  =09=09=09   access(newpat, READ) =3D=3D 0) {
  =09=09    /* try to edit the file anyway */
  =09=09    edit(newpat, "1");
--- 577,583 ----
  =09=09=09return(changestring());
  =09=09    }
 =20
! =09=09} else if (field =3D=3D FILENAME &&
  =09=09=09   access(newpat, READ) =3D=3D 0) {
  =09=09    /* try to edit the file anyway */
  =09=09    edit(newpat, "1");
***************
*** 667,676 ****
  =09display();
      same:
  =09atchange();
! =09=09
  =09/* get a character from the terminal */
  =09if ((c =3D mygetch()) =3D=3D EOF
! =09    || c =3D=3D ctrl('D')=20
  =09    || c =3D=3D ctrl('Z')) {
  =09    break;=09/* change lines */
  =09}
--- 667,676 ----
  =09display();
      same:
  =09atchange();
!=20
  =09/* get a character from the terminal */
  =09if ((c =3D mygetch()) =3D=3D EOF
! =09    || c =3D=3D ctrl('D')
  =09    || c =3D=3D ctrl('Z')) {
  =09    break;=09/* change lines */
  =09}
***************
*** 762,778 ****
      fprintf(script, "ed - <<\\!\n");
      *oldfile =3D '\0';
      seekline(1);
!     for (i =3D 0;=20
  =09 fscanf(refsfound, "%" PATHLEN_STR "s%*s%" NUMLEN_STR "s%*[^\n]", newf=
ile, linenum) =3D=3D 2;
  =09 ++i) {
  =09strcpy(newfile, decode_path(newfile));
  =09/* see if the line is to be changed */
  =09if (change[i] =3D=3D YES) {
  =09    anymarked =3D YES;
! =09=09
  =09    /* if this is a new file */
  =09    if (strcmp(newfile, oldfile) !=3D 0) {
! =09=09=09=09
  =09=09/* make sure it can be changed */
  =09=09if (access(newfile, WRITE) !=3D 0) {
  =09=09    snprintf(msg, sizeof(msg), "Cannot write to file %s", newfile);
--- 762,778 ----
      fprintf(script, "ed - <<\\!\n");
      *oldfile =3D '\0';
      seekline(1);
!     for (i =3D 0;
  =09 fscanf(refsfound, "%" PATHLEN_STR "s%*s%" NUMLEN_STR "s%*[^\n]", newf=
ile, linenum) =3D=3D 2;
  =09 ++i) {
  =09strcpy(newfile, decode_path(newfile));
  =09/* see if the line is to be changed */
  =09if (change[i] =3D=3D YES) {
  =09    anymarked =3D YES;
!=20
  =09    /* if this is a new file */
  =09    if (strcmp(newfile, oldfile) !=3D 0) {
!=20
  =09=09/* make sure it can be changed */
  =09=09if (access(newfile, WRITE) !=3D 0) {
  =09=09    snprintf(msg, sizeof(msg), "Cannot write to file %s", newfile);
***************
*** 805,811 ****
  =09=09=09putc(tolower((unsigned char)*s), script);
  =09=09    }
  =09=09    putc(']', script);
! =09=09} else=09
  =09=09    putc(*s, script);
  =09    }
  =09    putc('/', script);=09=09=09/* to */
--- 805,811 ----
  =09=09=09putc(tolower((unsigned char)*s), script);
  =09=09    }
  =09=09    putc(']', script);
! =09=09} else
  =09=09    putc(*s, script);
  =09    }
  =09    putc('/', script);=09=09=09/* to */
***************
*** 823,834 ****
 =20
      /* if any line was marked */
      if (anymarked =3D=3D YES) {
! =09=09
  =09/* edit the files */
  =09clearprompt();
  =09refresh();
  =09fprintf(stderr, "Changed lines:\n\r");
! =09execute("sh", "sh", temp2, NULL);
  =09askforreturn();
  =09seekline(1);
      } else {
--- 823,834 ----
 =20
      /* if any line was marked */
      if (anymarked =3D=3D YES) {
!=20
  =09/* edit the files */
  =09clearprompt();
  =09refresh();
  =09fprintf(stderr, "Changed lines:\n\r");
! =09execute("sh", NULL, temp2, NULL);
  =09askforreturn();
  =09seekline(1);
      } else {
***************
*** 847,853 ****
  mark(unsigned int i)
  {
      unsigned int j;
! =09
      j =3D i + topline - 1;
      if (j < totallines) {
  =09move(displine[i], 1);
--- 847,853 ----
  mark(unsigned int i)
  {
      unsigned int j;
!=20
      j =3D i + topline - 1;
      if (j < totallines) {
  =09move(displine[i], 1);
***************
*** 872,884 ****
  =09return;
      }
      switch (p->percent) {
! =09=09
      case 101: /* scroll down one page */
  =09if (nextline + mdisprefs > totallines) {
  =09    nextline =3D totallines - mdisprefs + 1;
  =09}
  =09break;
! =09=09
      case 102: /* scroll up one page */
  =09nextline =3D topline - mdisprefs;
  =09if (nextline < 1) {
--- 872,884 ----
  =09return;
      }
      switch (p->percent) {
!=20
      case 101: /* scroll down one page */
  =09if (nextline + mdisprefs > totallines) {
  =09    nextline =3D totallines - mdisprefs + 1;
  =09}
  =09break;
!=20
      case 102: /* scroll up one page */
  =09nextline =3D topline - mdisprefs;
  =09if (nextline < 1) {
***************
*** 889,895 ****
      case 103: /* scroll down one line */
  =09nextline =3D topline + 1;
  =09break;
! =09=09
      case 104: /* scroll up one line */
  =09if (topline > 1) {
  =09    nextline =3D topline - 1;
--- 889,895 ----
      case 103: /* scroll down one line */
  =09nextline =3D topline + 1;
  =09break;
!=20
      case 104: /* scroll up one line */
  =09if (topline > 1) {
  =09    nextline =3D topline - 1;
***************
*** 954,960 ****
      rewind(refsfound);
 =20
      /* restrict the width of displayed columns */
!     /* HBB FIXME 20060419: magic number alert! */=20
      i =3D (COLS - 5) / 3;
      if (ogs =3D=3D YES) {
  =09i =3D (COLS - 7) / 5;
--- 954,960 ----
      rewind(refsfound);
 =20
      /* restrict the width of displayed columns */
!     /* HBB FIXME 20060419: magic number alert! */
      i =3D (COLS - 5) / 3;
      if (ogs =3D=3D YES) {
  =09i =3D (COLS - 7) / 5;
Index: gtags-cscope/edit.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /sources/global/global/gtags-cscope/edit.c,v
retrieving revision 1.10
diff -c -r1.10 edit.c
*** gtags-cscope/edit.c=098 Sep 2015 03:22:52 -0000=091.10
--- gtags-cscope/edit.c=094 May 2024 18:43:05 -0000
***************
*** 1,7 ****
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation=20
   All rights reserved.
! =20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
--- 1,7 ----
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation
   All rights reserved.
!=20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
***************
*** 14,20 ****
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.=20
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
--- 14,20 ----
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
***************
*** 27,33 ****
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.=20
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
  /*
--- 27,33 ----
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
  /*
***************
*** 59,65 ****
  =09}
  =09/* get the selected line */
  =09seekline(i + topline);
! =09
  =09/* get the file name and line number */
  =09if (fscanf(refsfound, "%" PATHLEN_STR "s%*s%" NUMLEN_STR "s", file, li=
nenum) =3D=3D 2) {
  =09=09edit(decode_path(file), linenum);=09/* edit it */
--- 59,65 ----
  =09}
  =09/* get the selected line */
  =09seekline(i + topline);
!=20
  =09/* get the file name and line number */
  =09if (fscanf(refsfound, "%" PATHLEN_STR "s%*s%" NUMLEN_STR "s", file, li=
nenum) =3D=3D 2) {
  =09=09edit(decode_path(file), linenum);=09/* edit it */
***************
*** 82,88 ****
  =09}
  =09/* get the first line */
  =09seekline(1);
! =09
  =09/* get each file name and line number */
  =09while (fscanf(refsfound, "%" PATHLEN_STR "s%*s%" NUMLEN_STR "s%*[^\n]"=
, file, linenum) =3D=3D 2) {
  =09=09edit(decode_path(file), linenum);=09/* edit it */
--- 82,88 ----
  =09}
  =09/* get the first line */
  =09seekline(1);
!=20
  =09/* get each file name and line number */
  =09while (fscanf(refsfound, "%" PATHLEN_STR "s%*s%" NUMLEN_STR "s%*[^\n]"=
, file, linenum) =3D=3D 2) {
  =09=09edit(decode_path(file), linenum);=09/* edit it */
***************
*** 95,101 ****
  =09}
  =09seekline(topline);
  }
! =09
  /** call the editor */
 =20
  void
--- 95,101 ----
  =09}
  =09seekline(topline);
  }
!=20
  /** call the editor */
 =20
  void
***************
*** 111,126 ****
  =09(void) snprintf(plusnum, sizeof(plusnum), lineflag, linenum);
  =09/* if this is the more or page commands */
  =09if (strcmp(s =3D mybasename(editor), "more") =3D=3D 0 || strcmp(s, "pa=
ge") =3D=3D 0) {
! =09=09
  =09=09/* get it to pause after displaying a file smaller than the screen
  =09=09   length */
! =09=09(void) execute(editor, editor, plusnum, file, NULL_DEVICE, NULL);
! =09}
! =09else if (lineflagafterfile) {
! =09=09(void) execute(editor, editor, file, plusnum, NULL);
! =09}
! =09else {
! =09=09(void) execute(editor, editor, plusnum, file, NULL);
  =09}
  =09clear();=09/* redisplay screen */
  }
--- 111,133 ----
  =09(void) snprintf(plusnum, sizeof(plusnum), lineflag, linenum);
  =09/* if this is the more or page commands */
  =09if (strcmp(s =3D mybasename(editor), "more") =3D=3D 0 || strcmp(s, "pa=
ge") =3D=3D 0) {
!=20
  =09=09/* get it to pause after displaying a file smaller than the screen
  =09=09   length */
!             if (editor_options)
! =09=09(void) execute(editor, editor_options, plusnum, file, NULL_DEVICE, =
NULL);
!             else
! =09=09(void) execute(editor, NULL, plusnum, file, NULL_DEVICE, NULL);
! =09} else if (lineflagafterfile) {
!             if (editor_options)
! =09=09(void) execute(editor, editor_options, file, plusnum, NULL);
!             else
! =09=09(void) execute(editor, NULL, file, plusnum, NULL);
! =09} else {
!             if (editor_options)
! =09=09(void) execute(editor, editor_options, plusnum, file, NULL);
!             else
! =09=09(void) execute(editor, NULL, plusnum, file, NULL);
  =09}
  =09clear();=09/* redisplay screen */
  }
***************
*** 131,137 ****
  filepath(char *file)
  {
  =09static=09char=09path[PATHLEN + 1];
! =09
  =09if (prependpath !=3D NULL && *file !=3D '/') {
  =09=09(void) snprintf(path, sizeof(path), "%s/%s", prependpath, file);
  =09=09file =3D path;
--- 138,144 ----
  filepath(char *file)
  {
  =09static=09char=09path[PATHLEN + 1];
!=20
  =09if (prependpath !=3D NULL && *file !=3D '/') {
  =09=09(void) snprintf(path, sizeof(path), "%s/%s", prependpath, file);
  =09=09file =3D path;
Index: gtags-cscope/exec.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /sources/global/global/gtags-cscope/exec.c,v
retrieving revision 1.6
diff -c -r1.6 exec.c
*** gtags-cscope/exec.c=098 Sep 2015 03:22:52 -0000=091.6
--- gtags-cscope/exec.c=094 May 2024 18:43:05 -0000
***************
*** 1,7 ****
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation=20
   All rights reserved.
! =20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
--- 1,7 ----
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation
   All rights reserved.
!=20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
***************
*** 14,20 ****
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.=20
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
--- 14,20 ----
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
***************
*** 27,33 ****
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.=20
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
  /*
--- 27,33 ----
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
  /*
***************
*** 72,91 ****
 =20
  /*VARARGS1*/
  int
! execute(char *a, ...)=09/* note: "exec" is already defined on u370 */
  {
  =09va_list=09ap;
  =09int=09exitcode =3D -1;=09/* initialize, to avoid warning */
  =09char=09*argv[BUFSIZ];
! =09pid_t=09p;
 =20
  =09/* fork and exec the program or shell script */
  =09endwin();=09/* restore the terminal modes */
  =09mousecleanup();
  =09fflush(stdout);
! =09va_start(ap, a);
! =09for (p =3D 0; (argv[p] =3D va_arg(ap, char *)) !=3D 0; p++)
! =09=09;
  #if !HAVE_FORK
  =09/* HBB 20010313: in MSDOG, everything is completely different.
  =09 * No fork()/exec()/wait(), but rather a single libc call: */
--- 72,99 ----
 =20
  /*VARARGS1*/
  int
! execute(char *a, char **opts, ...)=09/* note: "exec" is already defined o=
n u370 */
  {
  =09va_list=09ap;
  =09int=09exitcode =3D -1;=09/* initialize, to avoid warning */
  =09char=09*argv[BUFSIZ];
! =09pid_t=09p =3D 0;
 =20
  =09/* fork and exec the program or shell script */
  =09endwin();=09/* restore the terminal modes */
  =09mousecleanup();
  =09fflush(stdout);
! =09va_start(ap, opts);
!         argv[0] =3D a; p++; /* the first argument should be the executabl=
e's name */
!=20
!         if (opts) {
!             for (int i =3D 0; opts[i] !=3D 0; i++) {
!                 argv[p] =3D opts[i]; p++;
!             }
!         }
!=20
! =09for (; (argv[p] =3D va_arg(ap, char *)) !=3D 0; p++)
!             ;
  #if !HAVE_FORK
  =09/* HBB 20010313: in MSDOG, everything is completely different.
  =09 * No fork()/exec()/wait(), but rather a single libc call: */
***************
*** 98,107 ****
  =09=09exitcode =3D join(p);=09/* parent */
  =09}
  #endif /* MSDOS */
! =09
  =09/* the menu and scrollbar may be changed by the command executed */
  #if UNIXPC || !TERMINFO
! # ifndef __DJGPP__ /* leave CRLF handling as is */     =20
  =09nonl();
  # endif
  =09raw();=09/* endwin() turns off cbreak mode so restore it */
--- 106,115 ----
  =09=09exitcode =3D join(p);=09/* parent */
  =09}
  #endif /* MSDOS */
!=20
  =09/* the menu and scrollbar may be changed by the command executed */
  #if UNIXPC || !TERMINFO
! # ifndef __DJGPP__ /* leave CRLF handling as is */
  =09nonl();
  # endif
  =09raw();=09/* endwin() turns off cbreak mode so restore it */
***************
*** 122,128 ****
  myexecvp(char *a, char **args)
  {
      char    msg[MSGLEN + 1];
! =09
      /* modify argv[0] to reference the last component of its path name */
      args[0] =3D mybasename(args[0]);
 =20
--- 130,136 ----
  myexecvp(char *a, char **args)
  {
      char    msg[MSGLEN + 1];
!=20
      /* modify argv[0] to reference the last component of its path name */
      args[0] =3D mybasename(args[0]);
 =20
***************
*** 144,157 ****
  =09pid_t=09p;=09=09/* process number */
 =20
  =09p =3D fork();
! =09
  =09/* the parent ignores the interrupt, quit, and hangup signals */
  =09if (p > 0) {
  =09=09oldsigquit =3D signal(SIGQUIT, SIG_IGN);
  =09=09oldsighup =3D signal(SIGHUP, SIG_IGN);
! #ifdef SIGTSTP=09=09
  =09=09oldsigtstp =3D signal(SIGTSTP, SIG_DFL);
! #endif=09=09
  =09}
  =09/* so they can be used to stop the child */
  =09else if (p =3D=3D 0) {
--- 152,165 ----
  =09pid_t=09p;=09=09/* process number */
 =20
  =09p =3D fork();
!=20
  =09/* the parent ignores the interrupt, quit, and hangup signals */
  =09if (p > 0) {
  =09=09oldsigquit =3D signal(SIGQUIT, SIG_IGN);
  =09=09oldsighup =3D signal(SIGHUP, SIG_IGN);
! #ifdef SIGTSTP
  =09=09oldsigtstp =3D signal(SIGTSTP, SIG_DFL);
! #endif
  =09}
  =09/* so they can be used to stop the child */
  =09else if (p =3D=3D 0) {
***************
*** 160,166 ****
  =09=09signal(SIGHUP, SIG_DFL);
  #ifdef SIGTSTP
  =09=09signal(SIGTSTP, SIG_DFL);
! #endif=09=09=09
  =09}
  =09/* check for fork failure */
  =09if (p =3D=3D -1) {
--- 168,174 ----
  =09=09signal(SIGHUP, SIG_DFL);
  #ifdef SIGTSTP
  =09=09signal(SIGTSTP, SIG_DFL);
! #endif
  =09}
  =09/* check for fork failure */
  =09if (p =3D=3D -1) {
***************
*** 172,180 ****
  /** join is the compliment of fork */
 =20
  static int
! join(pid_t p)=20
  {
! =09int=09status; =20
  =09pid_t=09w;
 =20
  =09/* wait for the correct child to exit */
--- 180,188 ----
  /** join is the compliment of fork */
 =20
  static int
! join(pid_t p)
  {
! =09int=09status;
  =09pid_t=09w;
 =20
  =09/* wait for the correct child to exit */
***************
*** 187,193 ****
  =09signal(SIGHUP, oldsighup);
  #ifdef SIGTSTP
  =09signal(SIGTSTP, oldsigtstp);
! #endif=09
 =20
  =09/* return the child's exit code */
  =09return(status >> 8);
--- 195,201 ----
  =09signal(SIGHUP, oldsighup);
  #ifdef SIGTSTP
  =09signal(SIGTSTP, oldsigtstp);
! #endif
 =20
  =09/* return the child's exit code */
  =09return(status >> 8);
Index: gtags-cscope/global-cscope.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /sources/global/global/gtags-cscope/global-cscope.h,v
retrieving revision 1.9
diff -c -r1.9 global-cscope.h
*** gtags-cscope/global-cscope.h=0915 May 2019 18:36:51 -0000=091.9
--- gtags-cscope/global-cscope.h=094 May 2024 18:43:05 -0000
***************
*** 1,7 ****
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation=20
   All rights reserved.
! =20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
--- 1,7 ----
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation
   All rights reserved.
!=20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
***************
*** 14,20 ****
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.=20
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
--- 14,20 ----
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
***************
*** 27,33 ****
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.=20
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
  /* $Id: global-cscope.h,v 1.9 2019/05/15 18:36:51 h-iwamoto Exp $ */
--- 27,33 ----
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
  /* $Id: global-cscope.h,v 1.9 2019/05/15 18:36:51 h-iwamoto Exp $ */
***************
*** 72,78 ****
  # ifndef HAVE_MEMSET
  #  ifndef HAVE_MEMORY_H
  char=09*memset();
! #  else=20
  #   include <memory.h>=09/* memset */
  #  endif /*V9*/
  # endif /* HAVE_MEMSET */
--- 72,78 ----
  # ifndef HAVE_MEMSET
  #  ifndef HAVE_MEMORY_H
  char=09*memset();
! #  else
  #   include <memory.h>=09/* memset */
  #  endif /*V9*/
  # endif /* HAVE_MEMSET */
***************
*** 98,106 ****
  #if BSD
  # undef=09tolower=09=09/* BSD toupper and tolower don't test the characte=
r */
  # undef=09toupper
! # define=09tolower(c)=09(isupper(c) ? (c) - 'A' + 'a' : (c))=09
  # define=09toupper(c)=09(islower(c) ? (c) - 'a' + 'A' : (c))
! # if !sun=20
  #  if !__FreeBSD__
  /* in traditional BSD, *printf() doesn't return the number of bytes
   * written */
--- 98,106 ----
  #if BSD
  # undef=09tolower=09=09/* BSD toupper and tolower don't test the characte=
r */
  # undef=09toupper
! # define=09tolower(c)=09(isupper(c) ? (c) - 'A' + 'a' : (c))
  # define=09toupper(c)=09(islower(c) ? (c) - 'a' + 'A' : (c))
! # if !sun
  #  if !__FreeBSD__
  /* in traditional BSD, *printf() doesn't return the number of bytes
   * written */
***************
*** 115,121 ****
  /* #define SHORT_NAMES_ONLY */
 =20
  /* Just in case autoconf didn't correctly flag HAVE_FIXKEYPAD */
! #ifndef HAVE_FIXKEYPAD=20
  # if SVR2 && !BSD && !V9 && !u3b2 && !sun
  #  define HAVE_FIXKEYPAD
  # endif
--- 115,121 ----
  /* #define SHORT_NAMES_ONLY */
 =20
  /* Just in case autoconf didn't correctly flag HAVE_FIXKEYPAD */
! #ifndef HAVE_FIXKEYPAD
  # if SVR2 && !BSD && !V9 && !u3b2 && !sun
  #  define HAVE_FIXKEYPAD
  # endif
***************
*** 143,149 ****
  # else
  #  define O_BINARY 0x00
  # endif
! #endif=20
 =20
  #undef SETMODE
  #if O_BINARY || O_TEXT
--- 143,149 ----
  # else
  #  define O_BINARY 0x00
  # endif
! #endif
 =20
  #undef SETMODE
  #if O_BINARY || O_TEXT
***************
*** 151,157 ****
   * to actually do something */
  # ifdef HAVE_SETMODE
  #  define SETMODE(fildes, mode) setmode(fildes,mode)
! # else=20
  #  ifdef HAVE__SETMODE
  #   define SETMODE(fildes, mode) _setmode(fildes,mode)
  #  endif
--- 151,157 ----
   * to actually do something */
  # ifdef HAVE_SETMODE
  #  define SETMODE(fildes, mode) setmode(fildes,mode)
! # else
  #  ifdef HAVE__SETMODE
  #   define SETMODE(fildes, mode) _setmode(fildes,mode)
  #  endif
***************
*** 163,169 ****
  #ifdef R_OK
  # define=09READ=09R_OK
  #else
! # define=09READ=094=09
  #endif
  #ifdef W_OK
  # define=09WRITE=09W_OK
--- 163,169 ----
  #ifdef R_OK
  # define=09READ=09R_OK
  #else
! # define=09READ=094
  #endif
  #ifdef W_OK
  # define=09WRITE=09W_OK
***************
*** 216,222 ****
  };
 =20
  /* main.c global data */
! extern=09char=09*editor, *home, *shell, *lineflag;=09/**< environment var=
iables */
  extern=09char=09*global_command;=09=09=09/**< "global" by default */
  extern=09char=09*gtags_command;=09=09=09=09/**< "gtags" by default */
  extern=09char=09*home;=09=09/**< Home directory */
--- 216,224 ----
  };
 =20
  /* main.c global data */
! extern=09char=09*editor, *home, *shell, *lineflag; /**< environment varia=
bles */
! extern=09char=09**editor_options; /** The editor options if any */
! extern  int     options_number;
  extern=09char=09*global_command;=09=09=09/**< "global" by default */
  extern=09char=09*gtags_command;=09=09=09=09/**< "gtags" by default */
  extern=09char=09*home;=09=09/**< Home directory */
***************
*** 274,280 ****
  extern=09BOOL=09unixpcmouse;=09=09/**< UNIX PC mouse interface */
  #endif
 =20
! /* cscope functions called from more than one function or between files *=
/=20
 =20
  char=09*filepath(char *file);
  char=09*findcalledby(char *pattern);
--- 276,282 ----
  extern=09BOOL=09unixpcmouse;=09=09/**< UNIX PC mouse interface */
  #endif
 =20
! /* cscope functions called from more than one function or between files *=
/
 =20
  char=09*filepath(char *file);
  char=09*findcalledby(char *pattern);
***************
*** 358,363 ****
  int=09egrep(char *file, FILE *output, char *format);
  int=09mygetline(char p[], char s[], unsigned size, int firstchar, BOOL is=
caseless);
  int=09mygetch(void);
! int=09execute(char *a, ...);
 =20
  #endif /* CSCOPE_GLOBAL_H */
--- 360,365 ----
  int=09egrep(char *file, FILE *output, char *format);
  int=09mygetline(char p[], char s[], unsigned size, int firstchar, BOOL is=
caseless);
  int=09mygetch(void);
! int=09execute(char *a, char **opts, ...);
 =20
  #endif /* CSCOPE_GLOBAL_H */
Index: gtags-cscope/gtags-cscope.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /sources/global/global/gtags-cscope/gtags-cscope.c,v
retrieving revision 1.34
diff -c -r1.34 gtags-cscope.c
*** gtags-cscope/gtags-cscope.c=0912 Jan 2018 00:18:02 -0000=091.34
--- gtags-cscope/gtags-cscope.c=094 May 2024 18:43:05 -0000
***************
*** 1,7 ****
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation=20
   All rights reserved.
! =20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
--- 1,7 ----
  /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
!  Copyright (c) 1998-2000, The Santa Cruz Operation
   All rights reserved.
!=20
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are m=
et:
 =20
***************
*** 14,20 ****
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.=20
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
--- 14,20 ----
 =20
   *Neither name of The Santa Cruz Operation nor the names of its contribut=
ors
   may be used to endorse or promote products derived from this software
!  without specific prior written permission.
 =20
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
   IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED T=
O,
***************
*** 27,33 ****
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.=20
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
 =20
--- 27,33 ----
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI=
CT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WA=
Y
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S=
UCH
!  DAMAGE.
   =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
 =20
 =20
***************
*** 42,47 ****
--- 42,48 ----
  #include "strbuf.h"
  #include "build.h"
  #include "version-cscope.h"=09/* FILEVERSION and FIXVERSION */
+ #include "alloc.h"
 =20
  /* for libutil */
  #include "env.h"
***************
*** 88,93 ****
--- 89,96 ----
  #define TMPDIR=09"/tmp"
 =20
  char=09*editor, *shell, *lineflag;=09/**< environment variables */
+ char    **editor_options =3D 0;              /** Editor flags if any **/
+ int     options_number =3D 0;              /** the number of options allo=
cated **/
  char=09*global_command;=09/**< "global" by default */
  char=09*gtags_command;=09=09/**< "gtags" by default */
  char=09*home;=09=09=09/**< Home directory */
***************
*** 110,116 ****
  char=09temp1[PATHLEN + 1];=09/**< temporary file name */
  char=09temp2[PATHLEN + 1];=09/**< temporary file name */
  char=09tempdirpv[PATHLEN + 1];=09/**< private temp directory */
! char=09tempstring[TEMPSTRING_LEN + 1]; /**< use this as a buffer, instead=
 of yytext,=20
  =09=09=09=09 * which had better be left alone */
  char=09*tmpdir;=09=09/**< temporary directory */
 =20
--- 113,119 ----
  char=09temp1[PATHLEN + 1];=09/**< temporary file name */
  char=09temp2[PATHLEN + 1];=09/**< temporary file name */
  char=09tempdirpv[PATHLEN + 1];=09/**< private temp directory */
! char=09tempstring[TEMPSTRING_LEN + 1]; /**< use this as a buffer, instead=
 of yytext,
  =09=09=09=09 * which had better be left alone */
  char=09*tmpdir;=09=09/**< temporary directory */
 =20
***************
*** 122,133 ****
  static=09void=09usage(void);
  int=09qflag;
 =20
  #ifdef HAVE_FIXKEYPAD
  void=09fixkeypad();
  #endif
-=20
  #if defined(KEY_RESIZE) && defined(SIGWINCH)
! void=20
  sigwinch_handler(int sig, siginfo_t *info, void *unused)
  {
      (void) sig;
--- 125,138 ----
  static=09void=09usage(void);
  int=09qflag;
 =20
+ static void get_editor_options(void);
+ static void options_string_to_vector(char * options);
+=20
  #ifdef HAVE_FIXKEYPAD
  void=09fixkeypad();
  #endif
  #if defined(KEY_RESIZE) && defined(SIGWINCH)
! void
  sigwinch_handler(int sig, siginfo_t *info, void *unused)
  {
      (void) sig;
***************
*** 149,155 ****
  #if defined(KEY_RESIZE) && defined(SIGWINCH)
      struct sigaction winch_action;
  #endif
! =09
      /* save the command name for messages */
      argv0 =3D argv[0];
 =20
--- 154,160 ----
  #if defined(KEY_RESIZE) && defined(SIGWINCH)
      struct sigaction winch_action;
  #endif
!=20
      /* save the command name for messages */
      argv0 =3D argv[0];
 =20
***************
*** 173,179 ****
  =09}
 =20
  =09for (s =3D argv[0] + 1; *s !=3D '\0'; s++) {
! =09=09=09
  =09    /* look for an input field number */
  =09    if (isdigit((unsigned char) *s)) {
  =09=09field =3D *s - '0';
--- 178,184 ----
  =09}
 =20
  =09for (s =3D argv[0] + 1; *s !=3D '\0'; s++) {
!=20
  =09    /* look for an input field number */
  =09    if (isdigit((unsigned char) *s)) {
  =09=09field =3D *s - '0';
***************
*** 261,267 ****
  =09=09    s =3D *++argv;
  =09=09}
  =09=09if (*s =3D=3D '\0') {
! =09=09    fprintf(stderr, "%s: -%c option: missing or empty value\n",=20
  =09=09=09    argv0, c);
  =09=09    goto usage;
  =09=09}
--- 266,272 ----
  =09=09    s =3D *++argv;
  =09=09}
  =09=09if (*s =3D=3D '\0') {
! =09=09    fprintf(stderr, "%s: -%c option: missing or empty value\n",
  =09=09=09    argv0, c);
  =09=09    goto usage;
  =09=09}
***************
*** 281,287 ****
  =09=09case 'p':=09/* file path components to display */
  =09=09    if (*s < '0' || *s > '9' ) {
  =09=09=09fprintf(stderr, "\
! %s: -p option: missing or invalid numeric value\n",=20
  =09=09=09=09argv0);
  =09=09=09goto usage;
  =09=09    }
--- 286,292 ----
  =09=09case 'p':=09/* file path components to display */
  =09=09    if (*s < '0' || *s > '9' ) {
  =09=09=09fprintf(stderr, "\
! %s: -p option: missing or invalid numeric value\n",
  =09=09=09=09argv0);
  =09=09=09goto usage;
  =09=09    }
***************
*** 297,303 ****
  =09=09}
  =09=09goto nextarg;
  =09    default:
! =09=09fprintf(stderr, "%s: unknown option: -%c\n", argv0,=20
  =09=09=09*s);
  =09    usage:
  =09=09usage();
--- 302,308 ----
  =09=09}
  =09=09goto nextarg;
  =09    default:
! =09=09fprintf(stderr, "%s: unknown option: -%c\n", argv0,
  =09=09=09*s);
  =09    usage:
  =09=09usage();
***************
*** 305,311 ****
  =09=09myexit(1);
  =09    } /* switch(option letter) */
  =09} /* for(option) */
!     nextarg:=09
  =09;
      } /* while(argv) */
 =20
--- 310,316 ----
  =09=09myexit(1);
  =09    } /* switch(option letter) */
  =09} /* for(option) */
!     nextarg:
  =09;
      } /* while(argv) */
 =20
***************
*** 314,319 ****
--- 319,325 ----
      editor =3D mygetenv("EDITOR", EDITOR);
      editor =3D mygetenv("VIEWER", editor); /* use viewer if set */
      editor =3D mygetenv("CSCOPE_EDITOR", editor);=09/* has last word */
+     get_editor_options(); /* Remove options from editor if any */
      home =3D mygetenv("HOME", HOME);
      global_command =3D mygetenv("GTAGSGLOBAL", "global");
      gtags_command =3D mygetenv("GTAGSGTAGS", "gtags");
***************
*** 332,338 ****
      /* make sure that tmpdir exists */
      if (lstat (tmpdir, &stat_buf)) {
  =09fprintf (stderr, "\
! cscope: Temporary directory %s does not exist or cannot be accessed\n",=
=20
  =09=09 tmpdir);
  =09fprintf (stderr, "\
  cscope: Please create the directory or set the environment variable\n\
--- 338,344 ----
      /* make sure that tmpdir exists */
      if (lstat (tmpdir, &stat_buf)) {
  =09fprintf (stderr, "\
! cscope: Temporary directory %s does not exist or cannot be accessed\n",
  =09=09 tmpdir);
  =09fprintf (stderr, "\
  cscope: Please create the directory or set the environment variable\n\
***************
*** 413,419 ****
  =09strbuf_close(sb);
      } else {
  =09if (linemode =3D=3D NO || verbosemode =3D=3D YES)    /* display if ver=
bose as well */
! =09    postmsg("Building cross-reference...");                =20
  =09rebuild();
  =09if (linemode =3D=3D NO )
              clearmsg(); /* clear any build progress message */
--- 419,425 ----
  =09strbuf_close(sb);
      } else {
  =09if (linemode =3D=3D NO || verbosemode =3D=3D YES)    /* display if ver=
bose as well */
! =09    postmsg("Building cross-reference...");
  =09rebuild();
  =09if (linemode =3D=3D NO )
              clearmsg(); /* clear any build progress message */
***************
*** 424,430 ****
 =20
      /* opendatabase(); */
 =20
!     /* if using the line oriented user interface so cscope can be a=20
         subprocess to emacs or samuel */
      if (linemode =3D=3D YES) {
  =09if (*Pattern !=3D '\0') {=09=09/* do any optional search */
--- 430,436 ----
 =20
      /* opendatabase(); */
 =20
!     /* if using the line oriented user interface so cscope can be a
         subprocess to emacs or samuel */
      if (linemode =3D=3D YES) {
  =09if (*Pattern !=3D '\0') {=09=09/* do any optional search */
***************
*** 441,450 ****
  =09}
  =09if (onesearch =3D=3D YES)
  =09    myexit(0);
! =09=09
  =09for (;;) {
  =09    char buf[PATLEN + 2];
! =09=09=09
  =09    printf(">> ");
  =09    fflush(stdout);
  =09    if (fgets(buf, sizeof(buf), stdin) =3D=3D NULL) {
--- 447,456 ----
  =09}
  =09if (onesearch =3D=3D YES)
  =09    myexit(0);
!=20
  =09for (;;) {
  =09    char buf[PATLEN + 2];
!=20
  =09    printf(">> ");
  =09    fflush(stdout);
  =09    if (fgets(buf, sizeof(buf), stdin) =3D=3D NULL) {
***************
*** 624,630 ****
  =09 * about that, but DOS absolutely needs it */
  =09if (refsfound !=3D NULL)
  =09=09fclose(refsfound);
! =09
  =09/* remove any temporary files */
  =09if (temp1[0] !=3D '\0') {
  =09=09unlink(temp1);
--- 630,636 ----
  =09 * about that, but DOS absolutely needs it */
  =09if (refsfound !=3D NULL)
  =09=09fclose(refsfound);
!=20
  =09/* remove any temporary files */
  =09if (temp1[0] !=3D '\0') {
  =09=09unlink(temp1);
***************
*** 644,646 ****
--- 650,722 ----
  =09/* HBB 20000421: be nice: free allocated data */
  =09exit(sig);
  }
+=20
+ /* Modifies editor and editor_flags when $EDITOR has options
+    (whitespace separated elements), if there are no options it will not m=
odify
+    any variable and editor_options will be null */
+ static void
+ get_editor_options(void)
+ {
+     int count =3D 0;
+     char *opts =3D editor, *_editor;
+=20
+     /* Now opts will point to where the args/opts begin */
+     for (int i =3D 0; *opts !=3D '\0'; opts++, i++)
+         if (*opts =3D=3D ' ') { count =3D i; break; }
+=20
+     /* there were no space separated elements */
+     if (count =3D=3D 0)
+         return;
+=20
+     /* Move opt to the exact arg position*/
+     for (; *opts !=3D '\0'; opts++)
+         if (*opts !=3D ' ')
+             break;
+=20
+     /* There were spaces, but just that, nothing meaningful */
+     if (*opts =3D=3D '\0') return;
+=20
+     /* Would it be better to use NAME_MAX or PATH_MAX, or any other porta=
ble
+        macro? */
+     _editor =3D malloc(256);
+     memcpy(_editor, editor, count);
+     _editor[count] =3D '\0';
+     editor =3D _editor;
+     options_string_to_vector(opts);
+ }
+=20
+ static void
+ options_string_to_vector(char *opts)
+ {
+   options_number =3D 8;
+   editor_options =3D mymalloc(options_number * sizeof(editor_options[0]))=
;
+   int count, pos;
+=20
+   for (pos =3D 0; ; pos++) {
+     for (; *opts =3D=3D ' '; opts++) ;
+=20
+     if (*opts =3D=3D '\0')
+       return;
+=20
+     if (pos > (options_number - 1)) {
+       options_number +=3D 8;
+       editor_options =3D myrealloc(editor_options, options_number * sizeo=
f(editor_options[0]));
+     }
+=20
+     for (count =3D 0; ; count++)
+       if (opts[count] =3D=3D ' ' || opts[count] =3D=3D '\0')
+         break;
+=20
+     editor_options[pos] =3D mymalloc(256);
+     memcpy(editor_options[pos], opts, count);
+=20
+     /* just in case any options or argument (or both, like in opt=3Darg) =
is bigger
+      that the expected. I have seen some long options used in QEMU */
+     if (count > 255)
+       editor_options[pos][255] =3D '\0';
+     else
+       editor_options[pos][count] =3D '\0';
+=20
+     opts +=3D count;
+   }
+ }

------=_Part_313791_1046445869.1714850420434--