summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-02-09 02:18:44 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-02-09 02:18:44 +0000
commit2daf2f782cfcd3aedc541b85f8623f97359545f0 (patch)
tree4612e42a561ef7634424adaa909d6a9f92866034 /gnu/usr.bin
parent328f35a635ee7b14c4d6f2dbddacba138e62219b (diff)
Merge conflicts, and a few details:
- Makefile.bsd-wrapper: man pages, disable NLS for now. - doc/Makefile.in: install man pages manually, remove buggy targets that would break `make clean'. - makeinfo/Makefile.in: shell failure ??? rework problematic line. - util/texindex.c: let maketempname create the file, remove race condition.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/texinfo/Makefile.am15
-rw-r--r--gnu/usr.bin/texinfo/Makefile.bsd-wrapper16
-rw-r--r--gnu/usr.bin/texinfo/Makefile.in234
-rw-r--r--gnu/usr.bin/texinfo/config.h.in248
-rw-r--r--gnu/usr.bin/texinfo/configure1266
-rw-r--r--gnu/usr.bin/texinfo/configure.in85
-rw-r--r--gnu/usr.bin/texinfo/dir-example612
-rw-r--r--gnu/usr.bin/texinfo/doc/Makefile.am54
-rw-r--r--gnu/usr.bin/texinfo/doc/Makefile.in403
-rw-r--r--gnu/usr.bin/texinfo/doc/info-stnd.texi992
-rw-r--r--gnu/usr.bin/texinfo/doc/info.texi182
-rw-r--r--gnu/usr.bin/texinfo/doc/texinfo.tex3377
-rw-r--r--gnu/usr.bin/texinfo/doc/texinfo.txi5329
-rw-r--r--gnu/usr.bin/texinfo/info/Makefile.am31
-rw-r--r--gnu/usr.bin/texinfo/info/Makefile.in362
-rw-r--r--gnu/usr.bin/texinfo/info/dir.c11
-rw-r--r--gnu/usr.bin/texinfo/info/echo-area.c20
-rw-r--r--gnu/usr.bin/texinfo/info/filesys.c197
-rw-r--r--gnu/usr.bin/texinfo/info/filesys.h17
-rw-r--r--gnu/usr.bin/texinfo/info/footnotes.c22
-rw-r--r--gnu/usr.bin/texinfo/info/footnotes.h9
-rw-r--r--gnu/usr.bin/texinfo/info/indices.c56
-rw-r--r--gnu/usr.bin/texinfo/info/info-utils.h26
-rw-r--r--gnu/usr.bin/texinfo/info/info.c499
-rw-r--r--gnu/usr.bin/texinfo/info/info.h49
-rw-r--r--gnu/usr.bin/texinfo/info/infodoc.c249
-rw-r--r--gnu/usr.bin/texinfo/info/infomap.c363
-rw-r--r--gnu/usr.bin/texinfo/info/m-x.c26
-rw-r--r--gnu/usr.bin/texinfo/info/makedoc.c37
-rw-r--r--gnu/usr.bin/texinfo/info/man.c139
-rw-r--r--gnu/usr.bin/texinfo/info/nodemenu.c10
-rw-r--r--gnu/usr.bin/texinfo/info/nodes.h42
-rw-r--r--gnu/usr.bin/texinfo/info/search.h12
-rw-r--r--gnu/usr.bin/texinfo/info/session.c1174
-rw-r--r--gnu/usr.bin/texinfo/info/termdep.h10
-rw-r--r--gnu/usr.bin/texinfo/info/terminal.c109
-rw-r--r--gnu/usr.bin/texinfo/info/tilde.c68
-rw-r--r--gnu/usr.bin/texinfo/info/variables.c2
-rw-r--r--gnu/usr.bin/texinfo/info/window.c138
-rw-r--r--gnu/usr.bin/texinfo/lib/Makefile.am5
-rw-r--r--gnu/usr.bin/texinfo/lib/system.h131
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/Makefile.am10
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/Makefile.in465
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/makeinfo.c8639
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/makeinfo.h247
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/multi.c214
-rw-r--r--gnu/usr.bin/texinfo/mkinstalldirs2
-rw-r--r--gnu/usr.bin/texinfo/po/ChangeLog0
-rw-r--r--gnu/usr.bin/texinfo/po/Makefile.in.in30
-rw-r--r--gnu/usr.bin/texinfo/po/cat-id-tbl.c920
-rw-r--r--gnu/usr.bin/texinfo/util/Makefile.am8
-rw-r--r--gnu/usr.bin/texinfo/util/gen-dir-node76
-rw-r--r--gnu/usr.bin/texinfo/util/install-info.c1423
-rw-r--r--gnu/usr.bin/texinfo/util/texi2dvi732
-rw-r--r--gnu/usr.bin/texinfo/util/texindex.c218
-rw-r--r--gnu/usr.bin/texinfo/util/update-info875
56 files changed, 14880 insertions, 15606 deletions
diff --git a/gnu/usr.bin/texinfo/Makefile.am b/gnu/usr.bin/texinfo/Makefile.am
index 03c30601d08..6fb066b6ec6 100644
--- a/gnu/usr.bin/texinfo/Makefile.am
+++ b/gnu/usr.bin/texinfo/Makefile.am
@@ -1,16 +1,23 @@
## Makefile.am for texinfo.
-## $Id: Makefile.am,v 1.2 1999/01/11 16:38:00 espie Exp $
+## $Id: Makefile.am,v 1.3 2000/02/09 02:18:35 espie Exp $
## Process this file with automake to produce Makefile.in in all directories.
# Be sure we're using the right version of Automake.
-# 1.2f was the first version that supported .txi as a Texinfo suffix.
-AUTOMAKE_OPTIONS = 1.2f
+AUTOMAKE_OPTIONS = 1.4 readme-alpha
# Additional files to distribute.
-EXTRA_DIST = INTRODUCTION dir-example
+EXTRA_DIST = INTRODUCTION dir-example djgpp
+
+# This is to prevent texinfo.tex from being included in the top-level
+# distribution directory.
+TEXINFO_TEX = doc/texinfo.tex
# All subdirectories.
# Do intl/ and lib/ first since the C programs depend on them.
# Do doc/ last so makeinfo will be built when we get there.
# Others are alphabetical.
SUBDIRS = intl lib info makeinfo po util doc
+
+# One special target for them to use by hand.
+install-tex:
+ cd doc && $(MAKE) TEXMF=$(TEXMF) install-tex
diff --git a/gnu/usr.bin/texinfo/Makefile.bsd-wrapper b/gnu/usr.bin/texinfo/Makefile.bsd-wrapper
index 9cc535633f2..8a0c38f5ae6 100644
--- a/gnu/usr.bin/texinfo/Makefile.bsd-wrapper
+++ b/gnu/usr.bin/texinfo/Makefile.bsd-wrapper
@@ -1,11 +1,13 @@
-# $OpenBSD: Makefile.bsd-wrapper,v 1.29 1999/06/07 00:45:37 deraadt Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.30 2000/02/09 02:18:36 espie Exp $
INFODIR= infodir=${DESTDIR}/usr/share/info
INFOPATH= DEFAULT_INFOPATH=/usr/local/info:/usr/share/info:.
CLEANFILES= makeinfo/makeinfo.info info/info.info info/info-stnd.info \
- info/funs.h info/doc.c
+ info/funs.h info/doc.c intl/libintl.h
+
+MAN= doc/info.1 doc/install-info.1 doc/makeinfo.1 doc/texi2dvi.1
+MAN+= doc/texindex.1 doc/info.5 doc/texinfo.5
-NOMAN= # info.1 manpage passed into obsolescence
SUBDIRS= intl lib info makeinfo po util doc
GNUCFLAGS= CC="${CC}" CFLAGS="${CFLAGS} ${COPTS}"
FSFMAKE= ${MAKE} SUBDIRS="${SUBDIRS}" ${GNUCFLAGS} ${INFODIR} \
@@ -30,13 +32,15 @@ config: .FORCE
-rm -f config.cache
.endif
PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
+ CFLAGS="${CFLAGS} ${COPTS}" \
INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
- /bin/sh ${.CURDIR}/configure --prefix=/usr ${CF}
+ /bin/sh ${.CURDIR}/configure --prefix=/usr --disable-nls ${CF}
config.status:
PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
+ CFLAGS="${CFLAGS} ${COPTS}" \
INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
- /bin/sh ${.CURDIR}/configure --prefix=/usr ${CF}
+ /bin/sh ${.CURDIR}/configure --prefix=/usr --disable-nls ${CF}
.ifdef NOMAN
maninstall:
@@ -51,7 +55,7 @@ install: maninstall
clean cleandir:
rm -f ${CLEANFILES}
- -@if [ -e Makefile ]; then \
+ if [ -e ${.OBJDIR}/Makefile ]; then \
$(FSFMAKE) distclean; fi
depend:
diff --git a/gnu/usr.bin/texinfo/Makefile.in b/gnu/usr.bin/texinfo/Makefile.in
index dda80775567..e6c6fbcd5dc 100644
--- a/gnu/usr.bin/texinfo/Makefile.in
+++ b/gnu/usr.bin/texinfo/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.2f from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,10 +11,9 @@
# PARTICULAR PURPOSE.
# Be sure we're using the right version of Automake.
-# 1.2f was the first version that supported .txi as a Texinfo suffix.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -35,6 +34,8 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
+DESTDIR =
+
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -47,7 +48,7 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
@@ -80,17 +81,19 @@ POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
-TEXMF = @TEXMF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
l = @l@
-AUTOMAKE_OPTIONS = 1.2f
+AUTOMAKE_OPTIONS = 1.4 readme-alpha
# Additional files to distribute.
-EXTRA_DIST = INTRODUCTION dir-example
+EXTRA_DIST = INTRODUCTION dir-example djgpp
+
+# This is to prevent texinfo.tex from being included in the top-level
+# distribution directory.
+TEXINFO_TEX = doc/texinfo.tex
# All subdirectories.
# Do intl/ and lib/ first since the C programs depend on them.
@@ -129,45 +132,51 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
-DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL \
-Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 config.guess \
-config.h.in config.sub configure configure.in install-sh missing \
-mkinstalldirs stamp-h.in texinfo.tex
+DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \
+INSTALL Makefile.am Makefile.in NEWS TODO acconfig.h acinclude.m4 \
+aclocal.m4 config.guess config.in config.sub configure configure.in \
+install-sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
-default: all
-
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-$(ACLOCAL_M4): configure.in
+$(ACLOCAL_M4): configure.in acinclude.m4
cd $(srcdir) && $(ACLOCAL)
-config.status: $(srcdir)/configure
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
- @:
-stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @if test ! -f $@; then \
+ rm -f stamp-h; \
+ $(MAKE) stamp-h; \
+ else :; fi
+stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=config.h \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
$(SHELL) ./config.status
- @echo timestamp > stamp-h
-$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
+ @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.in: $(srcdir)/stamp-h.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
+ else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/stamp-h.in
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
mostlyclean-hdr:
@@ -191,48 +200,72 @@ all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(SUBDIRMAKE) $$target) \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(SUBDIRMAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
- done && test -z "$$fail"
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
+ if test "$$subdir" = "."; then dot_seen=yes; fi; \
done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
- target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(SUBDIRMAKE) $$target) \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(SUBDIRMAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(SUBDIRMAKE) tags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+ && mkid -f$$here/ID $$unique $(LISP)
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
+ test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
@@ -251,29 +284,31 @@ top_distdir = $(distdir)
# tarfile.
distcheck: dist
-rm -rf $(distdir)
- GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \
- && $(MAKE) \
- && $(MAKE) dvi \
- && $(MAKE) check \
- && $(MAKE) install \
- && $(MAKE) installcheck \
- && $(MAKE) dist
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
- @echo "========================"; \
- echo "$(distdir).tar.gz is ready for distribution"; \
- echo "========================"
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
- GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
- GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
@@ -281,94 +316,101 @@ distdir: $(DISTFILES)
-chmod 777 $(distdir)
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
for subdir in $(SUBDIRS); do \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
- || exit 1; \
- chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(SUBDIRMAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
|| exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
done
+info-am:
info: info-recursive
+dvi-am:
dvi: dvi-recursive
-check: all-am
- $(MAKE) check-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
installcheck: installcheck-recursive
all-recursive-am: config.h
- $(MAKE) all-recursive
-
-all-am: Makefile config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+install-exec-am:
install-exec: install-exec-recursive
- @$(NORMAL_INSTALL)
+install-data-am:
install-data: install-data-recursive
- @$(NORMAL_INSTALL)
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
- @:
-
+uninstall-am:
uninstall: uninstall-recursive
-
-all: all-recursive-am all-am
-
+all-am: Makefile config.h
+all-redirect: all-recursive-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
+installdirs-am:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
-clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
+mostlyclean: mostlyclean-recursive
-distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
-
-maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
- maintainer-clean-generic distclean-am
+clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
-mostlyclean: mostlyclean-recursive mostlyclean-am
+clean: clean-recursive
-clean: clean-recursive clean-am
+distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
-distclean: distclean-recursive distclean-am
+distclean: distclean-recursive
-rm -f config.status
-maintainer-clean: maintainer-clean-recursive maintainer-clean-am
+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
-rm -f config.status
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr install-data-recursive uninstall-data-recursive \
-install-exec-recursive uninstall-exec-recursive installdirs-recursive \
-uninstalldirs-recursive all-recursive check-recursive \
-installcheck-recursive info-recursive dvi-recursive \
-mostlyclean-recursive distclean-recursive clean-recursive \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
-installcheck all-recursive-am all-am install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+# One special target for them to use by hand.
+install-tex:
+ cd doc && $(MAKE) TEXMF=$(TEXMF) install-tex
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/gnu/usr.bin/texinfo/config.h.in b/gnu/usr.bin/texinfo/config.h.in
deleted file mode 100644
index 94c0061d524..00000000000
--- a/gnu/usr.bin/texinfo/config.h.in
+++ /dev/null
@@ -1,248 +0,0 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-/* acconfig.h
- This file is in the public domain.
-
- Descriptive text for the C preprocessor macros that
- the distributed Autoconf macros can define.
- No software package will use all of them; autoheader copies the ones
- your configure.in uses into your configuration header file templates.
-
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). Although this order
- can split up related entries, it makes it easier to check whether
- a given entry is in the file.
-
- Leave the following blank line there!! Autoheader needs it. */
-
-
-
-/* Define if using alloca.c. */
-#undef C_ALLOCA
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-#undef CRAY_STACKSEG_END
-
-/* Define if you have alloca, as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-#undef HAVE_ALLOCA_H
-
-/* Define if you don't have vprintf but do have _doprnt. */
-#undef HAVE_DOPRNT
-
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
-
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
-
-/* Define if on MINIX. */
-#undef _MINIX
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
-
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define as the return type of signal handlers (int or void). */
-#undef RETSIGTYPE
-
-/* Define if the setvbuf function takes the buffering type as its second
- argument and the buffer pointer as the third, as on System V
- before release 3. */
-#undef SETVBUF_REVERSED
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
-
-/* Define to 1 if NLS is requested. */
-#undef ENABLE_NLS
-
-/* Define as 1 if you have catgets and don't want to use GNU gettext. */
-#undef HAVE_CATGETS
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-#undef HAVE_GETTEXT
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
-
-/* Define as 1 if you have the stpcpy function. */
-#undef HAVE_STPCPY
-
-/* Define to the name of the distribution. */
-#undef PACKAGE
-
-/* Define to the version of the distribution. */
-#undef VERSION
-
-/* Define if you have the __argz_count function. */
-#undef HAVE___ARGZ_COUNT
-
-/* Define if you have the __argz_next function. */
-#undef HAVE___ARGZ_NEXT
-
-/* Define if you have the __argz_stringify function. */
-#undef HAVE___ARGZ_STRINGIFY
-
-/* Define if you have the bzero function. */
-#undef HAVE_BZERO
-
-/* Define if you have the dcgettext function. */
-#undef HAVE_DCGETTEXT
-
-/* Define if you have the getcwd function. */
-#undef HAVE_GETCWD
-
-/* Define if you have the getpagesize function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define if you have the memcpy function. */
-#undef HAVE_MEMCPY
-
-/* Define if you have the memmove function. */
-#undef HAVE_MEMMOVE
-
-/* Define if you have the memset function. */
-#undef HAVE_MEMSET
-
-/* Define if you have the munmap function. */
-#undef HAVE_MUNMAP
-
-/* Define if you have the putenv function. */
-#undef HAVE_PUTENV
-
-/* Define if you have the setenv function. */
-#undef HAVE_SETENV
-
-/* Define if you have the setlocale function. */
-#undef HAVE_SETLOCALE
-
-/* Define if you have the setvbuf function. */
-#undef HAVE_SETVBUF
-
-/* Define if you have the sigprocmask function. */
-#undef HAVE_SIGPROCMASK
-
-/* Define if you have the sigsetmask function. */
-#undef HAVE_SIGSETMASK
-
-/* Define if you have the stpcpy function. */
-#undef HAVE_STPCPY
-
-/* Define if you have the strcasecmp function. */
-#undef HAVE_STRCASECMP
-
-/* Define if you have the strchr function. */
-#undef HAVE_STRCHR
-
-/* Define if you have the strdup function. */
-#undef HAVE_STRDUP
-
-/* Define if you have the strerror function. */
-#undef HAVE_STRERROR
-
-/* Define if you have the <argz.h> header file. */
-#undef HAVE_ARGZ_H
-
-/* Define if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define if you have the <nl_types.h> header file. */
-#undef HAVE_NL_TYPES_H
-
-/* Define if you have the <pwd.h> header file. */
-#undef HAVE_PWD_H
-
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define if you have the <sys/fcntl.h> header file. */
-#undef HAVE_SYS_FCNTL_H
-
-/* Define if you have the <sys/file.h> header file. */
-#undef HAVE_SYS_FILE_H
-
-/* Define if you have the <sys/ptem.h> header file. */
-#undef HAVE_SYS_PTEM_H
-
-/* Define if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define if you have the <sys/ttold.h> header file. */
-#undef HAVE_SYS_TTOLD_H
-
-/* Define if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if you have the <termcap.h> header file. */
-#undef HAVE_TERMCAP_H
-
-/* Define if you have the <termio.h> header file. */
-#undef HAVE_TERMIO_H
-
-/* Define if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define if you have the <values.h> header file. */
-#undef HAVE_VALUES_H
-
-/* Define if you have the bsd library (-lbsd). */
-#undef HAVE_LIBBSD
-
-/* Define if you have the i library (-li). */
-#undef HAVE_LIBI
-
-/* For gettext (NLS) */
-#include <libintl.h>
-#define _(String) gettext (String)
-#define N_(String) (String)
-
-
-/* Leave that blank line there!! Autoheader needs it.
- If you're adding to this file, keep in mind:
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). */
diff --git a/gnu/usr.bin/texinfo/configure b/gnu/usr.bin/texinfo/configure
index 844c73e447f..c6d470071f3 100644
--- a/gnu/usr.bin/texinfo/configure
+++ b/gnu/usr.bin/texinfo/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
+# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -55,6 +55,7 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
@@ -338,7 +339,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
+ echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
@@ -508,9 +509,11 @@ ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
+ac_exeext=
+ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -527,7 +530,6 @@ fi
-
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -554,28 +556,30 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:562: checking for a BSD compatible install" >&5
+echo "configure:565: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -605,13 +609,12 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:615: checking whether build environment is sane" >&5
+echo "configure:618: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -668,7 +671,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:672: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:675: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -697,7 +700,7 @@ fi
PACKAGE=texinfo
-VERSION=3.12
+VERSION=4.0
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -714,7 +717,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:718: checking for working aclocal" >&5
+echo "configure:721: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -722,12 +725,12 @@ if (aclocal --version) < /dev/null > /dev/null 2>&1; then
ACLOCAL=aclocal
echo "$ac_t""found" 1>&6
else
- ACLOCAL="sh $missing_dir/missing aclocal"
+ ACLOCAL="$SHELL $missing_dir/missing aclocal"
echo "$ac_t""missing" 1>&6
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:731: checking for working autoconf" >&5
+echo "configure:734: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -735,12 +738,12 @@ if (autoconf --version) < /dev/null > /dev/null 2>&1; then
AUTOCONF=autoconf
echo "$ac_t""found" 1>&6
else
- AUTOCONF="sh $missing_dir/missing autoconf"
+ AUTOCONF="$SHELL $missing_dir/missing autoconf"
echo "$ac_t""missing" 1>&6
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:744: checking for working automake" >&5
+echo "configure:747: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -748,12 +751,12 @@ if (automake --version) < /dev/null > /dev/null 2>&1; then
AUTOMAKE=automake
echo "$ac_t""found" 1>&6
else
- AUTOMAKE="sh $missing_dir/missing automake"
+ AUTOMAKE="$SHELL $missing_dir/missing automake"
echo "$ac_t""missing" 1>&6
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:757: checking for working autoheader" >&5
+echo "configure:760: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -761,12 +764,12 @@ if (autoheader --version) < /dev/null > /dev/null 2>&1; then
AUTOHEADER=autoheader
echo "$ac_t""found" 1>&6
else
- AUTOHEADER="sh $missing_dir/missing autoheader"
+ AUTOHEADER="$SHELL $missing_dir/missing autoheader"
echo "$ac_t""missing" 1>&6
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:770: checking for working makeinfo" >&5
+echo "configure:773: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -774,24 +777,35 @@ if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
MAKEINFO=makeinfo
echo "$ac_t""found" 1>&6
else
- MAKEINFO="sh $missing_dir/missing makeinfo"
+ MAKEINFO="$SHELL $missing_dir/missing makeinfo"
echo "$ac_t""missing" 1>&6
fi
+
+
+if test -n "$TEXINFO_MAINT"; then
+ TEXINFO_MAINT_TRUE=
+ TEXINFO_MAINT_FALSE='#'
+else
+ TEXINFO_MAINT_TRUE='#'
+ TEXINFO_MAINT_FALSE=
+fi
+
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:787: checking for $ac_word" >&5
+echo "configure:800: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
@@ -812,16 +826,17 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:816: checking for $ac_word" >&5
+echo "configure:830: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -856,25 +871,61 @@ else
echo "$ac_t""no" 1>&6
fi
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:881: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:864: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:913: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
-cat > conftest.$ac_ext <<EOF
-#line 874 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 924 "configure"
#include "confdefs.h"
+
main(){return(0);}
EOF
-if { (eval echo configure:878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -888,18 +939,24 @@ else
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:898: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:955: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:903: checking whether we are using GNU C" >&5
+echo "configure:960: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -908,7 +965,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -919,11 +976,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:927: checking whether ${CC-cc} accepts -g" >&5
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:988: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -938,20 +999,24 @@ rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
- CFLAGS="-O2"
+ CFLAGS="-g"
fi
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:955: checking how to run the C preprocessor" >&5
+echo "configure:1020: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -966,14 +1031,14 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 970 "configure"
+#line 1035 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
@@ -983,14 +1048,31 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 987 "configure"
+#line 1052 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 1069 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
@@ -1003,6 +1085,8 @@ fi
rm -f conftest*
fi
rm -f conftest*
+fi
+rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
CPP="$ac_cv_prog_CPP"
@@ -1013,13 +1097,13 @@ echo "$ac_t""$CPP" 1>&6
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1017: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1101: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1023 "configure"
+#line 1107 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -1037,7 +1121,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1041 "configure"
+#line 1125 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -1065,28 +1149,30 @@ fi
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1073: checking for a BSD compatible install" >&5
+echo "configure:1158: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -1116,20 +1202,23 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1125: checking for $ac_word" >&5
+echo "configure:1213: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
@@ -1148,42 +1237,8 @@ else
fi
-# We do this for the sake of a more helpful warning in doc/Makefile.
-TEXMF='$(datadir)/texmf'
-# Extract the first word of "texconfig", so it can be a program name with args.
-set dummy texconfig; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1157: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_TEXCONFIG'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$TEXCONFIG"; then
- ac_cv_prog_TEXCONFIG="$TEXCONFIG" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_TEXCONFIG="true"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_TEXCONFIG" && ac_cv_prog_TEXCONFIG="false"
-fi
-fi
-TEXCONFIG="$ac_cv_prog_TEXCONFIG"
-if test -n "$TEXCONFIG"; then
- echo "$ac_t""$TEXCONFIG" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-$TEXCONFIG && eval `texconfig conf </dev/null | grep '^TEXMF='`
-
-
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1187: checking for POSIXized ISC" >&5
+echo "configure:1242: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -1205,18 +1260,18 @@ fi
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1209: checking for minix/config.h" >&5
+echo "configure:1264: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1214 "configure"
+#line 1269 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1253,62 +1308,14 @@ EOF
fi
-echo $ac_n "checking for gzdopen in -lz""... $ac_c" 1>&6
-echo "configure:1258: checking for gzdopen in -lz" >&5
-ac_lib_var=`echo z'_'gzdopen | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lz $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1266 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gzdopen();
-
-int main() {
-gzdopen()
-; return 0; }
-EOF
-if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lz $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
# Needed on sysV68 for sigblock, sigsetmask. But check for it in libc first.
echo $ac_n "checking for sigblock""... $ac_c" 1>&6
-echo "configure:1307: checking for sigblock" >&5
+echo "configure:1314: checking for sigblock" >&5
if eval "test \"`echo '$''{'ac_cv_func_sigblock'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1312 "configure"
+#line 1319 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char sigblock(); below. */
@@ -1331,7 +1338,7 @@ sigblock();
; return 0; }
EOF
-if { (eval echo configure:1335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_sigblock=yes"
else
@@ -1349,7 +1356,7 @@ if eval "test \"`echo '$ac_cv_func_'sigblock`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sigblock in -lbsd""... $ac_c" 1>&6
-echo "configure:1353: checking for sigblock in -lbsd" >&5
+echo "configure:1360: checking for sigblock in -lbsd" >&5
ac_lib_var=`echo bsd'_'sigblock | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1357,7 +1364,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbsd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1361 "configure"
+#line 1368 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1368,7 +1375,7 @@ int main() {
sigblock()
; return 0; }
EOF
-if { (eval echo configure:1372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1401,28 +1408,29 @@ fi
# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
# rather ncurses. So we check for it.
TERMLIBS=
-for termlib in ncurses curses termcap terminfo termlib ; do
- echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6
-echo "configure:1407: checking for tputs in -l${termlib}" >&5
-ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'`
+# Check for termlib before termcap because Solaris termcap needs libucb.
+for termlib in ncurses curses termlib termcap terminfo; do
+ echo $ac_n "checking for tgetent in -l${termlib}""... $ac_c" 1>&6
+echo "configure:1415: checking for tgetent in -l${termlib}" >&5
+ac_lib_var=`echo ${termlib}'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-l${termlib} $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1415 "configure"
+#line 1423 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char tputs();
+char tgetent();
int main() {
-tputs()
+tgetent()
; return 0; }
EOF
-if { (eval echo configure:1426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1444,24 +1452,23 @@ fi
done
-
if test "x$termlib" = xncurses; then
for ac_hdr in ncurses/termcap.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1454: checking for $ac_hdr" >&5
+echo "configure:1461: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1459 "configure"
+#line 1466 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1464: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1487,13 +1494,69 @@ fi
done
fi
+echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
+echo "configure:1499: checking whether stat file-mode macros are broken" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1504 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined(S_ISBLK) && defined(S_IFDIR)
+# if S_ISBLK (S_IFDIR)
+You lose.
+# endif
+#endif
+
+#if defined(S_ISBLK) && defined(S_IFCHR)
+# if S_ISBLK (S_IFCHR)
+You lose.
+# endif
+#endif
+
+#if defined(S_ISLNK) && defined(S_IFREG)
+# if S_ISLNK (S_IFREG)
+You lose.
+# endif
+#endif
+
+#if defined(S_ISSOCK) && defined(S_IFREG)
+# if S_ISSOCK (S_IFREG)
+You lose.
+# endif
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "You lose" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_header_stat_broken=yes
+else
+ rm -rf conftest*
+ ac_cv_header_stat_broken=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_header_stat_broken" 1>&6
+if test $ac_cv_header_stat_broken = yes; then
+ cat >> confdefs.h <<\EOF
+#define STAT_MACROS_BROKEN 1
+EOF
+
+fi
+
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1492: checking for ANSI C header files" >&5
+echo "configure:1555: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1497 "configure"
+#line 1560 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1501,8 +1564,8 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_cv_header_stdc=yes
@@ -1518,7 +1581,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1522 "configure"
+#line 1585 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1536,7 +1599,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1540 "configure"
+#line 1603 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1557,7 +1620,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1561 "configure"
+#line 1624 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1568,7 +1631,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1597,18 +1660,18 @@ for ac_hdr in fcntl.h pwd.h string.h strings.h termcap.h termio.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1601: checking for $ac_hdr" >&5
+echo "configure:1664: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1606 "configure"
+#line 1669 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1633,14 +1696,103 @@ else
fi
done
+echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
+echo "configure:1701: checking POSIX termios" >&5
+if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1706 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <unistd.h>
+#include <termios.h>
+int main() {
+/* SunOS 4.0.3 has termios.h but not the library calls. */
+ tcgetattr(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:1716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ am_cv_sys_posix_termios=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_sys_posix_termios=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
+
+
+ echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
+echo "configure:1732: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
+
+ gwinsz_in_termios_h=no
+ if test $am_cv_sys_posix_termios = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 1741 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+# include <termios.h>
+# ifdef TIOCGWINSZ
+ yes
+# endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+ gwinsz_in_termios_h=yes
+fi
+rm -f conftest*
+
+ fi
+
+ if test $gwinsz_in_termios_h = no; then
+ cat > conftest.$ac_ext <<EOF
+#line 1761 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+# include <sys/ioctl.h>
+# ifdef TIOCGWINSZ
+ yes
+# endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+ am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
+fi
+rm -f conftest*
+
+ fi
+
+fi
+
+echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
+ if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
+ cat >> confdefs.h <<\EOF
+#define GWINSZ_IN_SYS_IOCTL 1
+EOF
+
+ fi
+
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1639: checking for off_t" >&5
+echo "configure:1791: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1644 "configure"
+#line 1796 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1649,7 +1801,7 @@ else
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_off_t=yes
else
@@ -1668,12 +1820,12 @@ EOF
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1672: checking return type of signal handlers" >&5
+echo "configure:1824: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1677 "configure"
+#line 1829 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -1690,7 +1842,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:1694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -1709,12 +1861,12 @@ EOF
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1713: checking for working const" >&5
+echo "configure:1865: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1718 "configure"
+#line 1870 "configure"
#include "confdefs.h"
int main() {
@@ -1763,7 +1915,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1784,12 +1936,12 @@ EOF
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1788: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:1940: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1793 "configure"
+#line 1945 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -1797,7 +1949,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:1801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -1818,22 +1970,311 @@ EOF
fi
+
+ headers='
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
+#endif
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+'
+
+ if test x = y; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_DECL_STRERROR 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_DECL_STRCASECMP 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_DECL_STRNCASECMP 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_DECL_STRCOLL 1
+EOF
+
+ fi
+
+
+ for jm_func in strerror strcasecmp strncasecmp strcoll
+ do
+
+ test -z "$ac_cv_header_memory_h" && for ac_hdr in memory.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2022: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2027 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ test -z "$ac_cv_header_string_h" && for ac_hdr in string.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2062: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2067 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ test -z "$ac_cv_header_strings_h" && for ac_hdr in strings.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2102: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2107 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2112: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ test -z "$ac_cv_header_stdlib_h" && for ac_hdr in stdlib.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2142: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2147 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ test -z "$ac_cv_header_unistd_h" && for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2182: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2187 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ echo $ac_n "checking whether $jm_func is declared""... $ac_c" 1>&6
+echo "configure:2219: checking whether $jm_func is declared" >&5
+ if eval "test \"`echo '$''{'jm_cv_func_decl_$jm_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2224 "configure"
+#include "confdefs.h"
+$headers
+int main() {
+
+#ifndef $jm_func
+char *(*pfn) = (char *(*)) $jm_func
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ eval "jm_cv_func_decl_$jm_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "jm_cv_func_decl_$jm_func=no"
+fi
+rm -f conftest*
+fi
+
+
+ if eval "test \"`echo '$jm_cv_func_decl_'$jm_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
+ cat >> confdefs.h <<EOF
+#define $jm_tr_func 1
+EOF
+
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+ done
+
+
+
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1825: checking for working alloca.h" >&5
+echo "configure:2266: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1830 "configure"
+#line 2271 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -1854,25 +2295,30 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1858: checking for alloca" >&5
+echo "configure:2299: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1863 "configure"
+#line 2304 "configure"
#include "confdefs.h"
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
# else
-# ifdef _AIX
- #pragma alloca
+# if HAVE_ALLOCA_H
+# include <alloca.h>
# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
+# endif
# endif
# endif
# endif
@@ -1882,7 +2328,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -1907,19 +2353,19 @@ if test $ac_cv_func_alloca_works = no; then
# that cause trouble. Some versions do not even contain alloca or
# contain a buggy version. If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.
- ALLOCA=alloca.o
+ ALLOCA=alloca.${ac_objext}
cat >> confdefs.h <<\EOF
#define C_ALLOCA 1
EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1918: checking whether alloca needs Cray hooks" >&5
+echo "configure:2364: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1923 "configure"
+#line 2369 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1944,12 +2390,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1948: checking for $ac_func" >&5
+echo "configure:2394: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1953 "configure"
+#line 2399 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1972,7 +2418,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1999,7 +2445,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2003: checking stack direction for C alloca" >&5
+echo "configure:2449: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2007,7 +2453,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2011 "configure"
+#line 2457 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2026,7 +2472,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -2047,13 +2493,54 @@ EOF
fi
+echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
+echo "configure:2498: checking for working strcoll" >&5
+if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_strcoll_works=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2506 "configure"
+#include "confdefs.h"
+#include <string.h>
+main ()
+{
+ exit (strcoll ("abc", "def") >= 0 ||
+ strcoll ("ABC", "DEF") >= 0 ||
+ strcoll ("123", "456") >= 0);
+}
+EOF
+if { (eval echo configure:2516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_strcoll_works=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_strcoll_works=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_strcoll_works" 1>&6
+if test $ac_cv_func_strcoll_works = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRCOLL 1
+EOF
+
+fi
+
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:2052: checking for vprintf" >&5
+echo "configure:2539: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2057 "configure"
+#line 2544 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@@ -2076,7 +2563,7 @@ vprintf();
; return 0; }
EOF
-if { (eval echo configure:2080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
@@ -2100,12 +2587,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:2104: checking for _doprnt" >&5
+echo "configure:2591: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2109 "configure"
+#line 2596 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@@ -2128,7 +2615,7 @@ _doprnt();
; return 0; }
EOF
-if { (eval echo configure:2132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
@@ -2153,7 +2640,7 @@ fi
fi
echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
-echo "configure:2157: checking whether setvbuf arguments are reversed" >&5
+echo "configure:2644: checking whether setvbuf arguments are reversed" >&5
if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2161,7 +2648,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2165 "configure"
+#line 2652 "configure"
#include "confdefs.h"
#include <stdio.h>
/* If setvbuf has the reversed format, exit 0. */
@@ -2175,7 +2662,7 @@ main () {
exit(0); /* Non-reversed systems segv here. */
}
EOF
-if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setvbuf_reversed=yes
else
@@ -2198,16 +2685,15 @@ EOF
fi
-for ac_func in setvbuf getcwd memset bzero strchr strcasecmp \
- sigprocmask sigsetmask
+for ac_func in setvbuf getcwd memset bzero strchr sigprocmask sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2206: checking for $ac_func" >&5
+echo "configure:2692: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2211 "configure"
+#line 2697 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2230,7 +2716,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2254,15 +2740,15 @@ else
fi
done
-for ac_func in memcpy memmove strdup strerror
+for ac_func in memcpy memmove strdup strcasecmp strerror strncasecmp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2261: checking for $ac_func" >&5
+echo "configure:2747: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2266 "configure"
+#line 2752 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2285,7 +2771,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2306,29 +2792,84 @@ EOF
else
echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.o"
+LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
fi
done
-ALL_LINGUAS="de fr"
+# HP-UX 9 (at least) needs -lncurses which defines termcap variables PC etc.
+echo $ac_n "checking for library with termcap variables""... $ac_c" 1>&6
+echo "configure:2804: checking for library with termcap variables" >&5
+if eval "test \"`echo '$''{'ac_cv_var_ospeed'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ oldLIBS=$LIBS
+for trylib in $termlib ncurses curses termlib termcap terminfo; do
+ if test "x$trylib" != "x$termlib"; then
+ LIBS="$oldLIBS -l$termlib -l$trylib"
+ else
+ LIBS="$oldLIBS -l$termlib"
+ fi
+ cat > conftest.$ac_ext <<EOF
+#line 2816 "configure"
+#include "confdefs.h"
+
+int main() {
+#ifdef HAVE_NCURSES_TERMCAP_H
+#include <ncurses/termcap.h>
+#else
+#ifdef HAVE_TERMCAP_H
+#include <termcap.h>
+#else
+#undef PC
+char *BC;
+char* *UP;
+char PC;
+short ospeed;
+#endif
+#endif
+return ospeed != 0;
+
+; return 0; }
+EOF
+if { (eval echo configure:2837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_var_ospeed=$trylib; break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+LIBS=$oldLIBS
+
+fi
+
+echo "$ac_t""$ac_cv_var_ospeed" 1>&6
+if test -n "$ac_cv_var_ospeed" \
+ && test "x$termlib" != "x$ac_cv_var_ospeed"; then
+ TERMLIBS="${TERMLIBS} -l${ac_cv_var_ospeed}"
+fi
+
+
+ALL_LINGUAS="cs de de_AT eo fr nl no ru"
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2318: checking for inline" >&5
+echo "configure:2859: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 2325 "configure"
+#line 2866 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -2354,12 +2895,12 @@ EOF
esac
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2358: checking for size_t" >&5
+echo "configure:2899: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2363 "configure"
+#line 2904 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2368,7 +2909,7 @@ else
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_size_t=yes
else
@@ -2390,18 +2931,18 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2394: checking for $ac_hdr" >&5
+echo "configure:2935: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2399 "configure"
+#line 2940 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -2429,12 +2970,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2433: checking for $ac_func" >&5
+echo "configure:2974: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2438 "configure"
+#line 2979 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2457,7 +2998,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2482,7 +3023,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2486: checking for working mmap" >&5
+echo "configure:3027: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2490,7 +3031,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2494 "configure"
+#line 3035 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2630,7 +3171,7 @@ main()
}
EOF
-if { (eval echo configure:2634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -2654,22 +3195,22 @@ fi
for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
-unistd.h values.h sys/param.h
+unistd.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2662: checking for $ac_hdr" >&5
+echo "configure:3203: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2667 "configure"
+#line 3208 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:3213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -2695,15 +3236,15 @@ fi
done
for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
-__argz_count __argz_stringify __argz_next
+strdup __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2702: checking for $ac_func" >&5
+echo "configure:3243: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2707 "configure"
+#line 3248 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2726,7 +3267,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2755,12 +3296,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2759: checking for $ac_func" >&5
+echo "configure:3300: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2764 "configure"
+#line 3305 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2783,7 +3324,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2817,19 +3358,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2821: checking for LC_MESSAGES" >&5
+echo "configure:3362: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2826 "configure"
+#line 3367 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -2850,7 +3391,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2854: checking whether NLS is requested" >&5
+echo "configure:3395: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -2870,13 +3411,13 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2874: checking whether included gettext is requested" >&5
+echo "configure:3415: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
nls_cv_force_use_gnu_gettext=$withval
else
- nls_cv_force_use_gnu_gettext=no
+ nls_cv_force_use_gnu_gettext=yes
fi
echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
@@ -2889,18 +3430,18 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2893: checking for libintl.h" >&5
+echo "configure:3434: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2898 "configure"
+#line 3439 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:3444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -2916,19 +3457,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2920: checking for gettext in libc" >&5
+echo "configure:3461: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2925 "configure"
+#line 3466 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -2944,7 +3485,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:2948: checking for bindtextdomain in -lintl" >&5
+echo "configure:3489: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2952,7 +3493,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2956 "configure"
+#line 3497 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2963,7 +3504,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:2967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2979,28 +3520,51 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:2983: checking for gettext in libintl" >&5
+echo "configure:3524: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2988 "configure"
+ echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
+echo "configure:3529: checking for gettext in -lintl" >&5
+ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lintl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3537 "configure"
#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gettext();
int main() {
-return (int) gettext ("")
+gettext()
; return 0; }
EOF
-if { (eval echo configure:2995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- gt_cv_func_gettext_libintl=yes
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- gt_cv_func_gettext_libintl=no
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ gt_cv_func_gettext_libintl=yes
+else
+ echo "$ac_t""no" 1>&6
+gt_cv_func_gettext_libintl=no
+fi
+
fi
echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
@@ -3019,7 +3583,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3023: checking for $ac_word" >&5
+echo "configure:3587: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3053,12 +3617,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3057: checking for $ac_func" >&5
+echo "configure:3621: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3062 "configure"
+#line 3626 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3081,7 +3645,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3108,7 +3672,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3112: checking for $ac_word" >&5
+echo "configure:3676: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3116,9 +3680,13 @@ else
/*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
@@ -3140,7 +3708,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3144: checking for $ac_word" >&5
+echo "configure:3712: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3172,7 +3740,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 3176 "configure"
+#line 3744 "configure"
#include "confdefs.h"
int main() {
@@ -3180,7 +3748,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:3184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -3203,7 +3771,7 @@ fi
if test "$CATOBJEXT" = "NONE"; then
echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:3207: checking whether catgets can be used" >&5
+echo "configure:3775: checking whether catgets can be used" >&5
# Check whether --with-catgets or --without-catgets was given.
if test "${with_catgets+set}" = set; then
withval="$with_catgets"
@@ -3216,7 +3784,7 @@ fi
if test "$nls_cv_use_catgets" = "yes"; then
echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:3220: checking for main in -li" >&5
+echo "configure:3788: checking for main in -li" >&5
ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3224,14 +3792,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3228 "configure"
+#line 3796 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3259,12 +3827,12 @@ else
fi
echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:3263: checking for catgets" >&5
+echo "configure:3831: checking for catgets" >&5
if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3268 "configure"
+#line 3836 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char catgets(); below. */
@@ -3287,7 +3855,7 @@ catgets();
; return 0; }
EOF
-if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_catgets=yes"
else
@@ -3309,7 +3877,7 @@ EOF
# Extract the first word of "gencat", so it can be a program name with args.
set dummy gencat; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3313: checking for $ac_word" >&5
+echo "configure:3881: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3317,9 +3885,13 @@ else
/*)
ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path.
;;
+ ?:/*)
+ ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a dos path.
+ ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_GENCAT="$ac_dir/$ac_word"
@@ -3341,7 +3913,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3345: checking for $ac_word" >&5
+echo "configure:3917: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3349,9 +3921,13 @@ else
/*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
@@ -3374,7 +3950,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3378: checking for $ac_word" >&5
+echo "configure:3954: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3409,7 +3985,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3413: checking for $ac_word" >&5
+echo "configure:3989: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3467,7 +4043,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3471: checking for $ac_word" >&5
+echo "configure:4047: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3501,7 +4077,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3505: checking for $ac_word" >&5
+echo "configure:4081: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3509,9 +4085,13 @@ else
/*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
@@ -3533,7 +4113,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3537: checking for $ac_word" >&5
+echo "configure:4117: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3580,7 +4160,7 @@ fi
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
- echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
+ echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6
XGETTEXT=":"
fi
fi
@@ -3592,6 +4172,9 @@ fi
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
+
+
+
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
@@ -3623,7 +4206,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3627: checking for catalogs to be installed" >&5
+echo "configure:4210: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -3651,18 +4234,18 @@ echo "configure:3627: checking for catalogs to be installed" >&5
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:3655: checking for linux/version.h" >&5
+echo "configure:4238: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3660 "configure"
+#line 4243 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:4248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -3701,7 +4284,7 @@ fi
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
- MKINSTALLDIRS="sh $ac_aux_dir/mkinstalldirs"
+ MKINSTALLDIRS="$SHELL $ac_aux_dir/mkinstalldirs"
fi
# if test -z "$MKINSTALLDIRS"; then
# MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
@@ -3713,12 +4296,12 @@ fi
test -d po || mkdir po
if test "x$srcdir" != "x."; then
- if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+ if test "x`echo $srcdir | sed -e 's@^[A-z]:@@' -e 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
- else
+ else
posrcprefix="../"
fi
rm -f po/POTFILES
@@ -3726,7 +4309,6 @@ fi
< $srcdir/po/POTFILES.in > po/POTFILES
-
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -3750,7 +4332,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -3817,7 +4399,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -3834,9 +4416,10 @@ trap 'rm -fr `echo "Makefile \
intl/Makefile \
lib/Makefile \
makeinfo/Makefile \
- po/Makefile.in \
+ makeinfo/tests/Makefile \
+ po/Makefile.in \
util/Makefile \
- config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+ config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -3845,9 +4428,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
@@ -3867,8 +4452,8 @@ s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
s%@ACLOCAL@%$ACLOCAL%g
@@ -3877,14 +4462,14 @@ s%@AUTOMAKE@%$AUTOMAKE%g
s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
+s%@TEXINFO_MAINT_TRUE@%$TEXINFO_MAINT_TRUE%g
+s%@TEXINFO_MAINT_FALSE@%$TEXINFO_MAINT_FALSE%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@RANLIB@%$RANLIB%g
-s%@TEXCONFIG@%$TEXCONFIG%g
-s%@TEXMF@%$TEXMF%g
-s%@TERMLIBS@%$TERMLIBS%g
s%@ALLOCA@%$ALLOCA%g
s%@LIBOBJS@%$LIBOBJS%g
+s%@TERMLIBS@%$TERMLIBS%g
s%@USE_NLS@%$USE_NLS%g
s%@MSGFMT@%$MSGFMT%g
s%@GMSGFMT@%$GMSGFMT%g
@@ -3953,7 +4538,8 @@ CONFIG_FILES=\${CONFIG_FILES-"Makefile \
intl/Makefile \
lib/Makefile \
makeinfo/Makefile \
- po/Makefile.in \
+ makeinfo/tests/Makefile \
+ po/Makefile.in \
util/Makefile \
"}
EOF
@@ -4036,7 +4622,7 @@ ac_eD='%g'
if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="config.h"
+ CONFIG_HEADERS="config.h:config.in"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
@@ -4170,10 +4756,14 @@ EOF
cat >> $CONFIG_STATUS <<EOF
+
EOF
cat >> $CONFIG_STATUS <<\EOF
test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in >po/Makefile
+case "$CONFIG_FILES" in *po/Makefile.in*)
+ sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+ esac
+
exit 0
EOF
chmod +x $CONFIG_STATUS
diff --git a/gnu/usr.bin/texinfo/configure.in b/gnu/usr.bin/texinfo/configure.in
index ac3c85b74be..c2e95ca5cf5 100644
--- a/gnu/usr.bin/texinfo/configure.in
+++ b/gnu/usr.bin/texinfo/configure.in
@@ -1,11 +1,13 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $Id: configure.in,v 1.2 1999/01/11 16:38:01 espie Exp $
+dnl $Id: configure.in,v 1.3 2000/02/09 02:18:36 espie Exp $
dnl
AC_INIT(makeinfo/makeinfo.c)
-AC_PREREQ(2.12)dnl Minimum Autoconf version required.
-AM_CONFIG_HEADER(config.h)
+AC_PREREQ(2.13)dnl Minimum Autoconf version required.
+AM_CONFIG_HEADER(config.h:config.in)dnl Keep filename to 8.3 for MS-DOS.
-AM_INIT_AUTOMAKE([texinfo], [3.12])
+AM_INIT_AUTOMAKE([texinfo], [4.0])
+
+AM_CONDITIONAL(TEXINFO_MAINT, test -n "$TEXINFO_MAINT")
dnl Checks for programs.
AC_PROG_CC
@@ -13,29 +15,20 @@ AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_RANLIB
-# We do this for the sake of a more helpful warning in doc/Makefile.
-TEXMF='$(datadir)/texmf'
-AC_CHECK_PROG(TEXCONFIG, texconfig, true, false)
-$TEXCONFIG && eval `texconfig conf </dev/null | grep '^TEXMF='`
-AC_SUBST(TEXMF)
-
AC_ISC_POSIX
AC_MINIX
-dnl Checks for libraries.
-AC_CHECK_LIB(z, gzdopen)
-
# Needed on sysV68 for sigblock, sigsetmask. But check for it in libc first.
AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))
# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
# rather ncurses. So we check for it.
TERMLIBS=
-for termlib in ncurses curses termcap terminfo termlib ; do
- AC_CHECK_LIB(${termlib}, tputs,
+# Check for termlib before termcap because Solaris termcap needs libucb.
+for termlib in ncurses curses termlib termcap terminfo; do
+ AC_CHECK_LIB(${termlib}, tgetent,
[TERMLIBS="${TERMLIBS} -l${termlib}"; break])
done
-AC_SUBST(TERMLIBS)
dnl Checks for header files.
dnl Do not use <ncurses/termcap.h> unless we're linking with ncurses.
@@ -43,10 +36,13 @@ if test "x$termlib" = xncurses; then
dnl Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined.
AC_CHECK_HEADERS(ncurses/termcap.h)
fi
+AC_HEADER_STAT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h pwd.h string.h strings.h termcap.h termio.h \
termios.h unistd.h \
sys/fcntl.h sys/file.h sys/ptem.h sys/time.h sys/ttold.h sys/wait.h)
+AM_SYS_POSIX_TERMIOS
+AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
@@ -54,19 +50,58 @@ AC_TYPE_SIGNAL
AC_C_CONST
AC_STRUCT_TM
+dnl Checks for function declarations.
+txi_CHECK_DECLS
+
dnl Checks for library functions.
AC_FUNC_ALLOCA
+AC_FUNC_STRCOLL
AC_FUNC_VPRINTF
AC_FUNC_SETVBUF_REVERSED
-AC_CHECK_FUNCS(setvbuf getcwd memset bzero strchr strcasecmp \
- sigprocmask sigsetmask)
-dnl strcasecmp, strerror, xmalloc, xrealloc, probably others should be added.
-AC_REPLACE_FUNCS(memcpy memmove strdup strerror)
+AC_CHECK_FUNCS(setvbuf getcwd memset bzero strchr sigprocmask sigsetmask)
+dnl strerror, xmalloc, xrealloc, probably others should be added.
+AC_REPLACE_FUNCS(memcpy memmove strdup strcasecmp strerror strncasecmp)
+
+dnl Checks for variables.
+# HP-UX 9 (at least) needs -lncurses which defines termcap variables PC etc.
+AC_MSG_CHECKING(for library with termcap variables)
+AC_CACHE_VAL(ac_cv_var_ospeed,
+oldLIBS=$LIBS
+for trylib in $termlib ncurses curses termlib termcap terminfo; do
+ if test "x$trylib" != "x$termlib"; then
+ LIBS="$oldLIBS -l$termlib -l$trylib"
+ else
+ LIBS="$oldLIBS -l$termlib"
+ fi
+ AC_TRY_LINK(,
+#ifdef HAVE_NCURSES_TERMCAP_H
+#include <ncurses/termcap.h>
+#else
+#ifdef HAVE_TERMCAP_H
+#include <termcap.h>
+#else
+#undef PC
+char *BC;
+char* *UP;
+char PC;
+short ospeed;
+#endif
+#endif
+return ospeed != 0;
+, ac_cv_var_ospeed=$trylib; break)
+done
+LIBS=$oldLIBS
+)
+AC_MSG_RESULT($ac_cv_var_ospeed)
+if test -n "$ac_cv_var_ospeed" \
+ && test "x$termlib" != "x$ac_cv_var_ospeed"; then
+ TERMLIBS="${TERMLIBS} -l${ac_cv_var_ospeed}"
+fi
+AC_SUBST(TERMLIBS)
dnl Set of available languages and i18n macros.
-ALL_LINGUAS="de fr"
+ALL_LINGUAS="cs de de_AT eo fr nl no ru"
AM_GNU_GETTEXT
-AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT([Makefile \
doc/Makefile \
@@ -74,7 +109,7 @@ AC_OUTPUT([Makefile \
intl/Makefile \
lib/Makefile \
makeinfo/Makefile \
- po/Makefile.in \
+ makeinfo/tests/Makefile \
+ po/Makefile.in \
util/Makefile \
- ],
- [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in >po/Makefile])
+ ])
diff --git a/gnu/usr.bin/texinfo/dir-example b/gnu/usr.bin/texinfo/dir-example
index 2f11fcc4356..fda04d29acc 100644
--- a/gnu/usr.bin/texinfo/dir-example
+++ b/gnu/usr.bin/texinfo/dir-example
@@ -6,7 +6,7 @@ This particular dir file is merely made available for your hacking
If you have dir entries for Texinfo manuals you'd like to be added here,
please send them to karl@gnu.org.
-$Id: dir-example,v 1.2 1999/01/11 16:38:01 espie Exp $
+$Id: dir-example,v 1.3 2000/02/09 02:18:36 espie Exp $

File: dir, Node: Top, This is the top of the INFO tree.
@@ -22,320 +22,346 @@ Not all of the topics shown below may be available on this system.
* Menu:
-GNU packages
-* Bash: (bash). Bourne-Again SHell.
-* Cpio: (cpio). Copy-in-copy-out archiver.
-* DC: (dc). Postfix desk calculator.
-* Diff: (diff). Comparing and merging programs.
-* Ed: (ed). Line editor.
-* Emacs: (emacs). Extensible self-documenting text editor.
-* File utilities: (fileutils). GNU file utilities.
-* Finding files: (find). Operating on files matching certain criteria.
-* Font utilities: (fontu). Programs for font manipulation.
-* Gawk: (gawk.info). A text scanning and processing language.
-* Gcal: (gcal). GNU calendar program.
-* Gzip: (gzip). General (de)compression.
-* Identifier DB: (id-utils). Identifier database utilities.
-* Ispell: (ispell). Interactive spelling corrector.
-* M4: (m4). Macro processor.
-* Make: (make). Remake files automatically.
-* Ptx: (ptx). Permuted index generator.
-* Shar: (sharutils). Shell archiver, uudecode/uuencode.
-* Shell utilities: (sh-utils). GNU shell utilities.
-* tar: (tar). Making tape (or disk) archives.
-* Text utilities: (textutils). GNU text utilities.
-* Time: (time). Measuring program resource usage.
-* UUCP: (uucp). Copying between machines, offline.
-* Wdiff: (wdiff). Word-by-word comparison.
-* Wget: (wget). URL download.
+GNU Packages
+* accounting: (psacct). GNU process accounting suite.
+* Bash: (bash). Bourne-Again SHell.
+* Cpio: (cpio). Copy-in-copy-out archiver.
+* DC: (dc). Postfix desk calculator.
+* Diff: (diff). Comparing and merging programs.
+* Ed: (ed). Line editor.
+* Emacs: (emacs). Extensible self-documenting text editor.
+* File utilities: (fileutils). GNU file utilities.
+* Finding files: (find). Operating on files matching certain criteria.
+* Font utilities: (fontu). Programs for font manipulation.
+* Gawk: (gawk.info). A text scanning and processing language.
+* Gcal: (gcal). GNU calendar program.
+* Gzip: (gzip). General (de)compression.
+* Identifier DB: (id-utils). Identifier database utilities.
+* Ispell: (ispell). Interactive spelling corrector.
+* M4: (m4). Macro processor.
+* Make: (make). Remake files automatically.
+* Ptx: (ptx). Permuted index generator.
+* Shar utilities: (sharutils). Shell archiver, uudecode/uuencode.
+* Shell utilities: (sh-utils). GNU shell utilities.
+* tar: (tar). Making tape (or disk) archives.
+* Text utilities: (textutils). GNU text utilities.
+* Time: (time). Measuring program resource usage.
+* UUCP: (uucp). Copying between machines, offline.
+* Wdiff: (wdiff). Word-by-word comparison.
+* Wget: (wget). URL download.
GNU programming tools
-* As: (as). Assembler.
-* Binutils: (binutils). ar/copy/objdump/nm/size/strip/ranlib.
-* Bison: (bison). LALR(1) parser generator.
-* CPP: (cpp). C preprocessor.
-* CVS: (cvs). Concurrent versions system for source control.
-* DejaGnu: (dejagnu). Testing framework.
-* Flex: (flex). A fast scanner generator.
-* Gasp: (gasp). GNU Assembler preprocessor.
-* Libtool: (libtool). Generic library support script.
-* GCC: (gcc). C compiler.
-* GDB: (gdb). Source-level debugger for C and C++.
-* Gettext Utilities: (gettext). GNU gettext utilities.
-* Gperf: (gperf). Perfect hash function generator.
-* Gprof: (gprof). Profiler.
-* Indent: (indent). Prettyprinter for programs.
-* Ld: (ld). Linker.
+* As: (as). Assembler.
+* Binutils: (binutils). ar/copy/objdump/nm/size/strip/ranlib.
+* Bison: (bison). LALR(1) parser generator.
+* CPP: (cpp). C preprocessor.
+* CVS: (cvs). Concurrent versions system for source control.
+* DejaGnu: (dejagnu). Testing framework.
+* egcs: (egcs). Experimental GNU C compiler.
+* g77: (g77). GNU Fortran 77 compiler.
+* Flex: (flex). A fast scanner generator.
+* Gasp: (gasp). GNU Assembler preprocessor.
+* Libtool: (libtool). Generic library support script.
+* GCC: (gcc). C compiler.
+* GDB: (gdb). Source-level debugger for C and C++.
+* Gettext Utilities: (gettext). GNU gettext utilities.
+* Gperf: (gperf). Perfect hash function generator.
+* Gprof: (gprof). Profiler.
+* Indent: (indent). Prettyprinter for programs.
+* Ld: (ld). Linker.
+* R FAQ: (R-FAQ). The R statistical language FAQ.
Texinfo documentation system
-* Info: (info). Documentation browsing system.
-* Texinfo: (texinfo). The GNU documentation format.
-* info program: (info-stnd). Standalone Info-reading program.
+* Info: (info). Documentation browsing system.
+* Texinfo: (texinfo). The GNU documentation format.
+* info program: (info-stnd). Standalone Info-reading program.
* install-info: (texinfo)Invoking install-info. Updating info/dir entries.
-* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
-* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
-* makeinfo: (texinfo)makeinfo preferred. Translate Texinfo source.
+* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
+* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
+* makeinfo: (texinfo)makeinfo options. Translate Texinfo source.
+
+Printing Tools
+* a2ps: (a2ps). PostScript Generating Utility
+* PreScript: (a2ps) PreScript. Input language for a2ps
+* card: (a2ps) card. Print Reference Cards
+* fixps: (a2ps) fixps. Fixing Some Ill Designed PostScript Files
+* fixnt: (a2ps) fixnt. Fixing Microsoft NT PostScript Files
+* pdiff: (a2ps) pdiff. Produce Pretty Comparison of Files
+* psmandup: (a2ps) psmandup. Printing Duplex on Simplex Printers
+* psset: (a2ps) psset. Inserting calls to setpagedevice
GNU Emacs Lisp
-* Elisp: (elisp). GNU Emacs Lisp reference manual.
+* Elisp: (elisp). GNU Emacs Lisp reference manual.
* Intro Elisp: (emacs-lisp-intro). Introduction to Elisp programming.
-* AUC TeX: (auctex). Editing (La)TeX files.
-* Calc: (calc). Calculator and more.
-* CC mode: (cc-mode). Editing C, C++, Objective C, and Java.
-* Common Lisp: (cl). Partial Common Lisp support for Emacs Lisp.
-* Dired-x: (dired-x). Extra directory editor features.
-* Edebug: (edebug). Source-level debugger for Emacs Lisp.
-* Ediff: (ediff). Comprehensive visual interface to diff & patch.
-* EDB: (edb). Database for Emacs.
-* Forms: (forms). Fill-in-the-form data entry.
-* Gmhist: (gmhist). Generic minibuffer history.
-* GNUS: (gnus). Netnews reading and posting.
-* Mailcrypt: (mailcrypt). Use PGP in Emacs.
-* MH-E: (mh-e). Emacs interface to the MH mail system.
-* PCL-CVS: (pcl-cvs). Emacs front end to CVS.
-* Supercite: (sc). Supercite for including other people's words.
-* VIP: (vip). vi emulation.
-* VIPER: (viper). The new VI-emulation mode in Emacs-19.29.
-* VM: (vm). Mail reader.
-* W3: (w3). WWW browser.
+* AUC TeX: (auctex). Editing (La)TeX files.
+* Calc: (calc). Calculator and more.
+* CC mode: (ccmode). Editing C, C++, Objective C, and Java.
+* Common Lisp: (cl). Partial Common Lisp support for Emacs Lisp.
+* Dired-x: (dired-x). Extra directory editor features.
+* Edebug: (edebug). Source-level debugger for Emacs Lisp.
+* Ediff: (ediff). Comprehensive visual interface to diff & patch.
+* EDB: (edb). Database for Emacs.
+* Forms: (forms). Fill-in-the-form data entry.
+* Gmhist: (gmhist). Generic minibuffer history.
+* GNUS: (gnus). Netnews reading and posting.
+* Mailcrypt: (mailcrypt). Use PGP in Emacs.
+* MH-E: (mh-e). Emacs interface to the MH mail system.
+* PCL-CVS: (pcl-cvs). Emacs front end to CVS.
+* Supercite: (sc). Supercite for including other people's words.
+* VIP: (vip). vi emulation.
+* VIPER: (viper). The new VI-emulation mode in Emacs-19.29.
+* VM: (vm). Mail reader.
+* W3: (w3). WWW browser.
GNU programming support
-* Autoconf: (autoconf). Automatic generation of package configuration.
-* Configure: (configure). Cygnus configure.
-* Gnats: (gnats). Cygnus bug tracking system.
-* Remsync: (remsync). Remote synchronization of directory trees.
-* Send PR: (send-pr). Cygnus bug reporting for Gnats.
+* Autoconf: (autoconf). Automatic generation of package configuration.
+* Configure: (configure). Cygnus configure.
+* Gnats: (gnats). Cygnus bug tracking system.
+* Remsync: (remsync). Remote synchronization of directory trees.
+* Send PR: (send-pr). Cygnus bug reporting for Gnats.
GNU libraries
-* Annotate: (annotate). High-level GDB to GUI's.
-* BFD: (bfd). Binary file descriptors for object file IO.
-* GDB library: (libgdb). Application programming interface to GDB.
-* GDBM: (gdbm). Hashed databases.
-* History: (history). Recall previous lines of input.
-* Iostream: (iostream). C++ input/output.
-* Libc: (libc). C library.
-* Libg++: (libg++). C++ classes.
-* Mmalloc: (mmalloc). Memory-mapped malloc.
-* Readline: (readline). General command-line interface.
-* Regex: (regex). Regular expressions.
-* Termcap: (termcap). All about /etc/termcap.
+* Annotate: (annotate). High-level GDB to GUI's.
+* BFD: (bfd). Binary file descriptors for object file IO.
+* CVS protocol: (cvsclient). CVS client/server protocol specification.
+* GDB library: (libgdb). Application programming interface to GDB.
+* GDBM: (gdbm). Hashed databases.
+* GDK: (gdk). General drawing kit.
+* GTK: (gtk). GIMP toolkit.
+* History: (history). Recall previous lines of input.
+* Iostream: (iostream). C++ input/output.
+* Libc: (libc). C library.
+* Libg++: (libg++). C++ classes.
+* Mmalloc: (mmalloc). Memory-mapped malloc.
+* Readline: (readline). General command-line interface.
+* Regex: (regex). Regular expressions.
+* Termcap: (termcap). All about /etc/termcap.
GNU programming documentation
-* GDB internals: (gdbint). Debugger internals.
-* Ld internals: (ldint). GNU linker internals.
-* Maintaining: (maintain). Maintaining GNU software.
-* Source config: (cfg-paper). Some theory on configuring source packages.
-* Stabs: (stabs). Symbol table debugging information format.
-* Standards: (standards). GNU coding standards.
+* GDB internals: (gdbint). Debugger internals.
+* Ld internals: (ldint). GNU linker internals.
+* Maintaining: (maintain). Maintaining GNU software.
+* Source config: (cfg-paper). Some theory on configuring source packages.
+* Stabs: (stabs). Symbol table debugging information format.
+* Standards: (standards). GNU coding standards.
Linux
-* dosemu: (dosemu). Linux DOS emulator.
-* gpm: (gpm). Linux general purpose mouse interface.
-* linux-faq: (linux-faq). The Linux FAQ List
+* dosemu: (dosemu). Linux DOS emulator.
+* gpm: (gpm). Linux general purpose mouse interface.
+* linux-faq: (linux-faq). The Linux FAQ List.
+
+Utilities
+* bzip2: (bzip2). (de)compression.
-TeX things
+TeX
* Afm2tfm: (dvips)Invoking afm2tfm. Making Type 1 fonts available to TeX.
-* Dvips: (dvips). DVI-to-PostScript translator.
-* Eplain: (eplain). Expanding on plain TeX.
-* Kpathsearch: (kpathsea). File lookup along search paths.
-* LaTeX: (latex). LaTeX.
-* MakeIndex: (makeindex). Index creation for TeX.
-* Naming fonts: (fontname). Filenames for TeX fonts.
-* TDS: (tds). Standard TeX directory structure.
-* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX.
-* Web2c: (web2c). TeX, Metafont, and their companion programs.
+* Dvips: (dvips). DVI-to-PostScript translator.
+* Eplain: (eplain). Expanding on plain TeX.
+* Kpathsearch: (kpathsea). File lookup along search paths.
+* LaTeX: (latex). LaTeX.
+* MakeIndex: (makeindex). Index creation for TeX.
+* Naming fonts: (fontname). Filenames for TeX fonts.
+* TDS: (tds). Standard TeX directory structure.
+* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX.
+* Web2c: (web2c). TeX, Metafont, and their companion programs.
DOS
-* Demacs: (demacs). GNU Emacs for DOS.
-* GNUish: (gnuish). GNU utilities for DOS.
+* GNUish: (gnuish). GNU utilities for DOS.
+* Mtools: (mtools). Access DOS disks from Unix.
Other things
-* Amd: (amdref). Filesystem automounter.
-* CMUCL: (cmu-user). CMU Common Lisp.
-* File headers: (filehdr). Bibliographic information for computer files.
-* GCP: (gcp). Game club protocol.
-* GIMP: (pdb). The GIMP procedural database.
-* HTML: (snafu). Hypertext Markup Language 2.0 specification.
-* Jargon: (jargon). The jargon file.
-* JED: (jed). JED editor documentation.
-* octave: (octave). Octave - A language for numerical computation.
-* Perl: (perl). Practical extraction and report language.
-* PRCS: (prcs). Project revision control system.
-* Screen: (screen). Virtual screen manager.
-* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info.
+* Amd: (am-utils). Filesystem automounter.
+* CMUCL: (cmu-user). CMU Common Lisp.
+* File headers: (filehdr). Bibliographic information for computer files.
+* GCP: (gcp). Game club protocol.
+* GIMP: (pdb). The GIMP procedural database.
+* HTML: (snafu). Hypertext Markup Language 2.0 specification.
+* Jargon: (jargon). The jargon file.
+* JED: (jed). JED editor documentation.
+* octave: (octave). Octave - A language for numerical computation.
+* Perl: (perl). Practical extraction and report language.
+* PRCS: (prcs). Project revision control system.
+* Screen: (screen). Terminal multiplexer.
+* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info.
Individual utilities
-* aclocal: (automake)Invoking aclocal. Generating aclocal.m4.
-* aid: (id-utils)aid invocation. Matching strings.
-* ar: (binutils)ar. Create/modify/extract archives.
-* at-pr: (gnats)at-pr. Bug report timely reminders.
-* automake: (automake). Making Makefile.in's.
-* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's.
-* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in.
-* awk: (gawk)Invoking gawk. Text processing and scanning.
-* basename: (sh-utils)basename invocation. Strip directory and suffix.
-* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies.
-* c++filt: (binutils)c++filt. Demangle C++ symbols.
-* cat: (textutils)cat invocation. Concatenate and write files.
-* chgrp: (fileutils)chgrp invocation. Change file groups.
-* chmod: (fileutils)chmod invocation. Change file permissions.
-* chown: (fileutils)chown invocation. Change file owners/groups.
-* chroot: (sh-utils)chroot invocation. Specify the root directory.
-* cksum: (textutils)cksum invocation. Print POSIX CRC checksum.
-* cmp: (diff)Invoking cmp. Character-by-character diff.
-* comm: (textutils)comm invocation. Compare sorted files by line.
-* cp: (fileutils)cp invocation. Copy files.
-* csplit: (textutils)csplit invocation. Split by context.
-* cut: (textutils)cut invocation. Print selected parts of lines.
-* date: (sh-utils)date invocation. Print/set system date and time.
-* dd: (fileutils)dd invocation. Copy and convert a file.
-* df: (fileutils)df invocation. Report filesystem disk usage.
-* diff3: (diff)Invoking diff3. Three-way diff.
-* dir: (fileutils)dir invocation. List directories briefly.
-* dircolors: (fileutils)dircolors invocation. Color setup for ls.
-* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
-* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures).
-* du: (fileutils)du invocation. Report on disk usage.
-* dvicopy: (web2c)DVIcopy invocation. Virtual font expansion
-* dvitomp: (web2c)DVItoMP invocation. DVI to MPX (MetaPost pictures).
-* dvitype: (web2c)DVItype invocation. DVI to human-readable text.
-* echo: (sh-utils)echo invocation. Print a line of text.
-* edit-pr: (gnats)Invoking edit-pr. Changing bugs.
-* eid: (id-utils)eid invocation. Invoking an editor on matches.
-* emacsclient: (emacs)Emacs Server. Connecting to a running Emacs.
-* emacsserver: (emacs)Emacs Server. Connecting to a running Emacs.
-* env: (sh-utils)env invocation. Modify the environment.
-* etags: (emacs)Create Tags Table. Creating a TAGS table.
-* expand: (textutils)expand invocation. Convert tabs to spaces.
-* expr: (sh-utils)expr invocation. Evaluate expressions.
-* factor: (sh-utils)factor invocation. Print prime factors
-* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
-* fid: (id-utils)fid invocation. Listing a file's identifiers.
-* file-pr: (gnats)file-pr. Processing incoming traffic.
-* find: (find)Invoking find. Finding and acting on files.
-* fmt: (textutils)fmt invocation. Reformat paragraph text.
-* fold: (textutils)fold invocation. Wrap long input lines.
-* g++: (gcc)Invoking G++. The GNU C++ compiler.
-* gcal2txt: (gcal)Invoking gcal2txt. Calendar resource to text file.
-* gettextize: (gettext)gettextize Invocation. Prepare a package for gettext.
-* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets.
-* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts.
-* gftype: (web2c)GFtype invocation. GF to human-readable text.
-* gid: (id-utils)gid invocation. Listing all matching lines.
-* git: (git). GNU interactive tools.
-* groups: (sh-utils)groups invocation. Print group names a user is in.
-* gunzip: (gzip)Overview. Decompression.
-* head: (textutils)head invocation. Output the first part of files.
-* hostname: (sh-utils)hostname invocation. Print or set system name.
-* id: (sh-utils)id invocation. Print real/effective uid/gid.
-* idx: (id-utils)idx invocation. Testing mkid scanners.
-* ifnames: (autoconf)Invoking ifnames. List conditionals in source.
-* iid: (id-utils)iid invocation. Interactive complex queries.
-* inimf: (web2c)inimf invocation. Initial Metafont.
-* inimp: (web2c)inimp invocation. Initial MetaPost.
-* initex: (web2c)initex invocation. Initial TeX.
-* install: (fileutils)install invocation. Copy and change attributes.
-* join: (textutils)join invocation. Join lines on a common field.
-* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
-* lid: (id-utils)lid invocation. Matching identifier patterns.
-* ln: (fileutils)ln invocation. Make links between files.
-* locate: (find)Invoking locate. Finding files in a database.
-* logname: (sh-utils)logname invocation. Print current login name.
-* ls: (fileutils)ls invocation. List directory contents.
-* makempx: (web2c)MakeMPX invocation. MetaPost label typesetting.
-* maketexmf: (kpathsea)MakeTeX scripts. MF source generation.
-* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation.
-* maketextex: (kpathsea)MakeTeX scripts. TeX source generation.
-* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation.
-* md5sum: (textutils)md5sum invocation. Print or check message-digests.
-* mf: (web2c)mf invocation. Creating typeface families.
-* mft: (web2c)MFT invocation. Prettyprinting Metafont source.
-* mkdir: (fileutils)mkdir invocation. Create directories.
-* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes).
-* mkid: (id-utils)mkid invocation. Creating an ID database.
-* mknod: (fileutils)mknod invocation. Create special files.
-* mp: (web2c)mp invocation. Creating technical diagrams.
-* mpto: (web2c)MPto invocation. MetaPost label extraction.
-* msgfmt: (gettext)msgfmt Invocation. Make MO files out of PO files.
-* msgmerge: (gettext)msgmerge Invocation. Update two PO files into one.
-* mv: (fileutils)mv invocation. Rename files.
-* newer: (web2c)Newer invocation. Compare modification times.
-* nice: (sh-utils)nice invocation. Modify scheduling priority.
-* nl: (textutils)nl invocation. Number lines and write files.
-* nlmconv: (binutils)nlmconv. Convert object to NetWare LM.
-* nm: (binutils)nm. List symbols in object files.
-* nohup: (sh-utils)nohup invocation. Immunize to hangups.
-* objcopy: (binutils)objcopy. Copy/translate object files.
-* objdump: (binutils)objdump. Display info from object files.
-* od: (textutils)od invocation. Dump files in octal, etc.
-* paste: (textutils)paste invocation. Merge lines of files.
-* patch: (diff)Invoking patch. Automatically applying diffs.
-* patgen: (web2c)Patgen invocation. Creating hyphenation patterns.
-* pathchk: (sh-utils)pathchk invocation. Check file name portability.
-* pid: (id-utils)pid invocation. Looking up filenames.
-* pktogf: (web2c)PKtoGF invocation. Packed to generic fonts.
-* pktype: (web2c)PKtype invocation. PK to human-readable text.
-* pltotf: (web2c)PLtoTF invocation. Property list to TFM.
-* pooltype: (web2c)Pooltype invocation. Display WEB pool files.
-* pr-addr: (gnats)pr-addr. Bug report address retrieval.
-* pr-edit: (gnats)pr-edit. The edit-pr driver.
-* pr: (textutils)pr invocation. Paginate or columnate files.
-* printenv: (sh-utils)printenv invocation. Print environment variables.
-* printf: (sh-utils)printf invocation. Format and print data.
-* pwd: (sh-utils)pwd invocation. Print working directory.
-* query-pr: (gnats)Invoking query-pr. Bug searching/reporting.
-* queue-pr: (gnats)queue-pr. Handling incoming traffic.
-* ranlib: (binutils)ranlib. Index archive file contents.
-* rm: (fileutils)rm invocation. Remove files.
-* rmdir: (fileutils)rmdir invocation. Remove empty directories.
-* sdiff: (diff)Invoking sdiff. Interactively merge files.
-* send-pr: (gnats)Invoking send-pr. Submitting bugs.
-* seq: (sh-utils)seq invocation. Print numeric sequences
-* shar: (sharutils)shar invocation. Create shell archive.
-* size: (binutils)size. List object file section sizes.
-* sleep: (sh-utils)sleep invocation. Delay for a specified time.
-* sort: (textutils)sort invocation. Sort text files.
-* split: (textutils)split invocation. Split into fixed-size pieces.
-* strings: (binutils)strings. List printable strings.
-* strip: (binutils)strip. Discard symbols.
-* stty: (sh-utils)stty invocation. Print/change terminal settings.
-* su: (sh-utils)su invocation. Modify user and group id.
-* sum: (textutils)sum invocation. Print traditional checksum.
-* sync: (fileutils)sync invocation. Synchronize memory and disk.
-* tabs: (tput)Invoking tabs. Tab settings.
-* tac: (textutils)tac invocation. Reverse files.
-* tail: (textutils)tail invocation. Output the last part of files.
-* tangle: (web2c)Tangle invocation. WEB to Pascal.
-* tcal: (gcal)Invoking tcal. Run Gcal with tomorrow's date.
-* tee: (sh-utils)tee invocation. Redirect to multiple files.
-* test: (sh-utils)test invocation. File/string tests.
-* tex: (web2c)tex invocation. Typesetting.
-* tftopl: (web2c)TFtoPL invocation. TFM -> property list.
-* touch: (fileutils)touch invocation. Change file timestamps.
-* tput: (tput)Invoking tput. Termcap in shell scripts.
-* tr: (textutils)tr invocation. Translate characters.
-* true: (sh-utils)true invocation. Do nothing, successfully.
-* tty: (sh-utils)tty invocation. Print terminal name.
-* txt2gcal: (gcal)Invoking txt2gcal. Calendar text to resource file.
-* uname: (sh-utils)uname invocation. Print system information.
-* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
-* uniq: (textutils)uniq invocation. Uniqify files.
-* unshar: (sharutils)unshar invocation. Extract from shell archive.
-* updatedb: (find)Invoking updatedb. Building the locate database.
-* users: (sh-utils)users invocation. Print current user names.
-* vdir: (fileutils)vdir invocation. List directories verbosely.
-* vftovp: (web2c)VFtoVP invocation. Virtual font -> virtual pl.
-* view-pr: (gnats)Invoking view-pr. Showing bug reports.
-* virmf: (web2c)virmf invocation. Virgin Metafont.
-* virmp: (web2c)virmp invocation. Virgin MetaPost.
-* virtex: (web2c)virtex invocation. Virgin TeX.
-* vptovf: (web2c)VPtoVF invocation. Virtual pl -> virtual font.
-* wc: (textutils)wc invocation. Byte, word, and line counts.
-* weave: (web2c)Weave invocation. WEB to TeX.
-* who: (sh-utils)who invocation. Print who is logged in.
-* whoami: (sh-utils)whoami invocation. Print effective user id.
-* xargs: (find)Invoking xargs. Operating on many files.
-* xgettext: (gettext)xgettext Invocation. Extract strings into a PO file.
-* yes: (sh-utils)yes invocation. Print a string indefinitely.
-* zcat: (gzip)Overview. Decompression to stdout.
+* aclocal: (automake)Invoking aclocal. Generating aclocal.m4.
+* aid: (id-utils)aid invocation. Matching strings.
+* ar: (binutils)ar. Create/modify/extract archives.
+* at-pr: (gnats)at-pr. Bug report timely reminders.
+* automake: (automake). Making Makefile.in's.
+* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's.
+* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in.
+* awk: (gawk)Invoking gawk. Text processing and scanning.
+* basename: (sh-utils)basename invocation. Strip directory and suffix.
+* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies.
+* c++filt: (binutils)c++filt. Demangle C++ symbols.
+* cat: (textutils)cat invocation. Concatenate and write files.
+* chgrp: (fileutils)chgrp invocation. Change file groups.
+* chmod: (fileutils)chmod invocation. Change file permissions.
+* chown: (fileutils)chown invocation. Change file owners/groups.
+* chroot: (sh-utils)chroot invocation. Specify the root directory.
+* cksum: (textutils)cksum invocation. Print POSIX CRC checksum.
+* cmp: (diff)Invoking cmp. Character-by-character diff.
+* comm: (textutils)comm invocation. Compare sorted files by line.
+* cp: (fileutils)cp invocation. Copy files.
+* csplit: (textutils)csplit invocation. Split by context.
+* cut: (textutils)cut invocation. Print selected parts of lines.
+* date: (sh-utils)date invocation. Print/set system date and time.
+* dd: (fileutils)dd invocation. Copy and convert a file.
+* df: (fileutils)df invocation. Report filesystem disk usage.
+* diff3: (diff)Invoking diff3. Three-way diff.
+* dir: (fileutils)dir invocation. List directories briefly.
+* dircolors: (fileutils)dircolors invocation. Color setup for ls.
+* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
+* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures).
+* du: (fileutils)du invocation. Report on disk usage.
+* dvicopy: (web2c)DVIcopy invocation. Virtual font expansion
+* dvitomp: (web2c)DVItoMP invocation. DVI to MPX (MetaPost pictures).
+* dvitype: (web2c)DVItype invocation. DVI to human-readable text.
+* echo: (sh-utils)echo invocation. Print a line of text.
+* edit-pr: (gnats)Invoking edit-pr. Changing bugs.
+* eid: (id-utils)eid invocation. Invoking an editor on matches.
+* emacsclient: (emacs)Emacs Server. Connecting to a running Emacs.
+* emacsserver: (emacs)Emacs Server. Connecting to a running Emacs.
+* env: (sh-utils)env invocation. Modify the environment.
+* etags: (emacs)Create Tags Table. Creating a TAGS table.
+* expand: (textutils)expand invocation. Convert tabs to spaces.
+* expr: (sh-utils)expr invocation. Evaluate expressions.
+* factor: (sh-utils)factor invocation. Print prime factors
+* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
+* fid: (id-utils)fid invocation. Listing a file's identifiers.
+* file-pr: (gnats)file-pr. Processing incoming traffic.
+* find: (find)Invoking find. Finding and acting on files.
+* fmt: (textutils)fmt invocation. Reformat paragraph text.
+* fold: (textutils)fold invocation. Wrap long input lines.
+* g++: (gcc)Invoking G++. The GNU C++ compiler.
+* gcal2txt: (gcal)Invoking gcal2txt. Calendar resource to text file.
+* gettextize: (gettext)gettextize Invocation. Prepare a package for gettext.
+* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets.
+* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts.
+* gftype: (web2c)GFtype invocation. GF to human-readable text.
+* gid: (id-utils)gid invocation. Listing all matching lines.
+* git: (git). GNU interactive tools.
+* groups: (sh-utils)groups invocation. Print group names a user is in.
+* gunzip: (gzip)Overview. Decompression.
+* head: (textutils)head invocation. Output the first part of files.
+* hostname: (sh-utils)hostname invocation. Print or set system name.
+* id: (sh-utils)id invocation. Print real/effective uid/gid.
+* idx: (id-utils)idx invocation. Testing mkid scanners.
+* ifnames: (autoconf)Invoking ifnames. List conditionals in source.
+* iid: (id-utils)iid invocation. Interactive complex queries.
+* inimf: (web2c)inimf invocation. Initial Metafont.
+* inimp: (web2c)inimp invocation. Initial MetaPost.
+* initex: (web2c)initex invocation. Initial TeX.
+* install: (fileutils)install invocation. Copy and change attributes.
+* join: (textutils)join invocation. Join lines on a common field.
+* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
+* libtoolize: (libtool)Invoking libtoolize. Adding libtool support.
+* lid: (id-utils)lid invocation. Matching identifier patterns.
+* ln: (fileutils)ln invocation. Make links between files.
+* locate: (find)Invoking locate. Finding files in a database.
+* logname: (sh-utils)logname invocation. Print current login name.
+* ls: (fileutils)ls invocation. List directory contents.
+* mail-files: (sharutils)mail-files invocation. Send files to remote site.
+* mailshar: (sharutils)mailshar invocation. Make and send a shell archive.
+* makempx: (web2c)MakeMPX invocation. MetaPost label typesetting.
+* maketexmf: (kpathsea)MakeTeX scripts. MF source generation.
+* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation.
+* maketextex: (kpathsea)MakeTeX scripts. TeX source generation.
+* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation.
+* md5sum: (textutils)md5sum invocation. Print or check message-digests.
+* mf: (web2c)mf invocation. Creating typeface families.
+* mft: (web2c)MFT invocation. Prettyprinting Metafont source.
+* mgetty: (mgetty). Faxes, voicemail and more.
+* mkdir: (fileutils)mkdir invocation. Create directories.
+* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes).
+* mkid: (id-utils)mkid invocation. Creating an ID database.
+* mknod: (fileutils)mknod invocation. Create special files.
+* mp: (web2c)mp invocation. Creating technical diagrams.
+* mpto: (web2c)MPto invocation. MetaPost label extraction.
+* msgfmt: (gettext)msgfmt Invocation. Make MO files out of PO files.
+* msgmerge: (gettext)msgmerge Invocation. Update two PO files into one.
+* mv: (fileutils)mv invocation. Rename files.
+* newer: (web2c)Newer invocation. Compare modification times.
+* nice: (sh-utils)nice invocation. Modify scheduling priority.
+* nl: (textutils)nl invocation. Number lines and write files.
+* nlmconv: (binutils)nlmconv. Convert object to NetWare LM.
+* nm: (binutils)nm. List symbols in object files.
+* nohup: (sh-utils)nohup invocation. Immunize to hangups.
+* objcopy: (binutils)objcopy. Copy/translate object files.
+* objdump: (binutils)objdump. Display info from object files.
+* od: (textutils)od invocation. Dump files in octal, etc.
+* paste: (textutils)paste invocation. Merge lines of files.
+* patch: (diff)Invoking patch. Automatically applying diffs.
+* patgen: (web2c)Patgen invocation. Creating hyphenation patterns.
+* pathchk: (sh-utils)pathchk invocation. Check file name portability.
+* pid: (id-utils)pid invocation. Looking up filenames.
+* pktogf: (web2c)PKtoGF invocation. Packed to generic fonts.
+* pktype: (web2c)PKtype invocation. PK to human-readable text.
+* pltotf: (web2c)PLtoTF invocation. Property list to TFM.
+* pooltype: (web2c)Pooltype invocation. Display WEB pool files.
+* pr-addr: (gnats)pr-addr. Bug report address retrieval.
+* pr-edit: (gnats)pr-edit. The edit-pr driver.
+* pr: (textutils)pr invocation. Paginate or columnate files.
+* printenv: (sh-utils)printenv invocation. Print environment variables.
+* printf: (sh-utils)printf invocation. Format and print data.
+* pwd: (sh-utils)pwd invocation. Print working directory.
+* query-pr: (gnats)Invoking query-pr. Bug searching/reporting.
+* queue-pr: (gnats)queue-pr. Handling incoming traffic.
+* ranlib: (binutils)ranlib. Index archive file contents.
+* rm: (fileutils)rm invocation. Remove files.
+* rmdir: (fileutils)rmdir invocation. Remove empty directories.
+* sdiff: (diff)Invoking sdiff. Interactively merge files.
+* send-pr: (gnats)Invoking send-pr. Submitting bugs.
+* seq: (sh-utils)seq invocation. Print numeric sequences
+* shar: (sharutils)shar invocation. Create shell archive.
+* size: (binutils)size. List object file section sizes.
+* sleep: (sh-utils)sleep invocation. Delay for a specified time.
+* sort: (textutils)sort invocation. Sort text files.
+* split: (textutils)split invocation. Split into fixed-size pieces.
+* strings: (binutils)strings. List printable strings.
+* strip: (binutils)strip. Discard symbols.
+* stty: (sh-utils)stty invocation. Print/change terminal settings.
+* su: (sh-utils)su invocation. Modify user and group id.
+* sum: (textutils)sum invocation. Print traditional checksum.
+* sync: (fileutils)sync invocation. Synchronize memory and disk.
+* tabs: (tput)Invoking tabs. Tab settings.
+* tac: (textutils)tac invocation. Reverse files.
+* tail: (textutils)tail invocation. Output the last part of files.
+* tangle: (web2c)Tangle invocation. WEB to Pascal.
+* tcal: (gcal)Invoking tcal. Run Gcal with tomorrow's date.
+* tee: (sh-utils)tee invocation. Redirect to multiple files.
+* test: (sh-utils)test invocation. File/string tests.
+* tex: (web2c)tex invocation. Typesetting.
+* tftopl: (web2c)TFtoPL invocation. TFM -> property list.
+* touch: (fileutils)touch invocation. Change file timestamps.
+* tput: (tput)Invoking tput. Termcap in shell scripts.
+* tr: (textutils)tr invocation. Translate characters.
+* true: (sh-utils)true invocation. Do nothing, successfully.
+* tty: (sh-utils)tty invocation. Print terminal name.
+* txt2gcal: (gcal)Invoking txt2gcal. Calendar text to resource file.
+* umb-scheme: (umb-scheme). UMB Scheme Interpreter.
+* uname: (sh-utils)uname invocation. Print system information.
+* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
+* uniq: (textutils)uniq invocation. Uniqify files.
+* unshar: (sharutils)unshar invocation. Extract from shell archive.
+* updatedb: (find)Invoking updatedb. Building the locate database.
+* users: (sh-utils)users invocation. Print current user names.
+* vdir: (fileutils)vdir invocation. List directories verbosely.
+* vftovp: (web2c)VFtoVP invocation. Virtual font -> virtual pl.
+* view-pr: (gnats)Invoking view-pr. Showing bug reports.
+* virmf: (web2c)virmf invocation. Virgin Metafont.
+* virmp: (web2c)virmp invocation. Virgin MetaPost.
+* virtex: (web2c)virtex invocation. Virgin TeX.
+* vptovf: (web2c)VPtoVF invocation. Virtual pl -> virtual font.
+* wc: (textutils)wc invocation. Byte, word, and line counts.
+* weave: (web2c)Weave invocation. WEB to TeX.
+* who: (sh-utils)who invocation. Print who is logged in.
+* whoami: (sh-utils)whoami invocation. Print effective user id.
+* xargs: (find)Invoking xargs. Operating on many files.
+* xgettext: (gettext)xgettext Invocation. Extract strings into a PO file.
+* yes: (sh-utils)yes invocation. Print a string indefinitely.
+* zcat: (gzip)Overview. Decompression to stdout.
+* zsh: (zsh). An enhanced Bourne shell.
diff --git a/gnu/usr.bin/texinfo/doc/Makefile.am b/gnu/usr.bin/texinfo/doc/Makefile.am
index f7c8e616237..fb305b27686 100644
--- a/gnu/usr.bin/texinfo/doc/Makefile.am
+++ b/gnu/usr.bin/texinfo/doc/Makefile.am
@@ -1,26 +1,60 @@
## Makefile.am for texinfo/emacs.
-## $Id: Makefile.am,v 1.2 1999/01/11 16:38:02 espie Exp $
+## $Id: Makefile.am,v 1.3 2000/02/09 02:18:37 espie Exp $
## Run automake in .. to produce Makefile.in from this.
-info_TEXINFOS = info-stnd.texi info.texi texinfo.txi
+# Put texinfo.txi first because that's the best candidate UPDATED in
+# version.texi.
+info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
+
+man_MANS = info.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 \
+ info.5 texinfo.5
+HELP2MAN = help2man
+noinst_SCRIPTS = $(HELP2MAN)
# Use the programs built in our distribution.
MAKEINFO = ../makeinfo/makeinfo
INSTALL_INFO = ../util/install-info
# Include our texinfo.tex, not Automake's.
-EXTRA_DIST = macro.texi userdoc.texi epsf.tex texinfo.tex
-
-# We try to discover this via configure just to give a better help message.
-TEXMF = @TEXMF@
+EXTRA_DIST = macro.texi userdoc.texi epsf.tex texinfo.tex \
+ txi-cs.tex txi-de.tex txi-en.tex txi-es.tex \
+ txi-nl.tex txi-no.tex txi-pt.tex \
+ $(man_MANS) $(noinst_SCRIPTS)
install-data-local:
- @echo "WARNING: You must install texinfo.tex and epsf.tex manually,"
- @echo "WARNING: perhaps in $(TEXMF)/tex/texinfo/"
- @echo "WARNING: and $(TEXMF)/tex/generic/dvips/ respectively."
+ @echo "WARNING: You must install texinfo.tex, txi-??.tex, and epsf.tex manually,"
+ @echo "WARNING: perhaps in TEXMF/tex/texinfo/ and"
+ @echo "WARNING: TEXMF/tex/generic/dvips/ respectively,"
+ @echo "WARNING: where TEXMF is a root of your TeX tree."
@echo "WARNING: See doc/README for some considerations."
+ @echo "WARNING: You can run make TEXMF=/your/texmf install-tex to do this."
+
+texmf_texinfo = $(TEXMF)/tex/texinfo
+texmf_dvips = $(TEXMF)/tex/generic/dvips
+install-tex:
+ test -n "$(TEXMF)" || (echo "TEXMF must be set." >&2; exit 1)
+ $(mkinstalldirs) $(texmf_texinfo) $(texmf_dvips)
+ $(INSTALL_DATA) texinfo.tex $(texmf_texinfo)/texinfo.tex
+ $(INSTALL_DATA) txi-cs.tex $(texmf_texinfo)/txi-cs.tex
+ $(INSTALL_DATA) txi-de.tex $(texmf_texinfo)/txi-de.tex
+ $(INSTALL_DATA) txi-no.tex $(texmf_texinfo)/txi-no.tex
+ $(INSTALL_DATA) epsf.tex $(texmf_dvips)/epsf.tex
+
+# Don't want to run help2man at every installation.
+if TEXINFO_MAINT
+info.1: ../info/ginfo $(HELP2MAN)
+ $(HELP2MAN) --name="read Info documents" $< >$@
+install-info.1: $(INSTALL_INFO) $(HELP2MAN)
+ $(HELP2MAN) --name="update info/dir entries" $< >$@
+makeinfo.1: $(MAKEINFO) $(HELP2MAN)
+ $(HELP2MAN) --name="translate Texinfo documents" $< >$@
+texi2dvi.1: ../util/texi2dvi $(HELP2MAN)
+ $(HELP2MAN) --name="print Texinfo documents" $< >$@
+texindex.1: ../util/texindex $(HELP2MAN)
+ $(HELP2MAN) --name="sort Texinfo index files" $< >$@
+endif
-# Do not create info files for distribution.
+# Do not create info files for distribution, but do create man pages.
dist-info:
# Do not try to build the info files in $(srcdir),
diff --git a/gnu/usr.bin/texinfo/doc/Makefile.in b/gnu/usr.bin/texinfo/doc/Makefile.in
index ae5d508ca5e..417d042262a 100644
--- a/gnu/usr.bin/texinfo/doc/Makefile.in
+++ b/gnu/usr.bin/texinfo/doc/Makefile.in
@@ -1,11 +1,20 @@
-# Makefile.in generated automatically by automake 1.2 from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+# 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.
-SHELL = /bin/sh
+# Put texinfo.txi first because that's the best candidate UPDATED in
+# version.texi.
+
+
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -26,6 +35,8 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
+DESTDIR =
+
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -38,17 +49,17 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
-NORMAL_INSTALL = true
-PRE_INSTALL = true
-POST_INSTALL = true
-NORMAL_UNINSTALL = true
-PRE_UNINSTALL = true
-POST_UNINSTALL = true
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -58,6 +69,7 @@ GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
+INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
@@ -69,66 +81,104 @@ POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
l = @l@
-info_TEXINFOS = info-stnd.texi info.texi texinfo.texi
+info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
+
+man_MANS = info.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 info.5 texinfo.5
-# Use the makeinfo built in our distribution.
+HELP2MAN = help2man
+noinst_SCRIPTS = $(HELP2MAN)
+
+# Use the programs built in our distribution.
MAKEINFO = ../makeinfo/makeinfo
+INSTALL_INFO = ../util/install-info
# Include our texinfo.tex, not Automake's.
-EXTRA_DIST = macro.texi userdoc.texi epsf.tex texinfo.tex
+EXTRA_DIST = macro.texi userdoc.texi epsf.tex texinfo.tex txi-cs.tex txi-de.tex txi-en.tex txi-es.tex txi-nl.tex txi-no.tex txi-pt.tex $(man_MANS) $(noinst_SCRIPTS)
+
-# We try to discover this via configure just to give a better help message.
-TEXMF = @TEXMF@
+texmf_texinfo = $(TEXMF)/tex/texinfo
+texmf_dvips = $(TEXMF)/tex/generic/dvips
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
+SCRIPTS = $(noinst_SCRIPTS)
+
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
TEXI2DVI = texi2dvi
-TEXINFO_TEX = $(srcdir)/texinfo.tex
-INFO_DEPS = info-stnd.info info.info texinfo
-DVIS = info-stnd.dvi info.dvi texinfo.dvi
-TEXINFOS = info-stnd.texi info.texi texinfo.texi
-DIST_COMMON = README $(info_TEXINFOS) Makefile.am Makefile.in \
-texinfo.tex
+INFO_DEPS = texinfo info-stnd.info info.info
+DVIS = texinfo.dvi info-stnd.dvi info.dvi
+TEXINFOS = texinfo.txi info-stnd.texi info.texi
+man1dir = $(mandir)/man1
+man5dir = $(mandir)/man5
+MANS = $(man_MANS)
+NROFF = nroff
+DIST_COMMON = README $(info_TEXINFOS) Makefile.am Makefile.in mdate-sh \
+stamp-vti stamp-vti.1 texinfo.tex version.texi
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
-default: all
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
.SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo
+.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-info-stnd.info: info-stnd.texi
-info-stnd.dvi: info-stnd.texi
+$(srcdir)/version.texi: stamp-vti
+ @:
+$(srcdir)/stamp-vti: texinfo.txi $(top_srcdir)/configure.in
+ @echo "@set UPDATED `$(SHELL) $(srcdir)/mdate-sh $(srcdir)/texinfo.txi`" > vti.tmp
+ @echo "@set EDITION $(VERSION)" >> vti.tmp
+ @echo "@set VERSION $(VERSION)" >> vti.tmp
+ @cmp -s vti.tmp $(srcdir)/version.texi \
+ || (echo "Updating $(srcdir)/version.texi"; \
+ cp vti.tmp $(srcdir)/version.texi)
+ -@rm -f vti.tmp
+ @cp $(srcdir)/version.texi $@
-info.info: info.texi $(info_TEXINFOS)
-info.dvi: info.texi $(info_TEXINFOS)
+mostlyclean-vti:
+ -rm -f vti.tmp
+
+clean-vti:
+
+distclean-vti:
+maintainer-clean-vti:
+ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
-texinfo: texinfo.texi
-texinfo.dvi: texinfo.texi
+texinfo: texinfo.txi version.texi
+texinfo.dvi: texinfo.txi version.texi
+
+
+info-stnd.info: info-stnd.texi version.texi
+info-stnd.dvi: info-stnd.texi version.texi
+
+
+info.info: info.texi $(info_TEXINFOS)
+info.dvi: info.texi $(info_TEXINFOS)
DVIPS = dvips
.texi.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texi:
@@ -147,8 +197,22 @@ DVIPS = dvips
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+ @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ cd $(srcdir) \
+ && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+
+.txi.dvi:
+ TEXINPUTS=.:$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+ @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ cd $(srcdir) \
+ && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.dvi.ps:
$(DVIPS) $< -o $@
@@ -157,33 +221,114 @@ uninstall-info:
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
ii=yes; \
else ii=; fi; \
- for file in $(INFO_DEPS); do \
- test -z $ii || install-info --info-dir=$(infodir) --remove $$file; \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ test -z "$ii" \
+ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
- $(NORMAL_UNINSTALL)
- for file in $(INFO_DEPS); do \
- (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+ @$(NORMAL_UNINSTALL)
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done
mostlyclean-aminfo:
- rm -f info-stnd.aux info-stnd.cp info-stnd.cps info-stnd.dvi \
- info-stnd.fn info-stnd.fns info-stnd.ky info-stnd.log \
- info-stnd.pg info-stnd.toc info-stnd.tp info-stnd.tps \
- info-stnd.vr info-stnd.vrs info-stnd.op info-stnd.tr \
- info-stnd.cv info.aux info.cp info.cps info.dvi info.fn \
- info.fns info.ky info.log info.pg info.toc info.tp info.tps \
- info.vr info.vrs info.op info.tr info.cv texinfo.aux \
- texinfo.cp texinfo.cps texinfo.dvi texinfo.fn texinfo.fns \
- texinfo.ky texinfo.log texinfo.pg texinfo.toc texinfo.tp \
- texinfo.tps texinfo.vr texinfo.vrs texinfo.op texinfo.tr \
- texinfo.cv
+ -rm -f texinfo.aux texinfo.cp texinfo.cps texinfo.dvi texinfo.fn \
+ texinfo.fns texinfo.ky texinfo.kys texinfo.ps texinfo.log \
+ texinfo.pg texinfo.toc texinfo.tp texinfo.tps texinfo.vr \
+ texinfo.vrs texinfo.op texinfo.tr texinfo.cv texinfo.cn \
+ info-stnd.aux info-stnd.cp info-stnd.cps info-stnd.dvi \
+ info-stnd.fn info-stnd.fns info-stnd.ky info-stnd.kys \
+ info-stnd.ps info-stnd.log info-stnd.pg info-stnd.toc \
+ info-stnd.tp info-stnd.tps info-stnd.vr info-stnd.vrs \
+ info-stnd.op info-stnd.tr info-stnd.cv info-stnd.cn info.aux \
+ info.cp info.cps info.dvi info.fn info.fns info.ky info.kys \
+ info.ps info.log info.pg info.toc info.tp info.tps info.vr \
+ info.vrs info.op info.tr info.cv info.cn
clean-aminfo:
distclean-aminfo:
maintainer-clean-aminfo:
- for i in $(INFO_DEPS); do rm -f `eval echo $$i*`; done
+ cd $(srcdir) && for i in $(INFO_DEPS); do \
+ rm -f $$i; \
+ if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
+ rm -f $$i-[0-9]*; \
+ fi; \
+ done
+
+install-man1:
+ $(mkinstalldirs) $(DESTDIR)$(man1dir)
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+ done
+
+uninstall-man1:
+ @list='$(man1_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man1dir)/$$inst; \
+ done
+
+install-man5:
+ $(mkinstalldirs) $(DESTDIR)$(man5dir)
+ @list='$(man5_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.5*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \
+ done
+
+uninstall-man5:
+ @list='$(man5_MANS)'; \
+ l2='$(man_MANS)'; for i in $$l2; do \
+ case "$$i" in \
+ *.5*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man5dir)/$$inst; \
+ done
+install-man: $(MANS)
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-man1 install-man5
+uninstall-man:
+ @$(NORMAL_UNINSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 uninstall-man5
tags: TAGS
TAGS:
@@ -195,85 +340,127 @@ subdir = doc
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
- $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
-info: $(INFO_DEPS)
-dvi: $(DVIS)
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data: install-info-am install-data-local
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall: uninstall-info
-
-all: Makefile $(INFO_DEPS)
-
+ $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
+info-am: $(INFO_DEPS)
+info: info-am
+dvi-am: $(DVIS)
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-info-am install-data-local
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-info uninstall-man
+uninstall: uninstall-am
+all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(MANS)
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
- $(mkinstalldirs) $(infodir)
+ $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(mandir)/man1 \
+ $(DESTDIR)$(mandir)/man5
mostlyclean-generic:
- test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- rm -f Makefile $(DISTCLEANFILES)
- rm -f config.cache config.log stamp-h stamp-h[0-9]*
- test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
- test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-aminfo mostlyclean-generic
+mostlyclean-am: mostlyclean-vti mostlyclean-aminfo \
+ mostlyclean-generic
-clean: clean-aminfo clean-generic mostlyclean
+mostlyclean: mostlyclean-am
-distclean: distclean-aminfo distclean-generic clean
- rm -f config.status
+clean-am: clean-vti clean-aminfo clean-generic \
+ mostlyclean-am
-maintainer-clean: maintainer-clean-aminfo maintainer-clean-generic \
- distclean
+clean: clean-am
+
+distclean-am: distclean-vti distclean-aminfo \
+ distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-vti maintainer-clean-vti.1 \
+ maintainer-clean-aminfo maintainer-clean-generic \
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
-distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
-dvi installcheck install-exec install-data install uninstall all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-vti distclean-vti clean-vti maintainer-clean-vti \
+mostlyclean-vti.1 distclean-vti.1 clean-vti.1 maintainer-clean-vti.1 \
+install-info-am uninstall-info mostlyclean-aminfo distclean-aminfo \
+clean-aminfo maintainer-clean-aminfo install-man1 uninstall-man1 \
+install-man5 uninstall-man5 install-man uninstall-man tags distdir \
+info-am info dvi-am dvi check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-local install-data-am \
+install-data install-am install uninstall-am uninstall all-redirect \
+all-am all installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
install-data-local:
- @echo "WARNING: You must install texinfo.tex and epsf.tex manually,"
- @echo "WARNING: perhaps in $(TEXMF)/tex/texinfo/"
- @echo "WARNING: and $(TEXMF)/tex/generic/dvips/ respectively."
+ @echo "WARNING: You must install texinfo.tex, txi-??.tex, and epsf.tex manually,"
+ @echo "WARNING: perhaps in TEXMF/tex/texinfo/ and"
+ @echo "WARNING: TEXMF/tex/generic/dvips/ respectively,"
+ @echo "WARNING: where TEXMF is a root of your TeX tree."
@echo "WARNING: See doc/README for some considerations."
-
-# Do not create info files for distribution.
+ @echo "WARNING: You can run make TEXMF=/your/texmf install-tex to do this."
+install-tex:
+ test -n "$(TEXMF)" || (echo "TEXMF must be set." >&2; exit 1)
+ $(mkinstalldirs) $(texmf_texinfo) $(texmf_dvips)
+ $(INSTALL_DATA) texinfo.tex $(texmf_texinfo)/texinfo.tex
+ $(INSTALL_DATA) txi-cs.tex $(texmf_texinfo)/txi-cs.tex
+ $(INSTALL_DATA) txi-de.tex $(texmf_texinfo)/txi-de.tex
+ $(INSTALL_DATA) txi-no.tex $(texmf_texinfo)/txi-no.tex
+ $(INSTALL_DATA) epsf.tex $(texmf_dvips)/epsf.tex
+
+# Don't want to run help2man at every installation.
+@TEXINFO_MAINT_TRUE@info.1: ../info/ginfo $(HELP2MAN)
+@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="read Info documents" $< >$@
+@TEXINFO_MAINT_TRUE@install-info.1: $(INSTALL_INFO) $(HELP2MAN)
+@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="update info/dir entries" $< >$@
+@TEXINFO_MAINT_TRUE@makeinfo.1: $(MAKEINFO) $(HELP2MAN)
+@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="translate Texinfo documents" $< >$@
+@TEXINFO_MAINT_TRUE@texi2dvi.1: ../util/texi2dvi $(HELP2MAN)
+@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="print Texinfo documents" $< >$@
+@TEXINFO_MAINT_TRUE@texindex.1: ../util/texindex $(HELP2MAN)
+@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="sort Texinfo index files" $< >$@
+
+# Do not create info files for distribution, but do create man pages.
dist-info:
# Do not try to build the info files in $(srcdir),
# since we don't distribute them.
.texi.info:
$(MAKEINFO) -I$(srcdir) `echo $< | sed 's,.*/,,'`
-texinfo: $(srcdir)/texinfo.texi
- $(MAKEINFO) -I$(srcdir) texinfo.texi
+texinfo: $(srcdir)/texinfo.txi
+ $(MAKEINFO) -I$(srcdir) texinfo.txi
-# Do not try to install them from $(srcdir).
+# Similarly, Do not try to install the info files from $(srcdir).
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(infodir)
@@ -287,14 +474,14 @@ install-info-am: $(INFO_DEPS)
done; \
done
@$(POST_INSTALL)
- @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ @if $(SHELL) -c '$(INSTALL_INFO) --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
for file in $(INFO_DEPS); do \
- echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
- install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+ echo " $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file";\
+ $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file || :;\
done; \
else : ; fi
-# Remove them at make distclean.
+# Remove the info files at make distclean.
distclean-aminfo:
rm -f texinfo texinfo-* info*.info*
diff --git a/gnu/usr.bin/texinfo/doc/info-stnd.texi b/gnu/usr.bin/texinfo/doc/info-stnd.texi
index c4238b8a3de..d5f232fa410 100644
--- a/gnu/usr.bin/texinfo/doc/info-stnd.texi
+++ b/gnu/usr.bin/texinfo/doc/info-stnd.texi
@@ -2,18 +2,17 @@
@comment %**start of header
@setfilename info-stnd.info
@settitle GNU Info
-@set InfoProgVer 2.11
-@paragraphindent none
-@footnotestyle end
@synindex vr cp
@synindex fn cp
@synindex ky cp
@comment %**end of header
-@comment $Id: info-stnd.texi,v 1.2 1999/01/11 16:38:02 espie Exp $
+@comment $Id: info-stnd.texi,v 1.3 2000/02/09 02:18:37 espie Exp $
+
+@include version.texi
@dircategory Texinfo documentation system
@direntry
-* info program: (info-stnd). Standalone Info-reading program.
+* Standalone info program: (info-stnd). Standalone Info-reading program.
@end direntry
@ifinfo
@@ -23,7 +22,7 @@ documentation for the Info reader that is part of GNU Emacs. If you do
not know how to use Info, but have a working Info reader, you should
read that documentation first.
-Copyright @copyright{} 1992, 93, 96, 97 Free Software Foundation, Inc.
+Copyright @copyright{} 1992, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -50,12 +49,14 @@ approved by the Free Software Foundation.
@end ifinfo
@titlepage
-@title GNU Info User's Guide
-@subtitle For GNU Info version @value{InfoProgVer}
-@author Brian J. Fox (bfox@@ai.mit.edu)
+@title GNU Info
+@subtitle for version @value{VERSION}, @value{UPDATED}
+@author Brian J. Fox (bfox@@gnu.org)
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1992, 1993, 1997 Free Software Foundation
+Copyright @copyright{} 1992, 93, 97, 98, 99 Free Software Foundation
+
+This manual is for GNU Info version @value{VERSION}, @value{UPDATED}.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -74,21 +75,23 @@ except that this permission notice may be stated in a translation
approved by the Free Software Foundation.
@end titlepage
-@ifinfo
-@node Top, What is Info, , (dir)
-@top The GNU Info Program
+@ifnottex
+@node Top
+@top GNU Info
This file documents GNU Info, a program for viewing the on-line
-formatted versions of Texinfo files, version @value{InfoProgVer}. This
+formatted versions of Texinfo files, version @value{VERSION}. This
documentation is different from the documentation for the Info reader
that is part of GNU Emacs.
-@end ifinfo
+
+This manual is for Info version @value{VERSION}, updated @value{UPDATED}.
+@end ifnottex
@menu
-* What is Info::
-* Options:: Options you can pass on the command line.
+* What is Info:: What is Info?
+* Invoking Info:: Options you can pass on the command line.
* Cursor Commands:: Commands which move the cursor within a node.
-* Scrolling Commands:: Commands for moving the node around
+* Scrolling Commands:: Commands for moving the node around
in a window.
* Node Commands:: Commands for selecting a new node.
* Searching Commands:: Commands for searching an Info file.
@@ -97,30 +100,29 @@ that is part of GNU Emacs.
* Printing Nodes:: How to print out the contents of a node.
* Miscellaneous Commands:: A few commands that defy categories.
* Variables:: How to change the default behavior of Info.
-* GNU Info Global Index:: Global index containing keystrokes,
- command names, variable names,
+* GNU Info Global Index:: Global index containing keystrokes,
+ command names, variable names,
and general concepts.
@end menu
-@node What is Info, Options, Top, Top
-@chapter What is Info?
-@iftex
-This file documents GNU Info, a program for viewing the on-line formatted
-versions of Texinfo files, version @value{InfoProgVer}.
-@end iftex
+@node What is Info
+@chapter What is Info?
@dfn{Info} is a program which is used to view Info files on an ASCII
terminal. @dfn{Info files} are the result of processing Texinfo files
with the program @code{makeinfo} or with one of the Emacs commands, such
as @code{M-x texinfo-format-buffer}. Texinfo itself is a documentation
system that uses a single source file to produce both on-line
-information and printed output. You can typeset and print the
-files that you read in Info.@refill
+information and printed output. You can typeset and print the files
+that you read in Info.
-@node Options, Cursor Commands, What is Info, Top
-@chapter Command Line Options
+
+@node Invoking Info
+@chapter Invoking Info
+@cindex invoking info
@cindex command line options
+@cindex options, command line
@cindex arguments, command line
GNU Info accepts several options to control the initial node being
@@ -128,24 +130,46 @@ viewed, and to specify which directories to search for Info files. Here
is a template showing an invocation of GNU Info from the shell:
@example
-info [--@var{option-name} @var{option-value}] @var{menu-item}@dots{}
+info [@var{option}]@dots{} [@var{menu-item}@dots{}]
@end example
-The following @var{option-names} are available when invoking Info from
-the shell:
+The program accepts the following options:
@table @code
+@item --apropos=@var{string}
+@cindex Searching all indices
+@cindex Info files@r{, searching all indices}
+@cindex Apropos@r{, in Info files}
+Specify a string to search in every index of every Info file installed
+on your system. Info looks up the named @var{string} in all the indices
+it can find, prints the results to standard output, and then exits. If
+you are not sure which Info file explains certain issues, this option is
+your friend. Note that if your system has a lot of Info files
+installed, searching all of them might take some time.
+
@cindex directory path
@item --directory @var{directory-path}
@itemx -d @var{directory-path}
-Add @var{directory-path} to the list of directory paths searched when
-Info needs to find a file. You may issue @code{--directory} multiple
-times; once for each directory which contains Info files.
-Alternatively, you may specify a value for the environment variable
-@code{INFOPATH}; if @code{--directory} is not given, the value of
-@code{INFOPATH} is used. The value of @code{INFOPATH} is a colon
-separated list of directory names. If you do not supply @code{INFOPATH}
-or @code{--directory-path}, Info uses a default path.
+Prepend @var{directory-path} to the list of directory paths searched
+when Info needs to find a file. You may issue @code{--directory}
+multiple times; once for each directory which contains Info files. The
+list of directories searched by Info is constructed from the value of
+the environment variable @code{INFOPATH}; @code{--directory} causes the
+named @var{directory-path} to be prepended to that list. The value of
+@code{INFOPATH} is a list of directories usually separated by a colon;
+on MS-DOS/MS-Windows systems, the semicolon is used. If you do not
+define @code{INFOPATH}, Info uses a default path defined when Info was
+built as the initial list of directories. If the value of
+@code{INFOPATH} ends with a colon (or semicolon on MS-DOS/MS-Windows),
+the initial list of directories is constructed by appending the
+build-time default to the value of @code{INFOPATH}.
+
+@cindex keystrokes, recording
+@cindex remembering user keystrokes
+@item --dribble=@var{dribble-file}
+Specify a file where all user keystrokes will be recorded. This file
+can be used later to replay the same sequence of commands, see the
+@samp{--restore} option below.
@item --file @var{filename}
@itemx -f @var{filename}
@@ -154,23 +178,66 @@ Specify a particular Info file to visit. By default, Info visits
the file @code{dir}; if you use this option, Info will start with
@code{(@var{filename})Top} as the first file and node.
+@cindex relative Info file names
+@cindex file names, relative
+@cindex Info files, relative
+If @var{filename} is an absolute file name, or begins with @file{./} or
+@file{../}, Info looks for @var{filename} only in the directory of the
+specified @var{filename}, and adds the directory of @var{filename} to
+the value of @code{INFOPATH}. In contrast, if @var{filename} is in the
+form of a relative file name, but without the @file{./} or @file{../}
+prefix, Info will only look for it in the directories specified in
+@code{INFOPATH}. In other words, Info does @emph{not} treat file names
+which lack @file{./} and @file{../} prefix as relative to the current
+directory.
+
+@cindex compressed Info files
+@cindex files, compressed
+@cindex Info files, compressed
+In every directory Info tries, if @var{filename} is not found, Info
+looks for it with a number of known extensions of Info files@footnote{
+@file{.info}, @file{-info}, @file{/index}, and @file{.inf}.}. For every
+known extension, Info looks for a compressed file, if a regular file
+isn't found. Info supports files compressed with @code{gzip},
+@code{bzip2}, @code{compress} and @code{yabba} programs; it calls
+@code{gunzip}, @code{bunzip2}, @code{uncompress} and @code{unyabba},
+accordingly, to decompress such files. Compressed Info files are
+assumed to have @file{.z}, @file{.gz}, @file{.bz2}, @file{.Z}, or
+@file{.Y} extensions, possibly in addition to one of the known Info
+files extensions@footnote{The MS-DOS version allows for the Info
+extension, such as @code{.inf}, and the short compressed file
+extensions, such as @file{.z} and @file{.gz}, to be merged into a single
+extension, since DOS doesn't allow more than a single dot in the
+basename of a file. Thus, on MS-DOS, if Info looks for @file{bison},
+file names like @file{bison.igz} and @file{bison.inz} will be found and
+decompressed by @code{gunzip}.}.
+
+@item --help
+@itemx -h
+Produces a relatively brief description of the available Info options.
+
@item --index-search @var{string}
-@cindex index search, selecting
+@cindex index search, selecting from the command line
@cindex online help, using Info as
-Go to the index entry @var{string} in the Info file specified with
-@samp{--file}. If no such entry, print @samp{no entries found} and exit
-with nonzero status. This can used from another program as a way to
-provide online help.
+After processing all command-line arguments, go to the index in the Info
+file and search for index entries which matche @var{string}. If such an
+entry is found, the Info session begins with displaying the node pointed
+to by the first matching index entry; press @kbd{,} to step through the
+rest of the matching entries. If no such entry exists, print @samp{no
+entries found} and exit with nonzero status. This can be used from
+another program as a way to provide online help, or as a quick way of
+starting to read an Info file at a certain node when you don't know the
+exact name of that node.
@item --node @var{nodename}
@itemx -n @var{nodename}
-@cindex node, selecting
+@cindex node, selecting from the command line
Specify a particular node to visit in the initial file that Info
loads. This is especially useful in conjunction with
@code{--file}@footnote{Of course, you can specify both the file and node
in a @code{--node} command; but don't forget to escape the open and
-close parentheses from the shell as in: @code{info --node
-"(emacs)Buffers"}}. You may specify @code{--node} multiple times; for
+close parentheses and whitespace from the shell as in: @code{info --node
+"(emacs)Buffers"}.}. You may specify @code{--node} multiple times; for
an interactive Info, each @var{nodename} is visited in its own window,
for a non-interactive Info (such as when @code{--output} is given) each
@var{nodename} is processed sequentially.
@@ -184,6 +251,36 @@ Each node that Info visits will be output to @var{filename} instead of
interactively viewed. A value of @code{-} for @var{filename} specifies
the standard output.
+@cindex replaying recorded keystrokes
+@item --restore=@var{dribble-file}
+Read keystrokes from @var{dribble-file}, presumably recorded during
+previous Info session (see the description of the @samp{--dribble}
+option above). When the keystrokes in the files are all read, Info
+reverts its input to the usual interactive operation.
+
+@anchor{--show-options}
+@cindex command-line options, how to find
+@cindex invocation description, how to find
+@item --show-options
+@itemx --usage
+@itemx -O
+This option causes Info to look for the node that describes how to
+invoke the program and its command-line options, and begin the session
+by displaying that node. It is provided to make it easier to find the
+most important usage information in a manual without the need to wade
+through complex menu hierarchies. The effect is similar to the
+@code{M-x goto-invocation} command (@pxref{goto-invocation}) from inside
+Info.
+
+@cindex speech synthesizers
+@item --speech-friendly
+@itemx -b
+On MS-DOS/MS-Windows only, this option causes Info to use standard file
+I/O functions for screen writes. (By default, Info uses direct writes
+to the video memory on these systems, for faster operation and colored
+display support.) This allows the speech synthesizers used by blind
+persons to catch the output and convert it to audible speech.
+
@item --subnodes
@cindex @code{--subnodes}, command line option
This option only has meaning when given in conjunction with
@@ -192,21 +289,26 @@ the menus of each node being output. Menu items which resolve to
external Info files are not output, and neither are menu items which are
members of an index. Each node is only output once.
-@item --help
-@itemx -h
-Produces a relatively brief description of the available Info options.
-
@item --version
@cindex version information
Prints the version information of Info and exits.
+@anchor{--vi-keys}
+@cindex vi-like key bindings
+@cindex Less-like key bindings
+@item --vi-keys
+This option binds functions to keys differently, to emulate the key
+bindings of @code{vi} and Less. The default key bindings are generally
+modeled after Emacs.
+
@item @var{menu-item}
@cindex menu, following
+@anchor{command-line menu items}
Info treats its remaining arguments as the names of menu items. The
-first argument is a menu item in the initial node visited, while
-the second argument is a menu item in the first argument's node.
-You can easily move to the node of your choice by specifying the menu
-names which describe the path to that node. For example,
+first argument is a menu item in the initial node visited (generally
+@code{dir}), the second argument is a menu item in the first argument's
+node, etc. You can easily move to the node of your choice by specifying
+the menu names which describe the path to that node. For example,
@example
info emacs buffers
@@ -218,9 +320,23 @@ and then selects the menu item @samp{Buffers} in the node
@samp{(emacs)Top}.
@end table
-@node Cursor Commands, Scrolling Commands, Options, Top
+To avoid searching the @file{dir} files and just show some arbitrary
+file, use @samp{-f} and the filename, as in @samp{info -f ./foo.info}.
+
+The index search and the search for the node which describes program
+invocation and command-line options begins @emph{after} processing all
+the command-line menu items. Therefore, the Info file searched for the
+index or the invocation node is the file where Info finds itself after
+following all the menu items given on the command line. This is so
+@samp{info emacs --show-options} does what you'd expect.
+
+@c FIXME: the feature with lowercasing the file name isn't documented
+
+
+@node Cursor Commands
@chapter Moving the Cursor
@cindex cursor, moving
+@cindex moving the cursor
Many people find that reading screens of text page by page is made
easier when one is able to indicate particular pieces of text with some
@@ -230,7 +346,12 @@ move the cursor about the screen. The notation used in this manual to
describe keystrokes is identical to the notation used within the Emacs
manual, and the GNU Readline manual. @xref{Characters, , Character
Conventions, emacs, the GNU Emacs Manual}, if you are unfamiliar with the
-notation.
+notation@footnote{
+Here's a short summary. @kbd{C-@var{x}} means press the @kbd{CTRL} key
+and the key @var{x}. @kbd{M-@var{x}} means press the @kbd{META} key and
+the key @var{x}. On many terminals th @kbd{META} key is known as the
+@kbd{ALT} key. @kbd{SPC} is the space bar. The other keys are usually
+called by the names imprinted on them.}.
The following table lists the basic cursor movement commands in Info.
Each entry consists of the key sequence you should type to execute the
@@ -239,8 +360,8 @@ invokes @code{execute-extended-command}. @xref{M-x, , Executing an
extended command, emacs, the GNU Emacs Manual}, for more detailed
information.} command name (displayed in parentheses), and a short
description of what the command does. All of the cursor motion commands
-can take an @dfn{numeric} argument (@pxref{Miscellaneous Commands,
-@code{universal-argument}}), to find out how to supply them. With a
+can take a @dfn{numeric} argument (see @ref{Miscellaneous Commands,
+@code{universal-argument}, to find out how to supply them}. With a
numeric argument, the motion commands are simply executed that
many times; for example, a numeric argument of 4 given to
@code{next-line} causes the cursor to move down 4 lines. With a
@@ -249,59 +370,83 @@ given to the @code{next-line} command would cause the cursor to move
@emph{up} 4 lines.
@table @asis
-@item @code{C-n} (@code{next-line})
+@item @key{C-n} (@code{next-line})
+@itemx @key{DOWN} (an arrow key)
@kindex C-n
+@kindex DOWN (an arrow key)
@findex next-line
Move the cursor down to the next line.
-@item @code{C-p} (@code{prev-line})
+@item @key{C-p} (@code{prev-line})
+@itemx @key{UP} (an arrow key)
@kindex C-p
+@kindex UP (an arrow key)
@findex prev-line
Move the cursor up to the previous line.
-@item @code{C-a} (@code{beginning-of-line})
+@item @key{C-a} (@code{beginning-of-line})
+@itemx @key{Home} (on DOS/Windows only)
@kindex C-a, in Info windows
+@kindex Home
@findex beginning-of-line
Move the cursor to the start of the current line.
-@item @code{C-e} (@code{end-of-line})
+@item @key{C-e} (@code{end-of-line})
+@itemx @key{End} (on DOS/Windows only)
@kindex C-e, in Info windows
+@kindex End
@findex end-of-line
Move the cursor to the end of the current line.
-@item @code{C-f} (@code{forward-char})
+@item @key{C-f} (@code{forward-char})
+@itemx @key{RIGHT} (an arrow key)
@kindex C-f, in Info windows
+@kindex RIGHT (an arrow key)
@findex forward-char
Move the cursor forward a character.
-@item @code{C-b} (@code{backward-char})
+@item @key{C-b} (@code{backward-char})
+@itemx @key{LEFT} (an arrow key)
@kindex C-b, in Info windows
+@kindex LEFT (an arrow key)
@findex backward-char
Move the cursor backward a character.
-@item @code{M-f} (@code{forward-word})
+@item @key{M-f} (@code{forward-word})
+@itemx @kbd{C-@key{RIGHT}} (on DOS/Windows only)
@kindex M-f, in Info windows
+@kindex C-RIGHT
@findex forward-word
Move the cursor forward a word.
-@item @code{M-b} (@code{backward-word})
+@item @key{M-b} (@code{backward-word})
+@itemx @kbd{C-@key{LEFT}} (on DOS/Windows only)
@kindex M-b, in Info windows
+@kindex C-LEFT
@findex backward-word
Move the cursor backward a word.
-@item @code{M-<} (@code{beginning-of-node})
-@itemx @code{b}
+@item @key{M-<} (@code{beginning-of-node})
+@itemx @key{C-@key{Home}} (on DOS/Windows only)
+@itemx @key{b}
+@itemx @key{M-b}, vi-like operation
@kindex b, in Info windows
@kindex M-<
+@kindex C-Home
+@kindex M-b, vi-like operation
@findex beginning-of-node
Move the cursor to the start of the current node.
-@item @code{M->} (@code{end-of-node})
+@item @key{M->} (@code{end-of-node})
+@itemx @key{C-@key{End}} (on DOS/Windows only)
+@itemx @key{e}
@kindex M->
+@kindex e, in Info windows
+@kindex C-End
@findex end-of-node
Move the cursor to the end of the current node.
-@item @code{M-r} (@code{move-to-window-line})
+@item @key{M-r} (@code{move-to-window-line})
@kindex M-r
@findex move-to-window-line
Move the cursor to a specific line of the window. Without a numeric
@@ -319,11 +464,23 @@ current paragraph you are reading is visible on the screen. The
commands detailed in this section are used to shift which part of the
current node is visible on the screen.
+Scrolling commands are bound differently when @samp{--vi-keys} operation
+(@pxref{--vi-keys}) is in effect. These key bindings are designated
+with ``vi-like operation''.
+
@table @asis
-@item @code{SPC} (@code{scroll-forward})
-@itemx @code{C-v}
+@item @key{SPC} (@code{scroll-forward})
+@itemx @key{NEXT} (an arrow key)
+@itemx @key{C-v}
+@itemx @key{C-f}, vi-like operation
+@itemx @key{f}, vi-like operation
+@itemx @key{M-SPC}, vi-like operation
@kindex SPC, in Info windows
+@kindex NEXT
@kindex C-v
+@kindex C-f, vi-like operation
+@kindex f, vi-like operation
+@kindex M-SPC, vi-like operation
@findex scroll-forward
Shift the text in this window up. That is, show more of the node which
is currently below the bottom of the window. With a numeric argument,
@@ -332,15 +489,99 @@ argument of 4 would shift all of the text in the window up 4 lines
(discarding the top 4 lines), and show you four new lines at the bottom
of the window. Without a numeric argument, @key{SPC} takes the bottom
two lines of the window and places them at the top of the window,
-redisplaying almost a completely new screenful of lines.
-
-@item @code{DEL} (@code{scroll-backward})
-@itemx @code{M-v}
+redisplaying almost a completely new screenful of lines. If you are at
+the end of a node, SPC takes you to the ``next'' node, so that you can
+read an entire manual from start to finish by repeating SPC.
+
+The default scroll size is one screen-full, but it can be changed by
+invoking the (@code{scroll-forward-set-window}) command, @samp{z} under
+@samp{--vi-keys}, with a numeric argument.
+
+@kindex PageDown
+The @key{NEXT} key is known as the @key{PageDown} key on some
+keyboards. When you use @key{NEXT} or @key{PageDown} to scroll, Info
+never scrolls beyond the end of the current node.
+
+@item @key{z} (@code{scroll-forward-set-window}, vi-like operation)
+@kindex z, vi-like operation
+@findex scroll-forward-set-window
+Scroll forward, like with @key{SPC}, but if a numeric argument is
+specified, it becomes the default scroll size for subsequent
+@code{scroll-forward} and @code{scroll-backward} commands.
+
+@item @key{DEL} (@code{scroll-backward})
+@itemx @key{PREVIOUS} (arrow key)
+@itemx @key{PRIOR} (arrow key)
+@itemx @key{M-v}
+@itemx @key{b}, vi-like operation
+@itemx @key{C-b}, vi-like operation
@kindex DEL, in Info windows
+@kindex PREVIOUS
@kindex M-v
+@kindex b, vi-like operation
+@kindex C-b, vi-like operation
@findex scroll-backward
Shift the text in this window down. The inverse of
-@code{scroll-forward}.
+@code{scroll-forward}. The default scroll size can be changed by
+invoking the(@code{scroll-backward-set-window}) command, @samp{w} under
+@samp{--vi-keys}, with a numeric argument.
+
+@item @key{w} (@code{scroll-backward-set-window}, vi-like operation)
+@kindex w, vi-like operation
+@findex scroll-backward-set-window
+Scroll backward, like with @key{DEL}, but if a numeric argument is
+specified, it becomes the default scroll size for subsequent
+@code{scroll-forward} and @code{scroll-backward} commands.
+
+@item @key{C-n} (@code{down-line}, vi-like operation)
+@itemx @key{C-e}, vi-like operation
+@itemx @key{RET}, vi-like operation
+@itemx @key{LFD}, vi-like operation
+@itemx @key{DOWN}, vi-like operation
+@kindex C-n, vi-like operation
+@kindex C-e, vi-like operation
+@kindex RET, vi-like operation
+@kindex LFD, vi-like operation
+@kindex DOWN, vi-like operation
+@findex down-line
+Scroll forward by one line. With a numeric argument, scroll forward
+that many lines.
+
+@item @key{C-p} (@code{up-line}, vi-like operation)
+@itemx @key{UP}, vi-like operation
+@itemx @key{y}, vi-like operation
+@itemx @key{k}, vi-like operation
+@itemx @key{C-k}, vi-like operation
+@itemx @key{C-y}, vi-like operation
+@kindex C-p, vi-like operation
+@kindex UP, vi-like operation
+@kindex y, vi-like operation
+@kindex k, vi-like operation
+@kindex C-k, vi-like operation
+@kindex C-y, vi-like operation
+@findex up-line
+Scroll backward one line. With a numeric argument, scroll backward that
+many lines.
+
+@item @key{d} (@code{scroll-half-screen-down}, vi-like operation)
+@itemx @key{C-d}, vi-like operation
+@kindex d, vi-like operation
+@kindex C-d, vi-like operation
+@findex scroll-half-screen-down
+Scroll forward by half of the screen size. With a numeric argument,
+scroll that many lines. If an argument is specified, it becomes the new
+default number of lines to scroll for subsequent @samp{d} and @samp{u}
+commands.
+
+@item @key{u} (@code{scroll-half-screen-up}, vi-like operation)
+@itemx @key{C-u}, vi-like operation
+@kindex u, vi-like operation
+@kindex C-u, vi-like operation
+@findex scroll-half-screen-up
+Scroll back by half of the screen size. With a numeric argument,
+scroll that many lines. If an argument is specified, it becomes the new
+default number of lines to scroll for subsequent @samp{u} and @samp{d}
+commands.
@end table
@cindex scrolling through node structure
@@ -351,8 +592,19 @@ viewing the beginning of a node, what happens is controlled by the
variable @code{scroll-behavior}. @xref{Variables,
@code{scroll-behavior}}, for more information.
+@kindex PageUp
+The @key{PREVIOUS} key is the @key{PageUp} key on many keyboards. Emacs
+refers to it by the name @key{PRIOR}. When you use @key{PRIOR} or
+@key{PageUp} to scroll, Info never scrolls beyond the beginning of the
+current node.
+
+@kindex BS (backspace)
+If your keyboard lacks the @key{DEL} key, look for a key called
+@key{BS}, or @samp{BackSpace}, sometimes designated with an arrow which
+points to the left, which should perform the same function.
+
@table @asis
-@item @code{C-l} (@code{redraw-display})
+@item @key{C-l} (@code{redraw-display})
@kindex C-l
@findex redraw-display
Redraw the display from scratch, or shift the line containing the cursor
@@ -361,7 +613,7 @@ the screen, and then redraws its entire contents. Given a numeric
argument of @var{n}, the line containing the cursor is shifted so that
it is on the @var{n}th line of the window.
-@item @code{C-x w} (@code{toggle-wrap})
+@item @kbd{C-x @key{w}} (@code{toggle-wrap})
@kindex C-w
@findex toggle-wrap
Toggles the state of line wrapping in the current window. Normally,
@@ -372,7 +624,8 @@ terminated at the rightmost column by changing the state of line
wrapping in the window with @code{C-x w}. When a line which needs more
space than one screen width to display is displayed, a @samp{$} appears
in the rightmost column of the screen, and the remainder of the line is
-invisible.
+invisible. When long lines are truncated, the modeline displays the
+@samp{$} character near its left edge.
@end table
@node Node Commands, Searching Commands, Scrolling Commands, Top
@@ -383,7 +636,9 @@ This section details the numerous Info commands which select a new node
to view in the current window.
The most basic node commands are @samp{n}, @samp{p}, @samp{u}, and
-@samp{l}.
+@samp{l}. Note that the commands to select nodes are mapped differently
+when @samp{--vi-keys} is in effect; these keybindings are designated
+below as ``vi-like operation''.
When you are viewing a node, the top line of the node contains some Info
@dfn{pointers} which describe where the next, previous, and up nodes
@@ -391,47 +646,78 @@ are. Info uses this line to move about the node structure of the file
when you use the following commands:
@table @asis
-@item @code{n} (@code{next-node})
+@item @key{n} (@code{next-node})
+@itemx @kbd{C-@key{NEXT}} (on DOS/Windows only)
+@itemx @kbd{C-x @key{n}}, vi-like operation
@kindex n
+@kindex C-NEXT
+@kindex C-x n, vi-like operation
@findex next-node
-Select the `Next' node.
+Select the `Next' node.
-@item @code{p} (@code{prev-node})
+@kindex C-PgDn
+The @key{NEXT} key is known as the @key{PgDn} key on some
+keyboards.
+
+@item @key{p} (@code{prev-node})
+@itemx @kbd{C-@key{PREVIOUS}} (on DOS/Windows only)
@kindex p
+@kindex C-PREVIOUS
@findex prev-node
Select the `Prev' node.
-@item @code{u} (@code{up-node})
+@kindex C-PgUp
+The @key{PREVIOUS} key is known as the @key{PgUp} key on some
+keyboards.
+
+@item @key{u} (@code{up-node})
+@itemx @kbd{C-@key{UP}} (an arrow key on DOS/Windows only)
+@itemx @kbd{C-x @key{u}}, vi-like operation
@kindex u
+@kindex C-UP
+@kindex C-x u, vi-like operation
@findex up-node
Select the `Up' node.
@end table
You can easily select a node that you have already viewed in this window
by using the @samp{l} command -- this name stands for "last", and
-actually moves through the list of already visited nodes for this
-window. @samp{l} with a negative numeric argument moves forward through
-the history of nodes for this window, so you can quickly step between
-two adjacent (in viewing history) nodes.
+actually moves backwards through the history of visited nodes for this
+window. This is handy when you followed a reference to another node,
+possibly to read about a related issue, and would like then to resume
+reading at the same place where you started the excursion.
+
+Each node where you press @samp{l} is discarded from the history. Thus,
+by the time you get to the first node you visited in a window, the
+entire history of that window is discarded.
@table @asis
-@item @code{l} (@code{history-node})
+@item @key{l} (@code{history-node})
+@itemx @key{C-@key{CENTER}} (on DOS/Windows only)
+@itemx @key{'}, vi-like operation
@kindex l
+@kindex C-CENTER
+@kindex ', vi-like operation
@findex history-node
-Select the most recently selected node in this window.
+Pop the most recently selected node in this window from the node
+history.
@end table
Two additional commands make it easy to select the most commonly
selected nodes; they are @samp{t} and @samp{d}.
@table @asis
-@item @code{t} (@code{top-node})
+@item @key{t} (@code{top-node})
+@itemx @key{M-t}, vi-like operation
@kindex t
+@kindex M-t, vi-like operation
@findex top-node
Select the node @samp{Top} in the current Info file.
-@item @code{d} (@code{dir-node})
+@item @key{d} (@code{dir-node})
+@itemx @key{M-d}, vi-like operation
@kindex d
+@kindex M-d, vi-like operation
@findex dir-node
Select the directory node (i.e., the node @samp{(dir)}).
@end table
@@ -440,18 +726,27 @@ Here are some other commands which immediately result in the selection
of a different node in the current window:
@table @asis
-@item @code{<} (@code{first-node})
+@item @key{<} (@code{first-node})
+@itemx @key{g}, vi-like operation
@kindex <
+@kindex g, vi-like operation
@findex first-node
Selects the first node which appears in this file. This node is most
-often @samp{Top}, but it does not have to be.
+often @samp{Top}, but it does not have to be. With a numeric argument
+@var{N}, select the @var{N}th node (the first node is node 1). An
+argument of zero is the same as the argument of 1.
-@item @code{>} (@code{last-node})
+@item @key{>} (@code{last-node})
+@itemx @key{G}, vi-like operation
@kindex >
+@kindex G, vi-like operation
@findex last-node
-Select the last node which appears in this file.
+Select the last node which appears in this file. With a numeric argument
+@var{N}, select the @var{N}th node (the first node is node 1). An
+argument of zero is the same as no argument, i.e., it selects the last
+node.
-@item @code{]} (@code{global-next-node})
+@item @key{]} (@code{global-next-node})
@kindex ]
@findex global-next-node
Move forward or down through node structure. If the node that you are
@@ -460,7 +755,7 @@ Otherwise, if this node has a menu, the first menu item is selected. If
there is no @samp{Next} and no menu, the same process is tried with the
@samp{Up} node of this node.
-@item @code{[} (@code{global-prev-node})
+@item @key{[} (@code{global-prev-node})
@kindex [
@findex global-prev-node
Move backward or up through node structure. If the node that you are
@@ -475,13 +770,18 @@ You can get the same behavior as @code{global-next-node} and
more information.
@table @asis
-@item @code{g} (@code{goto-node})
+@anchor{goto-node}
+@item @key{g} (@code{goto-node})
+@itemx @kbd{C-x @key{g}}, vi-like operation
@kindex g
+@kindex C-x g, vi-like operation
@findex goto-node
-Read the name of a node and select it. No completion is done while
-reading the node name, since the desired node may reside in a separate
-file. The node must be typed exactly as it appears in the Info file. A
-file name may be included as with any node specification, for example
+Read the name of a node and select it. While reading the node name,
+completion (@pxref{The Echo Area, completion}) is only done for the
+nodes which reside in one of the Info files that were loaded in the
+current Info session; if the desired node resides in some other file,
+you must type the node exactly as it appears in that Info file, and you
+must include the Info file of the other file. For example,
@example
@code{g(emacs)Buffers}
@@ -489,7 +789,61 @@ file name may be included as with any node specification, for example
finds the node @samp{Buffers} in the Info file @file{emacs}.
-@item @code{C-x k} (@code{kill-node})
+@anchor{goto-invocation}
+@item @key{O} (@code{goto-invocation}
+@itemx @key{I}
+@kindex O
+@kindex I
+@findex goto-invocation
+@cindex finding the Invocation node
+Read the name of a program and look for a node in the current Info file
+which describes the invocation and the command-line options for that
+program. The default program name is derived from the name of the
+current Info file. This command does the same as the
+@samp{--show-options} command-line option (@pxref{--show-options}), but
+it also allows to specify the program name; this is important for those
+manuals which describe several programs.
+
+If you need to find the Invocation node of a program that is documented
+in another Info file, you need to visit that file before invoking
+@samp{I}. For example, if you are reading the Emacs manual and want to
+see the command-line options of the @code{makeinfo} program, type @kbd{g
+(texinfo) @key{RET}} and then @kbd{I makeinfo @key{RET}}. If you don't
+know what Info file documents the command, or if invoking @samp{I}
+doesn't display the right node, go to the @samp{(dir)} node (using the
+@samp{d} command) and invoke @samp{I} from there.
+
+@item @key{G} (@code{menu-sequence})
+@kindex G
+@findex menu-sequence
+@cindex menu, following, from inside Info
+Read a sequence of menu entries and follow it. Info prompts for a
+sequence of menu items separated by commas. (Since commas are not
+allowed in a node name, they are a natural choice for a delimiter in a
+list of menu items.) Info then looks up the first item in the menu of
+the node @samp{(dir)} (if the @samp{(dir)} node cannot be found, Info
+uses @samp{Top}). If such an entry is found, Info goes to the node it
+points to and looks up the second item in the menu of that node, etc.
+In other words, you can specify a complete path which descends through
+the menu hierarchy of a particular Info file starting at the
+@samp{(dir)} node. This has the same effect as if you typed the menu
+item sequence on Info's command line, see @ref{command-line menu items,,
+Info command-line arguments processing}. For example,
+
+@example
+ @kbd{G Texinfo,Overview,Reporting Bugs @key{RET}}
+@end example
+
+@noindent
+displays the node @samp{Reporting Bugs} in the Texinfo manual. (You
+don't actually need to type the menu items in their full length, or in
+their exact letter-case. However, if you do type the menu items
+exactly, Info will find it faster.)
+
+If any of the menu items you type are not found, Info stops at the last
+entry it did find and reports an error.
+
+@item @kbd{C-x @key{k}} (@code{kill-node})
@kindex C-x k
@findex kill-node
Kill a node. The node name is prompted for in the echo area, with a
@@ -498,7 +852,7 @@ hard to forget about it, removing it from the list of history nodes kept
for the window where that node is found. Another node is selected in
the window which contained the killed node.
-@item @code{C-x C-f} (@code{view-file})
+@item @kbd{C-x C-f} (@code{view-file})
@kindex C-x C-f
@findex view-file
Read the name of a file and selects the entire file. The command
@@ -510,14 +864,14 @@ is equivalent to typing
@code{g(@var{filename})*}
@end example
-@item @code{C-x C-b} (@code{list-visited-nodes})
+@item @kbd{C-x C-b} (@code{list-visited-nodes})
@kindex C-x C-b
@findex list-visited-nodes
Make a window containing a menu of all of the currently visited nodes.
This window becomes the selected window, and you may use the standard
Info commands within it.
-@item @code{C-x b} (@code{select-visited-node})
+@item @kbd{C-x @key{b}} (@code{select-visited-node})
@kindex C-x b
@findex select-visited-node
Select a node which has been previously visited in a visible window.
@@ -534,49 +888,111 @@ entire Info file, search through the indices of an Info file, or find
areas within an Info file which discuss a particular topic.
@table @asis
-@item @code{s} (@code{search})
+@item @key{s} (@code{search})
+@itemx @key{/}
@kindex s
+@kindex /
@findex search
-Read a string in the echo area and search for it.
-
-@item @code{C-s} (@code{isearch-forward})
+Read a string in the echo area and search for it. If the string
+includes upper-case characters, the Info file is searched
+case-sensitively; otherwise Info ignores the letter case. With a
+numeric argument of @var{N}, search for @var{N}th occurrence of the
+string. Negative arguments search backwards.
+
+@item @key{?} (@code{search-backward}, vi-like operation)
+@kindex ?, vi-like operation
+@findex search-backward
+Read a string in the echo area and search backward through the Info file
+for that string. If the string includes upper-case characters, the Info
+file is searched case-sensitively; otherwise Info ignores the letter
+case. With a numeric argument of @var{N}, search for @var{N}th
+occurrence of the string. Negative arguments search forward.
+
+@item @key{S} (@code{search-case-sensitively}
+@kindex S
+@findex search-case-sensitively
+@cindex search, case-sensitive
+@cindex case-sensitive search
+Read a string in the echo area and search for it case-sensitively, even
+if the string includes only lower-case letters. With a numeric argument
+of @var{N}, search for @var{N}th occurrence of the string. Negative
+arguments search backwards.
+
+@item @kbd{C-x @key{n}} (@code{search-next})
+@itemx @key{n}, vi-like operation
+@kindex C-x n
+@kindex n, vi-like operation
+@findex search-next
+@cindex repeated search
+Search for the same string used in the last search command, in the same
+direction, and with the same case-sensitivity option. With a numeric
+argument of @var{N}, search for @var{N}th next occurrence.
+
+@item @kbd{C-x @key{N}} (@code{search-previous})
+@itemx @key{N}, vi-like operation
+@kindex C-x N
+@kindex n, vi-like operation
+@findex search-previous
+Search for the same string used in the last search command, and with the
+same case-sensitivity option, but in the reverse direction. With a
+numeric argument of @var{N}, search for @var{N}th previous occurrence.
+
+@item @key{C-s} (@code{isearch-forward})
@kindex C-s
@findex isearch-forward
+@cindex incremental search
Interactively search forward through the Info file for a string as you
-type it.
+type it. If the string includes upper-case characters, the search is
+case-sensitive; otherwise Info ignores the letter case.
-@item @code{C-r} (@code{isearch-backward})
+@item @key{C-r} (@code{isearch-backward})
@kindex C-r
@findex isearch-backward
Interactively search backward through the Info file for a string as
-you type it.
+you type it. If the string includes upper-case characters, the search
+is case-sensitive; otherwise Info ignores the letter case.
-@item @code{i} (@code{index-search})
+@item @key{i} (@code{index-search})
@kindex i
@findex index-search
+@cindex index, searching
+@cindex searching, in the indices
Look up a string in the indices for this Info file, and select a node
where the found index entry points to.
-@item @code{,} (@code{next-index-match})
+@item @key{,} (@code{next-index-match})
@kindex ,
@findex next-index-match
Move to the node containing the next matching index item from the last
@samp{i} command.
@end table
-The most basic searching command is @samp{s} (@code{search}). The
-@samp{s} command prompts you for a string in the echo area, and then
-searches the remainder of the Info file for an occurrence of that string.
-If the string is found, the node containing it is selected, and the
-cursor is left positioned at the start of the found string. Subsequent
-@samp{s} commands show you the default search string within @samp{[} and
-@samp{]}; pressing @key{RET} instead of typing a new string will use the
-default search string.
+The most basic searching command is @samp{s} or @samp{/}
+(@code{search}). The @samp{s} command prompts you for a string in the
+echo area, and then searches the remainder of the Info file for an
+occurrence of that string. If the string is found, the node containing
+it is selected, and the cursor is left positioned at the start of the
+found string. Subsequent @samp{s} commands show you the default search
+string within @samp{[} and @samp{]}; pressing @key{RET} instead of
+typing a new string will use the default search string. Under
+@samp{--vi-keys} (@pxref{--vi-keys}), using the @samp{n} or @samp{N}
+commands is a faster way of searching for the same string.
@dfn{Incremental searching} is similar to basic searching, but the
string is looked up while you are typing it, instead of waiting until
the entire search string has been specified.
+@cindex search, and case-sensitivity
+@cindex case-sensitivity, and search
+Both incremental and non-incremental search by default ignore the case
+of letters when comparing the Info file text with the search string.
+However, an uppercase letter in the search string makes the search
+case-sensitive. You can force a case-sensitive non-incremental search,
+even for a string that includes only lower-case letters, by using the
+@samp{S} command (@code{search-case-sensitively}). The @samp{n} and
+@samp{N} commands operate case-sensitively if the last search command
+was @samp{S}.
+
@node Xref Commands, Window Commands, Searching Commands, Top
@chapter Selecting Cross References
@@ -645,63 +1061,85 @@ references.
The following table lists the Info commands which operate on menu items.
@table @asis
-@item @code{1} (@code{menu-digit})
-@itemx @code{2} @dots{} @code{9}
+@item @key{1} (@code{menu-digit})
+@itemx @key{2} @dots{} @key{9}
+@itemx @key{M-1}, vi-like operation
+@itemx @key{M-2} @dots{} @key{M-9}, vi-like operation
@cindex 1 @dots{} 9, in Info windows
+@cindex M-1 @dots{} M-9, vi-like operation
@kindex 1 @dots{} 9, in Info windows
+@kindex M-1 @dots{} M-9, vi-like operation
@findex menu-digit
Within an Info window, pressing a single digit, (such as @samp{1}),
selects that menu item, and places its node in the current window.
For convenience, there is one exception; pressing @samp{0} selects the
-@emph{last} item in the node's menu.
+@emph{last} item in the node's menu. When @samp{--vi-keys} is in
+effect, digits set the numeric argument, so these commands are remapped
+to their @samp{M-} varieties. For example, to select the last menu
+item, press @key{M-0}.
-@item @code{0} (@code{last-menu-item})
+@item @key{0} (@code{last-menu-item})
+@itemx @key{M-0}, vi-like operation
@kindex 0, in Info windows
+@kindex M-0, vi-like operation
@findex last-menu-item
Select the last item in the current node's menu.
-@item @code{m} (@code{menu-item})
+@item @key{m} (@code{menu-item})
@kindex m
@findex menu-item
Reads the name of a menu item in the echo area and selects its node.
-Completion is available while reading the menu label.
+Completion is available while reading the menu label. @xref{The Echo
+Area, completion}.
-@item @code{M-x find-menu}
+@item @kbd{M-x find-menu}
@findex find-menu
Move the cursor to the start of this node's menu.
@end table
-This table lists the Info commands which operate on note cross references.
+This table lists the Info commands which operate on cross references.
@table @asis
-@item @code{f} (@code{xref-item})
-@itemx @code{r}
+@item @key{f} (@code{xref-item})
+@itemx @key{r}
+@item @key{M-f}, vi-like operation
+@itemx @kbd{C-x @key{r}}, vi-like operation
@kindex f
@kindex r
+@kindex M-f, vi-like operation
+@kindex C-x r, vi-like operation
@findex xref-item
Reads the name of a note cross reference in the echo area and selects
its node. Completion is available while reading the cross reference
-label.
+label. @xref{The Echo Area, completion}.
@end table
Finally, the next few commands operate on menu or note references alike:
@table @asis
-@item @code{TAB} (@code{move-to-next-xref})
+@item @key{TAB} (@code{move-to-next-xref})
@kindex TAB, in Info windows
@findex move-to-next-xref
Move the cursor to the start of the next nearest menu item or note
reference in this node. You can then use @key{RET}
(@code{select-reference-this-line}) to select the menu or note reference.
-@item @code{M-TAB} (@code{move-to-prev-xref})
+@item @key{M-TAB} (@code{move-to-prev-xref})
+@itemx @key{Shift-@key{TAB}} (on DOS/Windows only)
@kindex M-TAB, in Info windows
@findex move-to-prev-xref
Move the cursor the start of the nearest previous menu item or note
reference in this node.
-@item @code{RET} (@code{select-reference-this-line})
+@kindex Shift-TAB, in Info windows
+@kindex BackTab, in Info windows
+On DOS/Windows only, the @kbd{Shift-@key{TAB}} key is an alias for
+@kbd{M-@key{TAB}}. This key is sometimes called @samp{BackTab}.
+
+@item @key{RET} (@code{select-reference-this-line})
+@itemx @key{M-g}, vi-like operation
@kindex RET, in Info windows
+@kindex M-g, vi-like operation
@findex select-reference-this-line
Select the menu item or note reference appearing on this line.
@end table
@@ -744,7 +1182,7 @@ named @file{dir}, showing the node @samp{Top}.
@example
@group
------Info: (dir)Top, 40 lines --Top---------------------------------------
+-----Info: (dir)Top, 40 lines --Top-------------------------------------
^^ ^ ^^^ ^^
(file)Node #lines where
@end group
@@ -756,8 +1194,16 @@ the Info file containing the node has been split into subfiles, the name
of the subfile containing the node appears in the modeline as well:
@example
---zz-Info: (emacs)Top, 291 lines --Top-- Subfile: emacs-1.Z---------------
-@end example
+--zz-Info: (emacs)Top, 291 lines --Top-- Subfile: emacs-1.Z-------------
+@end example
+
+Truncation of long lines (as opposed to wrapping them to the next
+display line, @pxref{Scrolling Commands, toggle-wrap}) is indicated by a
+@samp{$} at the left edge of the mode line:
+
+@example
+--$--Info: (texinfo)Top, 480 lines --Top-- Subfile: texinfo-1-----------
+@end example
When Info makes a node internally, such that there is no corresponding
info file on disk, the name of the node is surrounded by asterisks
@@ -766,7 +1212,7 @@ are; the sample mode line below shows an internally constructed node
showing possible completions:
@example
------Info: *Completions*, 7 lines --All-----------------------------------
+-----Info: *Completions*, 7 lines --All---------------------------------
@end example
@node Basic Windows, The Echo Area, The Mode Line, Window Commands
@@ -778,7 +1224,7 @@ own mode line (@pxref{The Mode Line}) and history of nodes viewed in that
window (@pxref{Node Commands, , @code{history-node}}).
@table @asis
-@item @code{C-x o} (@code{next-window})
+@item @kbd{C-x @key{o}} (@code{next-window})
@cindex windows, selecting
@kindex C-x o
@findex next-window
@@ -790,12 +1236,12 @@ window on the screen. Given a numeric argument, @samp{C-x o} moves over
that many windows. A negative argument causes @samp{C-x o} to select
the previous window on the screen.
-@item @code{M-x prev-window}
+@item @kbd{M-x prev-window}
@findex prev-window
Select the previous window on the screen. This is identical to
@samp{C-x o} with a negative argument.
-@item @code{C-x 2} (@code{split-window})
+@item @kbd{C-x @key{2}} (@code{split-window})
@cindex windows, creating
@kindex C-x 2
@findex split-window
@@ -806,7 +1252,7 @@ can cause all of the windows on the screen to be resized for you
automatically, please @pxref{Variables, , automatic-tiling} for more
information.
-@item @code{C-x 0} (@code{delete-window})
+@item @kbd{C-x @key{0}} (@code{delete-window})
@cindex windows, deleting
@kindex C-x 0
@findex delete-window
@@ -814,26 +1260,26 @@ Delete the current window from the screen. If you have made too many
windows and your screen appears cluttered, this is the way to get rid of
some of them.
-@item @code{C-x 1} (@code{keep-one-window})
+@item @kbd{C-x @key{1}} (@code{keep-one-window})
@kindex C-x 1
@findex keep-one-window
Delete all of the windows excepting the current one.
-@item @code{ESC C-v} (@code{scroll-other-window})
+@item @kbd{ESC @key{C-v}} (@code{scroll-other-window})
@kindex ESC C-v, in Info windows
@findex scroll-other-window
Scroll the other window, in the same fashion that @samp{C-v} might
scroll the current window. Given a negative argument, scroll the
"other" window backward.
-@item @code{C-x ^} (@code{grow-window})
+@item @kbd{C-x @key{^}} (@code{grow-window})
@kindex C-x ^
@findex grow-window
Grow (or shrink) the current window. Given a numeric argument, grow
the current window that many lines; with a negative numeric argument,
shrink the window instead.
-@item @code{C-x t} (@code{tile-windows})
+@item @kbd{C-x @key{t}} (@code{tile-windows})
@cindex tiling
@kindex C-x t
@findex tile-windows
@@ -858,117 +1304,170 @@ table briefly lists the commands that are available while input is being
read in the echo area:
@table @asis
-@item @code{C-f} (@code{echo-area-forward})
+@item @key{C-f} (@code{echo-area-forward})
+@itemx @key{RIGHT} (an arrow key)
+@itemx @key{M-h}, vi-like operation
@kindex C-f, in the echo area
+@kindex RIGHT, in the echo area
+@kindex M-h, in the echo area, vi-like operation
@findex echo-area-forward
Move forward a character.
-@item @code{C-b} (@code{echo-area-backward})
+@item @key{C-b} (@code{echo-area-backward})
+@itemx @key{LEFT} (an arrow key)
+@itemx @key{M-l}, vi-like operation
+@kindex LEFT, in the echo area
@kindex C-b, in the echo area
+@kindex M-l, in the echo area, vi-like operation
@findex echo-area-backward
Move backward a character.
-@item @code{C-a} (@code{echo-area-beg-of-line})
+@item @key{C-a} (@code{echo-area-beg-of-line})
+@itemx @key{M-0}, vi-like operation
@kindex C-a, in the echo area
+@kindex M-0, in the echo area, vi-like operation
@findex echo-area-beg-of-line
Move to the start of the input line.
-@item @code{C-e} (@code{echo-area-end-of-line})
+@item @key{C-e} (@code{echo-area-end-of-line})
+@itemx @key{M-$}, vi-like operation
@kindex C-e, in the echo area
+@kindex M-$, vi-like operation
@findex echo-area-end-of-line
Move to the end of the input line.
-@item @code{M-f} (@code{echo-area-forward-word})
+@item @key{M-f} (@code{echo-area-forward-word})
+@itemx @key{C-@key{RIGHT}} (DOS/Windows only)
+@itemx @key{M-w}, vi-like operation
@kindex M-f, in the echo area
+@kindex M-w, in the echo area, vi-like operation
@findex echo-area-forward-word
Move forward a word.
-@item @code{M-b} (@code{echo-area-backward-word})
+@kindex C-RIGHT, in the echo area
+On DOS/Windows, @kbd{C-@key{RIGHT}} moves forward by words.
+
+@item @key{M-b} (@code{echo-area-backward-word})
+@itemx @key{C-@key{LEFT}} (DOS/Windows only)
@kindex M-b, in the echo area
@findex echo-area-backward-word
Move backward a word.
-@item @code{C-d} (@code{echo-area-delete})
+@kindex C-LEFT, in the echo area
+On DOS/Windows, @kbd{C-@key{LEFT}} moves backward by words.
+
+@item @key{C-d} (@code{echo-area-delete})
+@itemx @key{M-x}, vi-like operation
@kindex C-d, in the echo area
+@kindex M-x, in the echo area, vi-like operation
@findex echo-area-delete
Delete the character under the cursor.
-@item @code{DEL} (@code{echo-area-rubout})
+@item @key{DEL} (@code{echo-area-rubout})
@kindex DEL, in the echo area
@findex echo-area-rubout
Delete the character behind the cursor.
-@item @code{C-g} (@code{echo-area-abort})
+On some keyboards, this key is designated @key{BS}, for
+@samp{BackSpace}. Those keyboards will usually bind @key{DEL} in the
+echo area to @code{echo-area-delete}.
+
+@item @key{C-g} (@code{echo-area-abort})
+@itemx @key{C-u}, vi-like operation
@kindex C-g, in the echo area
+@kindex C-u, in the echo area, vi-like operation
@findex echo-area-abort
-Cancel or quit the current operation. If completion is being read,
-@samp{C-g} discards the text of the input line which does not match any
-completion. If the input line is empty, @samp{C-g} aborts the calling
-function.
+Cancel or quit the current operation. If completion is being read, this
+command discards the text of the input line which does not match any
+completion. If the input line is empty, it aborts the calling function.
-@item @code{RET} (@code{echo-area-newline})
+@item @key{RET} (@code{echo-area-newline})
@kindex RET, in the echo area
@findex echo-area-newline
Accept (or forces completion of) the current input line.
-@item @code{C-q} (@code{echo-area-quoted-insert})
+@item @key{C-q} (@code{echo-area-quoted-insert})
+@itemx @key{C-v}, vi-like operation
@kindex C-q, in the echo area
+@kindex C-v, in the echo area, vi-like operation
@findex echo-area-quoted-insert
Insert the next character verbatim. This is how you can insert control
-characters into a search string, for example.
+characters into a search string, for example, or the @samp{?} character
+when Info prompts with completion.
@item @var{printing character} (@code{echo-area-insert})
@kindex printing characters, in the echo area
@findex echo-area-insert
-Insert the character.
+Insert the character. Characters that have their 8th bit set, and not
+bound to @samp{M-} commands, are also inserted verbatim; this is useful
+for terminals which support Latin scripts.
-@item @code{M-TAB} (@code{echo-area-tab-insert})
+@item @key{M-TAB} (@code{echo-area-tab-insert})
+@itemx @key{Shift-@key{TAB}} (on DOS/Windows only)
@kindex M-TAB, in the echo area
+@kindex Shift-TAB, in the echo area
@findex echo-area-tab-insert
Insert a TAB character.
-@item @code{C-t} (@code{echo-area-transpose-chars})
+@kindex Shift-TAB, in the echo area
+@kindex BackTab, in the echo area
+On DOS/Windows only, the @kbd{Shift-@key{TAB}} key is an alias for
+@kbd{M-@key{TAB}}. This key is sometimes called @samp{BackTab}.
+
+@item @key{C-t} (@code{echo-area-transpose-chars})
@kindex C-t, in the echo area
@findex echo-area-transpose-chars
Transpose the characters at the cursor.
@end table
The next group of commands deal with @dfn{killing}, and @dfn{yanking}
-text. For an in depth discussion of killing and yanking,
-@pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs Manual}
+text@footnote{
+Some people are used to calling these operations @dfn{cut} and
+@dfn{paste}, respectively.}. For an in depth discussion of killing and
+yanking, @pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs
+Manual}
@table @asis
-@item @code{M-d} (@code{echo-area-kill-word})
+@item @key{M-d} (@code{echo-area-kill-word})
+@itemx @key{M-X}, vi-like operation
@kindex M-d, in the echo area
+@kindex M-X, in the echo area, vi-like operation
@findex echo-area-kill-word
Kill the word following the cursor.
-@item @code{M-DEL} (@code{echo-area-backward-kill-word})
+@item @key{M-DEL} (@code{echo-area-backward-kill-word})
+@itemx @key{M-@key{BS}}
@kindex M-DEL, in the echo area
@findex echo-area-backward-kill-word
Kill the word preceding the cursor.
-@item @code{C-k} (@code{echo-area-kill-line})
+@kindex M-BS, in the echo area
+On some keyboards, the @code{Backspace} key is used instead of
+@code{DEL}, so @code{M-@key{Backspace}} has the same effect as
+@code{M-@key{DEL}}.
+
+@item @key{C-k} (@code{echo-area-kill-line})
@kindex C-k, in the echo area
@findex echo-area-kill-line
Kill the text from the cursor to the end of the line.
-@item @code{C-x DEL} (@code{echo-area-backward-kill-line})
+@item @kbd{C-x @key{DEL}} (@code{echo-area-backward-kill-line})
@kindex C-x DEL, in the echo area
@findex echo-area-backward-kill-line
Kill the text from the cursor to the beginning of the line.
-@item @code{C-y} (@code{echo-area-yank})
+@item @key{C-y} (@code{echo-area-yank})
@kindex C-y, in the echo area
@findex echo-area-yank
Yank back the contents of the last kill.
-@item @code{M-y} (@code{echo-area-yank-pop})
+@item @key{M-y} (@code{echo-area-yank-pop})
@kindex M-y, in the echo area
@findex echo-area-yank-pop
Yank back a previous kill, removing the last yanked text first.
@end table
+@cindex completion
Sometimes when reading input in the echo area, the command that needed
input will only accept one of a list of several choices. The choices
represent the @dfn{possible completions}, and you must respond with one
@@ -981,14 +1480,14 @@ is called @dfn{completion}.
The following commands are available when completing in the echo area:
@table @asis
-@item @code{TAB} (@code{echo-area-complete})
-@itemx @code{SPC}
+@item @key{TAB} (@code{echo-area-complete})
+@itemx @key{SPC}
@kindex TAB, in the echo area
@kindex SPC, in the echo area
@findex echo-area-complete
Insert as much of a completion as is possible.
-@item @code{?} (@code{echo-area-possible-completions})
+@item @key{?} (@code{echo-area-possible-completions})
@kindex ?, in the echo area
@findex echo-area-possible-completions
Display a window containing a list of the possible completions of what
@@ -1004,13 +1503,14 @@ forget
@end example
@noindent
-and you have typed an @samp{f}, followed by @samp{?}, the possible
-completions would contain:
+and you have typed an @samp{f}, followed by @samp{?}, Info will pop up a
+window showing a node called @samp{*Completions*} which lists the
+possible completions like this:
@example
@group
-foliate
-food
+3 completions:
+foliate food
forget
@end group
@end example
@@ -1023,7 +1523,7 @@ Now, typing @samp{l} followed by @samp{TAB} results in @samp{foliate}
appearing in the echo area, since that is the only choice which begins
with @samp{fol}.
-@item @code{ESC C-v} (@code{echo-area-scroll-completions-window})
+@item @key{ESC C-v} (@code{echo-area-scroll-completions-window})
@kindex ESC C-v, in the echo area
@findex echo-area-scroll-completions-window
Scroll the completions window, if that is visible, or the "other"
@@ -1034,19 +1534,29 @@ window if not.
@chapter Printing Out Nodes
@cindex printing
-You may wish to print out the contents of a node as a quick reference
-document for later use. Info provides you with a command for doing
-this. In general, we recommend that you use @TeX{} to format the
-document and print sections of it, by running @code{tex} on the Texinfo
-source file.
+In general, we recommend that you use @TeX{} to format the document and
+print sections of it, by running @code{tex} on the Texinfo source file.
+However, you may wish to print out the contents of a node as a quick
+reference document for later use, or if you don't have @TeX{} installed.
+Info provides you with a command for doing this.
@table @asis
-@item @code{M-x print-node}
+@item @kbd{M-x print-node}
@findex print-node
@cindex INFO_PRINT_COMMAND, environment variable
Pipe the contents of the current node through the command in the
environment variable @code{INFO_PRINT_COMMAND}. If the variable does not
-exist, the node is simply piped to @code{lpr}.
+exist, the node is simply piped to @code{lpr} (on DOS/Windows, the
+default is to print the node to the local printer device, @file{PRN}).
+
+@cindex printing nodes to the local printer
+@cindex local printer device
+The value of @code{INFO_PRINT_COMMAND} may begin with the @samp{>}
+character, as in @samp{>/dev/printer}, in which case Info treats the
+rest as the name of a file or a device. Instead of piping to a command,
+Info opens the file, writes the node contents, and closes the file,
+under the assumption that text written to that file will be printed by
+the underlying OS.
@end table
@node Miscellaneous Commands, Variables, Printing Nodes, Top
@@ -1055,39 +1565,45 @@ exist, the node is simply piped to @code{lpr}.
GNU Info contains several commands which self-document GNU Info:
@table @asis
-@item @code{M-x describe-command}
+@item @kbd{M-x describe-command}
@cindex functions, describing
@cindex commands, describing
@findex describe-command
Read the name of an Info command in the echo area and then display a
brief description of what that command does.
-@item @code{M-x describe-key}
+@item @kbd{M-x describe-key}
@cindex keys, describing
@findex describe-key
Read a key sequence in the echo area, and then display the name and
documentation of the Info command that the key sequence invokes.
-@item @code{M-x describe-variable}
+@item @kbd{M-x describe-variable}
Read the name of a variable in the echo area and then display a brief
description of what the variable affects.
-@item @code{M-x where-is}
+@item @kbd{M-x where-is}
@findex where-is
Read the name of an Info command in the echo area, and then display
a key sequence which can be typed in order to invoke that command.
-@item @code{C-h} (@code{get-help-window})
-@itemx @code{?}
+@item @key{C-h} (@code{get-help-window})
+@itemx @key{?}
+@itemx @key{F1} (on DOS/Windows only)
+@itemx h, vi-like operation
@kindex C-h
@kindex ?, in Info windows
+@kindex F1
+@kindex h, vi-like operation
@findex get-help-window
Create (or Move into) the window displaying @code{*Help*}, and place
a node containing a quick reference card into it. This window displays
the most concise information about GNU Info available.
-@item @code{h} (@code{get-info-help-node})
+@item @key{h} (@code{get-info-help-node})
+@itemx @key{M-h}, vi-like operation
@kindex h
+@kindex M-h, vi-like operation
@findex get-info-help-node
Try hard to visit the node @code{(info)Help}. The Info file
@file{info.texi} distributed with GNU Info contains this node. Of
@@ -1098,18 +1614,25 @@ placed into the location of your Info directory.
Here are the commands for creating a numeric argument:
@table @asis
-@item @code{C-u} (@code{universal-argument})
+@item @key{C-u} (@code{universal-argument})
@cindex numeric arguments
@kindex C-u
@findex universal-argument
Start (or multiply by 4) the current numeric argument. @samp{C-u} is
a good way to give a small numeric argument to cursor movement or
scrolling commands; @samp{C-u C-v} scrolls the screen 4 lines, while
-@samp{C-u C-u C-n} moves the cursor down 16 lines.
-
-@item @code{M-1} (@code{add-digit-to-numeric-arg})
-@itemx @code{M-2} @dots{} @code{M-9}
-@kindex M-1 @dots{} M-9
+@samp{C-u C-u C-n} moves the cursor down 16 lines. @samp{C-u} followed
+by digit keys sets the numeric argument to the number thus typed:
+@kbd{C-u 1 2 0} sets the argument to 120.
+
+@item @key{M-1} (@code{add-digit-to-numeric-arg})
+@itemx @key{1}, vi-like operation
+@itemx @key{M-2} @dots{} @key{M-9}
+@itemx @key{2} @dots{} @key{9}, vi-like operation
+@itemx @key{M-0}
+@itemx @key{0}, vi-like operation
+@kindex M-0 @dots{} M-9
+@kindex 0 @dots{} 9, vi-like operation
@findex add-digit-to-numeric-arg
Add the digit value of the invoking key to the current numeric
argument. Once Info is reading a numeric argument, you may just type
@@ -1126,6 +1649,22 @@ or
@example
@kbd{M-3 2 C-l}
@end example
+
+@item @key{M--} (@code{add-digit-to-numeric-arg}
+@itemx @key{-}
+@kindex M--
+@kindex -
+@cindex negative arguments
+@cindex arguments, negative
+@cindex numeric arguments, negative
+To make a negative argument, type @kbd{-}. Typing @kbd{-} alone makes a
+negative argument with a value of -1. If you continue to type digit or
+Meta-digit keys after @kbd{-}, the result is a negative number produced
+by those digits.
+
+@kbd{-} doesn't work when you type in the echo area, because you need to
+be able to insert the @samp{-} character itself; use @kbd{M--} instead,
+if you need to specify negative arguments in the echo area.
@end table
@samp{C-g} is used to abort the reading of a multi-character key
@@ -1133,20 +1672,29 @@ sequence, to cancel lengthy operations (such as multi-file searches) and
to cancel reading input in the echo area.
@table @asis
-@item @code{C-g} (@code{abort-key})
+@item @key{C-g} (@code{abort-key})
+@itemx @key{C-u}, vi-like operation
@cindex cancelling typeahead
@cindex cancelling the current operation
@kindex C-g, in Info windows
+@kindex C-u cancels typeahead, vi-like operation
@findex abort-key
Cancel current operation.
@end table
-The @samp{q} command of Info simply quits running Info.
+The @samp{q} command of Info simply quits running Info. Under
+@samp{--vi-keys} (@pxref{--vi-keys}), you can also exit with @samp{:q}
+or @samp{ZZ}.
@table @asis
-@item @code{q} (@code{quit})
+@item @key{q} (@code{quit})
+@itemx @kbd{C-x C-c}
+@itemx @kbd{:q}, vi-like operation
+@itemx @kbd{ZZ}, vi-like operation
@cindex quitting
@kindex q
+@kindex C-x C-c
+@kindex ZZ, vi-like operation
@findex quit
Exit GNU Info.
@end table
@@ -1156,18 +1704,22 @@ and it is actually only 40 lines tall, here is a way to tell Info that
the operating system is correct.
@table @asis
-@item @code{M-x set-screen-height}
+@item @kbd{M-x set-screen-height}
@findex set-screen-height
@cindex screen, changing the height of
Read a height value in the echo area and set the height of the
displayed screen to that value.
@end table
+On MS-DOS/MS-Windows, this command actually tries to change the
+dimensions of the visible screen to the value you type in the echo
+area.
+
Finally, Info provides a convenient way to display footnotes which might
be associated with the current node that you are viewing:
@table @asis
-@item @code{ESC C-f} (@code{show-footnotes})
+@item @key{ESC C-f} (@code{show-footnotes})
@kindex ESC C-f
@findex show-footnotes
@cindex footnotes, displaying
@@ -1186,17 +1738,17 @@ and thus change the behavior of Info to more closely match your
environment and Info file reading manner.
@table @asis
-@item @code{M-x set-variable}
+@item @kbd{M-x set-variable}
@cindex variables, setting
@findex set-variable
Read the name of a variable, and the value for it, in the echo area and
then set the variable to that value. Completion is available when
-reading the variable name; often, completion is available when reading
-the value to give to the variable, but that depends on the variable
-itself. If a variable does @emph{not} supply multiple choices to
-complete over, it expects a numeric value.
+reading the variable name (@pxref{The Echo Area, completion}); often,
+completion is available when reading the value to give to the variable,
+but that depends on the variable itself. If a variable does @emph{not}
+supply multiple choices to complete over, it expects a numeric value.
-@item @code{M-x describe-variable}
+@item @kbd{M-x describe-variable}
@cindex variables, describing
@findex describe-variable
Read the name of a variable in the echo area and then display a brief
diff --git a/gnu/usr.bin/texinfo/doc/info.texi b/gnu/usr.bin/texinfo/doc/info.texi
index 8d188cbed0d..a21da8606a3 100644
--- a/gnu/usr.bin/texinfo/doc/info.texi
+++ b/gnu/usr.bin/texinfo/doc/info.texi
@@ -1,9 +1,9 @@
\input texinfo @c -*-texinfo-*-
-@comment %**start of header
+@comment %**start of header
@setfilename info.info
-@settitle Info 1.0
-@comment %**end of header
-@comment $Id: info.texi,v 1.2 1999/01/11 16:38:02 espie Exp $
+@settitle Info
+@comment %**end of header
+@comment $Id: info.texi,v 1.3 2000/02/09 02:18:37 espie Exp $
@dircategory Texinfo documentation system
@direntry
@@ -11,10 +11,10 @@
@end direntry
@ifinfo
-This file describes how to use Info,
-the on-line, menu-driven GNU documentation system.
+This file describes how to use Info, the on-line, menu-driven GNU
+documentation system.
-Copyright (C) 1989, 92, 96, 97 Free Software Foundation, Inc.
+Copyright (C) 1989, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -44,10 +44,9 @@ by the Free Software Foundation.
@author Brian Fox
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1989, 1992, 1993, 1996, 1997 Free Software
+Copyright @copyright{} 1989, 92, 93, 96, 97, 98, 99 Free Software
Foundation, Inc.
@sp 2
-
Published by the Free Software Foundation @*
59 Temple Place - Suite 330 @*
Boston, MA 02111-1307, USA.
@@ -67,31 +66,20 @@ except that this permission notice may be stated in a translation approved
by the Free Software Foundation.
@end titlepage
-@ifinfo
-@node Top, Getting Started, , (dir)
+@ifnottex
+@node Top
@top Info: An Introduction
Info is a program for reading documentation, which you are using now.
To learn how to use Info, type the command @kbd{h}. It brings you
to a programmed instruction sequence.
-
-@c Need to make sure that `Info-help' goes to the right node,
-@c which is the first node of the first chapter. (It should.)
-@c (Info-find-node "info"
-@c (if (< (window-height) 23)
-@c "Help-Small-Screen"
-@c "Help")))
-
-To learn advanced Info commands, type @kbd{n} twice. This brings you to
-@cite{Info for Experts}, skipping over the `Getting Started' chapter.
-@end ifinfo
+@end ifnottex
@menu
* Getting Started:: Getting started using an Info reader.
* Advanced Info:: Advanced commands within Info.
-* Create an Info File:: How to make your own Info file.
-* The Standalone Info Program: (info-stnd.info).
+* Creating an Info File:: How to make your own Info file.
@end menu
@node Getting Started, Advanced Info, Top, Top
@@ -101,7 +89,7 @@ To learn advanced Info commands, type @kbd{n} twice. This brings you to
This first part of the Info manual describes how to get around inside
of Info. The second part of the manual describes various advanced
Info commands, and how to write an Info as distinct from a Texinfo
-file. The third part is about how to generate Info files from
+file. The third part is about how to generate Info files from
Texinfo files.
@iftex
@@ -110,7 +98,7 @@ try Info commands while reading about them. Reading it on paper is less
effective, since you must take it on faith that the commands described
really do what the manual says. By all means go through this manual now
that you have it; but please try going through the on-line version as
-well.
+well.
There are two ways of looking at the online version of this manual:
@@ -340,7 +328,7 @@ Info can interpret it. The beginning of a menu is always identified
by a line which starts with @samp{* Menu:}. A node contains a menu if and
only if it has a line in it which starts that way. The only menu you
can use at any moment is the one in the node you are in. To use a
-menu in any other node, you must move to that node first.
+menu in any other node, you must move to that node first.
After the start of the menu, each line that starts with a @samp{*}
identifies one subtopic. The line usually contains a brief name
@@ -427,16 +415,14 @@ what you have entered.
not need to type the argument: you just type a Return, and it stands for
the subtopic of the line you are on.
-Here is a menu to give you a chance to practice.
-
-* Menu: The menu starts here.
-
-This menu gives you three ways of going to one place, Help-FOO.
-
-* Foo: Help-FOO. A node you can visit for fun.@*
-* Bar: Help-FOO. Strange! two ways to get to the same place.@*
-* Help-FOO:: And yet another!@*
+Here is a menu to give you a chance to practice. This menu gives you
+three ways of going to one place, Help-FOO:
+@menu
+* Foo: Help-FOO. A node you can visit for fun.
+* Bar: Help-FOO. Strange! two ways to get to the same place.
+* Help-FOO:: And yet another!
+@end menu
>> Now type just an @kbd{m} and see what happens:
@@ -559,17 +545,16 @@ to cancel the @samp{f}.
@c It is an accident of the menu updating command.
@node Help-Cross, , , Help-Adv
-@comment node-name, next, previous, up
-@unnumberedsubsec The node reached by the cross reference in Info
+@subsection The node reached by the cross reference in Info
This is the node reached by the cross reference named @samp{Cross}.
While this node is specifically intended to be reached by a cross
-reference, most cross references lead to nodes that ``belong''
-someplace else far away in the structure of Info. So you cannot expect
-the footnote to have a @samp{Next}, @samp{Previous} or @samp{Up} pointing back to
-where you came from. In general, the @kbd{l} (el) command is the only
-way to get back there.
+reference, most cross references lead to nodes that ``belong'' someplace
+else far away in the structure of Info. So you cannot expect the
+footnote to have a @samp{Next}, @samp{Previous} or @samp{Up} pointing
+back to where you came from. In general, the @kbd{l} (el) command is
+the only way to get back there.
>> Type @kbd{l} to return to the node where the cross reference was.
@@ -590,15 +575,15 @@ manner.
@samp{mInfo} and Return, to get to the node about Info and
see what other help is available.
-@node Advanced Info, Create an Info File, Getting Started, Top
-@comment node-name, next, previous, up
+
+@node Advanced Info
@chapter Info for Experts
This chapter describes various advanced Info commands, and how to write
an Info as distinct from a Texinfo file. (However, in most cases, writing a
Texinfo file is better, since you can use it @emph{both} to generate an
Info file and to make a printed manual. @xref{Top,, Overview of
-Texinfo, texinfo, Texinfo: The GNU Documentation Format}.)
+Texinfo, texinfo, Texinfo}.)
@menu
* Expert:: Advanced Info commands: g, s, e, and 1 - 5.
@@ -639,12 +624,12 @@ type @kbd{s} followed by the string to search for, terminated by
@key{RET}. To search for the same string again, just @kbd{s} followed
by @key{RET} will do. The file's nodes are scanned in the order
they are in in the file, which has no necessary relationship to the
-order that they may be in in the tree structure of menus and @samp{next} pointers.
-But normally the two orders are not very different. In any case,
-you can always do a @kbd{b} to find out what node you have reached, if
-the header is not visible (this can happen, because @kbd{s} puts your
-cursor at the occurrence of the string, not at the beginning of the
-node).
+order that they may be in in the tree structure of menus and @samp{next}
+pointers. But normally the two orders are not very different. In any
+case, you can always do a @kbd{b} to find out what node you have
+reached, if the header is not visible (this can happen, because @kbd{s}
+puts your cursor at the occurrence of the string, not at the beginning
+of the node).
If you grudge the system each character of type-in it requires, you
might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4}, ...
@@ -652,9 +637,9 @@ might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4}, ...
argument. @kbd{1} goes through the first item in the current node's
menu; @kbd{2} goes through the second item, etc.
-If you display supports multiple fonts, and you are using Emacs' Info
+If your display supports multiple fonts, and you are using Emacs' Info
mode to read Info files, the @samp{*} for the fifth menu item is
-underlines, and so is the @samp{*} for the ninth item; these underlines
+underlined, and so is the @samp{*} for the ninth item; these underlines
make it easy to see at a glance which number to use for an item.
On ordinary terminals, you won't have underlining. If you need to
@@ -678,12 +663,12 @@ Create some nodes, in some file, to document that topic.
Put that topic in the menu in the directory. @xref{Menus, Menu}.
@end enumerate
-Usually, the way to create the nodes is with Texinfo @pxref{Top,, Overview of
-Texinfo, texinfo, Texinfo: The GNU Documentation Format}); this has the
-advantage that you can also make a printed manual from them. However,
-if hyou want to edit an Info file, here is how.
+Usually, the way to create the nodes is with Texinfo (@pxref{Top,,
+Overview of Texinfo, texinfo, Texinfo}); this has the advantage that you
+can also make a printed manual from them. However, if you want to edit
+an Info file, here is how.
- The new node can live in an existing documentation file, or in a new
+The new node can live in an existing documentation file, or in a new
one. It must have a @key{^_} character before it (invisible to the
user; this node has one but you cannot see it), and it ends with either
a @key{^_}, a @key{^L}, or the end of file. Note: If you put in a
@@ -693,12 +678,12 @@ Also, a nicer way to make a node boundary be a page boundary as well
is to put a @key{^L} @emph{right after} the @key{^_}.
The @key{^_} starting a node must be followed by a newline or a
-@key{^L} newline, after which comes the node's header line. The
-header line must give the node's name (by which Info finds it),
-and state the names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if
-there are any). As you can see, this node's @samp{Up} node is the node
-@samp{Top}, which points at all the documentation for Info. The @samp{Next}
-node is @samp{Menus}.
+@key{^L} newline, after which comes the node's header line. The header
+line must give the node's name (by which Info finds it), and state the
+names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if there
+are any). As you can see, this node's @samp{Up} node is the node
+@samp{Top}, which points at all the documentation for Info. The
+@samp{Next} node is @samp{Menus}.
The keywords @dfn{Node}, @dfn{Previous}, @dfn{Up}, and @dfn{Next},
may appear in any order, anywhere in the header line, but the
@@ -728,10 +713,10 @@ node @kbd{*} is to make it possible to make old-fashioned,
unstructured files into nodes of the tree.
The @samp{Node:} name, in which a node states its own name, must not
-contain a filename, since Info when searching for a node does not
-expect one to be there. The @samp{Next}, @samp{Previous} and @samp{Up} names may
-contain them. In this node, since the @samp{Up} node is in the same file,
-it was not necessary to use one.
+contain a filename, since Info when searching for a node does not expect
+one to be there. The @samp{Next}, @samp{Previous} and @samp{Up} names
+may contain them. In this node, since the @samp{Up} node is in the same
+file, it was not necessary to use one.
Note that the nodes in this file have a file name in the header
line. The file names are ignored by Info, but they serve as comments
@@ -741,7 +726,7 @@ to help identify the node for the user.
@comment node-name, next, previous, up
@section How to Create Menus
- Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes.
+ Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes.
The @kbd{m} command searches the current node's menu for the topic which it
reads from the terminal.
@@ -766,11 +751,11 @@ short abbreviations. In a long menu, it is a good idea to capitalize
the beginning of each item name which is the minimum acceptable
abbreviation for it (a long menu is more than 5 or so entries).
- The nodes listed in a node's menu are called its ``subnodes'', and
-it is their ``superior''. They should each have an @samp{Up:} pointing at
-the superior. It is often useful to arrange all or most of the
-subnodes in a sequence of @samp{Next} and @samp{Previous} pointers so that someone who
-wants to see them all need not keep revisiting the Menu.
+ The nodes listed in a node's menu are called its ``subnodes'', and it
+is their ``superior''. They should each have an @samp{Up:} pointing at
+the superior. It is often useful to arrange all or most of the subnodes
+in a sequence of @samp{Next} and @samp{Previous} pointers so that
+someone who wants to see them all need not keep revisiting the Menu.
The Info Directory is simply the menu of the node @samp{(dir)Top}---that
is, node @samp{Top} in file @file{.../info/dir}. You can put new entries
@@ -816,7 +801,7 @@ They are just examples. The places they ``lead to'' do not really exist!
You can speed up the access to nodes of a large Info file by giving
it a tag table. Unlike the tag table for a program, the tag table for
-an Info file lives inside the file itself and is used
+an Info file lives inside the file itself and is used
automatically whenever Info reads in the file.
To make a tag table, go to a node in the file using Emacs Info mode and type
@@ -847,24 +832,24 @@ the beginning of the node's header (ending just after the node name),
a Delete character, and the character position in the file of the
beginning of the node.
+
@node Checking, Emacs Info Variables, Tags, Advanced Info
-@comment node-name, next, previous, up
@section Checking an Info File
- When creating an Info file, it is easy to forget the name of a node
-when you are making a pointer to it from another node. If you put in
-the wrong name for a node, this is not detected until someone
-tries to go through the pointer using Info. Verification of the Info
-file is an automatic process which checks all pointers to nodes and
-reports any pointers which are invalid. Every @samp{Next}, @samp{Previous}, and
+When creating an Info file, it is easy to forget the name of a node when
+you are making a pointer to it from another node. If you put in the
+wrong name for a node, this is not detected until someone tries to go
+through the pointer using Info. Verification of the Info file is an
+automatic process which checks all pointers to nodes and reports any
+pointers which are invalid. Every @samp{Next}, @samp{Previous}, and
@samp{Up} is checked, as is every menu item and every cross reference. In
-addition, any @samp{Next} which does not have a @samp{Previous} pointing back is
-reported. Only pointers within the file are checked, because checking
-pointers to other files would be terribly slow. But those are usually
-few.
+addition, any @samp{Next} which does not have a @samp{Previous} pointing
+back is reported. Only pointers within the file are checked, because
+checking pointers to other files would be terribly slow. But those are
+usually few.
- To check an Info file, do @kbd{M-x Info-validate} while looking at
-any node of the file with Emacs Info mode.
+To check an Info file, do @kbd{M-x Info-validate} while looking at any
+node of the file with Emacs Info mode.
@node Emacs Info Variables, , Checking, Advanced Info
@section Emacs Info-mode Variables
@@ -894,18 +879,17 @@ The standard directory for Info documentation files. Only used when the
function @code{Info-directory} is called.
@end vtable
-@node Create an Info File, , Advanced Info, Top
-@comment node-name, next, previous, up
-@chapter Creating an Info File from a Makeinfo file
-@code{makeinfo} is a utility that converts a Texinfo file into an Info
-file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
-GNU Emacs functions that do the same.
+@node Creating an Info File
+@chapter Creating an Info File
+
+@xref{Top,, Overview of Texinfo, texinfo, Texinfo}, to learn how to
+write a Texinfo file.
-@xref{Create an Info File, , Creating an Info File, texinfo, the Texinfo
-Manual}, to learn how to create an Info file from a Texinfo file.
+@xref{Creating an Info File,,, texinfo, Texinfo}, to learn how to create
+an Info file from a Texinfo file.
-@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU Documentation
-Format}, to learn how to write a Texinfo file.
+@xref{Installing an Info File,,, texinfo, Texinfo}, to learn how to
+install an Info file after you have created one.
@bye
diff --git a/gnu/usr.bin/texinfo/doc/texinfo.tex b/gnu/usr.bin/texinfo/doc/texinfo.tex
index 7385f1ffae3..c49af9f4ed9 100644
--- a/gnu/usr.bin/texinfo/doc/texinfo.tex
+++ b/gnu/usr.bin/texinfo/doc/texinfo.tex
@@ -1,7 +1,11 @@
% texinfo.tex -- TeX macros to handle Texinfo files.
-% $Id: texinfo.tex,v 1.2 1999/01/11 16:38:03 espie Exp $
%
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{1999-09-25.10}
+%
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
% Free Software Foundation, Inc.
%
% This texinfo.tex file is free software; you can redistribute it and/or
@@ -25,36 +29,44 @@
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
-% ftp://ftp.cs.umb.edu/pub/tex/texinfo.tex
-% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
-%
-% Send bug reports to bug-texinfo@gnu.org.
-% Please include a precise test case in each bug report,
-% including a complete document with which we can reproduce the problem.
-%
-% Texinfo macros (with @macro) are *not* supported by texinfo.tex. You
-% have to run makeinfo -E to expand macros first; the texi2dvi script
-% does this.
-
-
-% Make it possible to create a .fmt file just by loading this file:
-% if the underlying format is not loaded, start by loading it now.
-% Added by gildea November 1993.
-\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+% ftp://ftp.gnu.org/gnu/texinfo.tex
+% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
+% ftp://texinfo.org/tex/texinfo.tex
+% ftp://us.ctan.org/macros/texinfo/texinfo.tex
+% (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
+% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+% The texinfo.tex in any given Texinfo distribution could well be out
+% of date, so if that's what you're using, please check.
+% Texinfo has a small home page at http://texinfo.org/.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
+% The extra runs of TeX get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages. You can get
+% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
-% This automatically updates the version number based on RCS.
-\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision: 1.2 $
-\message{Loading texinfo package [Version \texinfoversion]:}
+\message{Loading texinfo [version \texinfoversion]:}
% If in a .fmt file, print the version number
% and turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
+\everyjob{\message{[Texinfo version \texinfoversion]}%
\catcode`+=\active \catcode`\_=\active}
% Save some parts of plain tex whose names we will redefine.
-
\let\ptexb=\b
\let\ptexbullet=\bullet
\let\ptexc=\c
@@ -70,18 +82,9 @@
\let\ptexstar=\*
\let\ptext=\t
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-
+% We never want plain's outer \+ definition in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
\message{Basics,}
\chardef\other=12
@@ -90,18 +93,47 @@
% starts a new line in the output.
\newlinechar = `^^J
-% Set up fixed words for English.
-\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
-\def\putwordInfo{Info}%
-\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
-\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
-\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
-\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
-\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
-\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
-\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
-\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
-\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
% Ignore a token.
%
@@ -122,30 +154,35 @@
% since that produces some useless output on the terminal.
%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\ifx\eTeXversion\undefined
\def\loggingall{\tracingcommands2 \tracingstats2
\tracingpages1 \tracingoutput1 \tracinglostchars1
\tracingmacros2 \tracingparagraphs1 \tracingrestores1
\showboxbreadth\maxdimen\showboxdepth\maxdimen
}%
+\else
+\def\loggingall{\tracingcommands3 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \tracingscantokens1 \tracingassigns1 \tracingifs1
+ \tracinggroups1 \tracingnesting2
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\fi
% For @cropmarks command.
% Do @cropmarks to get crop marks.
-%
+%
\newif\ifcropmarks
\let\cropmarks = \cropmarkstrue
%
% Dimensions to add cropmarks at corners.
% Added by P. A. MacKay, 12 Nov. 1986
%
-\newdimen\cornerlong \newdimen\cornerthick
-\newdimen\topandbottommargin
-\newdimen\outerhsize \newdimen\outervsize
-\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
-\outerhsize=7in
-%\outervsize=9.5in
-% Alternative @smallbook page size is 9.25in
-\outervsize=9.25in
-\topandbottommargin=.75in
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
% Main output routine.
\chardef\PAGE = 255
@@ -179,13 +216,16 @@
\shipout\vbox{%
\ifcropmarks \vbox to \outervsize\bgroup
\hsize = \outerhsize
- \line{\ewtop\hfil\ewtop}%
- \nointerlineskip
- \line{%
- \vbox{\moveleft\cornerthick\nstop}%
- \hfill
- \vbox{\moveright\cornerthick\nstop}%
- }%
+ \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.
@@ -203,18 +243,22 @@
\unvbox\footlinebox
\fi
%
+ \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
+ %
\ifcropmarks
\egroup % end of \vbox\bgroup
\hfil\egroup % end of (centering) \line\bgroup
\vskip\topandbottommargin plus1fill minus1fill
\boxmaxdepth = \cornerthick
- \line{%
- \vbox{\moveleft\cornerthick\nsbot}%
- \hfill
- \vbox{\moveright\cornerthick\nsbot}%
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
}%
- \nointerlineskip
- \line{\ewbot\hfil\ewbot}%
\egroup % \vbox from first cropmarks clause
\fi
}% end of \shipout\vbox
@@ -330,11 +374,11 @@
%% Call \inENV within environments (after a \begingroup)
\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment. Type Return to continue.}
+\ifENV\errmessage{Still within an environment; press RETURN to continue}
\endgroup\fi} % This is not perfect, but it should reduce lossage
% @begin foo is the same as @foo, for now.
-\newhelp\EMsimple{Type <Return> to continue.}
+\newhelp\EMsimple{Press RETURN to continue.}
\outer\def\begin{\parsearg\beginxxx}
@@ -393,7 +437,7 @@
% @@ prints an @
% Kludge this until the fonts are right (grr).
-\def\@{{\tt \char '100}}
+\def\@{{\tt\char64}}
% This is turned off because it was never documented
% and you can use @w{...} around a quote to suppress ligatures.
@@ -403,8 +447,8 @@
%\def\'{{'}}
% Used to generate quoted braces.
-\def\mylbrace {{\tt \char '173}}
-\def\myrbrace {{\tt \char '175}}
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
\let\{=\mylbrace
\let\}=\myrbrace
\begingroup
@@ -441,6 +485,18 @@
\fi\fi
}
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }
@@ -538,41 +594,47 @@ where each line of input produces a line of output.}
%% This method tries to make TeX break the page naturally
%% if the depth of the box does not fit.
%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
%\prevdepth=-1000pt
%}}
\def\needx#1{%
- % Go into vertical mode, so we don't make a big box in the middle of a
+ % Ensure vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
%
- % Don't add any leading before our big empty box, but allow a page
- % break, since the best break might be right here.
- \allowbreak
- \nointerlineskip
- \vtop to #1\mil{\vfil}%
- %
- % TeX does not even consider page breaks if a penalty added to the
- % main vertical list is 10000 or more. But in order to see if the
- % empty box we just added fits on the page, we must make it consider
- % page breaks. On the other hand, we don't want to actually break the
- % page after the empty box. So we use a penalty of 9999.
- %
- % There is an extremely small chance that TeX will actually break the
- % page at this \penalty, if there are no other feasible breakpoints in
- % sight. (If the user is using lots of big @group commands, which
- % almost-but-not-quite fill up a page, TeX will have a hard time doing
- % good page breaking, for example.) However, I could not construct an
- % example where a page broke at this \penalty; if it happens in a real
- % document, then we can reconsider our strategy.
- \penalty9999
- %
- % Back up by the size of the box, whether we did a page break or not.
- \kern -#1\mil
- %
- % Do not allow a page break right after this kern.
- \nobreak
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
}
% @br forces paragraph break
@@ -583,15 +645,19 @@ where each line of input produces a line of output.}
% We do .5em per period so that it has the same spacing in a typewriter
% font as three actual period characters.
%
-\def\dots{\hbox to 1.5em{%
- \hskip 0pt plus 0.25fil minus 0.25fil
- .\hss.\hss.%
- \hskip 0pt plus 0.5fil minus 0.5fil
-}}
+\def\dots{%
+ \leavevmode
+ \hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+}
% @enddots{} is an end-of-sentence ellipsis.
-%
+%
\def\enddots{%
+ \leavevmode
\hbox to 2em{%
\hskip 0pt plus 0.25fil minus 0.25fil
.\hss.\hss.\hss.%
@@ -602,7 +668,7 @@ where each line of input produces a line of output.}
% @page forces the start of a new page
-
+%
\def\page{\par\vfill\supereject}
% @exdent text....
@@ -669,332 +735,50 @@ where each line of input produces a line of output.}
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment
-\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
-\parsearg \commentxxx}
-
-\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
\let\c=\comment
-% @paragraphindent is defined for the Info formatting commands only.
-\let\paragraphindent=\comment
-
-% Prevent errors for section commands.
-% Used in @ignore and in failing conditionals.
-\def\ignoresections{%
-\let\chapter=\relax
-\let\unnumbered=\relax
-\let\top=\relax
-\let\unnumberedsec=\relax
-\let\unnumberedsection=\relax
-\let\unnumberedsubsec=\relax
-\let\unnumberedsubsection=\relax
-\let\unnumberedsubsubsec=\relax
-\let\unnumberedsubsubsection=\relax
-\let\section=\relax
-\let\subsec=\relax
-\let\subsubsec=\relax
-\let\subsection=\relax
-\let\subsubsection=\relax
-\let\appendix=\relax
-\let\appendixsec=\relax
-\let\appendixsection=\relax
-\let\appendixsubsec=\relax
-\let\appendixsubsection=\relax
-\let\appendixsubsubsec=\relax
-\let\appendixsubsubsection=\relax
-\let\contents=\relax
-\let\smallbook=\relax
-\let\titlepage=\relax
-}
-
-% Used in nested conditionals, where we have to parse the Texinfo source
-% and so want to turn off most commands, in case they are used
-% incorrectly.
-%
-\def\ignoremorecommands{%
- \let\defcodeindex = \relax
- \let\defcv = \relax
- \let\deffn = \relax
- \let\deffnx = \relax
- \let\defindex = \relax
- \let\defivar = \relax
- \let\defmac = \relax
- \let\defmethod = \relax
- \let\defop = \relax
- \let\defopt = \relax
- \let\defspec = \relax
- \let\deftp = \relax
- \let\deftypefn = \relax
- \let\deftypefun = \relax
- \let\deftypevar = \relax
- \let\deftypevr = \relax
- \let\defun = \relax
- \let\defvar = \relax
- \let\defvr = \relax
- \let\ref = \relax
- \let\xref = \relax
- \let\printindex = \relax
- \let\pxref = \relax
- \let\settitle = \relax
- \let\setchapternewpage = \relax
- \let\setchapterstyle = \relax
- \let\everyheading = \relax
- \let\evenheading = \relax
- \let\oddheading = \relax
- \let\everyfooting = \relax
- \let\evenfooting = \relax
- \let\oddfooting = \relax
- \let\headings = \relax
- \let\include = \relax
- \let\lowersections = \relax
- \let\down = \relax
- \let\raisesections = \relax
- \let\up = \relax
- \let\set = \relax
- \let\clear = \relax
- \let\item = \relax
-}
-
-% Ignore @ignore ... @end ignore.
-%
-\def\ignore{\doignore{ignore}}
-
-% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
-%
-\def\ifinfo{\doignore{ifinfo}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\ifnottex{\doignore{ifnottex}}
-\def\html{\doignore{html}}
-\def\menu{\doignore{menu}}
-\def\direntry{\doignore{direntry}}
-
-% Also ignore @macro ... @end macro. The user must run texi2dvi,
-% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
-\def\macro{\doignore{macro}}
-\let\unmacro = \comment
-
-
-% @dircategory CATEGORY -- specify a category of the dir file
-% which this file should belong to. Ignore this in TeX.
-\let\dircategory = \comment
-
-% Ignore text until a line `@end #1'.
-%
-\def\doignore#1{\begingroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define a command to swallow text until we reach `@end #1'.
- \long\def\doignoretext##1\end #1{\enddoignore}%
- %
- % Make sure that spaces turn into tokens that match what \doignoretext wants.
- \catcode32 = 10
- %
- % Ignore braces, too, so mismatched braces don't cause trouble.
- \catcode`\{ = 9
- \catcode`\} = 9
- %
- % And now expand that command.
- \doignoretext
-}
-
-% What we do to finish off ignored text.
-%
-\def\enddoignore{\endgroup\ignorespaces}%
-
-\newif\ifwarnedobs\warnedobsfalse
-\def\obstexwarn{%
- \ifwarnedobs\relax\else
- % We need to warn folks that they may have trouble with TeX 3.0.
- % This uses \immediate\write16 rather than \message to get newlines.
- \immediate\write16{}
- \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
- \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
- \immediate\write16{If you are running another version of TeX, relax.}
- \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
- \immediate\write16{ Then upgrade your TeX installation if you can.}
- \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
- \immediate\write16{If you are stuck with version 3.0, run the}
- \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
- \immediate\write16{ to use a workaround.}
- \immediate\write16{}
- \global\warnedobstrue
- \fi
-}
-
-% **In TeX 3.0, setting text in \nullfont hangs tex. For a
-% workaround (which requires the file ``dummy.tfm'' to be installed),
-% uncomment the following line:
-%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
-
-% Ignore text, except that we keep track of conditional commands for
-% purposes of nesting, up to an `@end #1' command.
-%
-\def\nestedignore#1{%
- \obstexwarn
- % We must actually expand the ignored text to look for the @end
- % command, so that nested ignore constructs work. Thus, we put the
- % text into a \vbox and then do nothing with the result. To minimize
- % the change of memory overflow, we follow the approach outlined on
- % page 401 of the TeXbook: make the current font be a dummy font.
- %
- \setbox0 = \vbox\bgroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define `@end #1' to end the box, which will in turn undefine the
- % @end command again.
- \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
- %
- % We are going to be parsing Texinfo commands. Most cause no
- % trouble when they are used incorrectly, but some commands do
- % complicated argument parsing or otherwise get confused, so we
- % undefine them.
- %
- % We can't do anything about stray @-signs, unfortunately;
- % they'll produce `undefined control sequence' errors.
- \ignoremorecommands
- %
- % Set the current font to be \nullfont, a TeX primitive, and define
- % all the font commands to also use \nullfont. We don't use
- % dummy.tfm, as suggested in the TeXbook, because not all sites
- % might have that installed. Therefore, math mode will still
- % produce output, but that should be an extremely small amount of
- % stuff compared to the main input.
- %
- \nullfont
- \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
- \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
- \let\tensf = \nullfont
- % Similarly for index fonts (mostly for their use in
- % smallexample)
- \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
- \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
- \let\indsf = \nullfont
- %
- % Don't complain when characters are missing from the fonts.
- \tracinglostchars = 0
- %
- % Don't bother to do space factor calculations.
- \frenchspacing
- %
- % Don't report underfull hboxes.
- \hbadness = 10000
- %
- % Do minimal line-breaking.
- \pretolerance = 10000
- %
- % Do not execute instructions in @tex
- \def\tex{\doignore{tex}}%
-}
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it. Make sure the catcode of space is correct to avoid
-% losing inside @example, for instance.
-%
-\def\set{\begingroup\catcode` =10
- \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
- \parsearg\setxxx}
-\def\setxxx#1{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
- \def\temp{#2}%
- \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
- \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
- \fi
- \endgroup
-}
-% Can't use \xdef to pre-expand #2 and save some time, since \temp or
-% \next or other control sequences that we've defined might get us into
-% an infinite loop. Consider `@set foo @cite{bar}'.
-\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
-
-% @clear VAR clears (i.e., unsets) the variable VAR.
-%
-\def\clear{\parsearg\clearxxx}
-\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
-
-% @value{foo} gets the text saved in variable foo.
-%
-\def\value{\begingroup
- \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
- \valuexxx}
-\def\valuexxx#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- {\{No value for ``#1''\}}%
- \else
- \csname SET#1\endcsname
- \fi
-\endgroup}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% We cannot implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
%
-\def\ifset{\parsearg\ifsetxxx}
-\def\ifsetxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifsetfail
+\def\paragraphindent{\parsearg\doparagraphindent}
+\def\doparagraphindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
\else
- \expandafter\ifsetsucceed
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
\fi
+ \parindent = \defaultparindent
}
-\def\ifsetsucceed{\conditionalsucceed{ifset}}
-\def\ifsetfail{\nestedignore{ifset}}
-\defineunmatchedend{ifset}
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
-%
-\def\ifclear{\parsearg\ifclearxxx}
-\def\ifclearxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifclearsucceed
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\def\exampleindent{\parsearg\doexampleindent}
+\def\doexampleindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
\else
- \expandafter\ifclearfail
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
\fi
}
-\def\ifclearsucceed{\conditionalsucceed{ifclear}}
-\def\ifclearfail{\nestedignore{ifclear}}
-\defineunmatchedend{ifclear}
-
-% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
-% following, through the first @end iftex (etc.). Make `@end iftex'
-% (etc.) valid only after an @iftex.
-%
-\def\iftex{\conditionalsucceed{iftex}}
-\def\ifnothtml{\conditionalsucceed{ifnothtml}}
-\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
-\defineunmatchedend{iftex}
-\defineunmatchedend{ifnothtml}
-\defineunmatchedend{ifnotinfo}
-
-% We can't just want to start a group at @iftex (for example) and end it
-% at @end iftex, since then @set commands inside the conditional have no
-% effect (they'd get reverted at the end of the group). So we must
-% define \Eiftex to redefine itself to be its previous value. (We can't
-% just define it to fail again with an ``unmatched end'' error, since
-% the @ifset might be nested.)
-%
-\def\conditionalsucceed#1{%
- \edef\temp{%
- % Remember the current value of \E#1.
- \let\nece{prevE#1} = \nece{E#1}%
- %
- % At the `@end #1', redefine \E#1 to be its previous value.
- \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
- }%
- \temp
-}
-
-% We need to expand lots of \csname's, but we don't want to expand the
-% control sequences after we've constructed them.
-%
-\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
% @asis just yields its argument. Used with @table, for example.
%
@@ -1017,33 +801,23 @@ where each line of input produces a line of output.}
\def\bullet{\implicitmath\ptexbullet\implicitmath}
\def\minus{\implicitmath-\implicitmath}
-\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
-\let\nwnode=\node
-\let\lastnode=\relax
-
-\def\donoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\setref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\unnumbnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\appendixnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
% @refill is a no-op.
\let\refill=\relax
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
% @setfilename is done at the beginning of every texinfo file.
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
- \readauxfile
- \opencontents
+ \iflinks
+ \readauxfile
+ \fi % \openindices needs to do some work in any case.
\openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'.
\global\let\setfilename=\comment % Ignore extra @setfilename cmds.
@@ -1059,30 +833,197 @@ where each line of input produces a line of output.}
\comment % Ignore the actual filename.
}
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
% @bye.
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
-% \def\macroxxx#1#2 \end macro{%
-% \expandafter\gdef\macrotemp#1{#2}%
-% \endgroup}
-
-%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
-%\def\linemacroxxx#1#2 \end linemacro{%
-%\let\parsearg=\relax
-%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
-%\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
-%\expandafter\gdef\macrotempx#1{#2}%
-%\endgroup}
-%\def\butfirst#1{}
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+\ifx\pdfoutput\undefined
+ \pdffalse
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\linkcolor = \relax
+ \let\pdfmakeoutlines = \relax
+\else
+ \pdftrue
+ \pdfoutput = 1
+ \input pdfcolor
+ \def\dopdfimage#1#2#3{%
+ \def\imagewidth{#2}%
+ \def\imageheight{#3}%
+ \ifnum\pdftexversion < 14
+ \pdfimage
+ \else
+ \pdfximage
+ \fi
+ \ifx\empty\imagewidth\else width \imagewidth \fi
+ \ifx\empty\imageheight\else height \imageheight \fi
+ {#1.pdf}%
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ \def\pdfmkdest#1{\pdfdest name{#1@} xyz}
+ \def\pdfmkpgn#1{#1@}
+ \let\linkcolor = \Cyan
+ \def\endlink{\Black\pdfendlink}
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ \def\pdfmakeoutlines{{%
+ \openin 1 \jobname.toc
+ \ifeof 1\else\bgroup
+ \closein 1
+ \indexnofonts
+ \def\tt{}
+ % thanh's hack / proper braces in bookmarks
+ \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+ \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+ %
+ \def\chapentry ##1##2##3{}
+ \def\unnumbchapentry ##1##2{}
+ \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \input \jobname.toc
+ \def\chapentry ##1##2##3{%
+ \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
+ \def\unnumbchapentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\secentry ##1##2##3##4{%
+ \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
+ \def\unnumbsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsecentry ##1##2##3##4##5{%
+ \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
+ \def\unnumbsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsubsecentry ##1##2##3##4##5##6{%
+ \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
+ \def\unnumbsubsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \input \jobname.toc
+ \egroup\fi
+ }}
+ \def\makelinks #1,{%
+ \def\params{#1}\def\E{END}%
+ \ifx\params\E
+ \let\nextmakelinks=\relax
+ \else
+ \let\nextmakelinks=\makelinks
+ \ifnum\lnkcount>0,\fi
+ \picknum{#1}%
+ \startlink attr{/Border [0 0 0]}
+ goto name{\pdfmkpgn{\the\pgn}}%
+ \linkcolor #1%
+ \advance\lnkcount by 1%
+ \endlink
+ \fi
+ \nextmakelinks
+ }
+ \def\picknum#1{\expandafter\pn#1}
+ \def\pn#1{%
+ \def\p{#1}%
+ \ifx\p\lbrace
+ \let\nextpn=\ppn
+ \else
+ \let\nextpn=\ppnn
+ \def\first{#1}
+ \fi
+ \nextpn
+ }
+ \def\ppn#1{\pgn=#1\gobble}
+ \def\ppnn{\pgn=\first}
+ \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \ifx\p\space\else\addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \fi
+ \nextsp}
+ \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ \def\pdfurl#1{%
+ \begingroup
+ \normalturnoffactive\def\@{@}%
+ \leavevmode\Red
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ % #1
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
+ \linkcolor #1\endlink}
+ \def\mkpgn#1{#1@}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\fi % \ifx\pdfoutput
\message{fonts,}
-
% Font-change commands.
-% Texinfo supports the sans serif font style, which plain TeX does not.
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf analogous to plain's \rm, etc.
\newfam\sffam
\def\sf{\fam=\sffam \tensf}
@@ -1148,22 +1089,17 @@ where each line of input produces a line of output.}
\setfont\deftt\ttshape{10}{\magstep1}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
-% Fonts for indices and small examples (9pt).
-% We actually use the slanted font rather than the italic,
-% because texinfo normally uses the slanted fonts for that.
-% Do not make many font distinctions in general in the index, since they
-% aren't very useful.
-\setfont\ninett\ttshape{9}{1000}
-\setfont\indrm\rmshape{9}{1000}
-\setfont\indit\slshape{9}{1000}
-\let\indsl=\indit
-\let\indtt=\ninett
-\let\indttsl=\ninett
-\let\indsf=\indrm
-\let\indbf=\indrm
-\setfont\indsc\scshape{10}{900}
-\font\indi=cmmi9
-\font\indsy=cmsy9
+% Fonts for indices, footnotes, small examples (9pt).
+\setfont\smallrm\rmshape{9}{1000}
+\setfont\smalltt\ttshape{9}{1000}
+\setfont\smallbf\bfshape{10}{900}
+\setfont\smallit\itshape{9}{1000}
+\setfont\smallsl\slshape{9}{1000}
+\setfont\smallsf\sfshape{9}{1000}
+\setfont\smallsc\scshape{10}{900}
+\setfont\smallttsl\ttslshape{10}{900}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
% Fonts for title page:
\setfont\titlerm\rmbshape{12}{\magstep3}
@@ -1277,11 +1213,12 @@ where each line of input produces a line of output.}
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
\resetmathfonts \setleading{15pt}}
\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
-\def\indexfonts{%
- \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
- \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
- \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
- \resetmathfonts \setleading{12pt}}
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \resetmathfonts \setleading{11pt}}
% Set up the default fonts, so we can use them for creating boxes.
%
@@ -1305,13 +1242,14 @@ where each line of input produces a line of output.}
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one.
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
-\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
\let\i=\smartitalic
-\let\var=\smartitalic
-\let\dfn=\smartitalic
+\let\var=\smartslanted
+\let\dfn=\smartslanted
\let\emph=\smartitalic
-\let\cite=\smartitalic
+\let\cite=\smartslanted
\def\b#1{{\bf #1}}
\let\strong=\b
@@ -1329,9 +1267,9 @@ where each line of input produces a line of output.}
}
\let\ttfont=\t
\def\samp#1{`\tclose{#1}'\null}
-\setfont\smallrm\rmshape{8}{1000}
-\font\smallsy=cmsy9
-\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
+\setfont\keyrm\rmshape{8}{1000}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
\raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
\vbox{\hrule\kern-0.4pt
\hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
@@ -1341,7 +1279,9 @@ where each line of input produces a line of output.}
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+% @file, @option are the same as @samp.
\let\file=\samp
+\let\option=\samp
% @code is a modification of @t,
% which makes spaces the same size as normal in the surrounding text.
@@ -1376,20 +1316,18 @@ where each line of input produces a line of output.}
% and arrange explicitly to hyphenate at a dash.
% -- rms.
{
-\catcode`\-=\active
-\catcode`\_=\active
-\catcode`\|=\active
-\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
-% The following is used by \doprintindex to insure that long function names
-% wrap around. It is necessary for - and _ to be active before the index is
-% read from the file, as \entry parses the arguments long before \code is
-% ever called. -- mycroft
-% _ is always active; and it shouldn't be \let = to an _ that is a
-% subscript character anyway. Then, @cindex @samp{_} (for example)
-% fails. --karl
-\global\def\indexbreaks{%
- \catcode`\-=\active \let-\realdash
-}
+ \catcode`\-=\active
+ \catcode`\_=\active
+ %
+ \global\def\code{\begingroup
+ \catcode`\-=\active \let-\codedash
+ \catcode`\_=\active \let_\codeunder
+ \codex
+ }
+ %
+ % If we end up with any active - characters when handling the index,
+ % just treat them as a normal -.
+ \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
}
\def\realdash{-}
@@ -1430,27 +1368,55 @@ where each line of input produces a line of output.}
\else{\tclose{\kbdfont\look}}\fi
\else{\tclose{\kbdfont\look}}\fi}
-% @url. Quotes do not seem necessary, so use \code.
+% For @url, @env, @command quotes seem unnecessary, so use \code.
\let\url=\code
-
-% @uref (abbreviation for `urlref') takes an optional second argument
-% specifying the text to display. First (mandatory) arg is the url.
-% Perhaps eventually put in a hypertex \special here.
-%
-\def\uref#1{\urefxxx #1,,\finish}
-\def\urefxxx#1,#2,#3\finish{%
- \setbox0 = \hbox{\ignorespaces #2}%
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url. Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
\ifdim\wd0 > 0pt
- \unhbox0\ (\code{#1})%
+ \unhbox0 % third arg given, show only that
\else
- \code{#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
\fi
-}
+ \endlink
+\endgroup}
-% rms does not like the angle brackets --karl, 17may97.
-% So now @email is just like @uref.
+% 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}
-\let\email=\uref
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
% Check if we are currently using a typewriter font. Since all the
% Computer Modern typewriter fonts have zero interword stretch (and
@@ -1460,8 +1426,7 @@ where each line of input produces a line of output.}
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of
-% @dmn{}pt.
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
%
\def\dmn#1{\thinspace #1}
@@ -1472,11 +1437,14 @@ where each line of input produces a line of output.}
% Polish suppressed-l. --karl, 22sep96.
%\def\l#1{{\li #1}\null}
+% Explicit font changes: @r, @sc, undocumented @ii.
\def\r#1{{\rm #1}} % roman font
-% Use of \lowercase was suggested.
\def\sc#1{{\smallcaps#1}} % smallcaps font
\def\ii#1{{\it #1}} % italic font
+% @acronym downcases the argument and prints in smallcaps.
+\def\acronym#1{{\smallcaps \lowercase{#1}}}
+
% @pounds{} is a sterling sign.
\def\pounds{{\it\$}}
@@ -1490,15 +1458,20 @@ where each line of input produces a line of output.}
\newif\ifseenauthor
\newif\iffinishedtitlepage
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
\def\shorttitlepage{\parsearg\shorttitlepagezzz}
\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\endgroup\page\hbox{}\page}
\def\titlepage{\begingroup \parindent=0pt \textfonts
\let\subtitlerm=\tenrm
-% I deinstalled the following change because \cmr12 is undefined.
-% This change was not in the ChangeLog anyway. --rms.
-% \let\subtitlerm=\cmr12
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
%
\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
@@ -1547,6 +1520,23 @@ where each line of input produces a line of output.}
% after the title page, which we certainly don't want.
\oldpage
\endgroup
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+ %
+ \ifpdf \pdfmakepagedesttrue \fi
+ %
\HEADINGSon
}
@@ -1560,10 +1550,10 @@ where each line of input produces a line of output.}
\let\thispage=\folio
-\newtoks \evenheadline % Token sequence for heading line of even pages
-\newtoks \oddheadline % Token sequence for heading line of odd pages
-\newtoks \evenfootline % Token sequence for footing line of even pages
-\newtoks \oddfootline % Token sequence for footing line of odd pages
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
% Now make Tex use those variables
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
@@ -1681,39 +1671,23 @@ where each line of input produces a line of output.}
% Subroutines used in generating headings
% Produces Day Month Year style of output.
-\def\today{\number\day\space
-\ifcase\month\or
-January\or February\or March\or April\or May\or June\or
-July\or August\or September\or October\or November\or December\fi
-\space\number\year}
-
-% Use this if you want the Month Day, Year style of output.
-%\def\today{\ifcase\month\or
-%January\or February\or March\or April\or May\or June\or
-%July\or August\or September\or October\or November\or December\fi
-%\space\number\day, \number\year}
-
-% @settitle line... specifies the title of the document, for headings
-% It generates no output of its own
-
-\def\thistitle{No Title}
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
\def\settitle{\parsearg\settitlezzz}
\def\settitlezzz #1{\gdef\thistitle{#1}}
\message{tables,}
-
-% @tabs -- simple alignment
-
-% These don't work. For one thing, \+ is defined as outer.
-% So these macros cannot even be defined.
-
-%\def\tabs{\parsearg\tabszzz}
-%\def\tabszzz #1{\settabs\+#1\cr}
-%\def\tabline{\parsearg\tablinezzz}
-%\def\tablinezzz #1{\+#1\cr}
-%\def\&{&}
-
% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
% default indentation of table text
@@ -1757,11 +1731,6 @@ July\or August\or September\or October\or November\or December\fi
\itemindex{#1}%
\nobreak % This prevents a break before @itemx.
%
- % Be sure we are not still in the middle of a paragraph.
- %{\parskip = 0in
- %\par
- %}%
- %
% If the item text does not fit in the space we have, put it on a line
% by itself, and do not allow a page break either before or after that
% line. We do not start a paragraph here because then if the next
@@ -1790,13 +1759,17 @@ July\or August\or September\or October\or November\or December\fi
\itemxneedsnegativevskipfalse
\else
% The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line. Since that
- % text will be indented by \tableindent, we make the item text be in
- % a zero-width box.
+ % following text (if any) will end up on the same line.
\noindent
- \rlap{\hskip -\tableindent\box0}\ignorespaces%
- \endgroup%
- \itemxneedsnegativevskiptrue%
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
\fi
}
@@ -1807,9 +1780,10 @@ July\or August\or September\or October\or November\or December\fi
\def\xitem{\errmessage{@xitem while not in a table}}
\def\xitemx{\errmessage{@xitemx while not in a table}}
-%% Contains a kludge to get @end[description] to work
+% Contains a kludge to get @end[description] to work.
\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+% @table, @ftable, @vtable.
\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
{\obeylines\obeyspaces%
\gdef\tablex #1^^M{%
@@ -1869,7 +1843,7 @@ July\or August\or September\or October\or November\or December\fi
\def\itemize{\parsearg\itemizezzz}
\def\itemizezzz #1{%
- \begingroup % ended by the @end itemsize
+ \begingroup % ended by the @end itemize
\itemizey {#1}{\Eitemize}
}
@@ -2082,46 +2056,60 @@ July\or August\or September\or October\or November\or December\fi
\multitablelinespace=0pt
% Macros used to set up halign preamble:
-%
+%
\let\endsetuptable\relax
\def\xendsetuptable{\endsetuptable}
\let\columnfractions\relax
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
-% 2/1/96, to allow fractions to be given with more than one digit.
-\def\pickupwholefraction#1 {\global\advance\colcount by1 %
-\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
-\setuptable}
+% #1 is the part of the @columnfraction before the decimal point, which
+% is presumably either 0 or the empty string (but we don't check, we
+% just throw it away). #2 is the decimal part, which we use as the
+% percent of \hsize for this column.
+\def\pickupwholefraction#1.#2 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
+ \setuptable
+}
\newcount\colcount
-\def\setuptable#1{\def\firstarg{#1}%
-\ifx\firstarg\xendsetuptable\let\go\relax%
-\else
- \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
\else
- \ifsetpercent
- \let\go\pickupwholefraction % In this case arg of setuptable
- % is the decimal point before the
- % number given in percent of hsize.
- % We don't need this so we don't use it.
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
\else
- \global\advance\colcount by1
- \setbox0=\hbox{#1 }% Add a normal word space as a separator;
- % typically that is always in the input, anyway.
- \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
+ % typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
\fi%
- \fi%
-\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
-\fi\go}
+ \fi
+ \go
+}
-% multitable syntax
-\def\tab{&\hskip1sp\relax} % 2/2/96
- % tiny skip here makes sure this column space is
- % maintained, even if it is never used.
+% This used to have \hskip1sp. But then the space in a template line is
+% not enough. That is bad. So let's go back to just & until we
+% encounter the problem it was intended to solve again.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{&}
% @multitable ... @end multitable definitions:
-
+%
\def\multitable{\parsearg\dotable}
\def\dotable#1{\bgroup
\vskip\parskip
@@ -2160,15 +2148,15 @@ July\or August\or September\or October\or November\or December\fi
% In order to keep entries from bumping into each other
% we will add a \leftskip of \multitablecolspace to all columns after
% the first one.
- %
+ %
% If a template has been used, we will add \multitablecolspace
% to the width of each template entry.
- %
+ %
% If the user has set preamble in terms of percent of \hsize we will
% use that dimension as the width of the column, and the \leftskip
% will keep entries from bumping into each other. Table will start at
% left margin and final column will justify at right margin.
- %
+ %
% Make sure we don't inherit \rightskip from the outer environment.
\rightskip=0pt
\ifnum\colcount=1
@@ -2199,15 +2187,18 @@ July\or August\or September\or October\or November\or December\fi
% If so, do nothing. If not, give it an appropriate dimension based on
% current baselineskip.
\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
%% strut to put in table in case some entry doesn't have descenders,
%% to keep lines equally spaced
\let\multistrut = \strut
-%% Test to see if parskip is larger than space between lines of
-%% table. If not, do nothing.
-%% If so, set to same dimension as multitablelinespace.
\else
+%% FIXME: what is \box0 supposed to be?
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
width0pt\relax} \fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
\ifdim\multitableparskip>\multitablelinespace
\global\multitableparskip=\multitablelinespace
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
@@ -2220,6 +2211,356 @@ width0pt\relax} \fi
\fi}
+\message{conditionals,}
+% Prevent errors for section commands.
+% Used in @ignore and in failing conditionals.
+\def\ignoresections{%
+ \let\chapter=\relax
+ \let\unnumbered=\relax
+ \let\top=\relax
+ \let\unnumberedsec=\relax
+ \let\unnumberedsection=\relax
+ \let\unnumberedsubsec=\relax
+ \let\unnumberedsubsection=\relax
+ \let\unnumberedsubsubsec=\relax
+ \let\unnumberedsubsubsection=\relax
+ \let\section=\relax
+ \let\subsec=\relax
+ \let\subsubsec=\relax
+ \let\subsection=\relax
+ \let\subsubsection=\relax
+ \let\appendix=\relax
+ \let\appendixsec=\relax
+ \let\appendixsection=\relax
+ \let\appendixsubsec=\relax
+ \let\appendixsubsection=\relax
+ \let\appendixsubsubsec=\relax
+ \let\appendixsubsubsection=\relax
+ \let\contents=\relax
+ \let\smallbook=\relax
+ \let\titlepage=\relax
+}
+
+% Used in nested conditionals, where we have to parse the Texinfo source
+% and so want to turn off most commands, in case they are used
+% incorrectly.
+%
+\def\ignoremorecommands{%
+ \let\defcodeindex = \relax
+ \let\defcv = \relax
+ \let\deffn = \relax
+ \let\deffnx = \relax
+ \let\defindex = \relax
+ \let\defivar = \relax
+ \let\defmac = \relax
+ \let\defmethod = \relax
+ \let\defop = \relax
+ \let\defopt = \relax
+ \let\defspec = \relax
+ \let\deftp = \relax
+ \let\deftypefn = \relax
+ \let\deftypefun = \relax
+ \let\deftypeivar = \relax
+ \let\deftypeop = \relax
+ \let\deftypevar = \relax
+ \let\deftypevr = \relax
+ \let\defun = \relax
+ \let\defvar = \relax
+ \let\defvr = \relax
+ \let\ref = \relax
+ \let\xref = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
+ \let\settitle = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\everyheading = \relax
+ \let\evenheading = \relax
+ \let\oddheading = \relax
+ \let\everyfooting = \relax
+ \let\evenfooting = \relax
+ \let\oddfooting = \relax
+ \let\headings = \relax
+ \let\include = \relax
+ \let\lowersections = \relax
+ \let\down = \relax
+ \let\raisesections = \relax
+ \let\up = \relax
+ \let\set = \relax
+ \let\clear = \relax
+ \let\item = \relax
+}
+
+% Ignore @ignore ... @end ignore.
+%
+\def\ignore{\doignore{ignore}}
+
+% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
+%
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\html{\doignore{html}}
+\def\menu{\doignore{menu}}
+\def\direntry{\doignore{direntry}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory = \comment
+
+% Ignore text until a line `@end #1'.
+%
+\def\doignore#1{\begingroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define a command to swallow text until we reach `@end #1'.
+ % This @ is a catcode 12 token (that is the normal catcode of @ in
+ % this texinfo.tex file). We change the catcode of @ below to match.
+ \long\def\doignoretext##1@end #1{\enddoignore}%
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \catcode32 = 10
+ %
+ % Ignore braces, too, so mismatched braces don't cause trouble.
+ \catcode`\{ = 9
+ \catcode`\} = 9
+ %
+ % We must not have @c interpreted as a control sequence.
+ \catcode`\@ = 12
+ %
+ % Make the letter c a comment character so that the rest of the line
+ % will be ignored. This way, the document can have (for example)
+ % @c @end ifinfo
+ % and the @end ifinfo will be properly ignored.
+ % (We've just changed @ to catcode 12.)
+ \catcode`\c = 14
+ %
+ % And now expand that command.
+ \doignoretext
+}
+
+% What we do to finish off ignored text.
+%
+\def\enddoignore{\endgroup\ignorespaces}%
+
+\newif\ifwarnedobs\warnedobsfalse
+\def\obstexwarn{%
+ \ifwarnedobs\relax\else
+ % We need to warn folks that they may have trouble with TeX 3.0.
+ % This uses \immediate\write16 rather than \message to get newlines.
+ \immediate\write16{}
+ \immediate\write16{WARNING: for users of Unix TeX 3.0!}
+ \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
+ \immediate\write16{If you are running another version of TeX, relax.}
+ \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
+ \immediate\write16{ Then upgrade your TeX installation if you can.}
+ \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
+ \immediate\write16{If you are stuck with version 3.0, run the}
+ \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
+ \immediate\write16{ to use a workaround.}
+ \immediate\write16{}
+ \global\warnedobstrue
+ \fi
+}
+
+% **In TeX 3.0, setting text in \nullfont hangs tex. For a
+% workaround (which requires the file ``dummy.tfm'' to be installed),
+% uncomment the following line:
+%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
+
+% Ignore text, except that we keep track of conditional commands for
+% purposes of nesting, up to an `@end #1' command.
+%
+\def\nestedignore#1{%
+ \obstexwarn
+ % We must actually expand the ignored text to look for the @end
+ % command, so that nested ignore constructs work. Thus, we put the
+ % text into a \vbox and then do nothing with the result. To minimize
+ % the change of memory overflow, we follow the approach outlined on
+ % page 401 of the TeXbook: make the current font be a dummy font.
+ %
+ \setbox0 = \vbox\bgroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define `@end #1' to end the box, which will in turn undefine the
+ % @end command again.
+ \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
+ %
+ % We are going to be parsing Texinfo commands. Most cause no
+ % trouble when they are used incorrectly, but some commands do
+ % complicated argument parsing or otherwise get confused, so we
+ % undefine them.
+ %
+ % We can't do anything about stray @-signs, unfortunately;
+ % they'll produce `undefined control sequence' errors.
+ \ignoremorecommands
+ %
+ % Set the current font to be \nullfont, a TeX primitive, and define
+ % all the font commands to also use \nullfont. We don't use
+ % dummy.tfm, as suggested in the TeXbook, because not all sites
+ % might have that installed. Therefore, math mode will still
+ % produce output, but that should be an extremely small amount of
+ % stuff compared to the main input.
+ %
+ \nullfont
+ \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
+ \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
+ \let\tensf=\nullfont
+ % Similarly for index fonts (mostly for their use in smallexample).
+ \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
+ \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
+ \let\smallsf=\nullfont
+ %
+ % Don't complain when characters are missing from the fonts.
+ \tracinglostchars = 0
+ %
+ % Don't bother to do space factor calculations.
+ \frenchspacing
+ %
+ % Don't report underfull hboxes.
+ \hbadness = 10000
+ %
+ % Do minimal line-breaking.
+ \pretolerance = 10000
+ %
+ % Do not execute instructions in @tex
+ \def\tex{\doignore{tex}}%
+ % Do not execute macro definitions.
+ % `c' is a comment character, so the word `macro' will get cut off.
+ \def\macro{\doignore{ma}}%
+}
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it. Make sure the catcode of space is correct to avoid
+% losing inside @example, for instance.
+%
+\def\set{\begingroup\catcode` =10
+ \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
+ \parsearg\setxxx}
+\def\setxxx#1{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ \def\temp{#2}%
+ \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
+ \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+ \fi
+ \endgroup
+}
+% Can't use \xdef to pre-expand #2 and save some time, since \temp or
+% \next or other control sequences that we've defined might get us into
+% an infinite loop. Consider `@set foo @cite{bar}'.
+\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\def\clear{\parsearg\clearxxx}
+\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+
+% @value{foo} gets the text saved in variable foo.
+{
+ \catcode`\_ = \active
+ %
+ % We might end up with active _ or - characters in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}. So \let any
+ % such active characters to their normal equivalents.
+ \gdef\value{\begingroup
+ \catcode`\-=12 \catcode`\_=12
+ \indexbreaks \let_\normalunderscore
+ \valuexxx}
+}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we \let\value to this in \indexdummies). Ones
+% whose names contain - or _ still won't work, but we can't do anything
+% about that. The command has to be fully expandable, since the result
+% winds up in the index file. This means that if the variable's value
+% contains other Texinfo commands, it's almost certain it will fail
+% (although perhaps we could fix that with sufficient work to do a
+% one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+\def\ifset{\parsearg\ifsetxxx}
+\def\ifsetxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifsetfail
+ \else
+ \expandafter\ifsetsucceed
+ \fi
+}
+\def\ifsetsucceed{\conditionalsucceed{ifset}}
+\def\ifsetfail{\nestedignore{ifset}}
+\defineunmatchedend{ifset}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+\def\ifclear{\parsearg\ifclearxxx}
+\def\ifclearxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifclearsucceed
+ \else
+ \expandafter\ifclearfail
+ \fi
+}
+\def\ifclearsucceed{\conditionalsucceed{ifclear}}
+\def\ifclearfail{\nestedignore{ifclear}}
+\defineunmatchedend{ifclear}
+
+% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
+% following, through the first @end iftex (etc.). Make `@end iftex'
+% (etc.) valid only after an @iftex.
+%
+\def\iftex{\conditionalsucceed{iftex}}
+\def\ifnothtml{\conditionalsucceed{ifnothtml}}
+\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
+\defineunmatchedend{iftex}
+\defineunmatchedend{ifnothtml}
+\defineunmatchedend{ifnotinfo}
+
+% We can't just want to start a group at @iftex (for example) and end it
+% at @end iftex, since then @set commands inside the conditional have no
+% effect (they'd get reverted at the end of the group). So we must
+% define \Eiftex to redefine itself to be its previous value. (We can't
+% just define it to fail again with an ``unmatched end'' error, since
+% the @ifset might be nested.)
+%
+\def\conditionalsucceed#1{%
+ \edef\temp{%
+ % Remember the current value of \E#1.
+ \let\nece{prevE#1} = \nece{E#1}%
+ %
+ % At the `@end #1', redefine \E#1 to be its previous value.
+ \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
+ }%
+ \temp
+}
+
+% We need to expand lots of \csname's, but we don't want to expand the
+% control sequences after we've constructed them.
+%
+\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
\message{indexing,}
% Index generation facilities
@@ -2235,12 +2576,14 @@ width0pt\relax} \fi
% the file that accumulates this index. The file's extension is foo.
% The name of an index should be no more than 2 characters long
% for the sake of vms.
-
-\def\newindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#1}}
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
}
% @defindex foo == \newindex{foo}
@@ -2249,31 +2592,37 @@ width0pt\relax} \fi
% Define @defcodeindex, like @defindex except put all entries in @code.
-\def\newcodeindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#1}}
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}
}
\def\defcodeindex{\parsearg\newcodeindex}
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
-\def\synindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#2}}%
+% The \closeout helps reduce unnecessary open files; the limit on the
+% Acorn RISC OS is a mere 16 files.
+\def\synindex#1 #2 {%
+ \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+ \expandafter\closeout\csname#1indfile\endcsname
+ \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+ \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+ \noexpand\doindex{#2}}%
}
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
-\def\syncodeindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#2}}%
+\def\syncodeindex#1 #2 {%
+ \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+ \expandafter\closeout\csname#1indfile\endcsname
+ \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+ \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+ \noexpand\docodeindex{#2}}%
}
% Define \doindex, the driver for all \fooindex macros.
@@ -2294,6 +2643,7 @@ width0pt\relax} \fi
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
\def\indexdummies{%
+\def\ { }%
% Take care of the plain tex accent commands.
\def\"{\realbackslash "}%
\def\`{\realbackslash `}%
@@ -2323,8 +2673,11 @@ width0pt\relax} \fi
% (Must be a way to avoid doing expansion at all, and thus not have to
% laboriously list every single command here.)
\def\@{@}% will be @@ when we switch to @ as escape char.
-%\let\{ = \lbracecmd
-%\let\} = \rbracecmd
+% Need these in case \tex is in effect and \{ is a \delimiter again.
+% But can't use \lbracecmd and \rbracecmd because texindex assumes
+% braces and backslashes are used only as delimiters.
+\let\{ = \mylbrace
+\let\} = \myrbrace
\def\_{{\realbackslash _}}%
\def\w{\realbackslash w }%
\def\bf{\realbackslash bf }%
@@ -2335,7 +2688,6 @@ width0pt\relax} \fi
\def\gtr{\realbackslash gtr}%
\def\less{\realbackslash less}%
\def\hat{\realbackslash hat}%
-%\def\char{\realbackslash char}%
\def\TeX{\realbackslash TeX}%
\def\dots{\realbackslash dots }%
\def\result{\realbackslash result}%
@@ -2347,6 +2699,11 @@ width0pt\relax} \fi
\def\copyright{\realbackslash copyright}%
\def\tclose##1{\realbackslash tclose {##1}}%
\def\code##1{\realbackslash code {##1}}%
+\def\uref##1{\realbackslash uref {##1}}%
+\def\url##1{\realbackslash url {##1}}%
+\def\env##1{\realbackslash env {##1}}%
+\def\command##1{\realbackslash command {##1}}%
+\def\option##1{\realbackslash option {##1}}%
\def\dotless##1{\realbackslash dotless {##1}}%
\def\samp##1{\realbackslash samp {##1}}%
\def\,##1{\realbackslash ,{##1}}%
@@ -2362,8 +2719,16 @@ width0pt\relax} \fi
\def\kbd##1{\realbackslash kbd {##1}}%
\def\dfn##1{\realbackslash dfn {##1}}%
\def\emph##1{\realbackslash emph {##1}}%
-\def\value##1{\realbackslash value {##1}}%
+\def\acronym##1{\realbackslash acronym {##1}}%
+%
+% Handle some cases of @value -- where the variable name does not
+% contain - or _, and the value does not contain any
+% (non-fully-expandable) commands.
+\let\value = \expandablevalue
+%
\unsepspaces
+% Turn off macro expansion
+\turnoffmacros
}
% If an index command is used in an @example environment, any spaces
@@ -2420,6 +2785,12 @@ width0pt\relax} \fi
%\let\tt=\indexdummyfont
\let\tclose=\indexdummyfont
\let\code=\indexdummyfont
+\let\url=\indexdummyfont
+\let\uref=\indexdummyfont
+\let\env=\indexdummyfont
+\let\acronym=\indexdummyfont
+\let\command=\indexdummyfont
+\let\option=\indexdummyfont
\let\file=\indexdummyfont
\let\samp=\indexdummyfont
\let\kbd=\indexdummyfont
@@ -2435,14 +2806,24 @@ width0pt\relax} \fi
% so we do not become unable to do a definition.
{\catcode`\@=0 \catcode`\\=\other
-@gdef@realbackslash{\}}
+ @gdef@realbackslash{\}}
\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% For \ifx comparisons.
+\def\emptymacro{\empty}
-\let\SETmarginindex=\relax %initialize!
-% workhorse for all \fooindexes
-% #1 is name of index, #2 is stuff to put there
-\def\doind #1#2{%
+% Most index entries go through here, but \dosubind is the general case.
+%
+\def\doind#1#2{\dosubind{#1}{#2}\empty}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% \empty if called from \doind, as we usually are. The main exception
+% is with defuns, which call us directly.
+%
+\def\dosubind#1#2#3{%
% Put the index entry in the margin if desired.
\ifx\SETmarginindex\relax\else
\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
@@ -2453,48 +2834,75 @@ width0pt\relax} \fi
\indexdummies % Must do this here, since \bf, etc expand at this stage
\escapechar=`\\
{%
- \let\folio=0% We will expand all macros now EXCEPT \folio.
+ \let\folio = 0% We will expand all macros now EXCEPT \folio.
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash.
%
- % First process the index-string with all font commands turned off
- % to get the string to sort by.
- {\indexnofonts \xdef\indexsorttmp{#2}}%
+ \def\thirdarg{#3}%
+ %
+ % If third arg is present, precede it with space in sort key.
+ \ifx\thirdarg\emptymacro
+ \let\subentry = \empty
+ \else
+ \def\subentry{ #3}%
+ \fi
+ %
+ % First process the index entry with all font commands turned
+ % off to get the string to sort by.
+ {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
%
- % Now produce the complete index entry, with both the sort key and the
- % original text, including any font commands.
+ % Now the real index entry with the fonts.
\toks0 = {#2}%
+ %
+ % If third (subentry) arg is present, add it to the index
+ % string. And include a space.
+ \ifx\thirdarg\emptymacro \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ % Set up the complete index entry, with both the sort key
+ % and the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file, texindex reduces to
+ % two when writing the .??s sorted result.
\edef\temp{%
\write\csname#1indfile\endcsname{%
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
}%
- \temp
+ %
+ % If a skip is the last thing on the list now, preserve it
+ % by backing up by \lastskip, doing the \write, then inserting
+ % the skip again. Otherwise, the whatsit generated by the
+ % \write will make \lastskip zero. The result is that sequences
+ % like this:
+ % @end defun
+ % @tindex whatever
+ % @defun ...
+ % will have extra space inserted, because the \medbreak in the
+ % start of the @defun won't see the skip inserted by the @end of
+ % the previous defun.
+ %
+ % But don't do any of this if we're not in vertical mode. We
+ % don't want to do a \vskip and prematurely end a paragraph.
+ %
+ % Avoid page breaks due to these extra skips, too.
+ %
+ \iflinks
+ \ifvmode
+ \skip0 = \lastskip
+ \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
+ \fi
+ %
+ \temp % do the write
+ %
+ %
+ \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
+ \fi
}%
}%
\penalty\count255
}%
}
-\def\dosubind #1#2#3{%
-{\count10=\lastpenalty %
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\escapechar=`\\%
-{\let\folio=0%
-\def\rawbackslashxx{\indexbackslash}%
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2 #3}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
-\temp }%
-}\penalty\count10}}
-
% The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic}
% or
@@ -2534,7 +2942,7 @@ width0pt\relax} \fi
\def\doprintindex#1{\begingroup
\dobreak \chapheadingskip{10000}%
%
- \indexfonts \rm
+ \smallfonts \rm
\tolerance = 9500
\indexbreaks
%
@@ -2550,7 +2958,7 @@ width0pt\relax} \fi
% and it loses the chapter title and the aux file entries for the
% index. The easiest way to prevent this problem is to make sure
% there is some text.
- (Index is nonexistent)
+ \putwordIndexNonexistent
\else
%
% If the index file exists but is empty, then \openin leaves \ifeof
@@ -2558,7 +2966,7 @@ width0pt\relax} \fi
% it can discover if there is anything in it.
\read 1 to \temp
\ifeof 1
- (Index is empty)
+ \putwordIndexIsEmpty
\else
% Index files are almost Texinfo source, but we use \ as the escape
% character. It would be better to use @, but that's too big a change
@@ -2577,21 +2985,35 @@ width0pt\relax} \fi
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
-% Same as \bigskipamount except no shrink.
-% \balancecolumns gets confused if there is any shrink.
-\newskip\initialskipamount \initialskipamount 12pt plus4pt
-
-\def\initial #1{%
-{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
-\ifdim\lastskip<\initialskipamount
-\removelastskip \penalty-200 \vskip \initialskipamount\fi
-\line{\secbf#1\hfill}\kern 2pt\penalty10000}}
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \penalty -300
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ \vskip .33\baselineskip plus .1\baselineskip
+ %
+ % Do our best not to break after the initial.
+ \nobreak
+}}
% This typesets a paragraph consisting of #1, dot leaders, and then #2
% flush to the right margin. It is used for index and table of contents
% entries. The paragraph is indented by \leftskip.
%
-\def\entry #1#2{\begingroup
+\def\entry#1#2{\begingroup
%
% Start a new paragraph if necessary, so our assignments below can't
% affect previous text.
@@ -2614,12 +3036,15 @@ width0pt\relax} \fi
%
% \hangafter is reset to 1 (which is the value we want) at the start
% of each paragraph, so we need not do anything with that.
- \hangindent=2em
+ \hangindent = 2em
%
% When the entry text needs to be broken, just fill out the first line
% with blank space.
\rightskip = 0pt plus1fil
%
+ % A bit of stretch before each entry for the benefit of balancing columns.
+ \vskip 0pt plus1pt
+ %
% Start a ``paragraph'' for the index entry so the line breaking
% parameters we've set above will have an effect.
\noindent
@@ -2644,7 +3069,11 @@ width0pt\relax} \fi
% The `\ ' here is removed by the implicit \unskip that TeX does as
% part of (the primitive) \par. Without it, a spurious underfull
% \hbox ensues.
- \ #2% The page number ends the paragraph.
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ \ #2% The page number ends the paragraph.
+ \fi
\fi%
\par
\endgroup}
@@ -2673,24 +3102,26 @@ width0pt\relax} \fi
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
% Grab any single-column material above us.
- \output = {\global\setbox\partialpage = \vbox{%
- %
+ \output = {%
+ %
% Here is a possibility not foreseen in manmac: if we accumulate a
% whole lot of material, we might end up calling this \output
% routine twice in a row (see the doublecol-lose test, which is
% essentially a couple of indexes with @setchapternewpage off). In
- % that case, we must prevent the second \partialpage from
- % simply overwriting the first, causing us to lose the page.
- % This will preserve it until a real output routine can ship it
- % out. Generally, \partialpage will be empty when this runs and
- % this will be a no-op.
- \unvbox\partialpage
+ % 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
%
- % Unvbox the main output page.
- \unvbox255
- \kern-\topskip \kern\baselineskip
- }}%
- \eject
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
%
% Use the double-column output routine for subsequent pages.
\output = {\doublecolumnout}%
@@ -2718,14 +3149,21 @@ width0pt\relax} \fi
%
% Double the \vsize as well. (We don't need a separate register here,
% since nobody clobbers \vsize.)
+ \advance\vsize by -\ht\partialpage
\vsize = 2\vsize
}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
\def\doublecolumnout{%
\splittopskip=\topskip \splitmaxdepth=\maxdepth
% Get the available space for the double columns -- the normal
% (undoubled) page height minus any material left over from the
% previous page.
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ %
% box0 will be the left-hand column, box2 the right.
\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
\onepageout\pagesofar
@@ -2734,42 +3172,67 @@ width0pt\relax} \fi
}
\def\pagesofar{%
% Re-output the contents of the output page -- any previous material,
- % followed by the two boxes we just split.
+ % followed by the two boxes we just split, in box0 and box2.
\unvbox\partialpage
+ %
\hsize = \doublecolumnhsize
- \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
}
\def\enddoublecolumns{%
- \output = {\balancecolumns}\eject % split what we have
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
\endgroup % started in \begindoublecolumns
%
- % Back to normal single-column typesetting, but take account of the
- % fact that we just accumulated some stuff on the output page.
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
\pagegoal = \vsize
}
\def\balancecolumns{%
% Called at the end of the double column material.
- \setbox0 = \vbox{\unvbox255}%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
\dimen@ = \ht0
\advance\dimen@ by \topskip
\advance\dimen@ by-\baselineskip
- \divide\dimen@ by 2
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
\splittopskip = \topskip
% Loop until we get a decent breakpoint.
- {\vbadness=10000 \loop
- \global\setbox3=\copy0
- \global\setbox1=\vsplit3 to\dimen@
- \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt
- \repeat}%
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
\setbox0=\vbox to\dimen@{\unvbox1}%
\setbox2=\vbox to\dimen@{\unvbox3}%
+ %
\pagesofar
}
\catcode`\@ = \other
\message{sectioning,}
-% Define chapters, sections, etc.
+% Chapters, sections, etc.
\newcount\chapno
\newcount\secno \secno=0
@@ -2778,58 +3241,48 @@ width0pt\relax} \fi
% This counter is funny since it counts through charcodes of letters A, B, ...
\newcount\appendixno \appendixno = `\@
-\def\appendixletter{\char\the\appendixno}
-
-\newwrite\contentsfile
-% This is called from \setfilename.
-\def\opencontents{\openout\contentsfile = \jobname.toc }
+% \def\appendixletter{\char\the\appendixno}
+% We do the following for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
% Each @chapter defines this as the name of the chapter.
-% page headings and footings can use it. @section does likewise
-
-\def\thischapter{} \def\thissection{}
-\def\seccheck#1{\ifnum \pageno<0
- \errmessage{@#1 not allowed after generating table of contents}%
-\fi}
-
-\def\chapternofonts{%
- \let\rawbackslash=\relax
- \let\frenchspacing=\relax
- \def\result{\realbackslash result}%
- \def\equiv{\realbackslash equiv}%
- \def\expansion{\realbackslash expansion}%
- \def\print{\realbackslash print}%
- \def\TeX{\realbackslash TeX}%
- \def\dots{\realbackslash dots}%
- \def\result{\realbackslash result}%
- \def\equiv{\realbackslash equiv}%
- \def\expansion{\realbackslash expansion}%
- \def\print{\realbackslash print}%
- \def\error{\realbackslash error}%
- \def\point{\realbackslash point}%
- \def\copyright{\realbackslash copyright}%
- \def\tt{\realbackslash tt}%
- \def\bf{\realbackslash bf}%
- \def\w{\realbackslash w}%
- \def\less{\realbackslash less}%
- \def\gtr{\realbackslash gtr}%
- \def\hat{\realbackslash hat}%
- \def\char{\realbackslash char}%
- \def\tclose##1{\realbackslash tclose{##1}}%
- \def\code##1{\realbackslash code{##1}}%
- \def\samp##1{\realbackslash samp{##1}}%
- \def\r##1{\realbackslash r{##1}}%
- \def\b##1{\realbackslash b{##1}}%
- \def\key##1{\realbackslash key{##1}}%
- \def\file##1{\realbackslash file{##1}}%
- \def\kbd##1{\realbackslash kbd{##1}}%
- % These are redefined because @smartitalic wouldn't work inside xdef.
- \def\i##1{\realbackslash i{##1}}%
- \def\cite##1{\realbackslash cite{##1}}%
- \def\var##1{\realbackslash var{##1}}%
- \def\emph##1{\realbackslash emph{##1}}%
- \def\dfn##1{\realbackslash dfn{##1}}%
-}
+% page headings and footings can use it. @section does likewise.
+\def\thischapter{}
+\def\thissection{}
\newcount\absseclevel % used to calculate proper heading level
\newcount\secbase\secbase=0 % @raise/lowersections modify this count
@@ -2901,59 +3354,59 @@ width0pt\relax} \fi
\fi
}
-
+% @chapter, @appendix, @unnumbered.
\def\thischaptername{No Chapter Title}
\outer\def\chapter{\parsearg\chapteryyy}
\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz #1{\seccheck{chapter}%
+\def\chapterzzz #1{%
\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
+\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
\chapmacro {#1}{\the\chapno}%
\gdef\thissection{#1}%
\gdef\thischaptername{#1}%
% We don't substitute the actual chapter name into \thischapter
% because we don't want its macros evaluated now.
\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\the\chapno}}}%
+\temp
+\donoderef
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
\global\let\subsubsection = \numberedsubsubsec
-}}
+}
\outer\def\appendix{\parsearg\appendixyyy}
\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
-\def\appendixzzz #1{\seccheck{appendix}%
+\def\appendixzzz #1{%
\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \appendixno by 1 \message{Appendix \appendixletter}%
+\global\advance \appendixno by 1
+\message{\putwordAppendix\space \appendixletter}%
\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
\gdef\thissection{#1}%
\gdef\thischaptername{#1}%
\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash chapentry{\the\toks0}%
- {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\putwordAppendix{} \appendixletter}}}%
+\temp
+\appendixnoderef
\global\let\section = \appendixsec
\global\let\subsection = \appendixsubsec
\global\let\subsubsection = \appendixsubsubsec
-}}
+}
% @centerchap is like @unnumbered, but the heading is centered.
\outer\def\centerchap{\parsearg\centerchapyyy}
\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+% @top is like @unnumbered.
\outer\def\top{\parsearg\unnumberedyyy}
+
\outer\def\unnumbered{\parsearg\unnumberedyyy}
\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
-\def\unnumberedzzz #1{\seccheck{unnumbered}%
+\def\unnumberedzzz #1{%
\secno=0 \subsecno=0 \subsubsecno=0
%
% This used to be simply \message{#1}, but TeX fully expands the
@@ -2965,155 +3418,139 @@ width0pt\relax} \fi
% Anyway, we don't want the fully-expanded definition of @cite to appear
% as a result of the \message, we just want `@cite' itself. We use
% \the<toks register> to achieve this: TeX expands \the<toks> only once,
-% simply yielding the contents of the <toks register>.
+% simply yielding the contents of <toks register>. (We also do this for
+% the toc entries.)
\toks0 = {#1}\message{(\the\toks0)}%
%
\unnumbchapmacro {#1}%
\gdef\thischapter{#1}\gdef\thissection{#1}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
\global\let\section = \unnumberedsec
\global\let\subsection = \unnumberedsubsec
\global\let\subsubsection = \unnumberedsubsubsec
-}}
+}
+% Sections.
\outer\def\numberedsec{\parsearg\secyyy}
\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
-\def\seczzz #1{\seccheck{section}%
+\def\seczzz #1{%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash secentry %
-{\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\the\chapno}{\the\secno}}}%
+\temp
+\donoderef
+\nobreak
+}
\outer\def\appendixsection{\parsearg\appendixsecyyy}
\outer\def\appendixsec{\parsearg\appendixsecyyy}
\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
-\def\appendixsectionzzz #1{\seccheck{appendixsection}%
+\def\appendixsectionzzz #1{%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash secentry %
-{\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\appendixletter}{\the\secno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
-\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
+\def\unnumberedseczzz #1{%
\plainsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+% Subsections.
\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
-\def\numberedsubseczzz #1{\seccheck{subsection}%
+\def\numberedsubseczzz #1{%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash subsecentry %
-{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
-\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
+\def\appendixsubseczzz #1{%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash subsecentry %
-{\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
-\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
+\def\unnumberedsubseczzz #1{%
\plainsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+% Subsubsections.
\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
-\def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
+\def\numberedsubsubseczzz #1{%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1}
{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash subsubsecentry{\the\toks0}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
- {\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
-\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
+\def\appendixsubsubseczzz #1{%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1}
{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash subsubsecentry{\the\toks0}%
- {\appendixletter}
- {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
-\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
+\def\unnumberedsubsubseczzz #1{%
\plainsubsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
% These are variants which are not "outer", so they can appear in @ifinfo.
% Actually, they should now be obsolete; ordinary section commands should work.
@@ -3142,8 +3579,7 @@ width0pt\relax} \fi
% Define @majorheading, @heading and @subheading
-% NOTE on use of \vbox for chapter headings, section headings, and
-% such:
+% NOTE on use of \vbox for chapter headings, section headings, and such:
% 1) We use \vbox rather than the earlier \line to permit
% overlong headings to fold.
% 2) \hyphenpenalty is set to 10000 because hyphenation in a
@@ -3190,12 +3626,12 @@ width0pt\relax} \fi
\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-\def\CHAPPAGoff{
+\def\CHAPPAGoff{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chapbreak
\global\let\pagealignmacro=\chappager}
-\def\CHAPPAGon{
+\def\CHAPPAGon{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chappager
\global\let\pagealignmacro=\chappager
@@ -3249,7 +3685,7 @@ width0pt\relax} \fi
\def\unnchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 10000 %
+ \rm #1\hfill}}\bigskip \par\nobreak
}
\def\chfopen #1#2{\chapoddpage {\chapfonts
@@ -3260,7 +3696,7 @@ width0pt\relax} \fi
\def\centerchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt
- \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
+ \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
}
\def\CHAPFopen{
@@ -3313,24 +3749,45 @@ width0pt\relax} \fi
}
-\message{toc printing,}
-% Finish up the main text and prepare to read what we've written
-% to \contentsfile.
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc. We supply {\folio} at the end of the
+% argument, which will end up as the last argument to the \...entry macro.
+%
+% We open the .toc file here instead of at @setfilename or any other
+% given time so that @contents can be put in the document anywhere.
+%
+\newif\iftocfileopened
+\def\writetocentry#1{%
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ \iflinks \write\tocfile{#1{\folio}}\fi
+}
\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Finish up the main text and prepare to read what we've written
+% to \tocfile.
+%
\def\startcontents#1{%
% If @setchapternewpage on, and @headings double, the contents should
% start on an odd page, unlike chapters. Thus, we maintain
% \contentsalignmacro in parallel with \pagealignmacro.
% From: Torbjorn Granlund <tege@matematik.su.se>
\contentsalignmacro
- \immediate\closeout \contentsfile
- \ifnum \pageno>0
- \pageno = -1 % Request roman numbered pages.
- \fi
+ \immediate\closeout\tocfile
+ %
% Don't need to put `Contents' or `Short Contents' in the headline.
% It is abundantly clear what they are.
\unnumbchapmacro{#1}\def\thischapter{}%
+ \savepageno = \pageno
\begingroup % Set up to handle contents files properly.
\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
% We can't do this, because then an actual ^ in a section
@@ -3338,20 +3795,31 @@ width0pt\relax} \fi
%\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
\raggedbottom % Worry more about breakpoints than the bottom.
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
}
% Normal (long) toc.
-\outer\def\contents{%
- \startcontents{\putwordTableofContents}%
- \input \jobname.toc
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \pdfmakeoutlines
\endgroup
- \vfill \eject
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
}
% And just the chapters.
-\outer\def\summarycontents{%
- \startcontents{\putwordShortContents}%
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
%
\let\chapentry = \shortchapentry
\let\unnumbchapentry = \shortunnumberedentry
@@ -3367,12 +3835,23 @@ width0pt\relax} \fi
\def\unnumbsubsecentry ##1##2{}
\def\subsubsecentry ##1##2##3##4##5##6{}
\def\unnumbsubsubsecentry ##1##2{}
- \input \jobname.toc
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup
- \vfill \eject
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
}
\let\shortcontents = \summarycontents
+\ifpdf
+ \pdfcatalog{/PageMode /UseOutlines}%
+\fi
+
% These macros generate individual entries in the table of contents.
% The first argument is the chapter or section name.
% The last argument is the page number.
@@ -3383,7 +3862,7 @@ width0pt\relax} \fi
% See comments in \dochapentry re vbox and related settings
\def\shortchapentry#1#2#3{%
- \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
}
% Typeset the label for a chapter or appendix for the short contents.
@@ -3391,10 +3870,14 @@ width0pt\relax} \fi
% We could simplify the code here by writing out an \appendixentry
% command in the toc file for appendices, instead of using \chapentry
% for both, but it doesn't seem worth it.
-\setbox0 = \hbox{\shortcontrm \putwordAppendix }
-\newdimen\shortappendixwidth \shortappendixwidth = \wd0
-
+%
+\newdimen\shortappendixwidth
+%
\def\shortchaplabel#1{%
+ % Compute width of word "Appendix", may change with language.
+ \setbox0 = \hbox{\shortcontrm \putwordAppendix}%
+ \shortappendixwidth = \wd0
+ %
% We typeset #1 in a box of constant width, regardless of the text of
% #1, so the chapter titles will come out aligned.
\setbox0 = \hbox{#1}%
@@ -3409,7 +3892,7 @@ width0pt\relax} \fi
}
\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
-\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
+\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
% Sections.
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
@@ -3436,24 +3919,24 @@ width0pt\relax} \fi
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
\begingroup
\chapentryfonts
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup
\nobreak\vskip .25\baselineskip plus.1\baselineskip
}
\def\dosecentry#1#2{\begingroup
\secentryfonts \leftskip=\tocindent
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsecentry#1#2{\begingroup
\subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsubsecentry#1#2{\begingroup
\subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
% Final typesetting of a toc entry; we use the same \entry macro as for
@@ -3481,6 +3964,7 @@ width0pt\relax} \fi
\message{environments,}
+% @foo ... @end foo.
% Since these characters are used in examples, it should be an even number of
% \tt widths. Each \tt character is 1en, so two makes it 1em.
@@ -3553,6 +4037,7 @@ width0pt\relax} \fi
\let\!=\ptexexclam
\let\i=\ptexi
\let\{=\ptexlbrace
+ \let\+=\tabalign
\let\}=\ptexrbrace
\let\*=\ptexstar
\let\t=\ptext
@@ -3604,8 +4089,8 @@ width0pt\relax} \fi
% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
\let\nonarrowing=\relax
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \cartouche: draw rectangle w/rounded corners around argument
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
\font\circle=lcircle10
\newdimen\circthick
\newdimen\cartouter\newdimen\cartinner
@@ -3632,9 +4117,9 @@ width0pt\relax} \fi
\cartinner=\hsize \advance\cartinner by-\lskip
\advance\cartinner by-\rskip
\cartouter=\hsize
- \advance\cartouter by 18pt % allow for 3pt kerns on either
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
% side, and for 6pt waste from
-% each corner char
+% each corner char, and rule thickness
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
% Flag to tell @lisp, etc., not to narrow margin.
\let\nonarrowing=\comment
@@ -3688,49 +4173,52 @@ width0pt\relax} \fi
\fi
}
-% To ending an @example-like environment, we first end the paragraph
-% (via \afterenvbreak's vertical glue), and then the group. That way we
-% keep the zero \parskip that the environments set -- \parskip glue
-% will be inserted at the beginning of the next paragraph in the
-% document, after the environment.
+% Define the \E... control sequence only if we are inside the particular
+% environment, so the error checking in \end will work.
+%
+% To end an @example-like environment, we first end the paragraph (via
+% \afterenvbreak's vertical glue), and then the group. That way we keep
+% the zero \parskip that the environments set -- \parskip glue will be
+% inserted at the beginning of the next paragraph in the document, after
+% the environment.
%
-\def\nonfillfinish{\afterenvbreak\endgroup}%
+\def\nonfillfinish{\afterenvbreak\endgroup}
+% @lisp: indented, narrowed, typewriter font.
\def\lisp{\begingroup
\nonfillstart
\let\Elisp = \nonfillfinish
\tt
- % Make @kbd do something special, if requested.
- \let\kbdfont\kbdexamplefont
- \rawbackslash % have \ input char produce \ char from current font
- \gobble
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
}
-% Define the \E... control sequence only if we are inside the
-% environment, so the error checking in \end will work.
-%
-% We must call \lisp last in the definition, since it reads the
-% return following the @example (or whatever) command.
-%
+% @example: Same as @lisp.
\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
-\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
-\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-% @smallexample and @smalllisp. This is not used unless the @smallbook
-% command is given. Originally contributed by Pavel@xerox.
+% @small... is usually equivalent to the non-small (@smallbook
+% redefines). We must call \example (or whatever) last in the
+% definition, since it reads the return following the @example (or
+% whatever) command.
%
+% This actually allows (for example) @end display inside an
+% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
+%
+\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
+\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
+\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
+\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
+
+% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
+% Originally contributed by Pavel@xerox.
\def\smalllispx{\begingroup
- \nonfillstart
- \let\Esmalllisp = \nonfillfinish
- \let\Esmallexample = \nonfillfinish
- %
- % Smaller fonts for small examples.
- \indexfonts \tt
- \rawbackslash % make \ output the \ character from the current font (tt)
- \gobble
+ \def\Esmalllisp{\nonfillfinish\endgroup}%
+ \def\Esmallexample{\nonfillfinish\endgroup}%
+ \smallfonts
+ \lisp
}
-% This is @display; same as @lisp except use roman font.
+% @display: same as @lisp except keep current font.
%
\def\display{\begingroup
\nonfillstart
@@ -3738,7 +4226,15 @@ width0pt\relax} \fi
\gobble
}
-% This is @format; same as @display except don't narrow margins.
+% @smalldisplay (when @smallbook): @display plus smaller fonts.
+%
+\def\smalldisplayx{\begingroup
+ \def\Esmalldisplay{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \display
+}
+
+% @format: same as @display except don't narrow margins.
%
\def\format{\begingroup
\let\nonarrowing = t
@@ -3747,20 +4243,27 @@ width0pt\relax} \fi
\gobble
}
-% @flushleft (same as @format) and @flushright.
+% @smallformat (when @smallbook): @format plus smaller fonts.
%
-\def\flushleft{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eflushleft = \nonfillfinish
- \gobble
+\def\smallformatx{\begingroup
+ \def\Esmallformat{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \format
}
+
+% @flushleft (same as @format).
+%
+\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
+
+% @flushright.
+%
\def\flushright{\begingroup
\let\nonarrowing = t
\nonfillstart
\let\Eflushright = \nonfillfinish
\advance\leftskip by 0pt plus 1fill
- \gobble}
+ \gobble
+}
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
% and narrows the margins.
@@ -3783,9 +4286,11 @@ width0pt\relax} \fi
\fi
}
+
\message{defuns,}
-% Define formatter for defuns
-% First, allow user to change definition object font (\df) internally
+% @defun etc.
+
+% Allow user to change definition object font (\df) internally
\def\setdeffont #1 {\csname DEF#1\endcsname}
\newskip\defbodyindent \defbodyindent=.4in
@@ -3839,10 +4344,16 @@ width0pt\relax} \fi
%% contained text. This is especially needed for [ and ]
\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
-\def\ampnr{\&}
+\let\ampnr = \&
\def\lbrb{{\bf\char`\[}}
\def\rbrb{{\bf\char`\]}}
+% Active &'s sneak into the index arguments, so make sure it's defined.
+{
+ \catcode`& = 13
+ \global\let& = \ampnr
+}
+
% First, defname, which formats the header line itself.
% #1 should be the function name.
% #2 should be the type of definition, such as "Function".
@@ -3852,20 +4363,18 @@ width0pt\relax} \fi
% outside the @def...
\dimen2=\leftskip
\advance\dimen2 by -\defbodyindent
-\dimen3=\rightskip
-\advance\dimen3 by -\defbodyindent
-\noindent %
+\noindent
\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %
+\parshape 2 0in \dimen0 \defargsindent \dimen1
% Now output arg 2 ("Function" or some such)
% ending at \deftypemargin from the right margin,
% but stuck inside a box of width 0 so it does not interfere with linebreaking
{% Adjust \hsize to exclude the ambient margins,
% so that \rightline will obey them.
-\advance \hsize by -\dimen2 \advance \hsize by -\dimen3
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
+\advance \hsize by -\dimen2
+\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
% Make all lines underfull and no complaints:
\tolerance=10000 \hbadness=10000
\advance\leftskip by -\defbodyindent
@@ -3886,23 +4395,62 @@ width0pt\relax} \fi
\def#1{\endgraf\endgroup\medbreak}%
\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup %
\catcode 61=\active % 61 is `='
\obeylines\activeparens\spacesplit#3}
-\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+%
+\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
+% Used for @deftypemethod and @deftypeivar.
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by a space, is the class name.
+% #5 is the method's return type.
+%
+\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
+
+% Used for @deftypeop. The change from \deftypemethparsebody is an
+% extra argument at the beginning which is the `category', instead of it
+% being the hardwired string `Method' or `Instance Variable'. We have
+% to account for this both in the \...x definition and in parsing the
+% input at hand. Thus also need a control sequence (passed as #5) for
+% the \E... definition to assign the category name to.
+%
+\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 ##3 {%
+ \def#4{##1}%
+ \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
+
\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
@@ -3911,7 +4459,7 @@ width0pt\relax} \fi
\def#2##1 ##2 {\def#4{##1}%
\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
@@ -3926,7 +4474,7 @@ width0pt\relax} \fi
\def#1{\endgraf\endgroup\medbreak}%
\def#2{\begingroup\obeylines\spacesplit#3}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup %
\catcode 61=\active %
@@ -3943,7 +4491,7 @@ width0pt\relax} \fi
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
\parindent=0in
- \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+ \advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines
}
@@ -3988,7 +4536,7 @@ width0pt\relax} \fi
\def#2##1 ##2 {\def#4{##1}%
\begingroup\obeylines\spacesplit{#3{##2}}}%
\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\spacesplit{#3{#5}}}
@@ -4012,16 +4560,17 @@ width0pt\relax} \fi
% First, define the processing that is wanted for arguments of \defun
% Use this to expand the args and terminate the paragraph they make up
-\def\defunargs #1{\functionparens \sl
+\def\defunargs#1{\functionparens \sl
% Expand, preventing hyphenation at `-' chars.
% Note that groups don't affect changes in \hyphenchar.
-\hyphenchar\tensl=0
+% Set the font temporarily and use \font in case \setfont made \tensl a macro.
+{\tensl\hyphenchar\font=0}%
#1%
-\hyphenchar\tensl=45
+{\tensl\hyphenchar\font=45}%
\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
\interlinepenalty=10000
\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
+\endgraf\nobreak\vskip -\parskip\nobreak
}
\def\deftypefunargs #1{%
@@ -4032,7 +4581,7 @@ width0pt\relax} \fi
\tclose{#1}% avoid \code because of side effects on active chars
\interlinepenalty=10000
\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
+\endgraf\nobreak\vskip -\parskip\nobreak
}
% Do complete processing of one @defun or @defunx line already parsed.
@@ -4051,7 +4600,7 @@ width0pt\relax} \fi
\def\defun{\defparsebody\Edefun\defunx\defunheader}
\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Function}%
+\begingroup\defname {#1}{\putwordDeffunc}%
\defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
@@ -4065,7 +4614,7 @@ width0pt\relax} \fi
% #1 is the data type, #2 the name, #3 the args.
\def\deftypefunheaderx #1#2 #3\relax{%
\doind {fn}{\code{#2}}% Make entry in function index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
\deftypefunargs {#3}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
@@ -4096,7 +4645,7 @@ width0pt\relax} \fi
\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Macro}%
+\begingroup\defname {#1}{\putwordDefmac}%
\defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
@@ -4106,53 +4655,77 @@ width0pt\relax} \fi
\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Special Form}%
+\begingroup\defname {#1}{\putwordDefspec}%
\defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
-% This definition is run if you use @defunx
-% anywhere other than immediately after a @defun or @defunx.
-
-\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
-\def\defunx #1 {\errmessage{@defunx in invalid context}}
-\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
-\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
-\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
-\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
-\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
-
-% @defmethod, and so on
-
-% @defop {Funny Method} foo-class frobnicate argument
-
+% @defop CATEGORY CLASS OPERATION ARG...
+%
\def\defop #1 {\def\defoptype{#1}%
\defopparsebody\Edefop\defopx\defopheader\defoptype}
-
-\def\defopheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
-\begingroup\defname {#2}{\defoptype{} on #1}%
+%
+\def\defopheader#1#2#3{%
+\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
+\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
\defunargs {#3}\endgroup %
}
-% @deftypemethod foo-class return-type foo-method args
+% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
+%
+\def\deftypeop #1 {\def\deftypeopcategory{#1}%
+ \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
+ \deftypeopcategory}
+%
+% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
+\def\deftypeopheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}
+ {\deftypeopcategory\ \putwordon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
+
+% @deftypemethod CLASS TYPE METHOD ARG...
%
\def\deftypemethod{%
- \defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
+ \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
%
% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
\def\deftypemethodheader#1#2#3#4{%
- \deftypefnheaderx{Method on #1}{#2}#3 #4\relax
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
}
-% @defmethod == @defop Method
+% @deftypeivar CLASS TYPE VARNAME
+%
+\def\deftypeivar{%
+ \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
+%
+% #1 is the class name, #2 the data type, #3 the variable name.
+\def\deftypeivarheader#1#2#3{%
+ \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
+ \begingroup
+ \defname{#3}{\putwordInstanceVariableof\ \code{#1}}%
+ \defvarargs{#3}%
+ \endgroup
+}
+% @defmethod == @defop Method
+%
\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
-
-\def\defmethodheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% entry in function index
-\begingroup\defname {#2}{Method on #1}%
-\defunargs {#3}\endgroup %
+%
+% #1 is the class name, #2 the method name, #3 the args.
+\def\defmethodheader#1#2#3{%
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{#2}{\putwordMethodon\ \code{#1}}%
+ \defunargs{#3}%
+ \endgroup
}
% @defcv {Class Option} foo-class foo-flag
@@ -4161,37 +4734,30 @@ width0pt\relax} \fi
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
\def\defcvarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{\defcvtype{} of #1}%
+\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
+\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
\defvarargs {#3}\endgroup %
}
-% @defivar == @defcv {Instance Variable}
-
+% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
+%
\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
-
-\def\defivarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{Instance Variable of #1}%
-\defvarargs {#3}\endgroup %
+%
+\def\defivarheader#1#2#3{%
+ \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
+ \begingroup
+ \defname{#2}{\putwordInstanceVariableof\ #1}%
+ \defvarargs{#3}%
+ \endgroup
}
-% These definitions are run if you use @defmethodx, etc.,
-% anywhere other than immediately after a @defmethod, etc.
-
-\def\defopx #1 {\errmessage{@defopx in invalid context}}
-\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
-\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
-\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
-
-% Now @defvar
-
+% @defvar
% First, define the processing that is wanted for arguments of @defvar.
% This is actually simple: just print them in roman.
% This must expand the args and terminate the paragraph they make up
\def\defvarargs #1{\normalparens #1%
\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000}
+\endgraf\nobreak\vskip -\parskip\nobreak}
% @defvr Counter foo-count
@@ -4205,7 +4771,7 @@ width0pt\relax} \fi
\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{Variable}%
+\begingroup\defname {#1}{\putwordDefvar}%
\defvarargs {#2}\endgroup %
}
@@ -4214,7 +4780,7 @@ width0pt\relax} \fi
\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{User Option}%
+\begingroup\defname {#1}{\putwordDefopt}%
\defvarargs {#2}\endgroup %
}
@@ -4226,9 +4792,9 @@ width0pt\relax} \fi
% is actually part of the data type, which should not be put into the index.
\def\deftypevarheader #1#2{%
\dovarind#2 \relax% Make entry in variables index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
+\endgraf\nobreak\vskip -\parskip\nobreak
\endgroup}
\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
@@ -4239,18 +4805,9 @@ width0pt\relax} \fi
\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
+\endgraf\nobreak\vskip -\parskip\nobreak
\endgroup}
-% This definition is run if you use @defvarx
-% anywhere other than immediately after a @defvar or @defvarx.
-
-\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
-\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
-\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
-\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
-\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
-
% Now define @deftp
% Args are printed in bold, a slight difference from @defvar.
@@ -4263,51 +4820,394 @@ width0pt\relax} \fi
\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
-% This definition is run if you use @deftpx, etc
-% anywhere other than immediately after a @deftp, etc.
+% These definitions are used if you use @defunx (etc.)
+% anywhere other than immediately after a @defun or @defunx.
+%
+\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
+\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
+\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
+\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
+\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
+\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
+\def\defopx#1 {\errmessage{@defopx in invalid context}}
+\def\defspecx#1 {\errmessage{@defspecx in invalid context}}
+\def\deftpx#1 {\errmessage{@deftpx in invalid context}}
+\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
+\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
+\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
+\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
+\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
+\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
+\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
+\def\defunx#1 {\errmessage{@defunx in invalid context}}
+\def\defvarx#1 {\errmessage{@defvarx in invalid context}}
+\def\defvrx#1 {\errmessage{@defvrx in invalid context}}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scanmacro#1{%
+ \begingroup \newlinechar`\^^M
+ % Undo catcode changes of \startcontents and \doprintindex
+ \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ \toks0={#1\endinput}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \let\xeatspaces\eatspaces
+ \input \jobname.tmp
+ \endgroup
+}
+\else
+\def\scanmacro#1{%
+\begingroup \newlinechar`\^^M
+% Undo catcode changes of \startcontents and \doprintindex
+\catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
+\fi
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+\def\macrolist{} % List of all defined macros in the form
+ % \do\macro1\do\macro2...
+
+% Utility routines.
+% Thisdoes \let #1 = #2, except with \csnames.
+\def\cslet#1#2{%
+\expandafter\expandafter
+\expandafter\let
+\expandafter\expandafter
+\csname#1\endcsname
+\csname#2\endcsname}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=12\catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
-\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\macrobodyctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\{=12
+ \catcode`\}=12
+ \catcode`\@=12
+ \catcode`\^^M=12
+ \usembodybackslash}
+
+\def\macroargctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\@=12
+ \catcode`\\=12}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
-\message{cross reference,}
-% Define cross-reference macros
-\newwrite \auxfile
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{The name \the\macname\space is reserved}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ % Add the macroname to \macrolist
+ \toks0 = \expandafter{\macrolist\do}%
+ \xdef\macrolist{\the\toks0
+ \expandafter\noexpand\csname\the\macname\endcsname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\def\unmacro{\parsearg\unmacroxxx}
+\def\unmacroxxx#1{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist
+ \begingroup
+ \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
+ \def\do##1{%
+ \def\tempb{##1}%
+ \ifx\tempa\tempb
+ % remove this
+ \else
+ \toks0 = \expandafter{\newmacrolist\do}%
+ \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
+ \fi}%
+ \def\newmacrolist{}%
+ % Execute macro list to define \newmacrolist
+ \macrolist
+ \global\let\macrolist\newmacrolist
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
-\newif\ifhavexrefs % True if xref values are known.
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \next}
+
+% We mant to disable all macros during \shipout so that they are not
+% expanded by \write.
+\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
+ \edef\next{\macrolist}\expandafter\endgroup\next}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Just make them active and then expand them all to nothing.
+\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{\ignoreactivespaces
+\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
+ \expandafter\noexpand\csname#2\endcsname}%
+\expandafter\endgroup\next}
+
+
+\message{cross references,}
+% @xref etc.
+
+\newwrite\auxfile
+
+\newif\ifhavexrefs % True if xref values are known.
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-% @inforef is simple.
+% @inforef is relatively simple.
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
-% \setref{foo} defines a cross-reference point named foo.
+% @node's job is to define \lastnode.
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx [#1,]}
+\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
-\def\setref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ysectionnumberandtype}}
+% The sectioning commands (@chapter, etc.) call these.
+\def\donoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Ysectionnumberandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\unnumbnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\appendixnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Yappendixletterandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
-\def\unnumbsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ynothing}}
-\def\appendixsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Yappendixletterandtype}}
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
+% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
+% to set \indexdummies so commands such as @code in a section title
+% aren't expanded. It would be nicer not to expand the titles in the
+% first place, but there's so many layers that that is hard to do.
+%
+\def\setref#1#2{{%
+ \indexdummies
+ \pdfmkdest{#1}%
+ \dosetq{#1-title}{Ytitle}%
+ \dosetq{#1-pg}{Ypagenumber}%
+ \dosetq{#1-snt}{#2}%
+}}
-% \xref, \pxref, and \ref generate cross-references to specified points.
-% For \xrefX, #1 is the node name, #2 the name of the Info
-% cross-reference, #3 the printed node name, #4 the name of the Info
-% file, #5 the name of the printed manual. All but the node name can be
-% omitted.
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
%
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]}
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
\def\printedmanual{\ignorespaces #5}%
\def\printednodename{\ignorespaces #3}%
\setbox1=\hbox{\printedmanual}%
@@ -4320,7 +5220,7 @@ width0pt\relax} \fi
\else
% Use the actual chapter/section title appear inside
% the square brackets. Use the real section title if we have it.
- \ifdim \wd1>0pt%
+ \ifdim \wd1 > 0pt
% It is in another manual, so we don't have it.
\def\printednodename{\ignorespaces #1}%
\else
@@ -4341,27 +5241,54 @@ width0pt\relax} \fi
% are best written with fairly long node names, containing hyphens, this
% is a loss. Therefore, we give the text of the node name again, so it
% is as if TeX is seeing it for the first time.
+ \ifpdf
+ \leavevmode
+ \getfilename{#4}%
+ \ifnum\filenamelength>0
+ \startlink attr{/Border [0 0 0]}%
+ goto file{\the\filename.pdf} name{#1@}%
+ \else
+ \startlink attr{/Border [0 0 0]}%
+ goto name{#1@}%
+ \fi
+ \linkcolor
+ \fi
+ %
\ifdim \wd1 > 0pt
- \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
+ \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
\else
% _ (for example) has to be the character _ for the purposes of the
% control sequence corresponding to the node, but it has to expand
% into the usual \leavevmode...\vrule stuff for purposes of
% printing. So we \turnoffactive for the \refx-snt, back on for the
% printing, back off for the \refx-pg.
- {\turnoffactive \refx{#1-snt}{}}%
- \space [\printednodename],\space
+ {\normalturnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % [mynode],
+ [\printednodename],\space
+ % page 3
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
\fi
+ \endlink
\endgroup}
% \dosetq is the interface for calls from other macros
-% Use \turnoffactive so that punctuation chars such as underscore
-% work in node names.
-\def\dosetq #1#2{{\let\folio=0 \turnoffactive
-\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
-\next}}
+% Use \normalturnoffactive so that punctuation chars such as underscore
+% and backslash work in node names. (\turnoffactive doesn't do \.)
+\def\dosetq#1#2{%
+ {\let\folio=0%
+ \normalturnoffactive
+ \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
+ \iflinks
+ \next
+ \fi
+ }%
+}
% \internalsetq {foo}{page} expands into
% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
@@ -4413,12 +5340,14 @@ width0pt\relax} \fi
\expandafter\ifx\csname X#1\endcsname\relax
% If not defined, say something at least.
\angleleft un\-de\-fined\angleright
- \ifhavexrefs
- \message{\linenumber Undefined cross reference `#1'.}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
\fi
\fi
\else
@@ -4429,7 +5358,7 @@ width0pt\relax} \fi
}
% This is the macro invoked by entries in the aux file.
-%
+%
\def\xrdef#1{\begingroup
% Reenable \ as an escape while reading the second argument.
\catcode`\\ = 0
@@ -4492,8 +5421,7 @@ width0pt\relax} \fi
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
- % `\+ does not work, so use 43.
- \catcode43=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
% Make the characters 128-255 be printing characters
{%
\count 1=128
@@ -4582,6 +5510,8 @@ width0pt\relax} \fi
\xspaceskip\z@skip
\parindent\defaultparindent
%
+ \smallfonts \rm
+ %
% Hang the footnote text off the number.
\hang
\textindent{\thisfootno}%
@@ -4596,7 +5526,7 @@ width0pt\relax} \fi
\else\let\next\f@t\fi \next}
\def\f@@t{\bgroup\aftergroup\@foot\let\next}
\def\f@t#1{#1\@foot}
-\def\@foot{\strut\egroup}
+\def\@foot{\strut\par\egroup}
}%end \catcode `\@=11
@@ -4655,23 +5585,25 @@ width0pt\relax} \fi
% @image. We use the macros from epsf.tex to support this.
% If epsf.tex is not installed and @image is used, we complain.
-%
+%
% Check for and read epsf.tex up front. If we read it only at @image
% time, we might be inside a group, and then its definitions would get
% undone and the next image would fail.
\openin 1 = epsf.tex
\ifeof 1 \else
\closein 1
- \def\epsfannounce{\toks0 = }% do not bother showing banner
+ % Do not bother showing banner with post-v2.7 epsf.tex (available in
+ % doc/epsf.tex until it shows up on ctan).
+ \def\epsfannounce{\toks0 = }%
\input epsf.tex
\fi
%
+% We will only complain once about lack of epsf.tex.
\newif\ifwarnednoepsf
\newhelp\noepsfhelp{epsf.tex must be installed for images to
work. It is also included in the Texinfo distribution, or you can get
- it from ftp://ftp.tug.org/tex/epsf.tex.}
+ it from ftp://tug.org/tex/epsf.tex.}
%
-% Only complain once about lack of epsf.tex.
\def\image#1{%
\ifx\epsfbox\undefined
\ifwarnednoepsf \else
@@ -4689,42 +5621,79 @@ width0pt\relax} \fi
% #2 is (optional) width, #3 is (optional) height.
% #4 is just the usual extra ignored arg for parsing this stuff.
\def\imagexxx#1,#2,#3,#4\finish{%
- % \epsfbox itself resets \epsf?size at each figure.
- \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
- \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
- \epsfbox{#1.eps}%
+ \ifpdf
+ \centerline{\dopdfimage{#1}{#2}{#3}}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ % If the image is by itself, center it.
+ \ifvmode
+ \nobreak\bigskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \centerline{\epsfbox{#1.eps}}%
+ \bigbreak
+ \else
+ % In the middle of a paragraph, no extra space.
+ \epsfbox{#1.eps}%
+ \fi
+ \endgroup
+ \fi
}
-% End of control word definitions.
-
-\message{and turning on texinfo input format.}
+\message{localization,}
+% and i18n.
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
+% @documentlanguage is usually given very early, just after
+% @setfilename. If done too late, it may not override everything
+% properly. Single argument is the language abbreviation.
+% It would be nice if we could set up a hyphenation file here.
+%
+\def\documentlanguage{\parsearg\dodocumentlanguage}
+\def\dodocumentlanguage#1{%
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \let\temp = \relax
+ \else
+ \def\temp{\input txi-#1.tex }%
+ \fi
+ \temp
+ \endgroup
}
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? In the current directory
+should work if nowhere else does.}
+
-% Set some numeric style parameters, for 8.5 x 11 format.
+% @documentencoding should change something in TeX eventually, most
+% likely, but for now just recognize it.
+\let\documentencoding = \comment
-\hsize = 6in
-\hoffset = .25in
+
+% Page size parameters.
+%
\newdimen\defaultparindent \defaultparindent = 15pt
-\parindent = \defaultparindent
-\parskip 3pt plus 2pt minus 1pt
-\setleading{13.2pt}
-\advance\topskip by 1.2cm
\chapheadingskip = 15pt plus 4pt minus 2pt
\secheadingskip = 12pt plus 3pt minus 2pt
\subsecheadingskip = 9pt plus 2pt minus 2pt
% Prevent underfull vbox error messages.
-\vbadness=10000
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
% Following George Bush, just get rid of widows and orphans.
\widowpenalty=10000
@@ -4733,101 +5702,125 @@ width0pt\relax} \fi
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% using an old version of TeX, don't do anything. We want the amount of
% stretch added to depend on the line length, hence the dependence on
-% \hsize. This makes it come to about 9pt for the 8.5x11 format.
+% \hsize. We call this whenever the paper size is set.
%
-\ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
-\else
- \emergencystretch = \hsize
- \divide\emergencystretch by 45
-\fi
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
-% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
-\def\smallbook{
- \global\chapheadingskip = 15pt plus 4pt minus 2pt
- \global\secheadingskip = 12pt plus 3pt minus 2pt
- \global\subsecheadingskip = 9pt plus 2pt minus 2pt
+% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
+% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
+% set \parskip and call \setleading for \baselineskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
%
- \global\lispnarrowing = 0.3in
- \setleading{12pt}
- \advance\topskip by -1cm
- \global\parskip 2pt plus 1pt
- \global\hsize = 5in
- \global\vsize=7.5in
- \global\tolerance=700
- \global\hfuzz=1pt
- \global\contentsrightmargin=0pt
- \global\deftypemargin=0pt
- \global\defbodyindent=.5cm
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
%
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
%
- \global\let\smalllisp=\smalllispx
- \global\let\smallexample=\smalllispx
- \global\def\Esmallexample{\Esmalllisp}
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
}
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.5 (or so) format.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \setleading{12pt}%
+ %
+ \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \deftypemargin = 0pt
+ \defbodyindent = .5cm
+ %
+ \let\smalldisplay = \smalldisplayx
+ \let\smallexample = \smalllispx
+ \let\smallformat = \smallformatx
+ \let\smalllisp = \smalllispx
+}}
+
% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{
-\global\tolerance=700
-\global\hfuzz=1pt
-\setleading{12pt}
-\global\parskip 15pt plus 1pt
-
-\global\vsize= 53\baselineskip
-\advance\vsize by \topskip
-%\global\hsize= 5.85in % A4 wide 10pt
-\global\hsize= 6.5in
-\global\outerhsize=\hsize
-\global\advance\outerhsize by 0.5in
-\global\outervsize=\vsize
-\global\advance\outervsize by 0.6in
-
-\global\pagewidth=\hsize
-\global\pageheight=\vsize
-}
-
-\bindingoffset=0pt
-\normaloffset=\hoffset
-\pagewidth=\hsize
-\pageheight=\vsize
-
-% Allow control of the text dimensions. Parameters in order: textheight;
-% textwidth; voffset; hoffset; binding offset; topskip.
-% All require a dimension;
-% header is additional; added length extends the bottom of the page.
-
-\def\changepagesizes#1#2#3#4#5#6{
- \global\vsize= #1
- \global\topskip= #6
- \advance\vsize by \topskip
- \global\voffset= #3
- \global\hsize= #2
- \global\outerhsize=\hsize
- \global\advance\outerhsize by 0.5in
- \global\outervsize=\vsize
- \global\advance\outervsize by 0.6in
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
- \global\normaloffset= #4
- \global\bindingoffset= #5}
+\def\afourpaper{{\globaldefs = 1
+ \setleading{12pt}%
+ \parskip = 3pt plus 2pt minus 1pt
+ %
+ \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+}}
% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
-\def\afourlatex
- {\global\tolerance=700
- \global\hfuzz=1pt
- \setleading{12pt}
- \global\parskip 15pt plus 1pt
- \advance\baselineskip by 1.6pt
- \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
- }
+\def\afourlatex{{\globaldefs = 1
+ \setleading{13.6pt}%
+ %
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
+ %
+ \globaldefs = 0
+}}
% Use @afourwide to print on European A4 paper in wide format.
-\def\afourwide{\afourpaper
-\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
+\def\afourwide{%
+ \afourpaper
+ \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
+ %
+ \globaldefs = 0
+}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\def\pagesizes{\parsearg\pagesizesxxx}
+\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
% Define macros to output various characters with catcode for normal text.
\catcode`\"=\other
@@ -4838,6 +5831,7 @@ width0pt\relax} \fi
\catcode`\<=\other
\catcode`\>=\other
\catcode`\+=\other
+\catcode`\$=\other
\def\normaldoublequote{"}
\def\normaltilde{~}
\def\normalcaret{^}
@@ -4846,6 +5840,7 @@ width0pt\relax} \fi
\def\normalless{<}
\def\normalgreater{>}
\def\normalplus{+}
+\def\normaldollar{$}
% This macro is used to make a character print one way in ttfont
% where it can probably just be output, and another way in other fonts,
@@ -4856,7 +5851,13 @@ width0pt\relax} \fi
% interword stretch (and shrink), and it is reasonable to expect all
% typewriter fonts to have this, we can check that font parameter.
%
-\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
% Turn off all special characters except @
% (and those which the user can use as if they were ordinary).
@@ -4864,10 +5865,10 @@ width0pt\relax} \fi
% use math or other variants that look better in normal text.
\catcode`\"=\active
-\def\activedoublequote{{\tt \char '042}}
+\def\activedoublequote{{\tt\char34}}
\let"=\activedoublequote
\catcode`\~=\active
-\def~{{\tt \char '176}}
+\def~{{\tt\char126}}
\chardef\hat=`\^
\catcode`\^=\active
\def^{{\tt \hat}}
@@ -4878,7 +5879,7 @@ width0pt\relax} \fi
\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
\catcode`\|=\active
-\def|{{\tt \char '174}}
+\def|{{\tt\char124}}
\chardef \less=`\<
\catcode`\<=\active
\def<{{\tt \less}}
@@ -4887,6 +5888,8 @@ width0pt\relax} \fi
\def>{{\tt \gtr}}
\catcode`\+=\active
\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}
%\catcode 27=\active
%\def^^[{$\diamondsuit$}
@@ -4917,9 +5920,6 @@ width0pt\relax} \fi
% \normalbackslash outputs one backslash in fixed width font.
\def\normalbackslash{{\tt\rawbackslashxx}}
-% Say @foo, not \foo, in error messages.
-\escapechar=`\@
-
% \catcode 17=0 % Define control-q
\catcode`\\=\active
@@ -4933,7 +5933,8 @@ width0pt\relax} \fi
@let|=@normalverticalbar
@let<=@normalless
@let>=@normalgreater
-@let+=@normalplus}
+@let+=@normalplus
+@let$=@normaldollar}
@def@normalturnoffactive{@let"=@normaldoublequote
@let\=@normalbackslash
@@ -4943,7 +5944,8 @@ width0pt\relax} \fi
@let|=@normalverticalbar
@let<=@normalless
@let>=@normalgreater
-@let+=@normalplus}
+@let+=@normalplus
+@let$=@normaldollar}
% Make _ and + \other characters, temporarily.
% This is canceled by @fixbackslash.
@@ -4962,16 +5964,29 @@ width0pt\relax} \fi
% Also back turn on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
%
-@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
- @catcode`+=@active @catcode`@_=@active}
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
-%% These look ok in all fonts, so just make them not special. The @rm below
-%% makes sure that the current font starts out as the newly loaded cmr10
-@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+@c Set initial fonts.
@textfonts
@rm
+
@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
@c End:
diff --git a/gnu/usr.bin/texinfo/doc/texinfo.txi b/gnu/usr.bin/texinfo/doc/texinfo.txi
index ea16d1525a7..c34026c9756 100644
--- a/gnu/usr.bin/texinfo/doc/texinfo.txi
+++ b/gnu/usr.bin/texinfo/doc/texinfo.txi
@@ -1,15 +1,12 @@
\input texinfo.tex @c -*-texinfo-*-
-@c $Id: texinfo.txi,v 1.2 1999/01/11 16:38:04 espie Exp $
+@c $Id: texinfo.txi,v 1.3 2000/02/09 02:18:37 espie Exp $
@c %**start of header
@c All text is ignored before the setfilename.
@setfilename texinfo
-@settitle Texinfo @value{edition}
-@c Edition number is now the same as the Texinfo distribution version number.
-@set edition 3.12
-@set update-month February 1998
-@set update-date 27 @value{update-month}
+@include version.texi
+@settitle Texinfo @value{VERSION}
@c Define a new index for options.
@defcodeindex op
@@ -22,20 +19,21 @@
@footnotestyle separate
@paragraphindent 2
@finalout
-@comment %**end of header
-@c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with a
-@c prefix arg). This updates the node pointers, which texinfmt.el needs.
+@comment %**end of header
@dircategory Texinfo documentation system
@direntry
* Texinfo: (texinfo). The GNU documentation format.
-* install-info: (texinfo)Invoking install-info. Updating info/dir entries.
-* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
-* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
+* install-info: (texinfo)Invoking install-info. Update info/dir entries.
+* texi2dvi: (texinfo)Format with texi2dvi. Print Texinfo documents.
+* texindex: (texinfo)Format with tex/texindex. Sort Texinfo index files.
* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source.
@end direntry
+@c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with a
+@c prefix arg). This updates the node pointers, which texinfmt.el needs.
+
@c Set smallbook if printing in smallbook format so the example of the
@c smallbook font is actually written using smallbook; in bigbook, a kludge
@c is used for TeX output. Do this through the -t option to texi2dvi,
@@ -44,17 +42,20 @@
@c set smallbook
@c @@clear smallbook
+@c If you like blank pages. Can add through texi2dvi -t.
+@c setchapternewpage odd
+
@c Currently undocumented command, 5 December 1993:
@c nwnode (Same as node, but no warnings; for `makeinfo'.)
@ifinfo
This file documents Texinfo, a documentation system that can produce
-both on-line information and a printed manual from a single source file.
+both online information and a printed manual from a single source file.
-Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98
+Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98, 99
Free Software Foundation, Inc.
-This edition is for Texinfo version @value{edition}.
+This edition is for Texinfo version @value{VERSION}, @value{UPDATED}.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -78,7 +79,6 @@ except that this permission notice may be stated in a translation approved
by the Free Software Foundation.
@end ifinfo
-@setchapternewpage odd
@shorttitlepage Texinfo
@@ -86,25 +86,27 @@ by the Free Software Foundation.
@c use the new format for titles
@title Texinfo
@subtitle The GNU Documentation Format
-@subtitle for Texinfo version @value{edition}
-@subtitle @value{update-month}
+@subtitle for Texinfo version @value{VERSION}, @value{UPDATED}
-@author Robert J.@: Chassell
-@author Richard M.@: Stallman
+@author Robert J. Chassell
+@author Richard M. Stallman
@c Include the Distribution inside the titlepage so
@c that headings are turned off.
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1988, 90, 91, 92, 93, 95, 96, 97, 98
+Copyright @copyright{} 1988, 90, 91, 92, 93, 95, 96, 97, 98, 99
Free Software Foundation, Inc.
+This manual is for Texinfo version @value{VERSION}, @value{UPDATED}.
+
Published by the Free Software Foundation @*
59 Temple Place Suite 330 @*
Boston, MA 02111-1307 @*
USA @*
-ISBN 1-882114-65-5
+ISBN 1-882114-67-1 @c for version 4.0, September 1999.
+@c ISBN 1-882114-65-5 @c for version 3.12, March 1998.
@c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995
@c ISBN 1-882114-64-7 is for edition 2.24 of November 1996.
@@ -125,65 +127,22 @@ by the Free Software Foundation.
Cover art by Etienne Suvasa.
@end titlepage
-@ifinfo
-@node Top, Copying, (dir), (dir)
+@summarycontents
+@contents
+
+@ifnottex
+@node Top
@top Texinfo
Texinfo is a documentation system that uses a single source file to
-produce both on-line information and printed output.@refill
+produce both online information and printed output.
The first part of this master menu lists the major nodes in this Info
document, including the @@-command and concept indices. The rest of
-the menu lists all the lower level nodes in the document.@refill
-
-This is Edition @value{edition} of the Texinfo documentation,
-@w{@value{update-date}}.
-@end ifinfo
+the menu lists all the lower level nodes in the document.
-@c Here is a spare copy of the chapter menu entry descriptions,
-@c in case they are accidently deleted
-@ignore
-Your rights.
-Texinfo in brief.
-How to use Texinfo mode.
-What is at the beginning of a Texinfo file?
-What is at the end of a Texinfo file?
-How to create chapters, sections, subsections,
- appendices, and other parts.
-How to provide structure for a document.
-How to write nodes.
-How to write menus.
-How to write cross references.
-How to mark words and phrases as code,
- keyboard input, meta-syntactic
- variables, and the like.
-How to write quotations, examples, etc.
-How to write lists and tables.
-How to create indices.
-How to insert @@-signs, braces, etc.
-How to indicate results of evaluation,
- expansion of macros, errors, etc.
-How to force and prevent line and page breaks.
-How to describe functions and the like in a uniform manner.
-How to write footnotes.
-How to specify text for either @TeX{} or Info.
-How to print hardcopy.
-How to create an Info file.
-How to install an Info file
-A list of all the Texinfo @@-commands.
-Hints on how to write a Texinfo document.
-A sample Texinfo file to look at.
-Tell readers they have the right to copy
- and distribute.
-How to incorporate other Texinfo files.
-How to write page headings and footings.
-How to find formatting mistakes.
-All about paragraph refilling.
-A description of @@-Command syntax.
-Texinfo second edition features.
-A menu containing commands and variables.
-A menu covering many topics.
-@end ignore
+This is Edition @value{VERSION} of the Texinfo manual, updated @value{UPDATED}.
+@end ifnottex
@menu
* Copying:: Your rights.
@@ -206,13 +165,12 @@ A menu covering many topics.
* Breaks:: How to force and prevent line and page breaks.
* Definition Commands:: How to describe functions and the like
in a uniform manner.
-* Footnotes:: How to write footnotes.
* Conditionals:: How to specify text for either @TeX{} or Info.
-* Macros:: Defining new Texinfo commands.
-* Format/Print Hardcopy:: How to convert a Texinfo file to a file
+* Internationalization::
+* Defining New Texinfo Commands::
+* Hardcopy:: How to convert a Texinfo file to a file
for printing and how to print that file.
-* Create an Info File:: Convert a Texinfo file into an Info file.
-* Install an Info File:: Make an Info file accessible to users.
+* Creating and Installing Info Files::
* Command List:: All the Texinfo @@-commands.
* Tips:: Hints on how to write a Texinfo document.
* Sample Texinfo File:: A sample Texinfo file to look at.
@@ -233,18 +191,17 @@ A menu covering many topics.
Overview of Texinfo
-* Using Texinfo:: Create a conventional printed book
- or an Info file.
+* Reporting Bugs:: Submitting effective bug reports.
+* Using Texinfo:: Create printed or online output.
* Info Files:: What is an Info file?
* Printed Books:: Characteristics of a printed book or manual.
* Formatting Commands:: @@-commands are used for formatting.
* Conventions:: General rules for writing a Texinfo file.
-* Comments:: How to write comments and mark regions that
- the formatting commands will ignore.
+* Comments:: Writing comments and ignored text in general.
* Minimum:: What a Texinfo file must have.
* Six Parts:: Usually, a Texinfo file has six parts.
* Short Sample:: A short sample Texinfo file.
-* Acknowledgements::
+* Acknowledgements and History:: Contributors and genesis.
Using Texinfo Mode
@@ -285,7 +242,8 @@ The Texinfo File Header
* setfilename:: Tell Info the name of the Info file.
* settitle:: Create a title for the printed work.
* setchapternewpage:: Start chapters on right-hand pages.
-* paragraphindent:: An option to specify paragraph indentation.
+* paragraphindent:: Specify paragraph indentation.
+* exampleindent:: Specify environment indentation.
* End of Header:: Formatting a region requires this.
The Title and Copyright Pages
@@ -334,8 +292,9 @@ Nodes
* Two Paths:: Different commands to structure
Info output and printed output.
* Node Menu Illustration:: A diagram, and sample nodes and menus.
-* node:: How to write a node, in detail.
-* makeinfo Pointer Creation:: How to create node pointers with @code{makeinfo}.
+* node:: Creating nodes, in detail.
+* makeinfo Pointer Creation:: Letting makeinfo determine node pointers.
+* anchor:: Defining arbitrary cross-reference targets.
The @code{@@node} Command
@@ -384,23 +343,26 @@ Marking Words and Phrases
Indicating Definitions, Commands, etc.
* Useful Highlighting:: Highlighting provides useful information.
-* code:: How to indicate code.
-* kbd:: How to show keyboard input.
-* key:: How to specify keys.
-* samp:: How to show a literal sequence of characters.
-* var:: How to indicate a metasyntactic variable.
-* file:: How to indicate the name of a file.
-* dfn:: How to specify a definition.
-* cite:: How to refer to a book that is not in Info.
-* url:: How to indicate a world wide web reference.
-* email:: How to indicate an electronic mail address.
+* code:: Indicating program code.
+* kbd:: Showing keyboard input.
+* key:: Specifying keys.
+* samp:: Showing a literal sequence of characters.
+* var:: Indicating metasyntactic variables.
+* env:: Indicating environment variables.
+* file:: Indicating file names.
+* command:: Indicating command names.
+* option:: Indicating option names.
+* dfn:: Specifying definitions.
+* cite:: Referring to books not in the Info system.
+* acronym:: Indicating acronyms.
+* url:: Indicating a World Wide Web reference.
+* email:: Indicating an electronic mail address.
Emphasizing Text
* emph & strong:: How to emphasize text in Texinfo.
* Smallcaps:: How to use the small caps font.
* Fonts:: Various font commands for printed output.
-* Customized Highlighting:: How to define highlighting commands.
Quotations and Examples
@@ -409,8 +371,8 @@ Quotations and Examples
* quotation:: How to write a quotation.
* example:: How to write an example in a fixed-width font.
* noindent:: How to prevent paragraph indentation.
-* Lisp Example:: How to illustrate Lisp code.
-* smallexample & smalllisp:: Forms for the @code{@@smallbook} option.
+* lisp:: How to illustrate Lisp code.
+* small:: Forms for @code{@@smallbook}.
* display:: How to write an example in the current font.
* format:: How to write an example that does not narrow
the margins.
@@ -437,7 +399,7 @@ Multi-column Tables
* Multitable Column Widths:: Defining multitable column widths.
* Multitable Rows:: Defining multitable rows, with examples.
-Creating Indices
+Indices
* Index Entries:: Choose different words for index entries.
* Predefined Indices:: Use different indices for different kinds
@@ -467,6 +429,7 @@ Special Insertions
* math:: How to format a mathematical expression.
* Glyphs:: How to indicate results of evaluation,
expansion of macros, errors, etc.
+* Footnotes:: How to include footnotes.
* Images:: How to include graphics.
Inserting @@ and Braces
@@ -503,12 +466,17 @@ Glyphs for Examples
Glyphs Summary
-* result::
-* expansion::
-* Print Glyph::
-* Error Glyph::
-* Equivalence::
-* Point Glyph::
+* result::
+* expansion::
+* Print Glyph::
+* Error Glyph::
+* Equivalence::
+* Point Glyph::
+
+Footnotes
+
+* Footnote Commands:: How to write a footnote in Texinfo.
+* Footnote Styles:: Controlling how footnotes appear in Info.
Making and Preventing Breaks
@@ -540,11 +508,6 @@ The Definition Commands
* Abstract Objects:: Commands for object-oriented programming.
* Data Types:: The definition command for data types.
-Footnotes
-
-* Footnote Commands:: How to write a footnote in Texinfo.
-* Footnote Styles:: Controlling how footnotes appear in Info.
-
Conditionally Visible Text
* Conditional Commands:: Specifying text for HTML, Info, or @TeX{}.
@@ -557,30 +520,45 @@ Conditionally Visible Text
@code{@@set}, @code{@@clear}, and @code{@@value}
* ifset ifclear:: Format a region if a flag is set.
-* value:: Replace a flag with a string.
+* set value:: Expand a flag variable to a string.
* value Example:: An easy way to update edition information.
-Macros: Defining New Texinfo Commands
+Internationalization
+
+* documentlanguage:: Declaring the current language.
+* documentencoding:: Declaring the input encoding.
-* Defining Macros:: Both defining and undefining new commands.
+Defining New Texinfo Commands
+
+* Defining Macros:: Defining and undefining new commands.
* Invoking Macros:: Using a macro, once you've defined it.
+* Macro Details:: Beyond basic macro usage.
+* alias:: Command aliases.
+* definfoenclose:: Customized highlighting.
-Format and Print Hardcopy
+Formatting and Printing Hardcopy
* Use TeX:: Use @TeX{} to format for hardcopy.
-* Format with tex/texindex:: How to format in a shell.
-* Format with texi2dvi:: A simpler way to use the shell.
+* Format with tex/texindex:: How to format with explicit shell commands.
+* Format with texi2dvi:: A simpler way to format.
* Print with lpr:: How to print.
* Within Emacs:: How to format and print from an Emacs shell.
* Texinfo Mode Printing:: How to format and print in Texinfo mode.
* Compile-Command:: How to print using Emacs's compile command.
* Requirements Summary:: @TeX{} formatting requirements summary.
-* Preparing for TeX:: What you need to do to use @TeX{}.
+* Preparing for TeX:: What to do before you use @TeX{}.
* Overfull hboxes:: What are and what to do with overfull hboxes.
* smallbook:: How to print small format books and manuals.
* A4 Paper:: How to print on European A4 paper.
+* pagesizes:: How to print with customized page sizes.
* Cropmarks and Magnification:: How to print marks to indicate the size
of pages and how to print scaled up output.
+* PDF Output:: Portable Document Format output.
+
+Creating and Installing Info Files
+
+* Creating an Info File::
+* Install an Info File::
Creating an Info File
@@ -595,10 +573,11 @@ Creating an Info File
* Batch Formatting:: How to format for Info in Emacs Batch mode.
* Tag and Split Files:: How tagged and split files help Info
to run better.
+* makeinfo html:: Generating HTML output.
Installing an Info File
-* Directory file:: The top level menu for all Info files.
+* Directory File:: The top level menu for all Info files.
* New Info File:: Listing a new info file.
* Other Info Directories:: How to specify Info files that are
located in other directories.
@@ -645,16 +624,19 @@ Finding Badly Referenced Nodes
* Unsplit:: How to create an unsplit file.
* Tagifying:: How to tagify a file.
* Splitting:: How to split a file manually.
-
-How to Obtain @TeX{}
-
-* New Texinfo Mode Commands:: The updating commands are especially useful.
-* New Commands:: Many newly described @@-commands.
@end detailmenu
@end menu
-@node Copying, Overview, Top, Top
-@comment node-name, next, previous, up
+@c Reward readers for getting to the end of the menu :).
+@c Contributed by Arnold Robbins.
+@quotation
+Documentation is like sex: when it is good, it is very, very good; and
+when it is bad, it is better than nothing.
+---Dick Brandon
+@end quotation
+
+
+@node Copying
@unnumbered Texinfo Copying Conditions
@cindex Copying conditions
@cindex Conditions for copying Texinfo
@@ -690,100 +672,171 @@ their recipients to know that what they have is not what we distributed,
so that any problems introduced by others will not reflect on our
reputation.@refill
- The precise conditions of the licenses for the programs currently
+The precise conditions of the licenses for the programs currently
being distributed that relate to Texinfo are found in the General Public
-Licenses that accompany them.@refill
+Licenses that accompany them.
-@node Overview, Texinfo Mode, Copying, Top
-@comment node-name, next, previous, up
+
+@node Overview
@chapter Overview of Texinfo
@cindex Overview of Texinfo
@cindex Texinfo overview
-@dfn{Texinfo}@footnote{Note that the first syllable of ``Texinfo'' is
-pronounced like ``speck'', not ``hex''. This odd pronunciation is
-derived from, but is not the same as, the pronunciation of @TeX{}. In
-the word @TeX{}, the @samp{X} is actually the Greek letter ``chi''
-rather than the English letter ``ex''. Pronounce @TeX{} as if the
-@samp{X} were the last sound in the name `Bach'; but pronounce Texinfo
-as if the @samp{x} were a `k'. Spell ``Texinfo'' with a capital ``T''
-and write the other letters in lower case.}
-is a documentation system that uses a single source file to produce both
-on-line information and printed output. This means that instead of
-writing two different documents, one for the on-line help or other on-line
-information and the other for a typeset manual or other printed work, you
-need write only one document. When the work is revised, you need revise
-only one document. (You can read the on-line information, known as an
-@dfn{Info file}, with an Info documentation-reading program.)@refill
+@dfn{Texinfo}@footnote{The first syllable of ``Texinfo'' is pronounced
+like ``speck'', not ``hex''. This odd pronunciation is derived from,
+but is not the same as, the pronunciation of @TeX{}. In the word
+@TeX{}, the @samp{X} is actually the Greek letter ``chi'' rather than
+the English letter ``ex''. Pronounce @TeX{} as if the @samp{X} were the
+last sound in the name `Bach'; but pronounce Texinfo as if the @samp{x}
+were a `k'. Spell ``Texinfo'' with a capital ``T'' and the other
+letters in lower case.} is a documentation system that uses a single
+source file to produce both online information and printed output. This
+means that instead of writing two different documents, one for the
+online information and the other for a printed work, you need write only
+one document. Therefore, when the work is revised, you need revise only
+that one document.
@menu
-* Using Texinfo:: Create a conventional printed book
- or an Info file.
+* Reporting Bugs:: Submitting effective bug reports.
+* Using Texinfo:: Create printed or online output.
* Info Files:: What is an Info file?
* Printed Books:: Characteristics of a printed book or manual.
* Formatting Commands:: @@-commands are used for formatting.
* Conventions:: General rules for writing a Texinfo file.
-* Comments:: How to write comments and mark regions that
- the formatting commands will ignore.
+* Comments:: Writing comments and ignored text in general.
* Minimum:: What a Texinfo file must have.
* Six Parts:: Usually, a Texinfo file has six parts.
* Short Sample:: A short sample Texinfo file.
-* Acknowledgements::
+* Acknowledgements and History:: Contributors and genesis.
@end menu
-@node Using Texinfo, Info Files, Overview, Overview
-@ifinfo
-@heading Using Texinfo
-@end ifinfo
+
+@node Reporting Bugs
+@section Reporting Bugs
+
+@cindex Bugs, reporting
+@cindex Suggestions for Texinfo, making
+@cindex Reporting bugs
+We welcome bug reports or suggestions for the Texinfo system, both
+programs and documentation. Please email them to
+@email{bug-texinfo@@gnu.org}. You can get the latest version of Texinfo
+from @uref{ftp://ftp.gnu.org/gnu/texinfo/} and its mirrors worldwide.
+
+@cindex Checklist for bug reports
+For bug reports, please include enough information for the maintainers
+to reproduce the problem. Generally speaking, that means:
+
+@itemize @bullet
+@item the version number of Texinfo and the program(s) or manual(s) involved.
+@item hardware, operating system, and compiler versions.
+@item any unusual options you gave to @command{configure}.
+@item the contents of any input files necessary to reproduce the bug.
+@item a description of the problem and samples of any erroneous output.
+@item anything else that you think would be helpful.
+@end itemize
+
+When in doubt whether something is needed or not, include it. It's
+better to include too much than to leave out something important.
+
+Patches are most welcome; if possible, please make them with
+@samp{@w{diff -c}} (@pxref{Top,, Overview, diffutils, Comparing and
+Merging Files}) and include @file{ChangeLog} entries (@pxref{Change
+Log,,, emacs, The GNU Emacs Manual}).
+
+When sending email, please do not encode or split the messages in any
+way if possible; it's much easier to deal with one plain text message,
+however large, than many small ones.
+@uref{ftp://ftp.gnu.org/gnu/sharutils/, GNU shar} is a convenient way of
+packaging multiple and/or binary files for email.
+
+
+@node Using Texinfo
+@section Using Texinfo
+
+@cindex Using Texinfo in general
+@cindex Texinfo, introduction to
+@cindex Introduction to Texinfo
Using Texinfo, you can create a printed document with the normal
-features of a book, including chapters, sections, cross references,
-and indices. From the same Texinfo source file, you can create a
-menu-driven, on-line Info file with nodes, menus, cross references,
-and indices. You can, if you wish, make the chapters and sections of
-the printed document correspond to the nodes of the on-line
-information; and you use the same cross references and indices for
-both the Info file and the printed work. @cite{The GNU
-Emacs Manual} is a good example of a Texinfo file, as is this manual.@refill
+features of a book, including chapters, sections, cross references, and
+indices. From the same Texinfo source file, you can create a
+menu-driven, online Info file with nodes, menus, cross references, and
+indices. You can also create from that same source file an HTML output
+file suitable for use with a web browser. @cite{The GNU Emacs Manual}
+is a good example of a Texinfo file, as is this manual.
To make a printed document, you process a Texinfo source file with the
-@TeX{} typesetting program. This creates a DVI file that you can
-typeset and print as a book or report. (Note that the Texinfo language
-is completely different from @TeX{}'s usual language, plain @TeX{}.) If
-you do not have @TeX{}, but do have @code{troff} or @code{nroff}, you
-can use the @code{texi2roff} program instead.@refill
-
-To make an Info file, you process a Texinfo source file with the
-@code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command;
-this creates an Info file that you can install on-line.@refill
-
-@TeX{} and @code{texi2roff} work with many types of printers; similarly,
-Info works with almost every type of computer terminal. This power
-makes Texinfo a general purpose system, but brings with it a constraint,
-which is that a Texinfo file may contain only the customary
-``typewriter'' characters (letters, numbers, spaces, and punctuation
-marks) but no special graphics.@refill
-
-A Texinfo file is a plain @sc{ascii} file containing text and
+@TeX{} typesetting program (but the Texinfo language is very different
+from @TeX{}'s usual language, plain @TeX{}). This creates a DVI file
+that you can typeset and print as a book or report (@pxref{Hardcopy}).
+
+@pindex makeinfo
+To output an Info file, process your Texinfo source with the
+@code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command.
+You can install the result in your Info tree (@pxref{Install an Info
+File}).
+
+To output an HTML file, process your Texinfo source with @code{makeinfo}
+using the @samp{--html} option. You can (for example) install the
+result on your web site.
+
+@cindex Output formats, supporting more
+@cindex Docbook output format
+@cindex SGML-tools output format
+If you are a programmer and would like to contribute to the GNU project
+by implementing additional output formats for Texinfo, that would be
+excellent. But please do not write a separate translator texi2foo for
+your favorite format foo! That is the hard way to do the job, and makes
+extra work in subsequent maintenance, since the Texinfo language is
+continually being enhanced and updated. Instead, the best approach is
+modify @code{makeinfo} to generate the new format, as it does now for
+Info and HTML.
+
+@TeX{} works with virtually all printers; Info works with virtually all
+computer terminals; the HTML output works with virtually all web
+browsers. Thus Texinfo can be used by almost any computer user.
+
+@cindex Source file
+A Texinfo source file is a plain @sc{ascii} file containing text and
@dfn{@@-commands} (words preceded by an @samp{@@}) that tell the
-typesetting and formatting programs what to do. You may edit a
-Texinfo file with any text editor; but it is especially convenient to
-use GNU Emacs since that editor has a special mode, called Texinfo
-mode, that provides various Texinfo-related features. (@xref{Texinfo
-Mode}.)@refill
-
-Before writing a Texinfo source file, you should become familiar with
-the Info documentation reading program and learn about nodes,
-menus, cross references, and the rest. (@inforef{Top, info, info},
-for more information.)@refill
+typesetting and formatting programs what to do. You may edit a Texinfo
+file with any text editor; but it is especially convenient to use GNU
+Emacs since that editor has a special mode, called Texinfo mode, that
+provides various Texinfo-related features. (@xref{Texinfo Mode}.)
-You can use Texinfo to create both on-line help and printed manuals;
-moreover, Texinfo is freely redistributable. For these reasons, Texinfo
-is the format in which documentation for GNU utilities and libraries is
-written.@refill
+Before writing a Texinfo source file, you should learn about nodes,
+menus, cross references, and the rest, for example by reading this
+manual.
-@node Info Files, Printed Books, Using Texinfo, Overview
-@comment node-name, next, previous, up
+You can use Texinfo to create both online help and printed manuals;
+moreover, Texinfo is freely redistributable. For these reasons, Texinfo
+is the official documentation format of the GNU project. More
+information is available at the @uref{http://www.gnu.org/doc/, GNU
+documentation web page}.
+
+@cindex Man page output, not supported
+From time to time, proposals are made to generate traditional Unix man
+pages from Texinfo source. This is not likely to ever be supported,
+because man pages have a very strict conventional format. Merely
+enhancing @command{makeinfo} to output troff format would be
+insufficient. Generating a good man page therefore requires a
+completely different source than the typical Texinfo applications of
+generating a good user manual or a good reference manual. This makes
+generating man pages incompatible with the Texinfo design goal of not
+having to document the same information in different ways for different
+output formats. You might as well just write the man page directly.
+
+@pindex help2man
+@cindex O'Dea, Brendan
+If you wish to support man pages, the program @command{help2man} may be
+useful; it generates a traditional man page from the @samp{--help}
+output of a program. In fact, this is currently used to generate man
+pages for the Texinfo programs themselves. It is free software written
+by Brendan O'Dea, available from
+@uref{http://www.ozemail.com.au/~bod/help2man.tar.gz}.
+
+
+@node Info Files
@section Info files
@cindex Info files
@@ -870,8 +923,20 @@ The @file{dir} file in the @file{info} directory serves as the
departure point for the whole Info system. From it, you can reach the
`Top' nodes of each of the documents in a complete Info system.@refill
-@node Printed Books, Formatting Commands, Info Files, Overview
-@comment node-name, next, previous, up
+@cindex URI syntax for Info
+If you wish to refer to an Info file in a URI, you can use the
+(unofficial) syntax exemplified in the following. This works with
+Emacs/W3, for example:
+@example
+info:///usr/info/emacs#Dissociated%20Press
+info:emacs#Dissociated%20Press
+info://localhost/usr/info/emacs#Dissociated%20Press
+@end example
+
+The @command{info} program itself does not follow URI's of any kind.
+
+
+@node Printed Books
@section Printed Books
@cindex Printed book and manual characteristics
@cindex Manual characteristics, printed
@@ -883,9 +948,12 @@ departure point for the whole Info system. From it, you can reach the
A Texinfo file can be formatted and typeset as a printed book or manual.
To do this, you need @TeX{}, a powerful, sophisticated typesetting
program written by Donald Knuth.@footnote{You can also use the
-@code{texi2roff} program if you do not have @TeX{}; since Texinfo is
-designed for use with @TeX{}, @code{texi2roff} is not described here.
-@code{texi2roff} is not part of the standard GNU distribution.}
+@pindex texi2roff@r{, unsupported software}
+@uref{ftp://tug.org/texi2roff.tar.gz, @code{texi2roff}} program if you
+do not have @TeX{}; since Texinfo is designed for use with @TeX{},
+@code{texi2roff} is not described here. @code{texi2roff} is not part of
+the standard GNU distribution and is not maintained or up-to-date with
+all the Texinfo features described in this manual.}
A Texinfo-based book is similar to any other typeset, printed work: it
can have a title page, copyright page, table of contents, and preface,
@@ -893,18 +961,19 @@ as well as chapters, numbered or unnumbered sections and subsections,
page headers, cross references, footnotes, and indices.@refill
You can use Texinfo to write a book without ever having the intention
-of converting it into on-line information. You can use Texinfo for
+of converting it into online information. You can use Texinfo for
writing a printed novel, and even to write a printed memo, although
this latter application is not recommended since electronic mail is so
much easier.@refill
@TeX{} is a general purpose typesetting program. Texinfo provides a
-file called @file{texinfo.tex} that contains information (definitions or
+file @file{texinfo.tex} that contains information (definitions or
@dfn{macros}) that @TeX{} uses when it typesets a Texinfo file.
(@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commands
to @TeX{} commands, which @TeX{} can then process to create the typeset
document.) @file{texinfo.tex} contains the specifications for printing
-a document.@refill
+a document. You can get the latest version of @file{texinfo.tex} from
+@uref{ftp://ftp.gnu.org/gnu/texinfo.tex}.
Most often, documents are printed on 8.5 inch by 11 inch
pages (216@dmn{mm} by 280@dmn{mm}; this is the default size), but you
@@ -933,7 +1002,8 @@ character-only terminal in Info form and in a typeset book, the
formatting commands that Texinfo supports are necessarily
limited.@refill
-@xref{Obtaining TeX, , How to Obtain @TeX{}}.
+To get a copy of @TeX{}, see
+@ref{Obtaining TeX, , How to Obtain @TeX{}}.
@node Formatting Commands, Conventions, Printed Books, Overview
@@ -963,17 +1033,17 @@ numeric characters. Similarly, you can print the output generated by
@TeX{} on a wide variety of printers.@refill
Depending on what they do or what arguments@footnote{The word
-@dfn{argument} comes from the way it is used in mathematics and does
-not refer to a disputation between two people; it refers to the
-information presented to the command. According to the @cite{Oxford
-English Dictionary}, the word derives from the Latin for @dfn{to make
-clear, prove}; thus it came to mean `the evidence offered as proof',
-which is to say, `the information offered', which led to its
-mathematical meaning. In its other thread of derivation, the word
-came to mean `to assert in a manner against which others may make
-counter assertions', which led to the meaning of `argument' as a
-disputation.} they take, you need to write @@-commands on lines of
-their own or as part of sentences:@refill
+@dfn{argument} comes from the way it is used in mathematics and does not
+refer to a dispute between two people; it refers to the information
+presented to the command. According to the @cite{Oxford English
+Dictionary}, the word derives from the Latin for @dfn{to make clear,
+prove}; thus it came to mean `the evidence offered as proof', which is
+to say, `the information offered', which led to its mathematical
+meaning. In its other thread of derivation, the word came to mean `to
+assert in a manner against which others may make counter assertions',
+which led to the meaning of `argument' as a dispute.} they take, you
+need to write @@-commands on lines of their own or as part of
+sentences:
@itemize @bullet
@item
@@ -998,12 +1068,14 @@ wish (but usually within a sentence) with its argument,
marks text as being code.)@refill
@item
-Write a command such as @code{@@example} at the beginning of a line of
-its own; write the body-text on following lines; and write the matching
-@code{@@end} command, @code{@@end example} in this case, at the
-beginning of a line of its own after the body-text. (@code{@@example}
-@dots{} @code{@@end example} indents and typesets body-text as an
-example.)@refill
+Write a command such as @code{@@example} on a line of its own; write the
+body-text on following lines; and write the matching @code{@@end}
+command, @code{@@end example} in this case, at the on a line of its own
+after the body-text. (@code{@@example} @dots{} @code{@@end example}
+indents and typesets body-text as an example.) It's usually ok to
+indent environment commands like this, but in complicated and
+hard-to-define circumstances the extra spaces cause extra space to
+appear in the output, so beware.
@end itemize
@noindent
@@ -1026,6 +1098,10 @@ syntax, see @ref{Command Syntax, , @@-Command Syntax}.)@refill
@cindex Syntactic conventions
@cindex Conventions, syntactic
+This section describes the general conventions used in all Texinfo documents.
+
+@itemize @bullet
+@item
All printable @sc{ascii} characters except @samp{@@}, @samp{@{} and
@samp{@}} can appear in a Texinfo file and stand for themselves.
@samp{@@} is the escape character which introduces commands.
@@ -1034,6 +1110,7 @@ certain commands. To put one of these special characters into the
document, put an @samp{@@} character in front of it, like this:
@samp{@@@@}, @samp{@@@{}, and @samp{@@@}}.@refill
+@item
@ifinfo
It is customary in @TeX{} to use doubled single-quote characters to
begin and end quotations: ` ` and ' ' (but without a space between the
@@ -1044,23 +1121,26 @@ single-quote characters to @sc{ascii} double-quotes: ` ` and ' ' to " .@refill
@end ifinfo
@iftex
It is customary in @TeX{} to use doubled single-quote characters to
-begin and end quotations: @w{@tt{ `` }} and @w{@tt{ '' }}. This
+begin and end quotations: @w{@t{ `` }} and @w{@t{ '' }}. This
convention should be followed in Texinfo files. @TeX{} converts
doubled single-quote characters to left- and right-hand doubled
quotation marks, ``like this'', and Info converts doubled single-quote
-characters to @sc{ascii} double-quotes: @w{@tt{ `` }} and
-@w{@tt{ '' }} to @w{@tt{ " }}.@refill
+characters to @sc{ascii} double-quotes: @w{@t{ `` }} and
+@w{@t{ '' }} to @w{@t{ " }}.@refill
@end iftex
+@item
Use three hyphens in a row, @samp{---}, for a dash---like this. In
@TeX{}, a single or double hyphen produces a printed dash that is
shorter than the usual typeset dash. Info reduces three hyphens to two
for display on the screen.
+@item
To prevent a paragraph from being indented in the printed manual, put
the command @code{@@noindent} on a line by itself before the
paragraph.@refill
+@item
If you mark off a region of the Texinfo file with the @code{@@iftex}
and @w{@code{@@end iftex}} commands, that region will appear only in
the printed copy; in that region, you can use certain commands
@@ -1071,8 +1151,9 @@ region, you can use Info commands that you cannot use in @TeX{}.
Similarly for @code{@@ifhtml @dots{} @@end ifhtml},
@code{@@ifnothtml @dots{} @@end ifnothtml},
@code{@@ifnotinfo @dots{} @@end ifnotinfo},
-@code{@@ifnottex @dots{} @@end ifnottex},
+@code{@@ifnottex @dots{} @@end ifnottex}.
@xref{Conditionals}.
+@end itemize
@cindex Tabs; don't use!
@quotation
@@ -1090,9 +1171,6 @@ spaces when you press the @key{TAB} key.@refill
@noindent
Also, you can run @code{untabify} in Emacs to convert tabs in a region
to multiple spaces.@refill
-
-@noindent
-Don't use tabs.
@end quotation
@node Comments, Minimum, Conventions, Overview
@@ -1102,7 +1180,7 @@ Don't use tabs.
You can write comments in a Texinfo file that will not appear in
either the Info file or the printed manual by using the
@code{@@comment} command (which may be abbreviated to @code{@@c}).
-Such comments are for the person who reads the Texinfo file. All the
+Such comments are for the person who revises the Texinfo file. All the
text on a line that follows either @code{@@comment} or @code{@@c} is a
comment; the rest of the line does not appear in either the Info file
or the printed manual. (Often, you can write the @code{@@comment} or
@@ -1148,9 +1226,9 @@ within ignored text.
@cindex Texinfo file minimum
By convention, the names of Texinfo files end with one of the
-extensions @file{.texinfo}, @file{.texi}, or @file{.tex}. The longer
-extension is preferred since it describes more clearly to a human
-reader the nature of the file. The shorter extensions are for
+extensions @file{.texinfo}, @file{.texi}, @file{.txi}, or @file{.tex}.
+The longer extension is preferred since it describes more clearly to a
+human reader the nature of the file. The shorter extensions are for
operating systems that cannot handle long file names.@refill
In order to be made into a printed manual and an Info file, a Texinfo
@@ -1252,8 +1330,7 @@ the table of contents, and the @code{@@bye} command on a line of its
own.@refill
@end table
-@node Short Sample, Acknowledgements, Six Parts, Overview
-@comment node-name, next, previous, up
+@node Short Sample
@section A Short Sample Texinfo File
@cindex Sample Texinfo file
@@ -1264,7 +1341,6 @@ the material is standard boilerplate; when you write a manual, simply
insert the names for your own manual in this segment. (@xref{Beginning a
File}.)@refill
-@noindent
In the following, the sample text is @emph{indented}; comments on it are
not. The complete file, without any comments, is shown in
@ref{Sample Texinfo File}.
@@ -1282,9 +1358,8 @@ name of the Info file and the title used in the header.
@@c %**start of header
@@setfilename sample.info
@@settitle Sample Document
-@@c %**end of header
-
@@setchapternewpage odd
+@@c %**end of header
@end group
@end example
@@ -1393,15 +1468,14 @@ manual.
@subheading Part 6: The End of the Document
@noindent
-The end segment contains commands both for generating an index in a node
-and unnumbered chapter of its own and for generating the table of
-contents; and it contains the @code{@@bye} command that marks the end of
-the document.@refill
+The end segment contains commands for generating an index in a node and
+unnumbered chapter of its own, (usually) for generating the table of
+contents, and the @code{@@bye} command that marks the end of the
+document.@refill
@example
@group
@@node Concept Index, , First Chapter, Top
-@@comment node-name, next, previous, up
@@unnumbered Concept Index
@end group
@@ -1438,41 +1512,61 @@ an Info file; and @TeX{} typesets it for a printed
manual.
@end quotation
-@node Acknowledgements, , Short Sample, Overview
-@comment node-name, next, previous, up
-@section Acknowledgements
+
+@node Acknowledgements and History
+@section Acknowledgements and History
@cindex Stallman, Richard M.
@cindex Chassell, Robert J.
@cindex Berry, Karl
-Richard M.@: Stallman wrote Edition 1.0 of this manual. @w{Robert J.@:
-Chassell} revised and extended it, starting with Edition 1.1. Karl
-Berry made updates for the Texinfo 3.8 and subsequent releases, starting
-with Edition 2.22.
+Richard M.@: Stallman invented the Texinfo format, wrote the initial
+processors, and created Edition 1.0 of this manual. @w{Robert J.@:
+Chassell} greatly revised and extended the manual, starting with Edition
+1.1. Brian Fox was responsible for the standalone Texinfo distribution
+until version 3.8, and wrote the standalone @command{makeinfo} and
+@command{info}. Karl Berry has made the updates since Texinfo 3.8 and
+subsequent releases, starting with Edition 2.22 of the manual.
@cindex Pinard, Fran@,{c}ois
@cindex Zuhn, David D.
@cindex Weisshaus, Melissa
+@cindex Zaretskii, Eli
+@cindex Schwab, Andreas
+@cindex Weinberg, Zack
Our thanks go out to all who helped improve this work, particularly to
Fran@,{c}ois Pinard and @w{David D.@: Zuhn}, who tirelessly recorded and
reported mistakes and obscurities; our special thanks go to Melissa
Weisshaus for her frequent and often tedious reviews of nearly similar
-editions. Our mistakes are our own.
-
-Please send suggestions and corrections to:
-
-@example
-@group
-@r{Internet address:}
- bug-texinfo@@gnu.org
-@end group
-@end example
-
-@noindent
-Please include the manual's edition number and update date in your messages.
-
-@node Texinfo Mode, Beginning a File, Overview, Top
-@comment node-name, next, previous, up
+editions. The indefatigable Eli Zaretskii and Andreas Schwab have
+provided patches beyond counting. Zack Weinberg did the impossible by
+implementing the macro syntax in @file{texinfo.tex}. Dozens of others
+have contributed patches and suggestions, they are gratefully
+acknowledged in the @file{ChangeLog} file. Our mistakes are our own.
+
+@cindex Scribe
+@cindex Reid, Brian
+@cindex History of Texinfo
+A bit of history: in the 1970's at CMU, Brian Reid developed a program
+and format named Scribe to mark up documents for printing. It used the
+@code{@@} character to introduce commands as Texinfo does and strived to
+describe document contents rather than formatting.
+
+@cindex Bolio
+@cindex Bo@TeX{}
+Meanwhile, people at MIT developed another, not too dissimilar format
+called Bolio. This then was converted to using @TeX{} as its typesetting
+language: Bo@TeX{}.
+
+Bo@TeX{} could only be used as a markup language for documents to be
+printed, not for online documents. Richard Stallman (RMS) worked on
+both Bolio and Bo@TeX{}. He also developed a nifty on-line help format
+called Info, and then combined Bo@TeX{} and Info to create Texinfo, a
+mark up language for text that is intended to be read both on line and
+as printed hard copy.
+
+
+
+@node Texinfo Mode
@chapter Using Texinfo Mode
@cindex Texinfo mode
@cindex Mode, using Texinfo
@@ -1509,7 +1603,8 @@ detail.@refill
@end ifinfo
Texinfo mode provides special features for working with Texinfo
-files:@refill
+files.
+You can:@refill
@itemize @bullet
@item
@@ -1565,12 +1660,12 @@ delimiter, you can jump from chapter title to chapter title with the
The GNU Emacs Manual}, for details about the page commands.)@refill
You may name a Texinfo file however you wish, but the convention is to
-end a Texinfo file name with one of the three extensions
-@file{.texinfo}, @file{.texi}, or @file{.tex}. A longer extension is
-preferred, since it is explicit, but a shorter extension may be
-necessary for operating systems that limit the length of file names.
-GNU Emacs automatically enters Texinfo mode when you visit a file with
-a @file{.texinfo} or @file{.texi}
+end a Texinfo file name with one of the extensions
+@file{.texinfo}, @file{.texi}, @file{.txi}, or @file{.tex}. A longer
+extension is preferred, since it is explicit, but a shorter extension
+may be necessary for operating systems that limit the length of file
+names. GNU Emacs automatically enters Texinfo mode when you visit a
+file with a @file{.texinfo}, @file{.texi} or @file{.txi}
extension. Also, Emacs switches to Texinfo mode
when you visit a
file that has @samp{-*-texinfo-*-} in its first line. If ever you are
@@ -1762,14 +1857,10 @@ cursor in the @file{*Occur*} buffer.@refill
If you call @code{texinfo-show-structure} with a prefix argument by
typing @w{@kbd{C-u C-c C-s}}, it will list not only those lines with the
-@@-commands for @code{@@chapter}, @code{@@section}, and the like,
-but also the @code{@@node} lines. (This is how the
-@code{texinfo-show-structure} command worked without an argument in
-the first version of Texinfo. It was changed because @code{@@node}
-lines clutter up the @samp{*Occur*} buffer and are usually not
-needed.) You can use @code{texinfo-show-structure} with a prefix
-argument to check whether the `Next', `Previous', and `Up' pointers of
-an @code{@@node} line are correct.@refill
+@@-commands for @code{@@chapter}, @code{@@section}, and the like, but
+also the @code{@@node} lines. You can use @code{texinfo-show-structure}
+with a prefix argument to check whether the `Next', `Previous', and `Up'
+pointers of an @code{@@node} line are correct.
Often, when you are working on a manual, you will be interested only
in the structure of the current chapter. In this case, you can mark
@@ -1823,18 +1914,18 @@ node pointers by hand, which is a tedious task.@refill
@subheading The Updating Commands
@end ifinfo
-You can use the updating commands@refill
+You can use the updating commands to:@refill
@itemize @bullet
@item
-to insert or update the `Next', `Previous', and `Up' pointers of a
+insert or update the `Next', `Previous', and `Up' pointers of a
node,@refill
@item
-to insert or update the menu for a section, and@refill
+insert or update the menu for a section, and@refill
@item
-to create a master menu for a Texinfo source file.@refill
+create a master menu for a Texinfo source file.@refill
@end itemize
You can also use the commands to update all the nodes and menus in a
@@ -1856,11 +1947,11 @@ interpose only an @code{@@comment} line or an @code{@@ifinfo} line.
Commands which work on a whole buffer require that the `Top' node be
followed by a node with an @code{@@chapter} or equivalent-level command.
-Note that the menu updating commands will not create a main or master
-menu for a Texinfo file that has only @code{@@chapter}-level nodes! The
-menu updating commands only create menus @emph{within} nodes for lower level
+The menu updating commands will not create a main or master menu for a
+Texinfo file that has only @code{@@chapter}-level nodes! The menu
+updating commands only create menus @emph{within} nodes for lower level
nodes. To create a menu of chapters, you must provide a `Top'
-node.@refill
+node.
The menu updating commands remove menu entries that refer to other Info
files since they do not refer to nodes within the current buffer. This
@@ -1906,7 +1997,7 @@ This updates all the nodes and menus completely and all at once.@refill
@end table
The other major updating commands do smaller jobs and are designed for
-the person who updates nodes and menus as he or she writes a Texinfo
+the person who updates nodes and menus as he or she writes a Texinfo
file.@refill
@need 1000
@@ -2031,7 +2122,7 @@ In this example, `Comments' is the name of both the node and the
section. The next node is called `Minimum' and the previous node is
called `Conventions'. The `Comments' section is within the `Overview'
node, which is specified by the `Up' pointer. (Instead of an
-@code{@@comment} line, you can write an @code{@@ifinfo} line.)@refill
+@code{@@comment} line, you may also write an @code{@@ifinfo} line.)@refill
If a file has a `Top' node, it must be called @samp{top} or @samp{Top}
and be the first node in the file.@refill
@@ -2040,14 +2131,14 @@ The menu updating commands create a menu of sections within a chapter,
a menu of subsections within a section, and so on. This means that
you must have a `Top' node if you want a menu of chapters.@refill
-Incidentally, the @code{makeinfo} command will create an Info file for
-a hierarchically organized Texinfo file that lacks `Next', `Previous'
-and `Up' pointers. Thus, if you can be sure that your Texinfo file
-will be formatted with @code{makeinfo}, you have no need for the
-`update node' commands. (@xref{Create an Info File, , Creating an
-Info File}, for more information about @code{makeinfo}.) However,
-both @code{makeinfo} and the @code{texinfo-format-@dots{}} commands
-require that you insert menus in the file.@refill
+Incidentally, the @code{makeinfo} command will create an Info file for a
+hierarchically organized Texinfo file that lacks `Next', `Previous' and
+`Up' pointers. Thus, if you can be sure that your Texinfo file will be
+formatted with @code{makeinfo}, you have no need for the update node
+commands. (@xref{Creating an Info File}, for more information about
+@code{makeinfo}.) However, both @code{makeinfo} and the
+@code{texinfo-format-@dots{}} commands require that you insert menus in
+the file.
@node Other Updating Commands, , Updating Requirements, Updating Nodes and Menus
@comment node-name, next, previous, up
@@ -2078,11 +2169,11 @@ For example, the following marks a whole buffer as a region and inserts
C-x h C-u M-x texinfo-insert-node-lines
@end example
-(Note that this command inserts titles as node names in @code{@@node}
-lines; the @code{texinfo-start-menu-description} command
-(@pxref{Inserting, Inserting Frequently Used Commands}) inserts titles
-as descriptions in menu entries, a different action. However, in both
-cases, you need to edit the inserted text.)@refill
+This command inserts titles as node names in @code{@@node} lines; the
+@code{texinfo-start-menu-description} command (@pxref{Inserting,
+Inserting Frequently Used Commands}) inserts titles as descriptions in
+menu entries, a different action. However, in both cases, you need to
+edit the inserted text.
@item M-x texinfo-multiple-files-update
@findex texinfo-multiple-files-update @r{(in brief)}
@@ -2182,7 +2273,7 @@ M-x makeinfo-buffer
For @TeX{} or the Info formatting commands to work, the file @emph{must}
include a line that has @code{@@setfilename} in its header.@refill
-@xref{Create an Info File}, for details about Info formatting.@refill
+@xref{Creating an Info File}, for details about Info formatting.@refill
@node Printing, Texinfo Mode Summary, Info Formatting, Texinfo Mode
@comment node-name, next, previous, up
@@ -2245,7 +2336,7 @@ on a line by itself. (When you use @code{texinfo-tex-region}, you must
surround the @code{@@settitle} line with start-of-header and
end-of-header lines.)@refill
-@xref{Format/Print Hardcopy}, for a description of the other @TeX{} related
+@xref{Hardcopy}, for a description of the other @TeX{} related
commands, such as @code{tex-show-print-queue}.@refill
@node Texinfo Mode Summary, , Printing, Texinfo Mode
@@ -2297,6 +2388,7 @@ C-c C-s @r{List all the headings.}
The @code{texinfo-master-menu} command creates a master menu; and can
be used to update every node and menu in a file as well.@refill
+@c Probably should use @tables in this section.
@example
@group
C-c C-u m
@@ -2398,7 +2490,7 @@ C-c C-t C-l @r{Recenter the output buffer.}
@subheading Other Updating Commands
-The `other updating commands' do not have standard keybindings because
+The remaining updating commands do not have standard keybindings because
they are rarely used.
@example
@@ -2609,12 +2701,13 @@ or else like this:
* setfilename:: Tell Info the name of the Info file.
* settitle:: Create a title for the printed work.
* setchapternewpage:: Start chapters on right-hand pages.
-* paragraphindent:: An option to specify paragraph indentation.
+* paragraphindent:: Specify paragraph indentation.
+* exampleindent:: Specify environment indentation.
* End of Header:: Formatting a region requires this.
@end menu
-@node First Line, Start of Header, Header, Header
-@comment node-name, next, previous, up
+
+@node First Line
@subsection The First Line of a Texinfo File
@cindex First line of a Texinfo file
@cindex Beginning line of a Texinfo file
@@ -2669,8 +2762,7 @@ A start-of-header line looks like this:@refill
The odd string of characters, @samp{%**}, is to ensure that no other
comment is accidentally taken for a start-of-header line.@refill
-@node setfilename, settitle, Start of Header, Header
-@comment node-name, next, previous, up
+@node setfilename
@subsection @code{@@setfilename}
@cindex Info file requires @code{@@setfilename}
@findex setfilename
@@ -2688,11 +2780,13 @@ else on the line; anything on the line after the command is considered
part of the file name, including what would otherwise be a
comment.
-The @code{@@setfilename} line specifies the name of the Info file to be
-generated. This name should be different from the name of the Texinfo
-file. There are two conventions for choosing the name: you can either
-remove the @samp{.texi} extension from the input file name, or replace
-it with the @samp{.info} extension.
+The @code{@@setfilename} line specifies the name of the output file to
+be generated. This name should be different from the name of the
+Texinfo file. There are two conventions for choosing the name: you can
+either remove the extension (such as @samp{.texi}) from the input file
+name, or replace it with the @samp{.info} extension. When producing
+HTML output, @code{makeinfo} will replace any extension with
+@samp{html}, or add @samp{.html} if the given name has no extension.
Some operating systems cannot handle long file names. You can run into
a problem even when the file name you specify is itself short enough.
@@ -2702,19 +2796,24 @@ short indirect subfiles, and name them by appending @samp{-1},
file name. (@xref{Tag and Split Files, , Tag Files and Split Files}.)
The subfile name @file{texinfo.info-10}, for example, is too long for
some systems; so the Info file name for this document is @file{texinfo}
-rather than @file{texinfo.info}.
+rather than @file{texinfo.info}. When @code{makeinfo} is running on
+operating systems such as MS-DOS which impose grave limits on file
+names, it will sometimes remove some characters from the original file
+name to leave enough space for the subfile suffix, thus producing files
+named @file{texin-10}, @file{gcc.i12}, etc.
@cindex Ignored before @code{@@setfilename}
+@cindex @samp{\input} source line ignored
The Info formatting commands ignore everything written before the
@code{@@setfilename} line, which is why the very first line of
the file (the @code{\input} line) does not show up in the output.
@pindex texinfo.cnf
The @code{@@setfilename} line produces no output when you typeset a
-manual with @TeX{}, but it nevertheless is essential: it opens the
+manual with @TeX{}, but it is nevertheless essential: it opens the
index, cross-reference, and other auxiliary files used by Texinfo, and
also reads @file{texinfo.cnf} if that file is present on your system
-(@pxref{Preparing for TeX,, Preparing to Use @TeX{}}).
+(@pxref{Preparing for TeX,, Preparing for @TeX{}}).
@node settitle, setchapternewpage, setfilename, Header
@@ -2766,15 +2865,15 @@ You may, if you wish, create your own, customized headings and
footings. @xref{Headings, , Page Headings}, for a detailed discussion
of this process.@refill
-@node setchapternewpage, paragraphindent, settitle, Header
-@comment node-name, next, previous, up
+
+@node setchapternewpage
@subsection @code{@@setchapternewpage}
@cindex Starting chapters
@cindex Pages, starting odd
@findex setchapternewpage
-In a book or a manual, text is usually printed on both sides of the
-paper, chapters start on right-hand pages, and right-hand pages have
+In an officially bound book, text is usually printed on both sides of
+the paper, chapters start on right-hand pages, and right-hand pages have
odd numbers. But in short reports, text often is printed only on one
side of the paper. Also in short reports, chapters sometimes do not
start on new pages, but are printed on the same page as the end of the
@@ -2782,7 +2881,7 @@ preceding chapter, after a small amount of vertical whitespace.@refill
You can use the @code{@@setchapternewpage} command with various
arguments to specify how @TeX{} should start chapters and whether it
-should typeset pages for printing on one or both sides of the paper
+should format headers for printing on one or both sides of the paper
(single-sided or double-sided printing).@refill
Write the @code{@@setchapternewpage} command at the beginning of a
@@ -2799,17 +2898,7 @@ You can specify one of three alternatives with the
@code{@@setchapternewpage} command:@refill
@table @asis
-@ignore
-@item No @code{@@setchapternewpage} command
-If the Texinfo file does not contain an @code{@@setchapternewpage}
-command before the @code{@@titlepage} command, @TeX{} automatically
-begins chapters on new pages and prints headings in the standard
-format for single-sided printing. This is the conventional format for
-single-sided printing.@refill
-The result is exactly the same as when you write
-@code{@@setchapternewpage on}.@refill
-@end ignore
@item @code{@@setchapternewpage off}
Cause @TeX{} to typeset a new chapter on the same page as the last
chapter, after skipping some vertical whitespace. Also, cause @TeX{} to
@@ -2818,9 +2907,9 @@ headers format with the @code{@@headings double} command; see
@ref{headings on off, , The @code{@@headings} Command}.)@refill
@item @code{@@setchapternewpage on}
-Cause @TeX{} to start new chapters on new pages and to typeset page
+Cause @TeX{} to start new chapters on new pages and to format page
headers for single-sided printing. This is the form most often
-used for short reports.@refill
+used for short reports or personal printing.
This alternative is the default.@refill
@@ -2830,13 +2919,11 @@ Cause @TeX{} to start new chapters on new, odd-numbered pages
the form most often used for books and manuals.@refill
@end table
-@noindent
Texinfo does not have an @code{@@setchapternewpage even} command.@refill
-@noindent
-(You can countermand or modify an @code{@@setchapternewpage} command
-with an @code{@@headings} command. @xref{headings on off, , The
-@code{@@headings} Command}.)@refill
+You can countermand or modify the effect on headers of an
+@code{@@setchapternewpage} command with an @code{@@headings} command.
+@xref{headings on off, , The @code{@@headings} Command}.@refill
At the beginning of a manual or book, pages are not numbered---for
example, the title and copyright pages of a book are not numbered.
@@ -2846,62 +2933,100 @@ numerals and not in sequence with the rest of the document.@refill
Since an Info file does not have pages, the @code{@@setchapternewpage}
command has no effect on it.@refill
-Usually, you do not write an @code{@@setchapternewpage} command for
-single-sided printing, but accept the default which is to typeset for
-single-sided printing and to start new chapters on new pages. Usually,
-you write an @code{@@setchapternewpage odd} command for double-sided
-printing.@refill
+We recommend not including any @code{@@setchapternewpage} command in
+your manual sources at all, since the desired output is not intrinsic to
+the document. Instead, if you don't want the default option (no blank
+pages, same headers on all pages) use the @option{--texinfo} option to
+@command{texi2dvi} to specify the output you want.
-@node paragraphindent, End of Header, setchapternewpage, Header
-@comment node-name, next, previous, up
+
+
+@node paragraphindent
@subsection Paragraph Indenting
@cindex Indenting paragraphs
@cindex Paragraph indentation
@findex paragraphindent
-The Info formatting commands may insert spaces at the beginning of the
-first line of each paragraph, thereby indenting that paragraph. You
-can use the @code{@@paragraphindent} command to specify the
-indentation. Write an @code{@@paragraphindent} command at the
-beginning of a line followed by either @samp{asis} or a number. The
-template is:@refill
+The Texinfo processors may insert whitespace at the beginning of the
+first line of each paragraph, thereby indenting that paragraph. You can
+use the @code{@@paragraphindent} command to specify this indentation.
+Write an @code{@@paragraphindent} command at the beginning of a line
+followed by either @samp{asis} or a number:
@example
@@paragraphindent @var{indent}
@end example
-The Info formatting commands indent according to the value of
-@var{indent}:@refill
+The indentation is according to the value of @var{indent}:
-@itemize @bullet
-@item
-If the value of @var{indent} is @samp{asis}, the Info formatting
-commands do not change the existing indentation.@refill
+@table @asis
+@item @code{asis}
+Do not change the existing indentation (not implemented in @TeX{}).
-@item
-If the value of @var{indent} is zero, the Info formatting commands delete
-existing indentation.@refill
+@item 0
+Omit all indentation.
-@item
-If the value of @var{indent} is greater than zero, the Info formatting
-commands indent the paragraph by that number of spaces.@refill
-@end itemize
+@item @var{n}
+Indent by @var{n} space characters in Info output, by @var{n} ems in
+@TeX{}.
+
+@end table
-The default value of @var{indent} is @samp{asis}.@refill
+The default value of @var{indent} is @samp{asis}.
+@code{@@paragraphindent} is ignored for HTML output.
Write the @code{@@paragraphindent} command before or shortly after the
end-of-header line at the beginning of a Texinfo file. (If you write
the command between the start-of-header and end-of-header lines, the
-region formatting commands indent paragraphs as specified.)@refill
+region formatting commands indent paragraphs as specified.)
A peculiarity of the @code{texinfo-format-buffer} and
@code{texinfo-format-region} commands is that they do not indent (nor
fill) paragraphs that contain @code{@@w} or @code{@@*} commands.
-@xref{Refilling Paragraphs}, for a detailed description of what goes
-on.@refill
+@xref{Refilling Paragraphs}, for further information.
-@node End of Header, , paragraphindent, Header
-@comment node-name, next, previous, up
+
+@node exampleindent
+@subsection @code{@@exampleindent}: Environment Indenting
+@cindex Indenting environments
+@cindex Environment indentation
+@cindex Example indentation
+@findex exampleindent
+
+The Texinfo processors indent each line of @code{@@example} and similar
+environments. You can use the @code{@@exampleindent} command to specify
+this indentation. Write an @code{@@exampleindent} command at the
+beginning of a line followed by either @samp{asis} or a number:
+
+@example
+@@exampleindent @var{indent}
+@end example
+
+The indentation is according to the value of @var{indent}:
+
+@table @asis
+@item @code{asis}
+Do not change the existing indentation (not implemented in @TeX{}).
+
+@item 0
+Omit all indentation.
+
+@item @var{n}
+Indent environments by @var{n} space characters in Info output, by
+@var{n} ems in @TeX{}.
+
+@end table
+
+The default value of @var{indent} is 5. @code{@@exampleindent} is
+ignored for HTML output.
+
+Write the @code{@@exampleindent} command before or shortly after the
+end-of-header line at the beginning of a Texinfo file. (If you write
+the command between the start-of-header and end-of-header lines, the
+region formatting commands indent examples as specified.)
+
+
+@node End of Header
@subsection End of Header
@cindex End of header line
@@ -2931,8 +3056,8 @@ variables that you can change.@refill
@xref{Start of Header}.
@end iftex
-@node Info Summary and Permissions, Titlepage & Copyright Page, Header, Beginning a File
-@comment node-name, next, previous, up
+
+@node Info Summary and Permissions
@section Summary and Copying Permissions for Info
The title page and the copyright page appear only in the printed copy of
@@ -2959,8 +3084,8 @@ node. This mean that a reader does @emph{not} see this text when
reading the file using Info, except when using the advanced Info command
@kbd{g *}.
-@node Titlepage & Copyright Page, The Top Node, Info Summary and Permissions, Beginning a File
-@comment node-name, next, previous, up
+
+@node Titlepage & Copyright Page
@section The Title and Copyright Pages
A manual's name and author are usually printed on a title page.
@@ -2974,6 +3099,12 @@ obscure @TeX{} typesetting commands that cannot be used in an Info file.
In addition, this part of the beginning of a Texinfo file contains the text
of the copying permissions that will appear in the printed manual.@refill
+@cindex Titlepage, for plain text
+You may wish to include titlepage-like information for plain text
+output. Simply place any such leading material between @code{@@ifinfo}
+and @code{@@end ifinfo}; @command{makeinfo} includes this in its plain
+text output. It will not show up in the Info readers.
+
@xref{Titlepage Permissions, , Titlepage Copying Permissions}, for the
standard text for the copyright permissions.@refill
@@ -2991,6 +3122,7 @@ standard text for the copyright permissions.@refill
and double or single sided printing.
@end menu
+
@node titlepage, titlefont center sp, Titlepage & Copyright Page, Titlepage & Copyright Page
@comment node-name, next, previous, up
@subsection @code{@@titlepage}
@@ -3003,53 +3135,57 @@ with @code{@@titlepage} on a line by itself and end it with
The @code{@@end titlepage} command starts a new page and turns on page
numbering. (@xref{Headings, , Page Headings}, for details about how to
-generate page headings.) All the material that you want to
-appear on unnumbered pages should be put between the
-@code{@@titlepage} and @code{@@end titlepage} commands. By using the
-@code{@@page} command you can force a page break within the region
-delineated by the @code{@@titlepage} and @code{@@end titlepage}
-commands and thereby create more than one unnumbered page. This is
-how the copyright page is produced. (The @code{@@titlepage} command
-might perhaps have been better named the
-@code{@@titleandadditionalpages} command, but that would have been
-rather long!)@refill
-
-@c !!! append refill to footnote when makeinfo can handle it.
+generate page headings.) All the material that you want to appear on
+unnumbered pages should be put between the @code{@@titlepage} and
+@code{@@end titlepage} commands. You can force the table of contents to
+appear there with the @code{@@setcontentsaftertitlepage} command
+(@pxref{Contents}).
+
+@findex page@r{, within @code{@@titlepage}}
+By using the @code{@@page} command you can force a page break within the
+region delineated by the @code{@@titlepage} and @code{@@end titlepage}
+commands and thereby create more than one unnumbered page. This is how
+the copyright page is produced. (The @code{@@titlepage} command might
+perhaps have been better named the @code{@@titleandadditionalpages}
+command, but that would have been rather long!)
+
When you write a manual about a computer program, you should write the
-version of the program to which the manual applies on the title
-page. If the manual changes more frequently than the program or is
-independent of it, you should also include an edition
-number@footnote{We have found that it is helpful to refer to versions
-of manuals as `editions' and versions of programs as `versions';
-otherwise, we find we are liable to confuse each other in conversation
-by referring to both the documentation and the software with the same
-words.} for the manual. This helps readers keep track of which manual
-is for which version of the program. (The `Top' node
-should also contain this information; see @ref{makeinfo top, ,
-@code{@@top}}.)@refill
+version of the program to which the manual applies on the title page.
+If the manual changes more frequently than the program or is independent
+of it, you should also include an edition number@footnote{We have found
+that it is helpful to refer to versions of manuals as `editions' and
+versions of programs as `versions'; otherwise, we find we are liable to
+confuse each other in conversation by referring to both the
+documentation and the software with the same words.} for the manual.
+This helps readers keep track of which manual is for which version of
+the program. (The `Top' node should also contain this information; see
+@ref{makeinfo top, , @code{@@top}}.)
Texinfo provides two main methods for creating a title page. One method
uses the @code{@@titlefont}, @code{@@sp}, and @code{@@center} commands
to generate a title page in which the words on the page are
-centered.@refill
+centered.
The second method uses the @code{@@title}, @code{@@subtitle}, and
@code{@@author} commands to create a title page with black rules under
the title and author lines and the subtitle text set flush to the
right hand side of the page. With this method, you do not specify any
of the actual formatting of the title page. You specify the text
-you want, and Texinfo does the formatting. You may use either
-method.@refill
+you want, and Texinfo does the formatting.
+
+You may use either method, or you may combine them; see the examples in
+the sections below.
@findex shorttitlepage
-For extremely simple applications, Texinfo also provides a command
-@code{@@shorttitlepage} which takes a single argument as the title.
-The argument is typeset on a page by itself and followed by a blank
-page.
+@cindex Bastard title page
+@cindex Title page, bastard
+For extremely simple applications, and for the bastard title page in
+traditional book front matter, Texinfo also provides a command
+@code{@@shorttitlepage} which takes a single argument as the title. The
+argument is typeset on a page by itself and followed by a blank page.
-@node titlefont center sp, title subtitle author, titlepage, Titlepage & Copyright Page
-@comment node-name, next, previous, up
+@node titlefont center sp
@subsection @code{@@titlefont}, @code{@@center}, and @code{@@sp}
@findex titlefont
@findex center
@@ -3060,7 +3196,8 @@ commands to create a title page for a printed document. (This is the
first of the two methods for creating a title page in Texinfo.)@refill
Use the @code{@@titlefont} command to select a large font suitable for
-the title itself.@refill
+the title itself. You can use @code{@@titlefont} more than once if you
+have an especially long title.
@need 700
For example:
@@ -3107,10 +3244,10 @@ A template for this method looks like this:@refill
@end group
@end example
-The spacing of the example fits an 8 1/2 by 11 inch manual.@refill
+The spacing of the example fits an 8.5 by 11 inch manual.@refill
-@node title subtitle author, Copyright & Permissions, titlefont center sp, Titlepage & Copyright Page
-@comment node-name, next, previous, up
+
+@node title subtitle author
@subsection @code{@@title}, @code{@@subtitle}, and @code{@@author}
@findex title
@findex subtitle
@@ -3119,9 +3256,8 @@ The spacing of the example fits an 8 1/2 by 11 inch manual.@refill
You can use the @code{@@title}, @code{@@subtitle}, and @code{@@author}
commands to create a title page in which the vertical and horizontal
spacing is done for you automatically. This contrasts with the method
-described in
-the previous section, in which the @code{@@sp} command is needed to
-adjust vertical spacing.@refill
+described in the previous section, in which the @code{@@sp} command is
+needed to adjust vertical spacing.
Write the @code{@@title}, @code{@@subtitle}, or @code{@@author}
commands at the beginning of a line followed by the title, subtitle,
@@ -3129,7 +3265,11 @@ or author.@refill
The @code{@@title} command produces a line in which the title is set
flush to the left-hand side of the page in a larger than normal font.
-The title is underlined with a black rule.@refill
+The title is underlined with a black rule. Only a single line is
+allowed; the @code{@@*} command may not be used to break the title into
+two lines. To handle very long titles, you may find it profitable to
+use both @code{@@title} and @code{@@titlefont}; see the final example in
+this section.
The @code{@@subtitle} command sets subtitles in a normal-sized font
flush to the right-hand side of the page.@refill
@@ -3179,29 +3319,28 @@ A template for this method looks like this:@refill
@end group
@end example
-@ifinfo
-@noindent
-Contrast this form with the form of a title page written using the
-@code{@@sp}, @code{@@center}, and @code{@@titlefont} commands:@refill
+You may also combine the @code{@@titlefont} method described in the
+previous section and @code{@@title} method described in this one. This
+may be useful if you have a very long title. Here is a real-life example:
@example
+@group
@@titlepage
-@@sp 10
-@@center @@titlefont@{Name of Manual When Printed@}
-@@sp 2
-@@center Subtitle, If Any
+@@titlefont@{GNU Software@}
@@sp 1
-@@center Second subtitle
-@@sp 2
-@@center Author
-@@page
-@dots{}
-@@end titlepage
+@@title for MS-Windows and MS-DOS
+@@subtitle Edition @@value@{edition@} for Release @@value@{cd-edition@}
+@@author by Daniel Hagerty, Melissa Weisshaus
+@@author and Eli Zaretskii
+@end group
@end example
-@end ifinfo
-@node Copyright & Permissions, end titlepage, title subtitle author, Titlepage & Copyright Page
-@comment node-name, next, previous, up
+@noindent
+(The use of @code{@@value} here is explained in @ref{value
+Example,,@code{@@value} Example}.)
+
+
+@node Copyright & Permissions
@subsection Copyright Page and Permissions
@cindex Copyright page
@cindex Printed permissions
@@ -3248,19 +3387,17 @@ Copyright @copyright{} @var{year} @var{copyright-owner}
@end example
It is customary to put information on how to get a manual after the
-copyright notice, followed by the copying permissions for the
-manual.@refill
+copyright notice, followed by the copying permissions for the manual.
-Note that permissions must be given here as well as in the summary
-segment within @code{@@ifinfo} and @code{@@end ifinfo} that
-immediately follows the header since this text appears only in the
-printed manual and the @samp{ifinfo} text appears only in the Info
-file.@refill
+Permissions must be given here as well as in the summary segment within
+@code{@@ifinfo} and @code{@@end ifinfo} that immediately follows the
+header since this text appears only in the printed manual and the
+@samp{ifinfo} text appears only in the Info file.
@xref{Sample Permissions}, for the standard text.@refill
-@node end titlepage, headings on off, Copyright & Permissions, Titlepage & Copyright Page
-@comment node-name, next, previous, up
+
+@node end titlepage
@subsection Heading Generation
@findex end titlepage
@cindex Headings, page, begin to appear
@@ -3327,6 +3464,7 @@ Turn on page headings appropriate for single-sided printing.
@refill
@item @@headings double
+@itemx @@headings on
Turn on page headings appropriate for double-sided printing. The two
commands, @code{@@headings on} and @code{@@headings double}, are
synonymous.@refill
@@ -3365,8 +3503,8 @@ headings.@refill
You can also specify your own style of page heading and footing.
@xref{Headings, , Page Headings}, for more information.@refill
-@node The Top Node, Software Copying Permissions, Titlepage & Copyright Page, Beginning a File
-@comment node-name, next, previous, up
+
+@node The Top Node
@section The `Top' Node and Master Menu
@cindex @samp{@r{Top}} node
@cindex Master menu
@@ -3393,10 +3531,9 @@ strictly speaking, you are not required to enclose these parts between
* Master Menu Parts:: A master menu has three or more parts.
@end menu
-@node Title of Top Node, Master Menu Parts, The Top Node, The Top Node
-@ifinfo
-@subheading `Top' Node Title
-@end ifinfo
+
+@node Title of Top Node
+@subsection `Top' Node Title
Sometimes, you will want to place an @code{@@top} sectioning command
line containing the title of the document immediately after the
@@ -3412,7 +3549,7 @@ version information. It looks like this:@refill
@dots{}
@@end titlepage
-@@ifinfo
+@@ifnottex
@@node Top, Copying, , (dir)
@@top Texinfo
@@ -3422,7 +3559,7 @@ Texinfo is a documentation system@dots{}
@group
This is edition@dots{}
@dots{}
-@@end ifinfo
+@@end ifnottex
@end group
@group
@@ -3559,10 +3696,10 @@ Usually, an introduction is put in an @code{@@unnumbered} section.
@cindex File ending
@findex bye
-The end of a Texinfo file should include the commands that create
-indices and generate detailed and summary tables of contents.
-And it must include the @code{@@bye} command that marks the last line
-processed by @TeX{}.@refill
+The end of a Texinfo file should include commands to create indices and
+(usually) to generate detailed and summary tables of contents. And it
+must include the @code{@@bye} command that marks the last line processed
+by @TeX{}.@refill
@need 700
For example:
@@ -3602,7 +3739,7 @@ accumulated. To generate an index, you must include the
@code{@@printindex} command at the place in the document where you
want the index to appear. Also, as part of the process of creating a
printed manual, you must run a program called @code{texindex}
-(@pxref{Format/Print Hardcopy}) to sort the raw data to produce a sorted
+(@pxref{Hardcopy}) to sort the raw data to produce a sorted
index file. The sorted index file is what is actually used to
print the index.@refill
@@ -3662,52 +3799,35 @@ For example:
@@printindex cp
@end group
-
-@group
-@@summarycontents
-@@contents
-@@bye
-@end group
@end smallexample
@noindent
-(Readers often prefer that the concept index come last in a book,
-since that makes it easiest to find.)@refill
-
-@ignore
-@c TeX can do sorting, just not conveniently enough to handle sorting
-@c Texinfo indexes. --karl, 5may97.
-In @TeX{}, the @code{@@printindex} command needs a sorted index file
-to work from. @TeX{} does not know how to do sorting; this is a
-deficiency. @TeX{} writes output files of raw index data; use the
-@code{texindex} program to convert these files to sorted index files.
-(@xref{Format/Print Hardcopy}, for more information.)@refill
-@end ignore
+Readers often prefer that the concept index come last in a book,
+since that makes it easiest to find. Having just one index helps
+readers also, since then they have only one place to look
+(@pxref{synindex}).
-@node Contents, File End, Printing Indices & Menus, Ending a File
-@comment node-name, next, previous, up
+@node Contents
@section Generating a Table of Contents
@cindex Table of contents
@cindex Contents, Table of
+@cindex Short table of contents
@findex contents
@findex summarycontents
@findex shortcontents
The @code{@@chapter}, @code{@@section}, and other structuring commands
supply the information to make up a table of contents, but they do not
-cause an actual table to appear in the manual. To do this, you must
-use the @code{@@contents} and @code{@@summarycontents}
-commands:@refill
+cause an actual table to appear in the manual. To do this, you must use
+the @code{@@contents} and/or @code{@@summarycontents} command(s).
@table @code
@item @@contents
Generate a table of contents in a printed manual, including all
chapters, sections, subsections, etc., as well as appendices and
unnumbered chapters. (Headings generated by the @code{@@heading}
-series of commands do not appear in the table of contents.) The
-@code{@@contents} command should be written on a line by
-itself.@refill
+series of commands do not appear in the table of contents.)
@item @@shortcontents
@itemx @@summarycontents
@@ -3719,42 +3839,55 @@ chapters (and appendices and unnumbered chapters). Omit sections, subsections
and subsubsections. Only a long manual needs a short table
of contents in addition to the full table of contents.@refill
-Write the @code{@@shortcontents} command on a line by itself right
-@emph{before} the @code{@@contents} command.@refill
@end table
-The table of contents commands automatically generate a chapter-like
-heading at the top of the first table of contents page. Write the table
-of contents commands at the very end of a Texinfo file, just before the
-@code{@@bye} command, following any index sections---anything in the
-Texinfo file after the table of contents commands will be omitted from
-the table of contents.@refill
-
-When you print a manual with a table of contents, the table of
-contents are printed last and numbered with roman numerals. You need
-to place those pages in their proper place, after the title page,
-yourself. (This is the only collating you need to do for a printed
-manual. The table of contents is printed last because it is generated
-after the rest of the manual is typeset.)@refill
-
-@need 700
-Here is an example of where to write table of contents commands:@refill
-
-@example
-@group
-@var{indices}@dots{}
-@@shortcontents
-@@contents
-@@bye
-@end group
-@end example
+Both contents commands should be written on a line by themselves.
+The contents commands automatically generate a chapter-like heading at
+the top of the first table of contents page, so don't include any
+sectioning command such as @code{@@unnumbered} before them.
Since an Info file uses menus instead of tables of contents, the Info
-formatting commands ignore the @code{@@contents} and
-@code{@@shortcontents} commands.@refill
-
-@node File End, , Contents, Ending a File
-@comment node-name, next, previous, up
+formatting commands ignore the contents commands. But the contents are
+included in plain text output (generated by @code{makeinfo --no-headers}).
+
+The contents commands can be placed either at the very end of the file,
+after any indices (see the previous section) and just before the
+@code{@@bye} (see the next section), or near the beginning of the file,
+after the @code{@@end titlepage} (@pxref{titlepage}). The advantage to
+the former is that then the contents output is always up to date,
+because it reflects the processing just done. The advantage to the
+latter is that the contents are printed in the proper place, thus you do
+not need to rearrange the DVI file with @command{dviselect} or shuffle
+paper. However, contents commands at the beginning of the document are
+ignored when outputting to standard output.
+
+@findex setcontentsaftertitlepage
+@findex setshortcontentsaftertitlepage
+@cindex Contents, after title page
+@cindex Table of contents, after title page
+As an author, you can put the contents commands wherever you prefer.
+But if you are a user simply printing a manual, you may wish to print
+the contents after the title page even if the author put the contents
+commands at the end of the document (as is the case in most existing
+Texinfo documents). You can do this by specifying
+@code{@@setcontentsaftertitlepage} and/or
+@code{@@setshortcontentsaftertitlepage}. The first prints only the main
+contents after the @code{@@end titlepage}; the second prints both the
+short contents and the main contents. In either case, any subsequent
+@code{@@contents} or @code{@@shortcontents} is ignored (unless no
+@code{@@end titlepage} is ever encountered).
+
+You need to include the @code{@@set@dots{}contentsaftertitlepage}
+commands early in the document (just after @code{@@setfilename}, for
+example). Or, if you're using @command{texi2dvi} (@pxref{Format with
+texi2dvi}), you can use its @option{--texinfo} option to specify this
+without altering the source file at all. For example:
+@example
+texi2dvi --texinfo=@@setshortcontentsaftertitlepage foo.texi
+@end example
+
+
+@node File End
@section @code{@@bye} File Ending
@findex bye
@@ -3769,8 +3902,8 @@ manual; it is as if text after @code{@@bye} were within @code{@@ignore}
with a local variables list. @xref{Compile-Command, , Using Local
Variables and the Compile Command}, for more information.@refill
-@node Structuring, Nodes, Ending a File, Top
-@comment node-name, next, previous, up
+
+@node Structuring
@chapter Chapter Structuring
@cindex Chapter structuring
@cindex Structuring of chapters
@@ -3809,8 +3942,8 @@ heading at the top of each node---but you don't need to.@refill
* Raise/lower sections:: How to change commands' hierarchical level.
@end menu
-@node Tree Structuring, Structuring Command Types, Structuring, Structuring
-@comment node-name, next, previous, up
+
+@node Tree Structuring
@section Tree Structure of Sections
@cindex Tree structuring
@@ -3853,9 +3986,9 @@ The chapter structuring commands are described in the sections that
follow; the @code{@@node} and @code{@@menu} commands are described in
following chapters. (@xref{Nodes}, and see @ref{Menus}.)@refill
-@node Structuring Command Types, makeinfo top, Tree Structuring, Structuring
-@comment node-name, next, previous, up
-@section Types of Structuring Commands
+
+@node Structuring Command Types
+@section Structuring Command Types
The chapter structuring commands fall into four groups or series, each
of which contains structuring commands corresponding to the
@@ -3900,119 +4033,43 @@ start new pages in the printed manual; the @code{@@heading} commands
do not.@refill
@end itemize
-@need 1000
Here are the four groups of chapter structuring commands:@refill
-@c Slightly different formatting for regular sized books and smallbooks.
-@ifset smallbook
-@sp 1
-@tex
-{\let\rm=\indrm \let\tt=\indtt
-\halign{\hskip\itemindent#\hfil& \hskip.5em#\hfil& \hskip.5em#\hfil&
-\hskip.5em#\hfil\cr
-
-& & & \rm No new pages\cr
-\rm Numbered& \rm Unnumbered& \rm Lettered and numbered& \rm Unnumbered\cr
-\rm In contents& \rm In contents& \rm In contents& \rm Not in contents\cr
-
-& & & \cr
- & \tt @@top& & \tt @@majorheading\cr
-\tt @@chapter& \tt @@unnumbered& \tt @@appendix& \tt @@chapheading\cr
-\tt @@section& \tt @@unnumberedsec& \tt @@appendixsec& \tt @@heading\cr
-\tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
-\tt @@subheading\cr
-\tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
-\tt @@subsubheading\cr}}
-@end tex
-@end ifset
-@ifclear smallbook
-@sp 1
-@tex
-\vbox{
-\halign{\hskip\itemindent\hskip.5em#\hfil& \hskip.5em#\hfil&
-\hskip.5em#\hfil& \hskip.5em #\hfil\cr
-
-& & & \cr
-& & & \rm No new pages\cr
-\rm Numbered& \rm Unnumbered& \rm Lettered and numbered& \rm Unnumbered\cr
-\rm In contents& \rm In contents& \rm In contents& \rm Not in contents\cr
-
-& & & \cr
- & \tt @@top& & \tt @@majorheading\cr
-\tt @@chapter& \tt @@unnumbered& \tt @@appendix& \tt @@chapheading\cr
-\tt @@section& \tt @@unnumberedsec& \tt @@appendixsec& \tt @@heading\cr
-\tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
-\tt @@subheading\cr
-\tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
-\tt @@subsubheading\cr}}
-@end tex
-@end ifclear
-@ifinfo
-@example
-@group
- @r{No new pages}
-@r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
-@r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
-
- @@top @@majorheading
-@@chapter @@unnumbered @@appendix @@chapheading
-@@section @@unnumberedsec @@appendixsec @@heading
-@@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
-@@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
-@end group
-@end example
-@end ifinfo
+@multitable @columnfractions .19 .30 .29 .22
+
+@item @tab @tab @tab No new page
+@item Numbered @tab Unnumbered @tab Lettered and numbered
+ @tab Unnumbered
+@item In contents @tab In contents @tab In contents @tab Not in contents
+@item @tab @code{@@top} @tab
+ @tab @code{@@majorheading}
+@item @code{@@chapter} @tab @code{@@unnumbered} @tab @code{@@appendix}
+ @tab @code{@@chapheading}
+@item @code{@@section} @tab @code{@@unnumberedsec} @tab @code{@@appendixsec}
+ @tab @code{@@heading}
+@item @code{@@subsection} @tab @code{@@unnumberedsubsec} @tab @code{@@appendixsubsec}
+ @tab @code{@@subheading}
+@item @code{@@subsubsection} @tab @code{@@unnumberedsubsubsec} @tab @code{@@appendixsubsubsec}
+ @tab @code{@@subsubheading}
+@end multitable
-@c Cannot line up columns properly inside of an example because of roman
-@c proportional fonts.
-@ignore
-@ifset smallbook
-@iftex
-@smallexample
-@group
- @r{No new pages}
-@r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
-@r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
-
- @@top @@majorheading
-@@chapter @@unnumbered @@appendix @@chapheading
-@@section @@unnumberedsec @@appendixsec @@heading
-@@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
-@@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
-@end group
-@end smallexample
-@end iftex
-@end ifset
-@ifclear smallbook
-@iftex
-@smallexample
-@group
- @r{No new pages}
-@r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
-@r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
-
- @@top @@majorheading
-@@chapter @@unnumbered @@appendix @@chapheading
-@@section @@unnumberedsec @@appendixsec @@heading
-@@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
-@@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
-@end group
-@end smallexample
-@end iftex
-@end ignore
-@node makeinfo top, chapter, Structuring Command Types, Structuring
-@comment node-name, next, previous, up
+@node makeinfo top
@section @code{@@top}
The @code{@@top} command is a special sectioning command that you use
only after an @samp{@@node Top} line at the beginning of a Texinfo file.
-The @code{@@top} command tells the @code{makeinfo} formatter
-which node is the `Top'
-node. It has the same typesetting effect as @code{@@unnumbered}
-(@pxref{unnumbered & appendix, , @code{@@unnumbered}, @code{@@appendix}}).
-For detailed information, see
-@ref{makeinfo top command, , The @code{@@top} Command}.@refill
+The @code{@@top} command tells the @code{makeinfo} formatter which node
+is the `Top' node, so it can use it as the root of the node tree if your
+manual uses implicit pointers. It has the same typesetting effect as
+@code{@@unnumbered} (@pxref{unnumbered & appendix, , @code{@@unnumbered}
+and @code{@@appendix}}). For detailed information, see @ref{makeinfo
+top command, , The @code{@@top} Command}.
+
+The @code{@@top} node and its menu (if any) is conventionally wrapped in
+an @code{@@ifnottex} conditional so that it will appear only in Info and
+HTML output, not @TeX{}.
+
@node chapter, unnumbered & appendix, makeinfo top, Structuring
@comment node-name, next, previous, up
@@ -4050,9 +4107,8 @@ This kind of stylistic choice is not usually offered by Texinfo.
@c but the Hacker's Dictionary wanted it ...
-@node unnumbered & appendix, majorheading & chapheading, chapter, Structuring
-@comment node-name, next, previous, up
-@section @code{@@unnumbered}, @code{@@appendix}
+@node unnumbered & appendix
+@section @code{@@unnumbered} and @code{@@appendix}
@findex unnumbered
@findex appendix
@@ -4347,12 +4403,11 @@ An attempt to raise above `chapters' reproduces chapter commands; an
attempt to lower below `subsubsections' reproduces subsubsection
commands.
-@node Nodes, Menus, Structuring, Top
-@comment node-name, next, previous, up
+@node Nodes
@chapter Nodes
@dfn{Nodes} are the primary segments of a Texinfo file. They do not
-themselves impose a hierarchic or any other kind of structure on a file.
+themselves impose a hierarchical or any other kind of structure on a file.
Nodes contain @dfn{node pointers} that name other nodes, and can contain
@dfn{menus} which are lists of nodes. In Info, the movement commands
can carry you to a pointed-to node or to a node listed in a menu. Node
@@ -4364,17 +4419,17 @@ books.@refill
* Two Paths:: Different commands to structure
Info output and printed output.
* Node Menu Illustration:: A diagram, and sample nodes and menus.
-* node:: How to write a node, in detail.
-* makeinfo Pointer Creation:: How to create node pointers with @code{makeinfo}.
+* node:: Creating nodes, in detail.
+* makeinfo Pointer Creation:: Letting makeinfo determine node pointers.
+* anchor:: Defining arbitrary cross-reference targets.
@end menu
-@node Two Paths, Node Menu Illustration, Nodes, Nodes
-@ifinfo
-@heading Two Paths
-@end ifinfo
+
+@node Two Paths
+@section Two Paths
The node and menu commands and the chapter structuring commands are
-independent of each other:
+technically independent of each other:
@itemize @bullet
@item
@@ -4391,26 +4446,26 @@ information for cross references; they do nothing else.@refill
You can use node pointers and menus to structure an Info file any way
you want; and you can write a Texinfo file so that its Info output has a
-different structure than its printed output. However, most Texinfo
-files are written such that the structure for the Info output
-corresponds to the structure for the printed output. It is not
-convenient to do otherwise.@refill
+different structure than its printed output. However, virtually all
+Texinfo files are written such that the structure for the Info output
+corresponds to the structure for the printed output. It is neither
+convenient nor understandable to the reader to do otherwise.@refill
Generally, printed output is structured in a tree-like hierarchy in
which the chapters are the major limbs from which the sections branch
out. Similarly, node pointers and menus are organized to create a
matching structure in the Info output.@refill
-@node Node Menu Illustration, node, Two Paths, Nodes
-@comment node-name, next, previous, up
+
+@node Node Menu Illustration
@section Node and Menu Illustration
Here is a copy of the diagram shown earlier that illustrates a Texinfo
file with three chapters, each of which contains two sections.@refill
-Note that the ``root'' is at the top of the diagram and the ``leaves''
-are at the bottom. This is how such a diagram is drawn conventionally;
-it illustrates an upside-down tree. For this reason, the root node is
+The ``root'' is at the top of the diagram and the ``leaves'' are at the
+bottom. This is how such a diagram is drawn conventionally; it
+illustrates an upside-down tree. For this reason, the root node is
called the `Top' node, and `Up' node pointers carry you closer to the
root.@refill
@@ -4426,35 +4481,36 @@ root.@refill
| | | | | |
Section Section Section Section Section Section
1.1 1.2 2.1 2.2 3.1 3.2
-
@end group
@end example
-Write the beginning of the node for Chapter 2 like this:@refill
+The fully-written command to start Chapter 2 would be this:
@example
@group
-@@node Chapter 2, Chapter 3, Chapter 1, top
+@@node Chapter 2, Chapter 3, Chapter 1, Top
@@comment node-name, next, previous, up
@end group
@end example
@noindent
-This @code{@@node} line says that the name of this node is ``Chapter 2'', the
-name of the `Next' node is ``Chapter 3'', the name of the `Previous'
-node is ``Chapter 1'', and the name of the `Up' node is ``Top''.
+This @code{@@node} line says that the name of this node is ``Chapter
+2'', the name of the `Next' node is ``Chapter 3'', the name of the
+`Previous' node is ``Chapter 1'', and the name of the `Up' node is
+``Top''. You can omit writing out these node names if your document is
+hierarchically organized (@pxref{makeinfo Pointer Creation}), but the
+pointer relationships still obtain.
@quotation
@strong{Please Note:} `Next' refers to the next node at the same
hierarchical level in the manual, not necessarily to the next node
within the Texinfo file. In the Texinfo file, the subsequent node may
-be at a lower level---a section-level node may follow a chapter-level
-node, and a subsection-level node may follow a section-level node.
-`Next' and `Previous' refer to nodes at the @emph{same} hierarchical
-level. (The `Top' node contains the exception to this rule. Since the
-`Top' node is the only node at that level, `Next' refers to the first
-following node, which is almost always a chapter or chapter-level
-node.)@refill
+be at a lower level---a section-level node most often follows a
+chapter-level node, for example. `Next' and `Previous' refer to nodes
+at the @emph{same} hierarchical level. (The `Top' node contains the
+exception to this rule. Since the `Top' node is the only node at that
+level, `Next' refers to the first following node, which is almost always
+a chapter or chapter-level node.)@refill
@end quotation
To go to Sections 2.1 and 2.2 using Info, you need a menu inside Chapter
@@ -4507,11 +4563,13 @@ line, an @code{@@chapter} line, and then by indexing lines.@refill
@end group
@end example
-@node node, makeinfo Pointer Creation, Node Menu Illustration, Nodes
-@comment node-name, next, previous, up
+
+@node node
@section The @code{@@node} Command
@cindex Node, defined
+@findex node
+
A @dfn{node} is a segment of text that begins at an @code{@@node}
command and continues until the next @code{@@node} command. The
definition of node is different from that for chapter or section. A
@@ -4526,19 +4584,23 @@ several nodes, one for each section, subsection, and
subsubsection.@refill
To create a node, write an @code{@@node} command at the beginning of a
-line, and follow it with four arguments, separated by commas, on the
-rest of the same line. These arguments are the name of the node, and
-the names of the `Next', `Previous', and `Up' pointers, in that order.
-You may insert spaces before each pointer if you wish; the spaces are
-ignored. You must write the name of the node, and the names of the
-`Next', `Previous', and `Up' pointers, all on the same line. Otherwise,
+line, and follow it with up to four arguments, separated by commas, on
+the rest of the same line. The first argument is required; it is the
+name of this node. The subsequent arguments are the names of the
+`Next', `Previous', and `Up' pointers, in that order, and may be omitted
+if your Texinfo document is hierarchically organized (@pxref{makeinfo
+Pointer Creation}).
+
+You may insert spaces before each name if you wish; the spaces are
+ignored. You must write the name of the node and the names of the
+`Next', `Previous', and `Up' pointers all on the same line. Otherwise,
the formatters fail. (@inforef{Top, info, info}, for more information
-about nodes in Info.)@refill
+about nodes in Info.)
Usually, you write one of the chapter-structuring command lines
immediately after an @code{@@node} line---for example, an
@code{@@section} or @code{@@subsection} line. (@xref{Structuring
-Command Types, , Types of Structuring Commands}.)@refill
+Command Types}.)
@quotation
@strong{Please note:} The GNU Emacs Texinfo mode updating commands work
@@ -4550,8 +4612,8 @@ structuring lines. @xref{Updating Requirements}.@refill
references. For this reason, you must write @code{@@node} lines in a
Texinfo file that you intend to format for printing, even if you do not
intend to format it for Info. (Cross references, such as the one at the
-end of this sentence, are made with @code{@@xref} and its related
-commands; see @ref{Cross References}.)@refill
+end of this sentence, are made with @code{@@xref} and related commands;
+see @ref{Cross References}.)@refill
@menu
* Node Names:: How to choose node and pointer names.
@@ -4563,11 +4625,11 @@ commands; see @ref{Cross References}.)@refill
* Top Node Summary:: Write a brief description for readers.
@end menu
-@node Node Names, Writing a Node, node, node
-@ifinfo
-@subheading Choosing Node and Pointer Names
-@end ifinfo
+@node Node Names
+@subsection Choosing Node and Pointer Names
+
+@cindex Node names, choosing
The name of a node identifies the node. The pointers enable
you to reach other nodes and consist of the names of those nodes.@refill
@@ -4587,8 +4649,14 @@ Also, it is helpful to include a brief description of the manual in the
`Top' node. @xref{First Node}, for information on how to write the
first node of a Texinfo file.@refill
-@node Writing a Node, Node Line Tips, Node Names, node
-@comment node-name, next, previous, up
+Even when you explicitly specify all pointers, that does not mean you
+can write the nodes in the Texinfo source file in an arbitrary order!
+Because @TeX{} processes the file sequentially, irrespective of node
+pointers, you must write the nodes in the order you wish them to appear
+in the printed output.
+
+
+@node Writing a Node
@subsection How to Write an @code{@@node} Line
@cindex Writing an @code{@@node} line
@cindex @code{@@node} line writing
@@ -4616,8 +4684,8 @@ their proper order. The comment line helps you keep track of which
arguments are for which pointers. This comment line is especially useful
if you are not familiar with Texinfo.@refill
-The template for a node line with `Next', `Previous', and `Up' pointers
-looks like this:@refill
+The template for a fully-written-out node line with `Next', `Previous',
+and `Up' pointers looks like this:@refill
@example
@@node @var{node-name}, @var{next}, @var{previous}, @var{up}
@@ -4625,22 +4693,21 @@ looks like this:@refill
If you wish, you can ignore @code{@@node} lines altogether in your first
draft and then use the @code{texinfo-insert-node-lines} command to
-create @code{@@node} lines for you. However, we do not
-recommend this practice. It is better to name the node itself
-at the same time that you
-write a segment so you can easily make cross references. A large number
-of cross references are an especially important feature of a good Info
-file.@refill
+create @code{@@node} lines for you. However, we do not recommend this
+practice. It is better to name the node itself at the same time that
+you write a segment so you can easily make cross references. A large
+number of cross references are an especially important feature of a good
+Info file.
After you have inserted an @code{@@node} line, you should immediately
write an @@-command for the chapter or section and insert its name.
Next (and this is important!), put in several index entries. Usually,
you will find at least two and often as many as four or five ways of
referring to the node in the index. Use them all. This will make it
-much easier for people to find the node.@refill
+much easier for people to find the node.
-@node Node Line Tips, Node Line Requirements, Writing a Node, node
-@comment node-name, next, previous, up
+
+@node Node Line Tips
@subsection @code{@@node} Line Tips
Here are three suggestions:
@@ -4664,8 +4731,8 @@ section or chapter titles---initial and significant words are
capitalized; others are not.@refill
@end itemize
+
@node Node Line Requirements, First Node, Node Line Tips, node
-@comment node-name, next, previous, up
@subsection @code{@@node} Line Requirements
@cindex Node line requirements
@@ -4673,7 +4740,7 @@ Here are several requirements for @code{@@node} lines:
@itemize @bullet
@cindex Unique nodename requirement
-@cindex Nodename must be unique
+@cindex Node name must be unique
@item
All the node names for a single Info file must be unique.@refill
@@ -4689,13 +4756,15 @@ different.@refill
A pointer name must be the name of a node.@refill
The node to which a pointer points may come before or after the
-node containing the pointer.@refill
+node containing the pointer.
-@cindex @@-command in nodename
-@cindex Nodename, cannot contain
+@cindex @@-commands in nodename
+@cindex Node name, should not contain @@-commands
@item
-You cannot use any of the Texinfo @@-commands in a node name;
-@w{@@-commands} confuse Info.@refill
+@w{@@-commands} used in node names generally confuse Info, so you should
+avoid them. For a few rare cases when this is useful, Texinfo has
+limited support for using @w{@@-commands} in node names; see
+@ref{Pointer Validation}.
@need 750
Thus, the beginning of the section called @code{@@chapter} looks like
@@ -4710,11 +4779,15 @@ this:@refill
@end group
@end smallexample
-@cindex Comma in nodename
-@cindex Apostrophe in nodename
@item
-You cannot use commas or apostrophes within a node name; these
-confuse @TeX{} or the Info formatters.@refill
+@cindex Apostrophe in nodename
+@cindex Colon in nodename
+@cindex Comma in nodename
+@cindex Period in nodename
+@cindex Characters, invalid in node name
+@cindex Invalid characters in node names
+Unfortunately, you cannot use periods, commas, colons or apostrophes
+within a node name; these confuse @TeX{} or the Info formatters.@refill
@need 700
For example, the following is a section title:
@@ -4833,69 +4906,100 @@ include an edition number for the manual. (The title page should also
contain this information: see @ref{titlepage, ,
@code{@@titlepage}}.)@refill
-@node makeinfo Pointer Creation, , node, Nodes
+@node makeinfo Pointer Creation
@section Creating Pointers with @code{makeinfo}
@cindex Creating pointers with @code{makeinfo}
@cindex Pointer creation with @code{makeinfo}
@cindex Automatic pointer creation with @code{makeinfo}
-The @code{makeinfo} program has a feature for automatically creating
-node pointers for a hierarchically organized file that lacks
-them.@refill
+The @code{makeinfo} program has a feature for automatically defining
+node pointers for a hierarchically organized file.
When you take advantage of this feature, you do not need to write the
`Next', `Previous', and `Up' pointers after the name of a node.
However, you must write a sectioning command, such as @code{@@chapter}
or @code{@@section}, on the line immediately following each truncated
-@code{@@node} line. You cannot write a comment line after a node
-line; the section line must follow it immediately.@refill
+@code{@@node} line (except that comment lines may intervene).
-In addition, you must follow the `Top' @code{@@node} line with a line beginning
-with @code{@@top} to mark the `Top' node in the file. @xref{makeinfo
-top, , @code{@@top}}.
+In addition, you must follow the `Top' @code{@@node} line with a line
+beginning with @code{@@top} to mark the `Top' node in the
+file. @xref{makeinfo top, , @code{@@top}}.
Finally, you must write the name of each node (except for the `Top'
node) in a menu that is one or more hierarchical levels above the
-node's hierarchical level.@refill
+node's hierarchical level.
+
+This node pointer insertion feature in @code{makeinfo} relieves you from
+the need to update menus and pointers manually or with Texinfo mode
+commands. (@xref{Updating Nodes and Menus}.)
+
+
+@node anchor
+@section @code{@@anchor}: Defining Arbitrary Cross-reference Targets
-This node pointer insertion feature in @code{makeinfo} is an
-alternative to the menu and pointer creation and update commands in
-Texinfo mode. (@xref{Updating Nodes and Menus}.) It is especially
-helpful to people who do not use GNU Emacs for writing Texinfo
-documents.@refill
+@findex anchor
+@cindex Anchors
+@cindex Cross-reference targets, arbitrary
+@cindex Targets for cross-references, arbitrary
+
+An @dfn{anchor} is a position in your document, labeled so that
+cross-references can refer to it, just as they can to nodes. You create
+an anchor with the @code{@@anchor} command, and give the label as a
+normal brace-delimited argument. For example:
+
+@example
+This marks the @@anchor@{x-spot@}spot.
+@dots{}
+@@xref@{x-spot,,the spot@}.
+@end example
-@node Menus, Cross References, Nodes, Top
-@comment node-name, next, previous, up
+@noindent produces:
+
+@example
+This marks the spot.
+@dots{}
+See [the spot], page 1.
+@end example
+
+As you can see, the @code{@@anchor} command itself produces no output.
+This example defines an anchor `x-spot' just before the word `spot'.
+You can refer to it later with an @code{@@xref} or other cross-reference
+command, as shown. @xref{Cross References}, for details on the
+cross-reference commands.
+
+It is best to put @code{@@anchor} commands just before the position you
+wish to refer to; that way, the reader's eye is led on to the correct
+text when they jump to the anchor. You can put the @code{@@anchor}
+command on a line by itself if that helps readability of the source.
+Spaces are always ignored after @code{@@anchor}.
+
+Anchor names and node names may not conflict. Anchors and nodes are
+given similar treatment in some ways; for example, the @code{goto-node}
+command in standalone Info takes either an anchor name or a node name as
+an argument. (@xref{goto-node,,,info-stnd,GNU Info}.)
+
+
+@node Menus
@chapter Menus
@cindex Menus
@findex menu
-@dfn{Menus} contain pointers to subordinate
-nodes.@footnote{Menus can carry you to any node, regardless
-of the hierarchical structure; even to nodes in a different
-Info file. However, the GNU Emacs Texinfo mode updating
-commands work only to create menus of subordinate nodes.
-Conventionally, cross references are used to refer to other
-nodes.} In Info, you use menus to go to such nodes. Menus
-have no effect in printed manuals and do not appear in
-them.@refill
+@dfn{Menus} contain pointers to subordinate nodes.@footnote{Menus can
+carry you to any node, regardless of the hierarchical structure; even to
+nodes in a different Info file. However, the GNU Emacs Texinfo mode
+updating commands work only to create menus of subordinate nodes.
+Conventionally, cross references are used to refer to other nodes.} In
+Info, you use menus to go to such nodes. Menus have no effect in
+printed manuals and do not appear in them.
By convention, a menu is put at the end of a node since a reader who
-uses the menu may not see text that follows it.@refill
-
-@ifinfo
-A node that has a menu should @emph{not} contain much text. If you
-have a lot of text and a menu, move most of the text into a new
-subnode---all but a few lines.@refill
-@end ifinfo
-@iftex
-@emph{A node that has a menu should not contain much text.} If you
-have a lot of text and a menu, move most of the text into a new
-subnode---all but a few lines. Otherwise, a reader with a terminal
-that displays only a few lines may miss the menu and its associated
-text. As a practical matter, you should locate a menu within 20 lines
-of the beginning of the node.@refill
-@end iftex
+uses the menu may not see text that follows it. Furthermore, a node
+that has a menu should not contain much text. If you have a lot of text
+and a menu, move most of the text into a new subnode---all but a few
+lines. Otherwise, a reader with a terminal that displays only a few
+lines may miss the menu and its associated text. As a practical matter,
+you should locate a menu within 20 lines of the beginning of the
+node.
@menu
* Menu Location:: Put a menu in a short node.
@@ -4906,6 +5010,7 @@ of the beginning of the node.@refill
* Other Info Files:: How to refer to a different Info file.
@end menu
+
@node Menu Location, Writing a Menu, Menus, Menus
@ifinfo
@heading Menus Need Short Nodes
@@ -4915,14 +5020,6 @@ of the beginning of the node.@refill
@cindex Nodes for menus are short
@cindex Short nodes for menus
-@ifinfo
-A reader can easily see a menu that is close to the beginning of the
-node. The node should be short. As a practical matter, you should
-locate a menu within 20 lines of the beginning of the node.
-Otherwise, a reader with a terminal that displays only a few lines may
-miss the menu and its associated text.@refill
-@end ifinfo
-
The short text before a menu may look awkward in a printed manual. To
avoid this, you can write a menu near the beginning of its node and
follow the menu by an @code{@@node} line, and then an @code{@@heading}
@@ -4954,7 +5051,8 @@ For example, the preceding two paragraphs follow an Info-only menu,
The Texinfo file for this document contains more than a dozen
examples of this procedure. One is at the beginning of this chapter;
-another is at the beginning of the ``Cross References'' chapter.@refill
+another is at the beginning of @ref{Cross References}. @refill
+
@node Writing a Menu, Menu Parts, Menu Location, Menus
@section Writing a Menu
@@ -4980,14 +5078,16 @@ Larger Units of Text
@end group
@end example
-In a menu, every line that begins with an @w{@samp{* }} is a
-@dfn{menu entry}. (Note the space after the asterisk.) A
-line that does not start with an @w{@samp{* }} may also
-appear in a menu. Such a line is not a menu entry but is a
-menu comment line that appears in the Info file. In
-the example above, the line @samp{Larger Units of Text} is a
-menu comment line; the two lines starting with @w{@samp{* }}
-are menu entries.
+In a menu, every line that begins with an @w{@samp{* }} is a @dfn{menu
+entry}. (Note the space after the asterisk.) A line that does not
+start with an @w{@samp{* }} may also appear in a menu. Such a line is
+not a menu entry but is a menu comment line that appears in the Info
+file. In the example above, the line @samp{Larger Units of Text} is a
+menu comment line; the two lines starting with @w{@samp{* }} are menu
+@cindex Spaces, in menus
+entries. Space characters in a menu are preserved as-is; this allows
+you to format the menu as you wish.
+
@node Menu Parts, Less Cluttered Menu Entry, Writing a Menu, Menus
@section The Parts of a Menu
@@ -5196,20 +5296,20 @@ For example:
not a Texinfo file, but a menu entry looks the same in both types of
file.)@refill
-Note that the GNU Emacs Texinfo mode menu updating commands only work
-with nodes within the current buffer, so you cannot use them to create
-menus that refer to other files. You must write such menus by hand.@refill
+The GNU Emacs Texinfo mode menu updating commands only work with nodes
+within the current buffer, so you cannot use them to create menus that
+refer to other files. You must write such menus by hand.
-@node Cross References, Marking Text, Menus, Top
-@comment node-name, next, previous, up
+
+@node Cross References
@chapter Cross References
@cindex Making cross references
@cindex Cross references
@cindex References
@dfn{Cross references} are used to refer the reader to other parts of the
-same or different Texinfo files. In Texinfo, nodes are the
-places to which cross references can refer.@refill
+same or different Texinfo files. In Texinfo, nodes and anchors are the
+places to which cross references can refer.
@menu
* References:: What cross references are for.
@@ -5235,7 +5335,7 @@ it.@refill
However, in any document, some information will be too detailed for
the current context, or incidental to it; use cross references to
-provide access to such information. Also, an on-line help system or a
+provide access to such information. Also, an online help system or a
reference manual is not like a novel; few read such documents in
sequence from beginning to end. Instead, people look up what they
need. For this reason, such creations should contain many cross
@@ -5250,15 +5350,16 @@ In Info, a cross reference results in an entry that you can follow using
the Info @samp{f} command. (@inforef{Help-Adv, Some advanced Info
commands, info}.)@refill
-The various cross reference commands use nodes to define cross
-reference locations. This is evident in Info, in which a cross
-reference takes you to the specified node. @TeX{} also uses nodes to
-define cross reference locations, but the action is less obvious. When
-@TeX{} generates a DVI file, it records nodes' page numbers and
-uses the page numbers in making references. Thus, if you are writing
-a manual that will only be printed, and will not be used on-line, you
-must nonetheless write @code{@@node} lines to name the places to which
-you make cross references.@refill
+The various cross reference commands use nodes (or anchors,
+@pxref{anchor,,@code{@@anchor}}) to define cross reference locations.
+This is evident in Info, in which a cross reference takes you to the
+specified location. @TeX{} also uses nodes to define cross reference
+locations, but the action is less obvious. When @TeX{} generates a DVI
+file, it records each node's page number and uses the page numbers in making
+references. Thus, if you are writing a manual that will only be
+printed, and will not be used online, you must nonetheless write
+@code{@@node} lines to name the places to which you make cross
+references.@refill
@need 800
@node Cross Reference Commands, Cross Reference Parts, References, Cross References
@@ -5359,7 +5460,7 @@ The five possible arguments for a cross reference are:@refill
@enumerate
@item
-The node name (required). This is the node to which the
+The node or anchor name (required). This is the location to which the
cross reference takes you. In a printed document, the location of the
node provides the page reference only for references within the same
document.@refill
@@ -5449,16 +5550,16 @@ or like this
@noindent
In @TeX{}, a cross reference looks like this:
-@example
+@quotation
See Section @var{section-number} [@var{node-name}], page @var{page}.
-@end example
+@end quotation
@noindent
or like this
-@example
+@quotation
See Section @var{section-number} [@var{title-or-topic}], page @var{page}.
-@end example
+@end quotation
The @code{@@xref} command does not generate a period or comma to end
the cross reference in either the Info file or the printed output.
@@ -5536,6 +5637,9 @@ which produces
*Note Tropical Storms::, for more info.
@end example
+@noindent
+and
+
@quotation
See Section 3.1 [Tropical Storms], page 24, for more info.
@end quotation
@@ -5583,7 +5687,7 @@ See Section 5.2 [Electrical Effects], page 57.
@noindent
(Note that in the preceding example the closing brace is followed by a
-period; and that the node name is printed, not the cross reference name.)@refill
+period; and that the node name is printed, not the cross reference name.)
You can write a clause after the cross reference, like this:@refill
@@ -5625,7 +5729,7 @@ within a title or other section will divide it into two arguments. In
a reference, you need to write a title such as ``Clouds, Mist, and
Fog'' without the commas.@refill
-Also, remember to write a comma or period after the closing brace of a
+Also, remember to write a comma or period after the closing brace of an
@code{@@xref} to terminate the cross reference. In the following
examples, a clause follows a terminating comma.@refill
@@ -5875,6 +5979,7 @@ This makes it useful as the last part of a sentence.@refill
@noindent
For example,
+@cindex Hurricanes
@example
For more information, see @@ref@{Hurricanes@}.
@end example
@@ -5883,7 +5988,7 @@ For more information, see @@ref@{Hurricanes@}.
produces
@example
-For more information, see *Note Hurricanes.
+For more information, see *Note Hurricanes::.
@end example
@noindent
@@ -5902,6 +6007,7 @@ both the printed and the Info format.@refill
@noindent
For example,
+@cindex Sea surges
@example
@group
Sea surges are described in @@ref@{Hurricanes@}.
@@ -5925,12 +6031,13 @@ Sea surges are described in *Note Hurricanes::.
@end example
@quotation
-@strong{Caution:} You @emph{must} write a period or comma immediately
-after an @code{@@ref} command with two or more arguments. Otherwise,
-Info will not find the end of the cross reference entry and its
-attempt to follow the cross reference will fail. As a general rule,
-you should write a period or comma after every @code{@@ref} command.
-This looks best in both the printed and the Info output.@refill
+@strong{Caution:} You @emph{must} write a period, comma, or right
+parenthesis immediately after an @code{@@ref} command with two or more
+arguments. Otherwise, Info will not find the end of the cross reference
+entry and its attempt to follow the cross reference will fail. As a
+general rule, you should write a period or comma after every
+@code{@@ref} command. This looks best in both the printed and the Info
+output.@refill
@end quotation
@node pxref, inforef, ref, Cross References
@@ -5975,6 +6082,7 @@ of the output and not the other.@refill
With one argument, a parenthetical cross reference looks like
this:@refill
+@cindex Flooding
@example
@dots{} storms cause flooding (@@pxref@{Hurricanes@}) @dots{}
@end example
@@ -6130,64 +6238,113 @@ refer to printed works for which no Info form exists. @xref{cite, ,
@code{@@cite}}.@refill
-@node uref, , inforef, Cross References
-@section @code{@@uref@{@var{url}[, @var{displayed-text}]@}}
+@node uref
+@section @code{@@uref@{@var{url}[, @var{text}][, @var{replacement}]@}}
@findex uref
@cindex Uniform resource locator, referring to
@cindex URL, referring to
-@code{@@uref} produces a reference to a uniform resource locator (URL).
-It takes one mandatory argument, the URL, and one optional argument, the
-text to display (the default is the URL itself). In HTML output,
-@code{@@uref} produces a link you can follow. For example:
+@cindex @code{href}, producing HTML
+@code{@@uref} produces a reference to a uniform resource locator (url).
+It takes one mandatory argument, the url, and two optional arguments
+which control the text that is displayed. In HTML output, @code{@@uref}
+produces a link you can follow.
+
+The second argument, if specified, is the text to display (the default
+is the url itself); in Info and DVI output, but not in HTML output, the
+url is also output.
+
+@cindex Man page, reference to
+The third argument, on the other hand, if specified is also the text to
+display, but the url is @emph{not} output in any format. This is useful
+when the text is already sufficiently referential, as in a man page. If
+the third argument is given, the second argument is ignored.
+
+The simple one argument form, where the url is both the target and the
+text of the link:
@example
-The official GNU ftp site is
-@@uref@{ftp://ftp.gnu.ai.mit.edu/pub/gnu@}
+The official GNU ftp site is @@uref@{ftp://ftp.gnu.org/gnu@}.
@end example
-@noindent produces (in text):
+@noindent produces:
@display
-The official GNU ftp site is
-@uref{ftp://ftp.gnu.ai.mit.edu/pub/gnu}
+The official GNU ftp site is @uref{ftp://ftp.gnu.org/gnu}.
@end display
-@noindent whereas
+
+An example of the two-argument form:
@example
-The official
-@@uref@{ftp://ftp.gnu.ai.mit.edu/pub/gnu,
- GNU ftp site@} holds programs and texts.
+The official @@uref@{ftp://ftp.gnu.org/gnu, GNU ftp site@} holds
+programs and texts.
@end example
-@noindent produces (in text):
+@noindent produces:
@display
-The official @uref{ftp://ftp.gnu.ai.mit.edu/pub/gnu, GNU ftp site} holds
+The official @uref{ftp://ftp.gnu.org/gnu, GNU ftp site} holds
programs and texts.
@end display
-@noindent and (in HTML):
+@noindent that is, the Info output is this:
@example
-The official <A HREF="ftp://ftp.gnu.ai.mit.edu/pub/gnu">GNU ftp
-site</A> holds programs and texts.
+The official GNU ftp site (ftp://ftp.gnu.org/gnu) holds
+programs and texts.
@end example
-To merely indicate a URL, use @code{@@url} (@pxref{url, @code{@@url}}).
+@noindent and the HTML output is this:
+@example
+The official <a href="ftp://ftp.gnu.org/gnu">GNU ftp site</a> holds
+programs and texts.
+@end example
-@node Marking Text, Quotations and Examples, Cross References, Top
-@comment node-name, next, previous, up
+An example of the three-argument form:
+@example
+The @@uref@{http://example.org/man.cgi/1/ls,,ls(1)@} program @dots{}
+@end example
+
+@noindent produces:
+@display
+The @uref{http://example.org/man.cgi/1/ls,,ls(1)} program @dots{}
+@end display
+
+@noindent but with HTML:
+@example
+The <a href="http://example.org/man.cgi/1/ls">ls(1)</a> program @dots{}
+@end example
+
+To merely indicate a url without creating a link people can follow, use
+@code{@@url} (@pxref{url, @code{@@url}}).
+
+
+Some people prefer to display url's in the unambiguous format:
+
+@display
+<URL:http://@var{host}/@var{path}>
+@end display
+
+@noindent
+@cindex <URL: convention, not used
+You can use this form in the input file if you wish. We feel it's not
+necessary to clutter up the output with the extra @samp{<URL:} and
+@samp{>}, since any software that tries to detect url's in text already
+has to detect them without the @samp{<URL:} to be useful.
+
+
+@node Marking Text
@chapter Marking Words and Phrases
@cindex Paragraph, marking text within
@cindex Marking words and phrases
@cindex Words and phrases, marking them
@cindex Marking text within a paragraph
+@cindex Text, marking up
In Texinfo, you can mark words and phrases in a variety of ways.
The Texinfo formatters use this information to determine how to
highlight the text.
You can specify, for example, whether a word or phrase is a
defining occurrence, a metasyntactic variable, or a symbol used in a
-program. Also, you can emphasize text.@refill
+program. Also, you can emphasize text, in several different ways.
@menu
* Indicating:: How to indicate definitions, files, etc.
@@ -6212,7 +6369,7 @@ For example, in a printed manual,
code is usually illustrated in a typewriter font;
@code{@@code} tells @TeX{} to typeset this text in this font. But it
would be easy to change the way @TeX{} highlights code to use another
-font, and this change would not effect how keystroke examples are
+font, and this change would not affect how keystroke examples are
highlighted. If straight typesetting commands were used in the body
of the file and you wanted to make a change, you would need to check
every single occurrence to make sure that you were changing code and
@@ -6220,24 +6377,29 @@ not something else that should not be changed.@refill
@menu
* Useful Highlighting:: Highlighting provides useful information.
-* code:: How to indicate code.
-* kbd:: How to show keyboard input.
-* key:: How to specify keys.
-* samp:: How to show a literal sequence of characters.
-* var:: How to indicate a metasyntactic variable.
-* file:: How to indicate the name of a file.
-* dfn:: How to specify a definition.
-* cite:: How to refer to a book that is not in Info.
-* url:: How to indicate a world wide web reference.
-* email:: How to indicate an electronic mail address.
+* code:: Indicating program code.
+* kbd:: Showing keyboard input.
+* key:: Specifying keys.
+* samp:: Showing a literal sequence of characters.
+* var:: Indicating metasyntactic variables.
+* env:: Indicating environment variables.
+* file:: Indicating file names.
+* command:: Indicating command names.
+* option:: Indicating option names.
+* dfn:: Specifying definitions.
+* cite:: Referring to books not in the Info system.
+* acronym:: Indicating acronyms.
+* url:: Indicating a World Wide Web reference.
+* email:: Indicating an electronic mail address.
@end menu
+
@node Useful Highlighting, code, Indicating, Indicating
@ifinfo
@subheading Highlighting Commands are Useful
@end ifinfo
-The highlighting commands can be used to generate useful information
+The highlighting commands can be used to extract useful information
from the file, such as lists of functions or file names. It is
possible, for example, to write a program in Emacs Lisp (or a keyboard
macro) to insert an index entry after every paragraph that contains
@@ -6263,14 +6425,17 @@ Indicate text that is a literal example of a sequence of characters.@refill
@item @@var@{@var{metasyntactic-variable}@}
Indicate a metasyntactic variable.@refill
-@item @@url@{@var{uniform-resource-locator}@}
-Indicate a uniform resource locator for the World Wide Web.
+@item @@env@{@var{environment-variable}@}
+Indicate an environment variable.@refill
@item @@file@{@var{file-name}@}
Indicate the name of a file.@refill
-@item @@email@{@var{email-address}[, @var{displayed-text}]@}
-Indicate an electronic mail address.
+@item @@command@{@var{command-name}@}
+Indicate the name of a command.@refill
+
+@item @@option@{@var{option}@}
+Indicate a command-line option.@refill
@item @@dfn@{@var{term}@}
Indicate the introductory or defining use of a term.@refill
@@ -6278,43 +6443,44 @@ Indicate the introductory or defining use of a term.@refill
@item @@cite@{@var{reference}@}
Indicate the name of a book.@refill
+@item @@acronym@{@var{acronym}@}
+Indicate an acronym.@refill
+
+@item @@url@{@var{uniform-resource-locator}@}
+Indicate a uniform resource locator for the World Wide Web.
+
+@item @@email@{@var{email-address}[, @var{displayed-text}]@}
+Indicate an electronic mail address.
+
@ignore
@item @@ctrl@{@var{ctrl-char}@}
Use for an @sc{ascii} control character.@refill
@end ignore
@end table
-@node code, kbd, Useful Highlighting, Indicating
-@comment node-name, next, previous, up
+
+@node code
@subsection @code{@@code}@{@var{sample-code}@}
@findex code
+@cindex Syntactic tokens, indicating
Use the @code{@@code} command to indicate text that is a piece of a
program and which consists of entire syntactic tokens. Enclose the
-text in braces.@refill
+text in braces.
+@cindex Expressions in a program, indicating
+@cindex Keywords, indicating
+@cindex Reserved words, indicating
Thus, you should use @code{@@code} for an expression in a program, for
the name of a variable or function used in a program, or for a
-keyword. Also, you should use @code{@@code} for the name of a
-program, such as @code{diff}, that is a name used in the machine. (You
-should write the name of a program in the ordinary text font if you
-regard it as a new English word, such as `Emacs' or `Bison'.)@refill
-
-Use @code{@@code} for environment variables such as @code{TEXINPUTS},
-and other variables.@refill
-
-Use @code{@@code} for command names in command languages that
-resemble programming languages, such as Texinfo or the shell.
-For example, @code{@@code} and @code{@@samp} are produced by writing
-@samp{@@code@{@@@@code@}} and @samp{@@code@{@@@@samp@}} in the Texinfo
-source, respectively.@refill
-
-Note, however, that you should not use @code{@@code} for shell options
-such as @samp{-c} when such options stand alone. (Use @code{@@samp}.)
-Also, an entire shell command often looks better if written using
-@code{@@samp} rather than @code{@@code}. In this case, the rule is to
-choose the more pleasing format.@refill
+keyword in a programming language.
+Use @code{@@code} for command names in languages that resemble
+programming languages, such as Texinfo. For example, @code{@@code} and
+@code{@@samp} are produced by writing @samp{@@code@{@@@@code@}} and
+@samp{@@code@{@@@@samp@}} in the Texinfo source, respectively.
+
+@cindex Case, not altering in @code{@@code}
It is incorrect to alter the case of a word inside an @code{@@code}
command when it appears at the beginning of a sentence. Most computer
languages are case sensitive. In C, for example, @code{Printf} is
@@ -6322,24 +6488,8 @@ different from the identifier @code{printf}, and most likely is a
misspelling of it. Even in languages which are not case sensitive, it
is confusing to a human reader to see identifiers spelled in different
ways. Pick one spelling and always use that. If you do not want to
-start a sentence with a command written all in lower case, you should
-rearrange the sentence.@refill
-
-Do not use the @code{@@code} command for a string of characters shorter
-than a syntactic token. If you are writing about @samp{TEXINPU}, which
-is just a part of the name for the @code{TEXINPUTS} environment
-variable, you should use @code{@@samp}.@refill
-
-In particular, you should not use the @code{@@code} command when writing
-about the characters used in a token; do not, for example, use
-@code{@@code} when you are explaining what letters or printable symbols
-can be used in the names of functions. (Use @code{@@samp}.) Also, you
-should not use @code{@@code} to mark text that is considered input to
-programs unless the input is written in a language that is like a
-programming language. For example, you should not use @code{@@code} for
-the keystroke commands of GNU Emacs (use @code{@@kbd} instead) although
-you may use @code{@@code} for the names of the Emacs Lisp functions that
-the keystroke commands invoke.@refill
+start a sentence with a command name written all in lower case, you
+should rearrange the sentence.
In the printed manual, @code{@@code} causes @TeX{} to typeset the
argument in a typewriter face. In the Info file, it causes the Info
@@ -6349,30 +6499,73 @@ formatting commands to use single quotation marks around the text.
For example,
@example
-Use @@code@{diff@} to compare two files.
+The function returns @@code@{nil@}.
@end example
@noindent
-produces this in the printed manual:@refill
+produces this in the printed manual:
@quotation
-Use @code{diff} to compare two files.
+The function returns @code{nil}.
@end quotation
-@iftex
+@iftex
@noindent
-and this in the Info file:@refill
-
+and this in the Info file:
@example
-Use `diff' to compare two files.
+The function returns `nil'.
@end example
@end iftex
+Here are some cases for which it is preferable not to use @code{@@code}:
+
+@itemize @bullet
+@item
+For shell command names such as @command{ls} (use @code{@@command}).
+
+@item
+For shell options such as @samp{-c} when such options stand alone (use
+@code{@@option}).
+
+@item
+Also, an entire shell command often looks better if written using
+@code{@@samp} rather than @code{@@code}. In this case, the rule is to
+choose the more pleasing format.
+
+@item
+For environment variable such as @env{TEXINPUTS} (use @code{@@env}).
+
+@item
+For a string of characters shorter than a syntactic token. For example,
+if you are writing about @samp{goto-ch}, which is just a part of the
+name for the @code{goto-char} Emacs Lisp function, you should use
+@code{@@samp}.
+
+@item
+In general, when writing about the characters used in a token; for
+example, do not use @code{@@code} when you are explaining what letters
+or printable symbols can be used in the names of functions. (Use
+@code{@@samp}.) Also, you should not use @code{@@code} to mark text
+that is considered input to programs unless the input is written in a
+language that is like a programming language. For example, you should
+not use @code{@@code} for the keystroke commands of GNU Emacs (use
+@code{@@kbd} instead) although you may use @code{@@code} for the names
+of the Emacs Lisp functions that the keystroke commands invoke.
+
+@end itemize
+
+Since @code{@@command}, @code{@@option}, and @code{@@env} were
+introduced relatively recently, it is acceptable to use @code{@@code} or
+@code{@@samp} for command names, options, and environment variables.
+The new commands allow you to express the markup more precisely, but
+there is no real harm in using the older commands, and of course the
+long-standing manuals do so.
+
-@node kbd, key, code, Indicating
+@node kbd
@subsection @code{@@kbd}@{@var{keyboard-characters}@}
@findex kbd
-@cindex keyboard input
+@cindex Keyboard input
Use the @code{@@kbd} command for characters of input to be typed by
users. For example, to refer to the characters @kbd{M-a},
@@ -6411,7 +6604,7 @@ Always use the same font for @code{@@kbd} as @code{@@code}.
@item example
Use the distinguishing font for @code{@@kbd} only in @code{@@example}
and similar environments.
-@item example
+@item distinct
(the default) Always use the distinguishing font for @code{@@kbd}.
@end table
@@ -6545,9 +6738,7 @@ To match @samp{foo} at the end of the line, use the regexp
Any time you are referring to single characters, you should use
@code{@@samp} unless @code{@@kbd} or @code{@@key} is more appropriate.
-Use @code{@@samp} for the names of command-line options (except in an
-@code{@@table}, where @code{@@code} seems to read more easily). Also,
-you may use @code{@@samp} for entire statements in C and for entire
+Also, you may use @code{@@samp} for entire statements in C and for entire
shell commands---in this case, @code{@@samp} often looks better than
@code{@@code}. Basically, @code{@@samp} is a catchall for whatever is
not covered by @code{@@code}, @code{@@kbd}, or @code{@@key}.@refill
@@ -6575,8 +6766,8 @@ In English, the vowels are @samp{a}, @samp{e},
@samp{y}.
@end quotation
-@node var, file, samp, Indicating
-@comment node-name, next, previous, up
+
+@node var
@subsection @code{@@var}@{@var{metasyntactic-variable}@}
@findex var
@@ -6588,26 +6779,30 @@ to that function.@refill
Do not use @code{@@var} for the names of particular variables in
programming languages. These are specific names from a program, so
-@code{@@code} is correct for them. For example, the Emacs Lisp variable
-@code{texinfo-tex-command} is not a metasyntactic variable; it is
-properly formatted using @code{@@code}.@refill
+@code{@@code} is correct for them (@pxref{code}). For example, the
+Emacs Lisp variable @code{texinfo-tex-command} is not a metasyntactic
+variable; it is properly formatted using @code{@@code}.
-The effect of @code{@@var} in the Info file is to change the case of
-the argument to all upper case; in the printed manual, to italicize it.
+Do not use @code{@@var} for environment variables either; @code{@@env}
+is correct for them (see the next section).
+
+The effect of @code{@@var} in the Info file is to change the case of the
+argument to all upper case. In the printed manual and HTML output, the
+argument is printed in slanted type.
@need 700
For example,
@example
To delete file @@var@{filename@},
-type @@code@{rm @@var@{filename@}@}.
+type @@samp@{rm @@var@{filename@}@}.
@end example
@noindent
produces
@quotation
-To delete file @var{filename}, type @code{rm @var{filename}}.
+To delete file @var{filename}, type @samp{rm @var{filename}}.
@end quotation
@noindent
@@ -6647,11 +6842,32 @@ angle brackets, for example:@refill
@noindent
However, that is not the style that Texinfo uses. (You can, of
-course, modify the sources to @TeX{} and the Info formatting commands
+course, modify the sources to @file{texinfo.tex} and the Info formatting commands
to output the @code{<@dots{}>} format if you wish.)@refill
-@node file, dfn, var, Indicating
-@comment node-name, next, previous, up
+
+@node env
+@subsection @code{@@env}@{@var{environment-variable}@}
+@findex env
+
+Use the @code{@@env} command to indicate environment variables, as used
+by many operating systems, including GNU. Do not use it for
+metasyntactic variables; use @code{@@var} instead (see the previous
+section).
+
+@code{@@env} is equivalent to @code{@@code} in its effects.
+For example:
+
+@example
+The @@env@{PATH@} environment variable sets the search path for commands.
+@end example
+@noindent produces
+@quotation
+The @env{PATH} environment variable sets the search path for commands.
+@end quotation
+
+
+@node file
@subsection @code{@@file}@{@var{file-name}@}
@findex file
@@ -6676,7 +6892,58 @@ The @file{.el} files are in
the @file{/usr/local/emacs/lisp} directory.
@end quotation
-@node dfn, cite, file, Indicating
+
+@node command
+@subsection @code{@@command}@{@var{command-name}@}
+@findex command
+@cindex Command names, indicating
+@cindex Program names, indicating
+
+Use the @code{@@command} command to indicate command names, such as
+@command{ls} or @command{cc}.
+
+@code{@@command} is equivalent to @code{@@code} in its effects.
+For example:
+
+@example
+The command @@command@{ls@} lists directory contents.
+@end example
+@noindent produces
+@quotation
+The command @command{ls} lists directory contents.
+@end quotation
+
+You should write the name of a program in the ordinary text font, rather
+than using @code{@@command}, if you regard it as a new English word,
+such as `Emacs' or `Bison'.
+
+When writing an entire shell command invocation, as in @samp{ls -l},
+you should use either @code{@@samp} or @code{@@code} at your discretion.
+
+
+@node option
+@subsection @code{@@option}@{@var{option-name}@}
+@findex option
+
+Use the @code{@@option} command to indicate a command-line option; for
+example, @option{-l} or @option{--version} or
+@option{--output=@var{filename}}.
+
+@code{@@option} is equivalent to @code{@@samp} in its effects.
+For example:
+
+@example
+The option @@option@{-l@} produces a long listing.
+@end example
+@noindent produces
+@quotation
+The option @option{-l} produces a long listing.
+@end quotation
+
+In tables, putting options inside @code{@@code} produces a
+more pleasing effect.
+
+@node dfn
@comment node-name, next, previous, up
@subsection @code{@@dfn}@{@var{term}@}
@findex dfn
@@ -6705,18 +6972,18 @@ term should be a definition of the term. The sentence does not need
to say explicitly that it is a definition, but it should contain the
information of a definition---it should make the meaning clear.
-@node cite, url, dfn, Indicating
-@comment node-name, next, previous, up
+@node cite
@subsection @code{@@cite}@{@var{reference}@}
@findex cite
Use the @code{@@cite} command for the name of a book that lacks a
-companion Info file. The command produces italics in the printed
-manual, and quotation marks in the Info file.@refill
+companion Info file. The command produces italics in the printed
+manual, and quotation marks in the Info file.
-(If a book is written in Texinfo, it is better to use a cross reference
+If a book is written in Texinfo, it is better to use a cross reference
command since a reader can easily follow such a reference in Info.
-@xref{xref, , @code{@@xref}}.)@refill
+@xref{xref, , @code{@@xref}}.
+
@ignore
@c node ctrl, , cite, Indicating
@@ -6768,27 +7035,50 @@ identify that control character: an uparrow followed by the character
@end ignore
-@node url, email, cite, Indicating
+@node acronym
+@subsection @code{@@acronym}@{@var{acronym}@}
+@findex acronym
+
+@cindex NASA, as acronym
+@cindex F.B.I., as acronym
+@cindex Abbreviations, tagging
+@cindex Acronyms, tagging
+Use the @code{@@acronym} command for abbreviations written in all
+capital letters, such as `@acronym{NASA}'. The abbreviation is given as
+the single argument in braces, as in @samp{@@acronym@{NASA@}}. As
+a matter of style, or for particular abbreviations, you may prefer to
+use periods, as in @samp{@@acronym@{F.B.I.@}}.
+
+In @TeX{} and HTML, the argument is printed in a slightly smaller font
+size. In Info or plain text output, this command changes nothing.
+
+
+@node url
@subsection @code{@@url}@{@var{uniform-resource-locator}@}
@findex url
@cindex Uniform resource locator, indicating
@cindex URL, indicating
-Use the @code{@@url} to indicate a uniform resource locator on the World
-Wide Web. This is analogous to @code{@@file}, @code{@@var}, etc., and
-is purely for markup purposes. It does not produce a link you can
-follow in HTML output (the @code{@@uref} command does, @pxref{uref,,
-@code{@@uref}}). It is useful for example URL's which do not actually
-exist. For example:
+Use the @code{@@url} command to indicate a uniform resource locator on
+the World Wide Web. This is analogous to @code{@@file}, @code{@@var},
+etc., and is purely for markup purposes. It does not produce a link you
+can follow in HTML output (use the @code{@@uref} command for that,
+@pxref{uref,, @code{@@uref}}). It is useful for url's which do
+not actually exist. For example:
@c Two lines because one is too long for smallbook format.
@example
-For example, the url might be
-@@url@{http://host.domain.org/path@}.
+For example, the url might be @@url@{http://example.org/path@}.
@end example
+@noindent which produces:
-@node email, , url, Indicating
+@display
+For example, the url might be @url{http://example.org/path}.
+@end display
+
+
+@node email
@subsection @code{@@email}@{@var{email-address}[, @var{displayed-text}]@}
@findex email
@@ -6807,10 +7097,10 @@ Send bug reports to @@email@{bug-texinfo@@@@gnu.org@}.
Send suggestions to the @@email@{bug-texinfo@@@@gnu.org, same place@}.
@end example
@noindent produces
-@example
+@display
Send bug reports to @email{bug-texinfo@@gnu.org}.
Send suggestions to the @email{bug-texinfo@@gnu.org, same place}.
-@end example
+@end display
@node Emphasis, , Indicating, Marking Text
@@ -6824,27 +7114,24 @@ Most often, this is the best way to mark words.
However, sometimes you will want to emphasize text without indicating a
category. Texinfo has two commands to do this. Also, Texinfo has
several commands that specify the font in which @TeX{} will typeset
-text. These commands have no affect on Info and only one of them,
+text. These commands have no effect on Info and only one of them,
the @code{@@r} command, has any regular use.@refill
@menu
* emph & strong:: How to emphasize text in Texinfo.
* Smallcaps:: How to use the small caps font.
* Fonts:: Various font commands for printed output.
-* Customized Highlighting:: How to define highlighting commands.
@end menu
-@node emph & strong, Smallcaps, Emphasis, Emphasis
-@comment node-name, next, previous, up
+@node emph & strong
@subsection @code{@@emph}@{@var{text}@} and @code{@@strong}@{@var{text}@}
@cindex Emphasizing text, font for
@findex emph
@findex strong
The @code{@@emph} and @code{@@strong} commands are for emphasis;
-@code{@@strong} is stronger. In printed output, @code{@@emph}
-produces @emph{italics} and @code{@@strong} produces
-@strong{bold}.@refill
+@code{@@strong} is stronger. In printed output, @code{@@emph} produces
+@emph{italics} and @code{@@strong} produces @strong{bold}.
@need 800
For example,
@@ -6863,7 +7150,7 @@ files in the directory.
produces the following in printed output:
@quotation
-@strong{Caution}: @code{rm * .[^.]*} removes @emph{all}
+@strong{Caution}: @samp{rm * .[^.]*} removes @emph{all}
files in the directory.
@end quotation
@@ -6876,7 +7163,7 @@ produces:
@end ifinfo
@example
- *Caution*: `rm * .[^.]*' removes *all*
+ *Caution*: `rm * .[^.]*' removes _all_
files in the directory.
@end example
@@ -6884,31 +7171,25 @@ The @code{@@strong} command is seldom used except to mark what is, in
effect, a typographical element, such as the word `Caution' in the
preceding example.
-In the Info file, both @code{@@emph} and @code{@@strong} put asterisks
-around the text.@refill
+In the Info output, @code{@@emph} surrounds the text with underscores
+(@samp{_}), and @code{@@strong} puts asterisks around the text.
@quotation
-@strong{Caution:} Do not use @code{@@emph} or @code{@@strong} with the
-word @samp{Note}; Info will mistake the combination for a cross
-reference. Use a phrase such as @strong{Please note} or
-@strong{Caution} instead.@refill
+@strong{Caution:} Do not use @code{@@strong} with the word @samp{Note};
+Info will mistake the combination for a cross reference. Use a phrase
+such as @strong{Please note} or @strong{Caution} instead.
@end quotation
-@node Smallcaps, Fonts, emph & strong, Emphasis
+
+@node Smallcaps
@subsection @code{@@sc}@{@var{text}@}: The Small Caps Font
@cindex Small caps font
@findex sc @r{(small caps font)}
-@iftex
-Use the @samp{@@sc} command to set text in the printed output in @sc{a
-small caps font} and set text in the Info file in upper case letters.@refill
-@end iftex
-@ifinfo
-Use the @samp{@@sc} command to set text in the printed output in a
-small caps font and set text in the Info file in upper case letters.@refill
-@end ifinfo
-
-Write the text between braces in lower case, like this:@refill
+Use the @samp{@@sc} command to set text in the printed and the HTML
+output in @sc{a small caps font} and set text in the Info file in upper
+case letters. Write the text you want to be in small caps (where
+possible) between braces in lower case, like this:
@example
The @@sc@{acm@} and @@sc@{ieee@} are technical societies.
@@ -6923,32 +7204,28 @@ The @sc{acm} and @sc{ieee} are technical societies.
@TeX{} typesets the small caps font in a manner that prevents the
letters from `jumping out at you on the page'. This makes small caps
-text easier to read than text in all upper case. The Info formatting
-commands set all small caps text in upper case.@refill
+text easier to read than text in all upper case---but it's usually
+better to use regular mixed case anyway. The Info formatting commands
+set all small caps text in upper case. In HTML, the text is upper-cased
+and a smaller font is used to render it.
-@ifinfo
-If the text between the braces of an @code{@@sc} command is upper case,
-@TeX{} typesets in full-size capitals. Use full-size capitals
-sparingly.@refill
-@end ifinfo
-@iftex
-If the text between the braces of an @code{@@sc} command is upper case,
-@TeX{} typesets in @sc{FULL-SIZE CAPITALS}. Use full-size capitals
-sparingly.@refill
-@end iftex
+If the text between the braces of an @code{@@sc} command is uppercase,
+@TeX{} typesets in FULL-SIZE CAPITALS. Use full-size capitals
+sparingly, if ever, and since it's redundant to mark all-uppercase text
+with @code{@@sc}, @command{makeinfo} warns about such usage.
You may also use the small caps font for a jargon word such as
-@sc{ato} (a @sc{nasa} word meaning `abort to orbit').@refill
+@sc{ato} (a @sc{nasa} word meaning `abort to orbit').
There are subtleties to using the small caps font with a jargon word
such as @sc{cdr}, a word used in Lisp programming. In this case, you
should use the small caps font when the word refers to the second and
subsequent elements of a list (the @sc{cdr} of the list), but you
should use @samp{@@code} when the word refers to the Lisp function of
-the same spelling.@refill
+the same spelling.
-@node Fonts, Customized Highlighting, Smallcaps, Emphasis
-@comment node-name, next, previous, up
+
+@node Fonts
@subsection Fonts for Printing, Not Info
@cindex Fonts for printing, not for Info
@findex i @r{(italic font)}
@@ -6992,124 +7269,7 @@ If possible, you should avoid using the other three font commands. If
you need to use one, it probably indicates a gap in the Texinfo
language.@refill
-@node Customized Highlighting, , Fonts, Emphasis
-@comment node-name, next, previous, up
-@subsection Customized Highlighting
-@cindex Highlighting, customized
-@cindex Customized highlighting
-
-@c I think this whole section is obsolete with the advent of macros
-@c --karl, 15sep96.
-You can use regular @TeX{} commands inside of @code{@@iftex} @dots{}
-@code{@@end iftex} to create your own customized highlighting commands
-for Texinfo. The easiest way to do this is to equate your customized
-commands with pre-existing commands, such as those for italics. Such
-new commands work only with @TeX{}.@refill
-
-@findex definfoenclose
-@cindex Enclosure command for Info
-You can use the @code{@@definfoenclose} command inside of
-@code{@@ifinfo} @dots{} @code{@@end ifinfo} to define commands for Info
-with the same names as new commands for @TeX{}.
-@code{@@definfoenclose} creates new commands for Info that mark text by
-enclosing it in strings that precede and follow the text.
-@footnote{Currently, @code{@@definfoenclose} works only with
-@code{texinfo-format-buffer} and @code{texinfo-format-region}, not with
-@code{makeinfo}.}@refill
-
-Here is how to create a new @@-command called @code{@@phoo} that causes
-@TeX{} to typeset its argument in italics and causes Info to display the
-argument between @samp{//} and @samp{\\}.@refill
-
-@need 1300
-For @TeX{}, write the following to equate the @code{@@phoo} command with
-the existing @code{@@i} italics command:@refill
-
-@example
-@group
-@@iftex
-@@global@@let@@phoo=@@i
-@@end iftex
-@end group
-@end example
-
-@noindent
-This defines @code{@@phoo} as a command that causes @TeX{} to typeset
-the argument to @code{@@phoo} in italics. @code{@@global@@let} tells
-@TeX{} to equate the next argument with the argument that follows the
-equals sign.
-
-@need 1300
-For Info, write the following to tell the Info formatters to enclose the
-argument between @samp{//} and @samp{\\}:
-
-@example
-@group
-@@ifinfo
-@@definfoenclose phoo, //, \\
-@@end ifinfo
-@end group
-@end example
-
-@noindent
-Write the @code{@@definfoenclose} command on a line and follow it with
-three arguments separated by commas (commas are used as separators in an
-@code{@@node} line in the same way).@refill
-
-@itemize @bullet
-@item
-The first argument to @code{@@definfoenclose} is the @@-command name
-@strong{without} the @samp{@@};
-
-@item
-the second argument is the Info start delimiter string; and,
-
-@item
-the third argument is the Info end delimiter string.
-@end itemize
-
-@noindent
-The latter two arguments enclose the highlighted text in the Info file.
-A delimiter string may contain spaces. Neither the start nor end
-delimiter is required. However, if you do not provide a start
-delimiter, you must follow the command name with two commas in a row;
-otherwise, the Info formatting commands will misinterpret the end
-delimiter string as a start delimiter string.@refill
-
-After you have defined @code{@@phoo} both for @TeX{} and for Info, you
-can then write @code{@@phoo@{bar@}} to see @samp{//bar\\}
-in Info and see
-@ifinfo
-@samp{bar} in italics in printed output.
-@end ifinfo
-@iftex
-@i{bar} in italics in printed output.
-@end iftex
-
-Note that each definition applies to its own formatter: one for @TeX{},
-the other for Info.
-
-@need 1200
-Here is another example:
-
-@example
-@group
-@@ifinfo
-@@definfoenclose headword, , :
-@@end ifinfo
-@@iftex
-@@global@@let@@headword=@@b
-@@end iftex
-@end group
-@end example
-
-@noindent
-This defines @code{@@headword} as an Info formatting command that
-inserts nothing before and a colon after the argument and as a @TeX{}
-formatting command to typeset its argument in bold.
-
-@node Quotations and Examples, Lists and Tables, Marking Text, Top
-@comment node-name, next, previous, up
+@node Quotations and Examples
@chapter Quotations and Examples
Quotations and examples are blocks of text consisting of one or more
@@ -7131,8 +7291,8 @@ line.@refill
* quotation:: How to write a quotation.
* example:: How to write an example in a fixed-width font.
* noindent:: How to prevent paragraph indentation.
-* Lisp Example:: How to illustrate Lisp code.
-* smallexample & smalllisp:: Forms for the @code{@@smallbook} option.
+* lisp:: How to illustrate Lisp code.
+* small:: Forms for @code{@@smallbook}.
* display:: How to write an example in the current font.
* format:: How to write an example that does not narrow
the margins.
@@ -7141,10 +7301,11 @@ line.@refill
* cartouche:: How to draw cartouches around examples.
@end menu
-@node Block Enclosing Commands, quotation, Quotations and Examples, Quotations and Examples
-@section The Block Enclosing Commands
+@node Block Enclosing Commands
+@section Block Enclosing Commands
-Here are commands for quotations and examples:@refill
+Here are commands for quotations and examples, explained further in the
+following sections:
@table @code
@item @@quotation
@@ -7155,28 +7316,31 @@ printed in a roman font by default.@refill
Illustrate code, commands, and the like. The text is printed
in a fixed-width font, and indented but not filled.@refill
-@item @@lisp
-Illustrate Lisp code. The text is printed in a fixed-width font,
-and indented but not filled.@refill
-
@item @@smallexample
-Illustrate code, commands, and the like. Similar to
-@code{@@example}, except that in @TeX{} this command typesets text in
-a smaller font for the smaller @code{@@smallbook} format than for the
-8.5 by 11 inch format.@refill
+Same as @code{@@example}, except that in @TeX{} this command typesets
+text in a smaller font for the @code{@@smallbook} format than for the
+default 8.5 by 11 inch format.
+
+@item @@lisp
+Like @code{@@example}, but specifically for illustrating Lisp code. The
+text is printed in a fixed-width font, and indented but not filled.
@item @@smalllisp
-Illustrate Lisp code. Similar to @code{@@lisp}, except that
-in @TeX{} this command typesets text in a smaller font for the smaller
-@code{@@smallbook} format than for the 8.5 by 11 inch format.@refill
+Is to @code{@@lisp} as @code{@@smallexample} is to @code{@@example}.
@item @@display
Display illustrative text. The text is indented but not filled, and
-no font is specified (so, by default, the font is roman).@refill
+no font is selected (so, by default, the font is roman).@refill
+
+@item @@smalldisplay
+Is to @code{@@display} as @code{@@smallexample} is to @code{@@example}.
@item @@format
-Print illustrative text. The text is not indented and not filled
-and no font is specified (so, by default, the font is roman).@refill
+Like @code{@@display} (the text is not filled and no font is selected),
+but the text is not indented.
+
+@item @@smallformat
+Is to @code{@@format} as @code{@@smallexample} is to @code{@@example}.
@end table
The @code{@@exdent} command is used within the above constructs to
@@ -7191,18 +7355,16 @@ paragraph.@refill
You can use the @code{@@cartouche} command within one of the above
constructs to highlight the example or quotation by drawing a box with
-rounded corners around it. (The @code{@@cartouche} command affects
-only the printed manual; it has no effect in the Info file; see
-@ref{cartouche, , Drawing Cartouches Around Examples}.)@refill
+rounded corners around it. @xref{cartouche, , Drawing Cartouches Around
+Examples}.
-@node quotation, example, Block Enclosing Commands, Quotations and Examples
-@comment node-name, next, previous, up
+
+@node quotation
@section @code{@@quotation}
@cindex Quotations
@findex quotation
-The text of a quotation is
-processed normally except that:@refill
+The text of a quotation is processed normally except that:
@itemize @bullet
@item
@@ -7244,8 +7406,8 @@ produces
This is a foo.
@end quotation
-@node example, noindent, quotation, Quotations and Examples
-@comment node-name, next, previous, up
+
+@node example
@section @code{@@example}
@cindex Examples, formatting them
@cindex Formatting examples
@@ -7271,10 +7433,9 @@ obtained by indenting each line with five spaces.
@end example
Write an @code{@@example} command at the beginning of a line by itself.
-This line will disappear from the output. Mark the end of the example
+Mark the end of the example
with an @code{@@end example} command, also written at the beginning of a
-line by itself. The @code{@@end example} will disappear from the
-output.@refill
+line by itself.@refill
@need 700
For example,
@@ -7292,12 +7453,14 @@ produces
mv foo bar
@end example
-Since the lines containing @code{@@example} and @code{@@end example}
-will disappear, you should put a blank line before the
-@code{@@example} and another blank line after the @code{@@end
-example}. (Remember that blank lines between the beginning
+The lines containing @code{@@example} and @code{@@end example}
+will disappear from the output.
+To make the output look good,
+you should put a blank line before the
+@code{@@example} and another blank line after the @code{@@end example}.
+Note that blank lines inside the beginning
@code{@@example} and the ending @code{@@end example} will appear in
-the output.)@refill
+the output.@refill
@quotation
@strong{Caution:} Do not use tabs in the lines of an example (or anywhere
@@ -7308,7 +7471,7 @@ convert tabs in a region to multiple spaces.)@refill
@end quotation
Examples are often, logically speaking, ``in the middle'' of a
-paragraph, and the text continues after an example should not be
+paragraph, and the text that continues after an example should not be
indented. The @code{@@noindent} command prevents a piece of text from
being indented as if it were a new paragraph.
@ifinfo
@@ -7319,8 +7482,8 @@ being indented as if it were a new paragraph.
embedded within sentences, not set off from preceding and following
text. @xref{code, , @code{@@code}}.)
-@node noindent, Lisp Example, example, Quotations and Examples
-@comment node-name, next, previous, up
+
+@node noindent
@section @code{@@noindent}
@findex noindent
@@ -7377,11 +7540,11 @@ Do not put braces after an @code{@@noindent} command; they are not
necessary, since @code{@@noindent} is a command used outside of
paragraphs (@pxref{Command Syntax}).@refill
-@node Lisp Example, smallexample & smalllisp, noindent, Quotations and Examples
-@comment node-name, next, previous, up
+
+@node lisp
@section @code{@@lisp}
-@cindex Lisp example
@findex lisp
+@cindex Lisp example
The @code{@@lisp} command is used for Lisp code. It is synonymous
with the @code{@@example} command.
@@ -7396,44 +7559,43 @@ regarding the nature of the example. This is useful, for example, if
you write a function that evaluates only and all the Lisp code in a
Texinfo file. Then you can use the Texinfo file as a Lisp
library.@footnote{It would be straightforward to extend Texinfo to work
-in a similar fashion for C, Fortran, or other languages.}@refill
+in a similar fashion for C, Fortran, or other languages.}
Mark the end of @code{@@lisp} with @code{@@end lisp} on a line by
itself.@refill
-@node smallexample & smalllisp, display, Lisp Example, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@smallexample} and @code{@@smalllisp}
+
+@node small
+@section @code{@@small@dots{}} Block Commands
@cindex Small book example
@cindex Example for a small book
@cindex Lisp example for a small book
+@findex smalldisplay
@findex smallexample
+@findex smallformat
@findex smalllisp
In addition to the regular @code{@@example} and @code{@@lisp} commands,
-Texinfo has two other ``example-style'' commands. These are the
-@code{@@smallexample} and @code{@@smalllisp} commands. Both these
-commands are designed for use with the @code{@@smallbook} command that
-causes @TeX{} to produce a printed manual in a 7 by 9.25 inch format
-rather than the regular 8.5 by 11 inch format.@refill
-
-In @TeX{}, the @code{@@smallexample} and @code{@@smalllisp} commands
-typeset text in a smaller font for the smaller @code{@@smallbook}
-format than for the 8.5 by 11 inch format. Consequently, many examples
-containing long lines fit in a narrower, @code{@@smallbook} page
-without needing to be shortened. Both commands typeset in the normal
-font size when you format for the 8.5 by 11 inch size; indeed,
-in this situation, the @code{@@smallexample} and @code{@@smalllisp}
-commands are defined to be the @code{@@example} and @code{@@lisp}
-commands.@refill
-
-In Info, the @code{@@smallexample} and @code{@@smalllisp} commands are
-equivalent to the @code{@@example} and @code{@@lisp} commands, and work
-exactly the same.@refill
-
-Mark the end of @code{@@smallexample} or @code{@@smalllisp} with
-@code{@@end smallexample} or @code{@@end smalllisp},
-respectively.@refill
+Texinfo has ``small'' example-style commands. These are
+@code{@@smalldisplay}, @code{@@smallexample}, @code{@@smallformat}, and
+@code{@@smalllisp}. All of these commands are designed for use with the
+@code{@@smallbook} command (which causes @TeX{} to format a printed book for
+a 7 by 9.25 inch trim size rather than the default 8.5 by 11 inch size).
+
+In @TeX{}, the @code{@@small@dots{}} commands typeset text in a smaller
+font for the smaller @code{@@smallbook} format than for the 8.5 by 11
+inch format. Consequently, many examples containing long lines fit in a
+narrower, @code{@@smallbook} page without needing to be shortened. Both
+commands typeset in the normal font size when you format for the 8.5 by
+11 inch size. Indeed, in this situation, the @code{@@small@dots{}}
+commands are equivalent to their non-small versions.
+
+In Info, the @code{@@small@dots{}} commands are also equivalent to their
+non-small companion commands.
+
+Mark the end of an @code{@@small@dots{}} block with a corresponding
+@code{@@end small@dots{}}. For example, pair @code{@@smallexample} with
+@code{@@end smallexample}.
@iftex
Here is an example written in the small font used by the
@@ -7444,7 +7606,7 @@ Here is an example written in the small font used by the
@tex
% Remove extra vskip; this is a kludge to counter the effect of display
\vskip-3\baselineskip
-{\ninett
+{\smalltt
\dots{} to make sure that you have the freedom to
distribute copies of free software (and charge for
this service if you wish), that you receive source
@@ -7474,21 +7636,21 @@ this text appears in a smaller font.
@end smallexample
@end ifinfo
-The @code{@@smallexample} and @code{@@smalllisp} commands make it
-easier to prepare smaller format manuals without forcing you to edit
-examples by hand to fit them onto narrower pages.@refill
+The @code{@@small@dots{}} commands make it easier to prepare smaller
+format manuals without forcing you to edit examples by hand to fit them
+onto narrower pages.@refill
-As a general rule, a printed document looks better if you write all the
-examples in a chapter consistently in @code{@@example} or in
-@code{@@smallexample}. Only occasionally should you mix the two
-formats.@refill
+As a general rule, a printed document looks better if you use only one
+of (for example) @code{@@example} or in @code{@@smallexample}
+consistently within a chapter. Only occasionally should you mix the two
+formats.
@xref{smallbook, , Printing ``Small'' Books}, for more information
about the @code{@@smallbook} command.@refill
-@node display, format, smallexample & smalllisp, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@display}
+
+@node display
+@section @code{@@display} and @code{@@smalldisplay}
@cindex Display formatting
@findex display
@@ -7506,9 +7668,14 @@ and an @code{@@end display} command. The @code{@@display} command
indents the text, but does not fill it.
@end display
-@node format, exdent, display, Quotations and Examples
-@comment node-name, next, previous, up
-@section @code{@@format}
+@findex smalldisplay
+Texinfo also provides a command @code{@@smalldisplay}, which is like
+@code{@@display} but uses a smaller font in @code{@@smallbook} format.
+@xref{small}.
+
+
+@node format
+@section @code{@@format} and @code{@@smallformat}
@findex format
The @code{@@format} command is similar to @code{@@example} except
@@ -7522,7 +7689,14 @@ from this example,
the @code{@@format} command does not fill the text.
@end format
-@node exdent, flushleft & flushright, format, Quotations and Examples
+@findex smallformat
+Texinfo also provides a command @code{@@smallformat}, which is like
+@code{@@format} but uses a smaller font in @code{@@smallbook} format.
+@xref{small}.
+
+
+
+@node exdent
@section @code{@@exdent}: Undoing a Line's Indentation
@cindex Indentation undoing
@findex exdent
@@ -7632,8 +7806,8 @@ further highlight an example or quotation. For instance, you could
write a manual in which one type of example is surrounded by a cartouche
for emphasis.@refill
-The @code{@@cartouche} command affects only the printed manual; it has
-no effect in the Info file.@refill
+@code{@@cartouche} affects only the printed manual; it has no effect in
+other output files.
@need 1500
For example,
@@ -7685,8 +7859,8 @@ the first column; multi-column tables are also supported.
* Multi-column Tables:: How to construct generalized tables.
@end menu
-@ifinfo
@node Introducing Lists, itemize, Lists and Tables, Lists and Tables
+@ifinfo
@heading Introducing Lists
@end ifinfo
@@ -7755,12 +7929,12 @@ Enumerated lists, using numbers or letters.
@item @@table
@itemx @@ftable
@itemx @@vtable
-Two-column tables with indexing.
+Two-column tables, optionally with indexing.
@end table
-@node itemize, enumerate, Introducing Lists, Lists and Tables
-@comment node-name, next, previous, up
-@section Making an Itemized List
+
+@node itemize
+@section @code{@@itemize}: Making an Itemized List
@cindex Itemization
@findex itemize
@@ -7768,23 +7942,26 @@ The @code{@@itemize} command produces sequences of indented
paragraphs, with a bullet or other mark inside the left margin
at the beginning of each paragraph for which such a mark is desired.@refill
+@cindex @code{@@w}, for blank items
Begin an itemized list by writing @code{@@itemize} at the beginning of
a line. Follow the command, on the same line, with a character or a
Texinfo command that generates a mark. Usually, you will write
@code{@@bullet} after @code{@@itemize}, but you can use
-@code{@@minus}, or any character or any special symbol that results in
-a single character in the Info file. (When you write @code{@@bullet}
-or @code{@@minus} after an @code{@@itemize} command, you may omit the
-@samp{@{@}}.)@refill
+@code{@@minus}, or any command or character that results in a single
+character in the Info file. If you don't want any mark at all, use
+@code{@@w}. (When you write the mark command such as
+@code{@@bullet} after an @code{@@itemize} command, you may omit the
+@samp{@{@}}.) If you don't specify a mark command, the default is
+@code{@@bullet}.
Write the text of the indented paragraphs themselves after the
@code{@@itemize}, up to another line that says @code{@@end
itemize}.@refill
-Before each paragraph for which a mark in the margin is desired, write
-a line that says just @code{@@item}. Do not write any other text on this
-line.@refill
@findex item
+Before each paragraph for which a mark in the margin is desired, write a
+line that says just @code{@@item}. It is ok to have text following the
+@code{@@item}.
Usually, you should put a blank line before an @code{@@item}. This
puts a blank line in the Info file. (@TeX{} inserts the proper
@@ -7792,8 +7969,8 @@ interline whitespace in either case.) Except when the entries are
very brief, these blank lines make the list look better.@refill
Here is an example of the use of @code{@@itemize}, followed by the
-output it produces. Note that @code{@@bullet} produces an @samp{*} in
-Info and a round dot in @TeX{}.@refill
+output it produces. @code{@@bullet} produces an @samp{*} in Info and a
+round dot in @TeX{}.
@example
@group
@@ -7866,9 +8043,9 @@ Second outer item.
@end itemize
@end quotation
-@node enumerate, Two-column Tables, itemize, Lists and Tables
-@comment node-name, next, previous, up
-@section Making a Numbered or Lettered List
+
+@node enumerate
+@section @code{@@enumerate}: Making a Numbered or Lettered List
@cindex Enumeration
@findex enumerate
@@ -7882,18 +8059,18 @@ letter as an option. Without an argument, @code{@@enumerate} starts the
list with the number @samp{1}. With a numeric argument, such as
@samp{3}, the command starts the list with that number. With an upper
or lower case letter, such as @samp{a} or @samp{A}, the command starts
-the list with that letter.@refill
+the list with that letter.
Write the text of the enumerated list in the same way you write an
itemized list: put @code{@@item} on a line of its own before the start
of each paragraph that you want enumerated. Do not write any other text
-on the line beginning with @code{@@item}.@refill
+on the line beginning with @code{@@item}.
You should put a blank line between entries in the list.
-This generally makes it easier to read the Info file.@refill
+This generally makes it easier to read the Info file.
@need 1500
-Here is an example of @code{@@enumerate} without an argument:@refill
+Here is an example of @code{@@enumerate} without an argument:
@example
@group
@@ -8000,8 +8177,8 @@ exhibits, and command-line option summaries.
* itemx:: How to put more entries in the first column.
@end menu
-@ifinfo
@node table, ftable vtable, Two-column Tables, Two-column Tables
+@ifinfo
@subheading Using the @code{@@table} Command
Use the @code{@@table} command to produce two-column tables.@refill
@@ -8030,6 +8207,7 @@ commands output the first column entries without added highlighting
listed here. However, you can only use commands that normally take
arguments in braces.)@refill
+@findex item
Begin each table entry with an @code{@@item} command at the beginning
of a line. Write the first column text on the same line as the
@code{@@item} command. Write the second column text on the line
@@ -8037,8 +8215,7 @@ following the @code{@@item} line and on subsequent lines. (You do not
need to type anything for an empty second column entry.) You may
write as many lines of supporting text as you wish, even several
paragraphs. But only text on the same line as the @code{@@item} will
-be placed in the first column.@refill
-@findex item
+be placed in the first column, including any footnote.
Normally, you should put a blank line before an @code{@@item} line.
This puts a blank like in the Info file. Except when the entries are
@@ -8076,8 +8253,8 @@ If you want to list two or more named items with a single block of
text, use the @code{@@itemx} command. (@xref{itemx, ,
@code{@@itemx}}.)@refill
-@node ftable vtable, itemx, table, Two-column Tables
-@comment node-name, next, previous, up
+
+@node ftable vtable
@subsection @code{@@ftable} and @code{@@vtable}
@cindex Tables with indexes
@cindex Indexing table entries automatically
@@ -8091,8 +8268,8 @@ functions and @code{@@vtable} automatically enters each of the items in
the first column of the table into the index of variables. This
simplifies the task of creating indices. Only the items on the same
line as the @code{@@item} commands are indexed, and they are indexed in
-exactly the form that they appear on that line. @xref{Indices, ,
-Creating Indices}, for more information about indices.@refill
+exactly the form that they appear on that line. @xref{Indices},
+for more information about indices.@refill
Begin a two-column table using @code{@@ftable} or @code{@@vtable} by
writing the @@-command at the beginning of a line, followed on the same
@@ -8103,8 +8280,7 @@ itself.
See the example for @code{@@table} in the previous section.
-@node itemx, , ftable vtable, Two-column Tables
-@comment node-name, next, previous, up
+@node itemx
@subsection @code{@@itemx}
@cindex Two named items for @code{@@table}
@findex itemx
@@ -8116,7 +8292,6 @@ line of its own. Use @code{@@itemx} for all but the first entry;
@code{@@itemx} command works exactly like @code{@@item} except that it
does not generate extra vertical space above the first column text.
-@need 1000
For example,
@example
@@ -8165,7 +8340,7 @@ multitable} completes the table. Details in the sections below.
* Multitable Rows:: Defining multitable rows, with examples.
@end menu
-@node Multitable Column Widths, Multitable Rows, Multi-column Tables, Multi-column Tables
+@node Multitable Column Widths
@subsection Multitable Column Widths
@cindex Multitable column widths
@cindex Column widths, defining for multitables
@@ -8190,7 +8365,7 @@ To specify column widths as fractions of the line length, write
@noindent The fractions need not add up exactly to 1.0, as these do
not. This allows you to produce tables that do not need the full line
-length.
+length. You can use a leading zero if you wish.
@item
@cindex Prototype row, column widths defined by
@@ -8220,7 +8395,7 @@ particularly likely to be useful.
@cindex Rows, of a multitable
@findex item
-@cindex tab
+@findex tab
After the @code{@@multitable} command defining the column widths (see
the previous section), you begin each row in the body of a multitable
with @code{@@item}, and separate the column entries with @code{@@tab}.
@@ -8270,9 +8445,8 @@ split that window.
@node Indices, Insertions, Lists and Tables, Top
@comment node-name, next, previous, up
-@chapter Creating Indices
+@chapter Indices
@cindex Indices
-@cindex Creating indices
Using Texinfo, you can generate indices without having to sort and
collate entries manually. In an index, the entries are listed in
@@ -8408,17 +8582,6 @@ command; that would be a spelling error.
Whichever case convention you use, please use it consistently!
-@ignore
-Concept index entries consist of English text. The usual convention
-is to capitalize the first word of each such index entry, unless that
-word is the name of a function, variable, or other such entity that
-should not be capitalized. However, if your concept index entries are
-consistently short (one or two words each) it may look better for each
-regular entry to start with a lower case letter, aside from proper
-names and acronyms that always call for upper case letters. Whichever
-convention you adapt, please be consistent!
-@end ignore
-
Entries in indices other than the concept index are symbol names in
programming languages, or program names; these names are usually
case-sensitive, so use upper and lower case as required for them.
@@ -8463,24 +8626,11 @@ Make an entry in the data type index for @var{data type}.@refill
@quotation
@strong{Caution:} Do not use a colon in an index entry. In Info, a
-colon separates the menu entry name from the node name. An extra
-colon confuses Info.
-@xref{Menu Parts, , The Parts of a Menu},
-for more information about the structure of a menu entry.@refill
+colon separates the menu entry name from the node name, so a colon in
+the entry itself confuses Info. @xref{Menu Parts, , The Parts of a
+Menu}, for more information about the structure of a menu entry.
@end quotation
-If you write several identical index entries in different places in a
-Texinfo file, the index in the printed manual will list all the pages to
-which those entries refer. However, the index in the Info file will
-list @strong{only} the node that references the @strong{first} of those
-index entries. Therefore, it is best to write indices in which each
-entry refers to only one place in the Texinfo file. Fortunately, this
-constraint is a feature rather than a loss since it means that the index
-will be easy to use. Otherwise, you could create an index that lists
-several pages for one entry and your reader would not know to which page
-to turn. If you have two identical entries for one topic, change the
-topics slightly, or qualify them to indicate the difference.@refill
-
You are not actually required to use the predefined indices for their
canonical purposes. For example, suppose you wish to index some C
preprocessor macros. You could put them in the function index along
@@ -8672,8 +8822,7 @@ You should define new indices within or right after the end-of-header
line of a Texinfo file, before any @code{@@synindex} or
@code{@@syncodeindex} commands (@pxref{Header}).@refill
-@node Insertions, Breaks, Indices, Top
-@comment node-name, next, previous, up
+@node Insertions
@chapter Special Insertions
@cindex Inserting special characters and symbols
@cindex Special insertions
@@ -8686,12 +8835,17 @@ elements that do not correspond to simple characters you can type.
These are:
@itemize @bullet
-@item Braces, @samp{@@} and periods.
+@item Braces and @samp{@@}.
@item Whitespace within and around a sentence.
@item Accents.
@item Dots and bullets.
@item The @TeX{} logo and the copyright symbol.
+@item The pounds currency symbol.
+@item The minus sign.
@item Mathematical expressions.
+@item Glyphs for evaluation, macros, errors, etc.
+@item Footnotes.
+@item Images.
@end itemize
@end iftex
@@ -8708,6 +8862,7 @@ These are:
* math:: How to format a mathematical expression.
* Glyphs:: How to indicate results of evaluation,
expansion of macros, errors, etc.
+* Footnotes:: How to include footnotes.
* Images:: How to include graphics.
@end menu
@@ -8741,7 +8896,8 @@ output.
Do not put braces after an @code{@@@@} command.
-@node Inserting Braces, , Inserting An Atsign, Braces Atsigns
+
+@node Inserting Braces
@subsection Inserting @samp{@{} and @samp{@}}with @@@{ and @@@}
@findex @{ @r{(single @samp{@{})}
@findex @} @r{(single @samp{@}})}
@@ -8756,12 +8912,11 @@ Do not put braces after either an @code{@@@{} or an @code{@@@}}
command.
-@node Inserting Space, Inserting Accents, Braces Atsigns, Insertions
+@node Inserting Space
@section Inserting Space
@cindex Inserting space
@cindex Spacing, inserting
-@cindex Whitespace, inserting
The following sections describe commands that control spacing of various
kinds within and after sentences.
@@ -8772,7 +8927,8 @@ kinds within and after sentences.
* dmn:: How to format a dimension.
@end menu
-@node Not Ending a Sentence, Ending a Sentence, Inserting Space, Inserting Space
+
+@node Not Ending a Sentence
@subsection Not Ending a Sentence
@cindex Not ending a sentence
@@ -8780,13 +8936,13 @@ kinds within and after sentences.
@cindex Periods, inserting
Depending on whether a period or exclamation point or question mark is
inside or at the end of a sentence, less or more space is inserted after
-a period in a typeset manual. Since it is not always possible for
-Texinfo to determine when a period ends a sentence and when it is used
+a period in a typeset manual. Since it is not always possible
+to determine when a period ends a sentence and when it is used
in an abbreviation, special commands are needed in some circumstances.
-(Usually, Texinfo can guess how to handle periods, so you do not need to
+Usually, Texinfo can guess how to handle periods, so you do not need to
use the special commands; you just enter a period as you would if you
were using a typewriter, which means you put two spaces after the
-period, question mark, or exclamation mark that ends a sentence.)
+period, question mark, or exclamation mark that ends a sentence.
@findex : @r{(suppress widening)}
Use the @code{@@:}@: command after a period, question mark,
@@ -8794,7 +8950,6 @@ exclamation mark, or colon that should not be followed by extra space.
For example, use @code{@@:}@: after periods that end abbreviations
which are not at the ends of sentences.
-@need 700
For example,
@example
@@ -8865,8 +9020,7 @@ In the Info file output, @code{@@.}@: is equivalent to a simple
The meanings of @code{@@:} and @code{@@.}@: in Texinfo are designed to
work well with the Emacs sentence motion commands (@pxref{Sentences,,,
-emacs, The GNU Emacs Manual}). This made it necessary for them to be
-incompatible with some other formatting systems that use @@-commands.
+emacs, The GNU Emacs Manual}).
Do not put braces after any of these commands.
@@ -8876,6 +9030,7 @@ Do not put braces after any of these commands.
@cindex Multiple spaces
@cindex Whitespace, inserting
+@cindex Space, inserting horizontal
@findex (space)
@findex (tab)
@findex (newline)
@@ -8916,7 +9071,7 @@ Other possible uses of @code{@@@kbd{SPACE}} have been subsumed by
Do not follow any of these commands with braces.
-@node dmn, , Multiple Spaces, Inserting Space
+@node dmn
@subsection @code{@@dmn}@{@var{dimension}@}: Format a Dimension
@cindex Thin space between number, dimension
@cindex Dimension formatting
@@ -8928,7 +9083,7 @@ At times, you may want to write @samp{12@dmn{pt}} or
abbreviation for the dimension. You can use the @code{@@dmn} command
to do this. On seeing the command, @TeX{} inserts just enough space
for proper typesetting; the Info formatting commands insert no space
-at all, since the Info file does not require it.@refill
+at all, since the Info file does not require it.
To use the @code{@@dmn} command, write the number and then follow it
immediately, with no intervening space, by @code{@@dmn}, and then by
@@ -8951,10 +9106,10 @@ In these cases, however, the formatters may insert a line break between
the number and the dimension, so use @code{@@w} (@pxref{w}). Also, if
you write a period after an abbreviation within a sentence, you should
write @samp{@@:} after the period to prevent @TeX{} from inserting extra
-whitespace, as shown here. @xref{Inserting Space}.
+whitespace, as shown here. @xref{Not Ending a Sentence}.
-@node Inserting Accents, Dots Bullets, Inserting Space, Insertions
+@node Inserting Accents
@section Inserting Accents
@cindex Inserting accents
@@ -8985,7 +9140,7 @@ possible, since accented characters are very common in some languages.
@findex dotaccent
@cindex Dot accent
@findex H
-@cindex Hungariam umlaut accent
+@cindex Hungarian umlaut accent
@findex ringaccent
@cindex Ring accent
@findex tieaccent
@@ -9053,22 +9208,22 @@ commonly used in languages other than English.
@cindex Es-zet
@cindex Sharp S
@cindex German S
-@multitable {@@questiondown@{@}} {oe,OE} {es-zet or sharp S}
+@multitable {x@@questiondown@{@} } {oe,OE} {es-zet or sharp S}
@item @t{@@exclamdown@{@}} @tab @exclamdown{} @tab upside-down !
@item @t{@@questiondown@{@}} @tab @questiondown{} @tab upside-down ?
-@item @t{@@aa@{@},@@AA@{@}} @tab @aa{},@AA{} @tab A,a with circle
+@item @t{@@aa@{@},@@AA@{@}} @tab @aa{},@AA{} @tab a,A with circle
@item @t{@@ae@{@},@@AE@{@}} @tab @ae{},@AE{} @tab ae,AE ligatures
@item @t{@@dotless@{i@}} @tab @dotless{i} @tab dotless i
@item @t{@@dotless@{j@}} @tab @dotless{j} @tab dotless j
@item @t{@@l@{@},@@L@{@}} @tab @l{},@L{} @tab suppressed-L,l
@item @t{@@o@{@},@@O@{@}} @tab @o{},@O{} @tab O,o with slash
-@item @t{@@oe@{@},@@OE@{@}} @tab @oe{},@OE{} @tab OE,oe ligatures
+@item @t{@@oe@{@},@@OE@{@}} @tab @oe{},@OE{} @tab oe,OE ligatures
@item @t{@@ss@{@}} @tab @ss{} @tab es-zet or sharp S
@end multitable
-@node Dots Bullets, TeX and copyright, Inserting Accents, Insertions
-@section Inserting Ellipsis, Dots, and Bullets
+@node Dots Bullets
+@section Inserting Ellipsis and Bullets
@cindex Dots, inserting
@cindex Bullets, inserting
@cindex Ellipsis, inserting
@@ -9092,9 +9247,10 @@ the braces, the formatters would be confused. @xref{Command Syntax, ,
@end menu
-@node dots, bullet, Dots Bullets, Dots Bullets
-@subsection @code{@@dots}@{@} (@dots{})
+@node dots
+@subsection @code{@@dots}@{@} (@dots{}) and @code{@@enddots}@{@} (@enddots{})
@findex dots
+@findex enddots
@cindex Inserting dots
@cindex Dots, inserting
@@ -9116,7 +9272,7 @@ the dots in the ellipsis.
@end iftex
-@node bullet, , dots, Dots Bullets
+@node bullet
@subsection @code{@@bullet}@{@} (@bullet{})
@findex bullet
@@ -9145,7 +9301,7 @@ braces.@refill
@end menu
-@node tex, copyright symbol, TeX and copyright, TeX and copyright
+@node tex
@subsection @code{@@TeX}@{@} (@TeX{})
@findex tex (command)
@@ -9153,10 +9309,10 @@ Use the @code{@@TeX@{@}} command to generate `@TeX{}'. In a printed
manual, this is a special logo that is different from three ordinary
letters. In Info, it just looks like @samp{TeX}. The
@code{@@TeX@{@}} command is unique among Texinfo commands in that the
-@kbd{T} and the @kbd{X} are in upper case.@refill
+@samp{T} and the @samp{X} are in upper case.@refill
-@node copyright symbol, , tex, TeX and copyright
+@node copyright symbol
@subsection @code{@@copyright}@{@} (@copyright{})
@findex copyright
@@ -9246,7 +9402,7 @@ remember to write the mathematical expression between one or two
@samp{$} (dollar-signs) as appropriate.
-@node Glyphs, Images, math, Insertions
+@node Glyphs
@section Glyphs for Examples
@cindex Glyphs
@@ -9303,12 +9459,12 @@ message.@refill
@menu
-* result::
-* expansion::
-* Print Glyph::
-* Error Glyph::
-* Equivalence::
-* Point Glyph::
+* result::
+* expansion::
+* Print Glyph::
+* Error Glyph::
+* Equivalence::
+* Point Glyph::
@end menu
@node result, expansion, Glyphs Summary, Glyphs
@@ -9317,6 +9473,7 @@ message.@refill
@cindex Indicating evaluation
@cindex Evaluation glyph
@cindex Value of an expression, indicating
+@findex result
Use the @code{@@result@{@}} command to indicate the result of
evaluating an expression.@refill
@@ -9344,6 +9501,7 @@ may be read as ``@code{(cdr '(1 2 3))} evaluates to @code{(2 3)}''.
@node expansion, Print Glyph, result, Glyphs
@subsection @code{@@expansion@{@}} (@expansion{}): Indicating an Expansion
@cindex Expansion, indicating it
+@findex expansion
When an expression is a macro call, it expands into a new expression.
You can indicate the result of the expansion with the
@@ -9399,6 +9557,7 @@ five spaces.@refill
@node Print Glyph, Error Glyph, expansion, Glyphs
@subsection @code{@@print@{@}} (@print{}): Indicating Printed Output
@cindex Printed output, indicating it
+@findex print
Sometimes an expression will print output during its execution. You
can indicate the printed output with the @code{@@print@{@}} command.@refill
@@ -9444,6 +9603,7 @@ In a Texinfo source file, this example is written as follows:
@node Error Glyph, Equivalence, Print Glyph, Glyphs
@subsection @code{@@error@{@}} (@error{}): Indicating an Error Message
@cindex Error message, indicating it
+@findex error
A piece of code may cause an error when you evaluate it. You can
designate the error message with the @code{@@error@{@}} command.@refill
@@ -9489,6 +9649,7 @@ Wrong type argument: integer-or-marker-p, x
@node Equivalence, Point Glyph, Error Glyph, Glyphs
@subsection @code{@@equiv@{@}} (@equiv{}): Indicating Equivalence
@cindex Equivalence, indicating it
+@findex equiv
Sometimes two expressions produce identical results. You can indicate the
exact equivalence of two forms with the @code{@@equiv@{@}} command.@refill
@@ -9522,9 +9683,10 @@ This indicates that evaluating @code{(make-sparse-keymap)} produces
identical results to evaluating @code{(list 'keymap)}.
-@node Point Glyph, , Equivalence, Glyphs
+@node Point Glyph
@subsection @code{@@point@{@}} (@point{}): Indicating Point in a Buffer
-@cindex Point, indicating it in a buffer
+@cindex Point, indicating in a buffer
+@findex point
Sometimes you need to show an example of text in an Emacs buffer. In
such examples, the convention is to include the entire contents of the
@@ -9585,17 +9747,207 @@ This is the changed @@point@{@}contents of foo.
@end example
+@node Footnotes
+@section Footnotes
+@cindex Footnotes
+@findex footnote
+
+A @dfn{footnote} is for a reference that documents or elucidates the
+primary text.@footnote{A footnote should complement or expand upon
+the primary text, but a reader should not need to read a footnote to
+understand the primary text. For a thorough discussion of footnotes,
+see @cite{The Chicago Manual of Style}, which is published by the
+University of Chicago Press.}@refill
+
+@menu
+* Footnote Commands:: How to write a footnote in Texinfo.
+* Footnote Styles:: Controlling how footnotes appear in Info.
+@end menu
+
+@node Footnote Commands
+@subsection Footnote Commands
+
+In Texinfo, footnotes are created with the @code{@@footnote} command.
+This command is followed immediately by a left brace, then by the text
+of the footnote, and then by a terminating right brace. Footnotes may
+be of any length (they will be broken across pages if necessary), but
+are usually short. The template is:
+
+@example
+ordinary text@@footnote@{@var{text of footnote}@}
+@end example
+
+As shown here, the @code{@@footnote} command should come right after the
+text being footnoted, with no intervening space; otherwise, the footnote
+marker might end up starting a line.
+
+For example, this clause is followed by a sample footnote@footnote{Here
+is the sample footnote.}; in the Texinfo source, it looks like
+this:@refill
+
+@example
+@dots{}a sample footnote@@footnote@{Here is the sample
+footnote.@}; in the Texinfo source@dots{}
+@end example
+
+In a printed manual or book, the reference mark for a footnote is a
+small, superscripted number; the text of the footnote appears at the
+bottom of the page, below a horizontal line.@refill
+
+In Info, the reference mark for a footnote is a pair of parentheses
+with the footnote number between them, like this: @samp{(1)}. The
+reference mark is followed by a cross-reference link to the footnote's
+text.
+
+In the HTML output, footnote references are marked with a small,
+superscripted number which is rendered as a hypertext link to the
+footnote text.
+
+By the way, footnotes in the argument of an @code{@@item} command for a
+@code{@@table} must be on the same line as the @code{@@item}
+(as usual). @xref{Two-column Tables}.
+
+
+@node Footnote Styles
+@subsection Footnote Styles
+
+Info has two footnote styles, which determine where the text of the
+footnote is located:@refill
+
+@itemize @bullet
+@cindex @samp{@r{End}} node footnote style
+@item
+In the `End' node style, all the footnotes for a single node
+are placed at the end of that node. The footnotes are separated from
+the rest of the node by a line of dashes with the word
+@samp{Footnotes} within it. Each footnote begins with an
+@samp{(@var{n})} reference mark.@refill
+
+@need 700
+@noindent
+Here is an example of a single footnote in the end of node style:@refill
+
+@example
+@group
+ --------- Footnotes ---------
+
+(1) Here is a sample footnote.
+@end group
+@end example
+
+@cindex @samp{@r{Separate}} footnote style
+@item
+In the `Separate' node style, all the footnotes for a single
+node are placed in an automatically constructed node of
+their own. In this style, a ``footnote reference'' follows
+each @samp{(@var{n})} reference mark in the body of the
+node. The footnote reference is actually a cross reference
+which you use to reach the footnote node.@refill
+
+The name of the node with the footnotes is constructed
+by appending @w{@samp{-Footnotes}} to the name of the node
+that contains the footnotes. (Consequently, the footnotes'
+node for the @file{Footnotes} node is
+@w{@file{Footnotes-Footnotes}}!) The footnotes' node has an
+`Up' node pointer that leads back to its parent node.@refill
+
+@noindent
+Here is how the first footnote in this manual looks after being
+formatted for Info in the separate node style:@refill
+
+@smallexample
+@group
+File: texinfo.info Node: Overview-Footnotes, Up: Overview
+
+(1) The first syllable of "Texinfo" is pronounced like "speck", not
+"hex". @dots{}
+@end group
+@end smallexample
+@end itemize
+
+A Texinfo file may be formatted into an Info file with either footnote
+style.@refill
+
+@findex footnotestyle
+Use the @code{@@footnotestyle} command to specify an Info file's
+footnote style. Write this command at the beginning of a line followed
+by an argument, either @samp{end} for the end node style or
+@samp{separate} for the separate node style.
+
+@need 700
+For example,
+
+@example
+@@footnotestyle end
+@end example
+@noindent
+or
+@example
+@@footnotestyle separate
+@end example
+
+Write an @code{@@footnotestyle} command before or shortly after the
+end-of-header line at the beginning of a Texinfo file. (If you
+include the @code{@@footnotestyle} command between the start-of-header
+and end-of-header lines, the region formatting commands will format
+footnotes as specified.)@refill
+
+If you do not specify a footnote style, the formatting commands use
+their default style. Currently, @code{texinfo-format-buffer} and
+@code{texinfo-format-region} use the `separate' style and
+@code{makeinfo} uses the `end' style.@refill
+
+@c !!! note: makeinfo's --footnote-style option overrides footnotestyle
+@ignore
+If you use @code{makeinfo} to create the Info file, the
+@samp{--footnote-style} option determines which style is used,
+@samp{end} for the end of node style or @samp{separate} for the
+separate node style. Thus, to format the Texinfo manual in the
+separate node style, you would use the following shell command:@refill
+
+@example
+makeinfo --footnote-style=separate texinfo.texi
+@end example
+
+@noindent
+To format the Texinfo manual in the end of node style, you would
+type:@refill
+
+@example
+makeinfo --footnote-style=end texinfo.texi
+@end example
+@end ignore
+@ignore
+If you use @code{texinfo-format-buffer} or
+@code{texinfo-format-region} to create the Info file, the value of the
+@code{texinfo-footnote-style} variable controls the footnote style.
+It can be either @samp{"separate"} for the separate node style or
+@samp{"end"} for the end of node style. (You can change the value of
+this variable with the @kbd{M-x edit-options} command (@pxref{Edit
+Options, , Editing Variable Values, emacs, The GNU Emacs Manual}), or
+with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining
+and Setting Variables, emacs, The GNU Emacs Manual}).@refill
+
+The @code{texinfo-footnote-style} variable also controls the style if
+you use the @kbd{M-x makeinfo-region} or @kbd{M-x makeinfo-buffer}
+command in Emacs.@refill
+@end ignore
+@ifinfo
+This chapter contains two footnotes.@refill
+@end ifinfo
+
+
@c this should be described with figures when we have them
@c perhaps in the quotation/example chapter.
-@node Images, , Glyphs, Insertions
+@node Images
@section Inserting Images
@cindex Images, inserting
@cindex Pictures, inserting
@findex image
-You can insert an image in an external file with the @code{@@image}
-command:
+You can insert an image given in an external file with the
+@code{@@image} command:
@example
@@image@{@var{filename}, @r{[}@var{width}@r{]}, @r{[}@var{height}@r{]}@}
@@ -9605,17 +9957,32 @@ command:
@cindex Image formats
The @var{filename} argument is mandatory, and must not have an
extension, because the different processors support different formats:
+@itemize @bullet
+@item
@TeX{} reads the file @file{@var{filename}.eps} (Encapsulated PostScript
-format); @code{makeinfo} uses @file{@var{filename}.txt} verbatim for
-Info output (more or less as if it was an @code{@@example}). HTML
-output requires @file{@var{filename}.jpg}.
+format).
+@item
+@pindex pdftex@r{, and images}
+PDF@TeX{} reads @file{@var{filename}.pdf} (Adobe's Portable Document Format).
+@item
+@code{makeinfo} uses @file{@var{filename}.txt} verbatim for
+Info output (more or less as if it was an @code{@@example}).
+@item
+@cindex GIF, unsupported due to patents
+@cindex PNG image format
+@cindex JPEG image format
+@code{makeinfo} producing HTML output tries @file{@var{filename}.png};
+if that does not exist, it tries @file{@var{filename}.jpg}. If that
+does not exist either, it complains. (We cannot support GIF format due
+to patents.)
+@end itemize
@cindex Width of images
@cindex Height of images
@cindex Aspect ratio of images
@cindex Distorting images
The optional @var{width} and @var{height} arguments specify the size to
-scale the image to (they are ignored for Info output). If they are both
+scale the image to (they are ignored for Info output). If neither is
specified, the image is presented in its natural size (given in the
file); if only one is specified, the other is scaled proportionately;
and if both are specified, both are respected, thus possibly distorting
@@ -9665,12 +10032,19 @@ inch vertically, with the width scaled proportionately:
@pindex epsf.tex
For @code{@@image} to work with @TeX{}, the file @file{epsf.tex} must be
-installed somewhere that @TeX{} can find it. This file is included in
-the Texinfo distribution and is available from
-@uref{ftp://ftp.tug.org/tex/epsf.tex}.
+installed somewhere that @TeX{} can find it. (The standard location is
+@file{@var{texmf}/tex/generic/dvips/epsf.tex}, where @var{texmf} is a
+root of your @TeX{} directory tree.) This file is included in the
+Texinfo distribution and is available from
+@uref{ftp://tug.org/tex/epsf.tex}.
+
+@code{@@image} can be used within a line as well as for displayed
+figures. Therefore, if you intend it to be displayed, be sure to leave
+a blank line before the command, or the output will run into the
+preceding text.
-@node Breaks, Definition Commands, Insertions, Top
+@node Breaks
@chapter Making and Preventing Breaks
@cindex Making line and page breaks
@cindex Preventing line and page breaks
@@ -9700,13 +10074,10 @@ commands.@refill
* need:: Another way to prevent unwanted page breaks.
@end menu
-@ifinfo
@node Break Commands, Line Breaks, Breaks, Breaks
-@heading The Break Commands
+@ifinfo
+@heading Break Commands
@end ifinfo
-@iftex
-@sp 1
-@end iftex
The break commands create or allow line and paragraph breaks:@refill
@@ -9839,8 +10210,7 @@ words match exactly, so give all necessary variants.
Info output is not hyphenated, so these commands have no effect there.
-@node w, sp, - and hyphenation, Breaks
-@comment node-name, next, previous, up
+@node w
@section @code{@@w}@{@var{text}@}: Prevent Line Breaks
@findex w @r{(prevent line break)}
@cindex Line breaks, preventing
@@ -9851,38 +10221,40 @@ within @var{text}.@refill
You can use the @code{@@w} command to prevent @TeX{} from automatically
hyphenating a long name or phrase that happens to fall near the end of a
-line.@refill
+line. For example:
@example
-You can copy GNU software from @@w@{@@samp@{ftp.gnu.ai.mit.edu@}@}.
+You can copy GNU software from @@w@{@@samp@{ftp.gnu.org@}@}.
@end example
@noindent
produces
@quotation
-You can copy GNU software from @w{@samp{ftp.gnu.ai.mit.edu}}.
+You can copy GNU software from @w{@samp{ftp.gnu.org}}.
@end quotation
-@quotation
-@strong{Caution:} Do not write an @code{@@refill} command at the end
-of a paragraph containing an @code{@@w} command; it will cause the
-paragraph to be refilled and may thereby negate the effect of the
-@code{@@w} command.@refill
-@end quotation
+@cindex Non-breakable space
+@cindex Unbreakable space
+@cindex Tied space
+You can also use @code{@@w} to produce a non-breakable space:
-@node sp, page, w, Breaks
-@comment node-name, next, previous, up
+@example
+None of the formatters will break at this@@w@{ @}space.
+@end example
+
+
+@node sp
@section @code{@@sp} @var{n}: Insert Blank Lines
@findex sp @r{(line spacing)}
-@cindex Spaces (blank lines)
+@cindex Space, inserting vertical
@cindex Blank lines
@cindex Line spacing
A line beginning with and containing only @code{@@sp @var{n}}
generates @var{n} blank lines of space in both the printed manual and
the Info file. @code{@@sp} also forces a paragraph break. For
-example,@refill
+example,
@example
@@sp 2
@@ -10028,7 +10400,8 @@ This paragraph is preceded by @dots{}
The @code{@@need} command is useful for preventing orphans (single
lines at the bottoms of printed pages).@refill
-@node Definition Commands, Footnotes, Breaks, Top
+
+@node Definition Commands
@chapter Definition Commands
@cindex Definition commands
@@ -10287,7 +10660,7 @@ produces
These two search commands are similar except @dots{}
@end deffn
-Each of the other definition commands has an `x' form: @code{@@defunx},
+Each definition command has an `x' form: @code{@@defunx},
@code{@@defvrx}, @code{@@deftypefunx}, etc.
The `x' forms work just like @code{@@itemx}; see @ref{itemx, , @code{@@itemx}}.
@@ -10434,8 +10807,8 @@ something like a variable---an entity that records a value. You must
choose a term to describe the category of entity being defined; for
example, ``Variable'' could be used if the entity is a variable.
Write the @code{@@defvr} command at the beginning of a line and
-followed it on the same line by the category of the entity and the
-name of the entity.@refill
+follow it on the same line by the category of the entity and the
+name of the entity.
Capitalize the category name like a title. If the name of the category
contains spaces, as in the name ``User Option'', enclose it in braces.
@@ -10798,7 +11171,7 @@ The template is:
@var{name}.@refill
@end table
-@node Abstract Objects, Data Types, Typed Variables, Def Cmds in Detail
+@node Abstract Objects
@subsection Object-Oriented Programming
Here are the commands for formatting descriptions about abstract
@@ -10833,8 +11206,7 @@ name. Thus,@refill
illustrates how you would write the first line of a definition of the
@code{border-pattern} class option of the class @code{Window}.@refill
-The template is
-
+The template is:
@example
@group
@@defcv @var{category} @var{class} @var{name}
@@ -10852,7 +11224,6 @@ variables in object-oriented programming. @code{@@defivar} is
equivalent to @samp{@@defcv @{Instance Variable@} @dots{}}@refill
The template is:
-
@example
@group
@@defivar @var{class} @var{instance-variable-name}
@@ -10863,12 +11234,20 @@ The template is:
@code{@@defivar} creates an entry in the index of variables.
+@findex deftypeivar
+@item @@deftypeivar @var{class} @var{data-type} @var{name}
+The @code{@@deftypeivar} command is the definition command for typed
+instance variables in object-oriented programming. It is similar to
+@code{@@defivar} with the addition of the @var{data-type} parameter to
+specify the type of the instance variable. @code{@@deftypeivar} creates an
+entry in the index of variables.
+
@findex defop
@item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
The @code{@@defop} command is the general definition command for
entities that may resemble methods in object-oriented programming.
-These entities take arguments, as functions do, but are associated
-with particular classes of objects.@refill
+These entities take arguments, as functions do, but are associated with
+particular classes of objects.@refill
For example, some systems have constructs called @dfn{wrappers} that
are associated with classes as methods are, but that act more like
@@ -10900,10 +11279,7 @@ is followed on the same line by the overall name of the category of
operation, the name of the class of the operation, the name of the
operation, and its arguments, if any.@refill
-@need 800
-@noindent
The template is:
-
@example
@group
@@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
@@ -10915,23 +11291,34 @@ The template is:
@code{@@defop} creates an entry, such as `@code{expose} on
@code{windows}', in the index of functions.@refill
+@findex deftypeop
+@item @@deftypeop @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
+The @code{@@deftypeop} command is the definition command for typed
+operations in object-oriented programming. It is similar to
+@code{@@defop} with the addition of the @var{data-type} parameter to
+specify the return type of the method. @code{@@deftypeop} creates an
+entry in the index of functions.
+
@item @@defmethod @var{class} @var{name} @var{arguments}@dots{}
@findex defmethod
The @code{@@defmethod} command is the definition command for methods
in object-oriented programming. A method is a kind of function that
implements an operation for a particular class of objects and its
-subclasses. In the Lisp Machine, methods actually were functions, but
+subclasses.
+@ignore
+@c ADR: Who cares?!?
+@c KB: Oh, I don't know, I think this info is crucial!
+In the Lisp Machine, methods actually were functions, but
they were usually defined with @code{defmethod}.
+@end ignore
@code{@@defmethod} is equivalent to @samp{@@defop Method @dots{}}.
The command is written at the beginning of a line and is followed by
the name of the class of the method, the name of the method, and its
arguments, if any.@refill
-@need 800
@noindent
-For example,
-
+For example:
@example
@group
@@defmethod @code{bar-class} bar-method argument
@@ -10957,6 +11344,7 @@ The template is:
@code{@@defmethod} creates an entry, such as `@code{bar-method} on
@code{bar-class}', in the index of functions.@refill
+
@item @@deftypemethod @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
@findex defmethod
The @code{@@deftypemethod} command is the definition command for methods
@@ -10967,7 +11355,7 @@ to the @code{@@defmethod} command with the addition of the
@end table
-@node Data Types, , Abstract Objects, Def Cmds in Detail
+@node Data Types
@subsection Data Types
Here is the command for data types:@refill
@@ -11077,7 +11465,6 @@ In the Texinfo source file, this example looks like this:
@example
@group
@@defun apply function &rest arguments
-
@@code@{apply@} calls @@var@{function@} with
@@var@{arguments@}, just like @@code@{funcall@} but with one
difference: the last of @@var@{arguments@} is a list of
@@ -11112,7 +11499,7 @@ sense in @@code@{apply@}.
@group
An interesting example of using @@code@{apply@} is found
-in the description of @@code@{mapcar@}.@@refill
+in the description of @@code@{mapcar@}.
@@end defun
@end group
@end example
@@ -11125,202 +11512,29 @@ Ordinary variables and user options are described using a format like
that for functions except that variables do not take arguments.
-@node Footnotes, Conditionals, Definition Commands, Top
-@chapter Footnotes
-@cindex Footnotes
-@findex footnote
-
-A @dfn{footnote} is for a reference that documents or elucidates the
-primary text.@footnote{A footnote should complement or expand upon
-the primary text, but a reader should not need to read a footnote to
-understand the primary text. For a thorough discussion of footnotes,
-see @cite{The Chicago Manual of Style}, which is published by the
-University of Chicago Press.}@refill
-
-@menu
-* Footnote Commands:: How to write a footnote in Texinfo.
-* Footnote Styles:: Controlling how footnotes appear in Info.
-@end menu
-
-@node Footnote Commands, Footnote Styles, Footnotes, Footnotes
-@section Footnote Commands
-
-In Texinfo, footnotes are created with the @code{@@footnote} command.
-This command is followed immediately by a left brace, then by the text
-of the footnote, and then by a terminating right brace. Footnotes may
-be of any length (they will be broken across pages if necessary), but
-are usually short. The template is:
-
-@example
-ordinary text@@footnote@{@var{text of footnote}@}
-@end example
-
-As shown here, the @code{@@footnote} command should come right after the
-text being footnoted, with no intervening space; otherwise, the
-formatters the footnote mark might end up starting up a line.
-
-For example, this clause is followed by a sample
-footnote@footnote{Here is the sample footnote.}; in the Texinfo
-source, it looks like this:@refill
-
-@example
-@dots{}a sample footnote@@footnote@{Here is the sample
-footnote.@}; in the Texinfo source@dots{}
-@end example
-
-@strong{Warning:} Don't use footnotes in the argument of the
-@code{@@item} command for a @code{@@table} table. This doesn't work, and
-because of limitations of @TeX{}, there is no way to fix it. You must
-put the footnote into the body text of the table.
-
-In a printed manual or book, the reference mark for a footnote is a
-small, superscripted number; the text of the footnote appears at the
-bottom of the page, below a horizontal line.@refill
-
-In Info, the reference mark for a footnote is a pair of parentheses
-with the footnote number between them, like this: @samp{(1)}.@refill
+@node Conditionals
+@chapter Conditionally Visible Text
+@cindex Conditionally visible text
+@cindex Text, conditionally visible
+@cindex Visibility of conditional text
+@cindex If text conditionally visible
+Sometimes it is good to use different text for different output formats.
+For example, you can use the @dfn{conditional commands} to specify
+different text for the printed manual and the Info output.
-@node Footnote Styles, , Footnote Commands, Footnotes
-@section Footnote Styles
+Conditional commands may not be nested.
-Info has two footnote styles, which determine where the text of the
-footnote is located:@refill
+The conditional commands comprise the following categories.
@itemize @bullet
-@cindex @samp{@r{End}} node footnote style
+@item Commands for HTML, Info, or @TeX{}.
+@item Commands for not HTML, Info, or @TeX{}.
+@item Raw @TeX{} or HTML commands.
@item
-In the `End' node style, all the footnotes for a single node
-are placed at the end of that node. The footnotes are separated from
-the rest of the node by a line of dashes with the word
-@samp{Footnotes} within it. Each footnote begins with an
-@samp{(@var{n})} reference mark.@refill
-
-@need 700
-@noindent
-Here is an example of a single footnote in the end of node style:@refill
-
-@example
-@group
- --------- Footnotes ---------
-
-(1) Here is a sample footnote.
-@end group
-@end example
-
-@cindex @samp{@r{Separate}} footnote style
-@item
-In the `Separate' node style, all the footnotes for a single
-node are placed in an automatically constructed node of
-their own. In this style, a ``footnote reference'' follows
-each @samp{(@var{n})} reference mark in the body of the
-node. The footnote reference is actually a cross reference
-which you use to reach the footnote node.@refill
-
-The name of the node containing the footnotes is constructed
-by appending @w{@samp{-Footnotes}} to the name of the node
-that contains the footnotes. (Consequently, the footnotes'
-node for the @file{Footnotes} node is
-@w{@file{Footnotes-Footnotes}}!) The footnotes' node has an
-`Up' node pointer that leads back to its parent node.@refill
-
-@noindent
-Here is how the first footnote in this manual looks after being
-formatted for Info in the separate node style:@refill
-
-@smallexample
-@group
-File: texinfo.info Node: Overview-Footnotes, Up: Overview
-
-(1) Note that the first syllable of "Texinfo" is
-pronounced like "speck", not "hex". @dots{}
-@end group
-@end smallexample
+Substituting text for all formats, and testing if a flag is set or clear.
@end itemize
-A Texinfo file may be formatted into an Info file with either footnote
-style.@refill
-
-@findex footnotestyle
-Use the @code{@@footnotestyle} command to specify an Info file's
-footnote style. Write this command at the beginning of a line followed
-by an argument, either @samp{end} for the end node style or
-@samp{separate} for the separate node style.
-
-@need 700
-For example,
-
-@example
-@@footnotestyle end
-@end example
-@noindent
-or
-@example
-@@footnotestyle separate
-@end example
-
-Write an @code{@@footnotestyle} command before or shortly after the
-end-of-header line at the beginning of a Texinfo file. (If you
-include the @code{@@footnotestyle} command between the start-of-header
-and end-of-header lines, the region formatting commands will format
-footnotes as specified.)@refill
-
-If you do not specify a footnote style, the formatting commands use
-their default style. Currently, @code{texinfo-format-buffer} and
-@code{texinfo-format-region} use the `separate' style and
-@code{makeinfo} uses the `end' style.@refill
-
-@c !!! note: makeinfo's --footnote-style option overrides footnotestyle
-@ignore
-If you use @code{makeinfo} to create the Info file, the
-@samp{--footnote-style} option determines which style is used,
-@samp{end} for the end of node style or @samp{separate} for the
-separate node style. Thus, to format the Texinfo manual in the
-separate node style, you would use the following shell command:@refill
-
-@example
-makeinfo --footnote-style=separate texinfo.texi
-@end example
-
-@noindent
-To format the Texinfo manual in the end of node style, you would
-type:@refill
-
-@example
-makeinfo --footnote-style=end texinfo.texi
-@end example
-@end ignore
-@ignore
-If you use @code{texinfo-format-buffer} or
-@code{texinfo-format-region} to create the Info file, the value of the
-@code{texinfo-footnote-style} variable controls the footnote style.
-It can be either @samp{"separate"} for the separate node style or
-@samp{"end"} for the end of node style. (You can change the value of
-this variable with the @kbd{M-x edit-options} command (@pxref{Edit
-Options, , Editing Variable Values, emacs, The GNU Emacs Manual}), or
-with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining
-and Setting Variables, emacs, The GNU Emacs Manual}).@refill
-
-The @code{texinfo-footnote-style} variable also controls the style if
-you use the @kbd{M-x makeinfo-region} or @kbd{M-x makeinfo-buffer}
-command in Emacs.@refill
-@end ignore
-This chapter contains two footnotes.@refill
-
-
-@node Conditionals, Macros, Footnotes, Top
-@comment node-name, next, previous, up
-@chapter Conditionally Visible Text
-@cindex Conditionally visible text
-@cindex Text, conditionally visible
-@cindex Visibility of conditional text
-@cindex If text conditionally visible
-
-Sometimes it is good to use different text for a printed manual and
-its corresponding Info file. In this case, you can use the
-@dfn{conditional commands} to specify which text is for the printed manual
-and which is for the Info file.@refill
-
@menu
* Conditional Commands:: Specifying text for HTML, Info, or @TeX{}.
* Conditional Not Commands:: Specifying text for not HTML, Info, or @TeX{}.
@@ -11330,21 +11544,18 @@ and which is for the Info file.@refill
flag to a string that you can insert.
@end menu
-@node Conditional Commands, Conditional Not Commands, Conditionals, Conditionals
-@ifinfo
-@heading Conditional Commands
-@end ifinfo
+
+@node Conditional Commands
+@section Conditional Commands
@findex ifinfo
-@code{@@ifinfo} begins segments of text that should be ignored
-by @TeX{} when it
-typesets the printed manual. The segment of text appears only
-in the Info file.
-The @code{@@ifinfo} command should appear on a line by itself; end
-the Info-only text with a line containing @code{@@end ifinfo} by
-itself. At the beginning of a Texinfo file, the Info permissions are
-contained within a region marked by @code{@@ifinfo} and @code{@@end
-ifinfo}. (@xref{Info Summary and Permissions}.)@refill
+@code{@@ifinfo} begins segments of text that should be ignored by @TeX{}
+when it typesets the printed manual. The segment of text appears only
+in the Info file. The @code{@@ifinfo} command should appear on a line
+by itself; end the Info-only text with a line containing @code{@@end
+ifinfo} by itself. At the beginning of a Texinfo file, the Info
+permissions are contained within a region marked by @code{@@ifinfo} and
+@code{@@end ifinfo}. (@xref{Info Summary and Permissions}.)
@findex iftex
@findex ifhtml
@@ -11363,6 +11574,9 @@ This text will appear only in the printed manual.
@@ifinfo
However, this text will appear only in Info.
@@end ifinfo
+@@ifhtml
+And this text will only appear in HTML.
+@@end ifhtml
@end example
@noindent
@@ -11373,18 +11587,16 @@ This text will appear only in the printed manual.
@ifinfo
However, this text will appear only in Info.
@end ifinfo
+@ifhtml
+And this text will only appear in HTML.
+@end ifhtml
@noindent
-Note how you only see one of the two lines, depending on whether you
-are reading the Info version or the printed version of this
-manual.@refill
-
-The @code{@@titlepage} command is a special variant of @code{@@iftex} that
-is used for making the title and copyright pages of the printed
-manual. (@xref{titlepage, , @code{@@titlepage}}.) @refill
+Notice that you only see one of the input lines, depending on which
+version of the manual you are reading.
-@node Conditional Not Commands, Raw Formatter Commands, Conditional Commands, Conditionals
+@node Conditional Not Commands
@section Conditional Not Commands
@findex ifnothtml
@findex ifnotinfo
@@ -11405,7 +11617,8 @@ If the output file is not being made for the given format, the region is
included. Otherwise, it is ignored.
The regions delimited by these commands are ordinary Texinfo source as
-with @code{@@iftex}, not raw formatter source as with @code{@@tex}.
+with @code{@@iftex}, not raw formatter source as with @code{@@tex}
+(@pxref{Raw Formatter Commands}).
@node Raw Formatter Commands, set clear value, Conditional Not Commands, Conditionals
@@ -11437,8 +11650,8 @@ overridden by Texinfo features.
You can enter plain @TeX{} completely, and use @samp{\} in the @TeX{}
commands, by delineating a region with the @code{@@tex} and @code{@@end
tex} commands. (The @code{@@tex} command also causes Info to ignore the
-region, like the @code{@@iftex} command.) The sole exception is that
-@code{@@} chracter still introduces a command, so that @code{@@end tex}
+region, like the @code{@@iftex} command.) The sole exception is that the
+@code{@@} character still introduces a command, so that @code{@@end tex}
can be recognized properly.
@cindex Mathematical expressions
@@ -11472,13 +11685,12 @@ $$ \chi^2 = \sum_{i=1}^N
@findex html
Analogously, you can use @code{@@ifhtml @dots{} @@end ifhtml} to delimit
a region to be included in HTML output only, and @code{@@html @dots{}
-@@end ifhtml} for a region of raw HTML (again, except that @code{@@} is
+@@end html} for a region of raw HTML (again, except that @code{@@} is
still the escape character, so the @code{@@end} command can be
recognized.)
-@node set clear value, , Raw Formatter Commands, Conditionals
-@comment node-name, next, previous, up
+@node set clear value
@section @code{@@set}, @code{@@clear}, and @code{@@value}
You can direct the Texinfo formatting commands to format or ignore parts
@@ -11493,12 +11705,12 @@ insert the date in several places in the Texinfo file.@refill
@menu
* ifset ifclear:: Format a region if a flag is set.
-* value:: Replace a flag with a string.
+* set value:: Expand a flag variable to a string.
* value Example:: An easy way to update edition information.
@end menu
-@node ifset ifclear, value, set clear value, set clear value
+@node ifset ifclear
@subsection @code{@@ifset} and @code{@@ifclear}
@findex ifset
@@ -11508,8 +11720,10 @@ ifset} commands. When the @var{flag} is cleared, the Texinfo formatting
commands do @emph{not} format the text.
Use the @code{@@set @var{flag}} command to turn on, or @dfn{set}, a
-@var{flag}; a @dfn{flag} can be any single word. The format for the
-command looks like this:@refill
+@var{flag}; a @dfn{flag} name can be any single word, containing
+letters, numerals, hyphens, or underscores.
+
+The format for the command looks like this:@refill
@findex set
@example
@@ -11613,13 +11827,17 @@ format the text up to the following @code{@@end ifclear}
command.@refill
@end table
-@node value, value Example, ifset ifclear, set clear value
-@subsection @code{@@value}
+
+@node set value
+@subsection @code{@@set} and @code{@@value}
@findex value
You can use the @code{@@set} command to specify a value for a flag,
-which is expanded by the @code{@@value} command. The value is a string
-a characters.
+which is expanded by the @code{@@value} command. A flag is an
+identifier; for best results, use only letters and numerals in a flag
+name, not @samp{-} or @samp{_}---they will work in some contexts, but
+not all, due to limitations in @TeX{}. The value is just a string of
+characters, the remainder of the input line.
Write the @code{@@set} command like this:
@@ -11628,12 +11846,11 @@ Write the @code{@@set} command like this:
@end example
@noindent
-This sets the value of @code{foo} to ``This is a string.''
-
-The Texinfo formatters replace an @code{@@value@{@var{flag}@}} command with
-the string to which @var{flag} is set.@refill
+This sets the value of the flag @code{foo} to ``This is a string.''.
-Thus, when @code{foo} is set as shown above, the Texinfo formatters convert
+The Texinfo formatters then replace an @code{@@value@{@var{flag}@}}
+command with the string to which @var{flag} is set. Thus, when
+@code{foo} is set as shown above, the Texinfo formatters convert
@example
@group
@@ -11655,9 +11872,9 @@ If you write the @code{@@set} command like this:
@noindent
without specifying a string, the value of @code{foo} is an empty string.
-If you clear a previously set flag with an @code{@@clear @var{flag}}
-command, a subsequent @code{@@value@{flag@}} command is invalid and the
-string is replaced with an error message that says @samp{@{No value for
+If you clear a previously set flag with @code{@@clear @var{flag}}, a
+subsequent @code{@@value@{flag@}} command is invalid and the string is
+replaced with an error message that says @samp{@{No value for
"@var{flag}"@}}.
For example, if you set @code{foo} as follows:@refill
@@ -11694,15 +11911,16 @@ It is a @{No value for "how-much"@} wet day.
@end group
@end example
-@node value Example, , value, set clear value
+
+@node value Example
@subsection @code{@@value} Example
You can use the @code{@@value} command to limit the number of places you
-need to change when you record an update to a manual.
-Here is how it is done in @cite{The GNU Make Manual}:
+need to change when you record an update to a manual. Here is how it is
+done in @cite{The GNU Make Manual}:
-@need 1000
-@noindent
+@enumerate
+@item
Set the flags:
@example
@@ -11714,8 +11932,7 @@ Set the flags:
@end group
@end example
-@need 750
-@noindent
+@item
Write text for the first @code{@@ifinfo} section, for people reading the
Texinfo file:
@@ -11724,12 +11941,11 @@ Texinfo file:
This is Edition @@value@{EDITION@},
last updated @@value@{UPDATED@},
of @@cite@{The GNU Make Manual@},
-for @@code@{make@}, Version @@value@{VERSION@}.
+for @@code@{make@}, version @@value@{VERSION@}.
@end group
@end example
-@need 1000
-@noindent
+@item
Write text for the title page, for people reading the printed manual:
@c List only the month and the year since that looks less fussy on a
@c printed cover than a date that lists the day as well.
@@ -11747,8 +11963,7 @@ Write text for the title page, for people reading the printed manual:
(On a printed cover, a date listing the month and the year looks less
fussy than a date listing the day as well as the month and year.)
-@need 750
-@noindent
+@item
Write text for the Top node, for people reading the Info file:
@example
@@ -11760,7 +11975,6 @@ for @@code@{make@} Version @@value@{VERSION@}.
@end group
@end example
-@need 950
After you format the manual, the text in the first @code{@@ifinfo}
section looks like this:
@@ -11770,49 +11984,336 @@ This is Edition 0.35 Beta, last updated 14 August 1992,
of `The GNU Make Manual', for `make', Version 3.63 Beta.
@end group
@end example
+@end enumerate
When you update the manual, change only the values of the flags; you do
-not need to rewrite the three sections.
+not need to edit the three sections.
+
+
+@node Internationalization
+@chapter Internationalization
+
+@cindex Internationalization
+Texinfo has some support for writing in languages other than English,
+although this area still needs considerable work.
+
+For a list of the various accented and special characters Texinfo
+supports, see @ref{Inserting Accents}.
+
+@menu
+* documentlanguage:: Declaring the current language.
+* documentencoding:: Declaring the input encoding.
+@end menu
+
+
+@node documentlanguage
+@section @code{@@documentlanguage @var{cc}}: Set the Document Language
+
+@findex documentlanguage
+@cindex Language, declaring
+@cindex Document language, declaring
+
+The @code{@@documentlanguage} command declares the current document
+language. Write it on a line by itself, with a two-letter ISO-639
+language code following (list is included below). If you have a
+multilingual document, the intent is to be able to use this command
+multiple times, to declare each language change. If the command is not
+used at all, the default is @code{en} for English.
+
+@cindex @file{txi-@var{cc}.tex}
+At present, this command is ignored in Info and HTML output. For
+@TeX{}, it causes the file @file{txi-@var{cc}.tex} to be read (if it
+exists). Such a file appropriately redefines the various English words
+used in @TeX{} output, such as `Chapter', `See', and so on.
+
+@cindex Hyphenation patterns, language-dependent
+It would be good if this command also changed @TeX{}'s ideas of the
+current hyphenation patterns (via the @TeX{} primitive
+@code{\language}), but this is unfortunately not currently implemented.
+
+@cindex ISO 639 codes
+@cindex Language codes
+@cindex African languages
+Here is the list of valid language codes. This list comes from
+@uref{http://www.iro.umontreal.ca/contrib/po/iso-639, the free
+translation project}. In the future we may wish to allow the 3-letter
+POV codes described at @uref{http://www.sil.org/ethnologue/#contents}.
+This will be necessary to support African languages.
+
+@multitable @columnfractions .06 .27 .06 .27 .06 .27
+@item
+@code{aa} @tab Afar @tab
+@code{ab} @tab Abkhazian @tab
+@code{af} @tab Afrikaans
+@item
+@code{am} @tab Amharic @tab
+@code{ar} @tab Arabic @tab
+@code{as} @tab Assamese
+@item
+@code{ay} @tab Aymara @tab
+@code{az} @tab Azerbaijani @tab
+@code{ba} @tab Bashkir
+@item
+@code{be} @tab Byelorussian @tab
+@code{bg} @tab Bulgarian @tab
+@code{bh} @tab Bihari
+@item
+@code{bi} @tab Bislama @tab
+@code{bn} @tab Bengali; Bangla @tab
+@code{bo} @tab Tibetan
+@item
+@code{br} @tab Breton @tab
+@code{ca} @tab Catalan @tab
+@code{co} @tab Corsican
+@item
+@code{cs} @tab Czech @tab
+@code{cy} @tab Welsh @tab
+@code{da} @tab Danish
+@item
+@code{de} @tab German @tab
+@code{dz} @tab Bhutani @tab
+@code{el} @tab Greek
+@item
+@code{en} @tab English @tab
+@code{eo} @tab Esperanto @tab
+@code{es} @tab Spanish
+@item
+@code{et} @tab Estonian @tab
+@code{eu} @tab Basque @tab
+@code{fa} @tab Persian
+@item
+@code{fi} @tab Finnish @tab
+@code{fj} @tab Fiji @tab
+@code{fo} @tab Faroese
+@item
+@code{fr} @tab French @tab
+@code{fy} @tab Frisian @tab
+@code{ga} @tab Irish
+@item
+@code{gd} @tab Scots Gaelic @tab
+@code{gl} @tab Galician @tab
+@code{gn} @tab Guarani
+@item
+@code{gu} @tab Gujarati @tab
+@code{ha} @tab Hausa @tab
+@code{he} @tab Hebrew
+@item
+@code{hi} @tab Hindi @tab
+@code{hr} @tab Croatian @tab
+@code{hu} @tab Hungarian
+@item
+@code{hy} @tab Armenian @tab
+@code{ia} @tab Interlingua @tab
+@code{id} @tab Indonesian
+@item
+@code{ie} @tab Interlingue @tab
+@code{ik} @tab Inupiak @tab
+@code{is} @tab Icelandic
+@item
+@code{it} @tab Italian @tab
+@code{iu} @tab Inuktitut @tab
+@code{ja} @tab Japanese
+@item
+@code{jw} @tab Javanese @tab
+@code{ka} @tab Georgian @tab
+@code{kk} @tab Kazakh
+@item
+@code{kl} @tab Greenlandic @tab
+@code{km} @tab Cambodian @tab
+@code{kn} @tab Kannada
+@item
+@code{ks} @tab Kashmiri @tab
+@code{ko} @tab Korean @tab
+@code{ku} @tab Kurdish
+@item
+@code{ky} @tab Kirghiz @tab
+@code{la} @tab Latin @tab
+@code{ln} @tab Lingala
+@item
+@code{lt} @tab Lithuanian @tab
+@code{lo} @tab Laothian @tab
+@code{lv} @tab Latvian, Lettish
+@item
+@code{mg} @tab Malagasy @tab
+@code{mi} @tab Maori @tab
+@code{mk} @tab Macedonian
+@item
+@code{ml} @tab Malayalam @tab
+@code{mn} @tab Mongolian @tab
+@code{mo} @tab Moldavian
+@item
+@code{mr} @tab Marathi @tab
+@code{ms} @tab Malay @tab
+@code{mt} @tab Maltese
+@item
+@code{my} @tab Burmese @tab
+@code{na} @tab Nauru @tab
+@code{ne} @tab Nepali
+@item
+@code{nl} @tab Dutch @tab
+@code{no} @tab Norwegian @tab
+@code{oc} @tab Occitan
+@item
+@code{om} @tab (Afan) Oromo @tab
+@code{or} @tab Oriya @tab
+@code{pa} @tab Punjabi
+@item
+@code{pl} @tab Polish @tab
+@code{ps} @tab Pashto, Pushto @tab
+@code{pt} @tab Portuguese
+@item
+@code{qu} @tab Quechua @tab
+@code{rm} @tab Rhaeto-Romance @tab
+@code{rn} @tab Kirundi
+@item
+@code{ro} @tab Romanian @tab
+@code{ru} @tab Russian @tab
+@code{rw} @tab Kinyarwanda
+@item
+@code{sa} @tab Sanskrit @tab
+@code{sd} @tab Sindhi @tab
+@code{sg} @tab Sangro
+@item
+@code{sh} @tab Serbo-Croatian @tab
+@code{si} @tab Sinhalese @tab
+@code{sk} @tab Slovak
+@item
+@code{sl} @tab Slovenian @tab
+@code{sm} @tab Samoan @tab
+@code{sn} @tab Shona
+@item
+@code{so} @tab Somali @tab
+@code{sq} @tab Albanian @tab
+@code{sr} @tab Serbian
+@item
+@code{ss} @tab Siswati @tab
+@code{st} @tab Sesotho @tab
+@code{su} @tab Sundanese
+@item
+@code{sv} @tab Swedish @tab
+@code{sw} @tab Swahili @tab
+@code{ta} @tab Tamil
+@item
+@code{te} @tab Telugu @tab
+@code{tg} @tab Tajik @tab
+@code{th} @tab Thai
+@item
+@code{ti} @tab Tigrinya @tab
+@code{tk} @tab Turkmen @tab
+@code{tl} @tab Tagalog
+@item
+@code{tn} @tab Setswana @tab
+@code{to} @tab Tonga @tab
+@code{tr} @tab Turkish
+@item
+@code{ts} @tab Tsonga @tab
+@code{tt} @tab Tatar @tab
+@code{tw} @tab Twi
+@item
+@code{ug} @tab Uighur @tab
+@code{uk} @tab Ukrainian @tab
+@code{ur} @tab Urdu
+@item
+@code{uz} @tab Uzbek @tab
+@code{vi} @tab Vietnamese @tab
+@code{vo} @tab Volapuk
+@item
+@code{wo} @tab Wolof @tab
+@code{xh} @tab Xhosa @tab
+@code{yi} @tab Yiddish
+@item
+@code{yo} @tab Yoruba @tab
+@code{za} @tab Zhuang @tab
+@code{zh} @tab Chinese
+@item
+@code{zu} @tab Zulu
+@end multitable
+
+
+@node documentencoding
+@section @code{@@documentencoding @var{enc}}: Set Input Encoding
+
+@findex documentencoding
+@cindex Encoding, declaring
+@cindex Input encoding, declaring
+@cindex Document input encoding
+
+The @code{@@documentencoding} command declares the input document
+encoding. Write it on a line by itself, with a valid encoding
+specification following, such as @samp{ISO-8859-1}.
+@cindex http-equiv, and charset
+@cindex meta HTML tag, and charset
+At present, this is used only in HTML output from @code{makeinfo}. If a
+document encoding @var{enc} is specified, it is used in the
+@samp{<meta>} tag is included in the @samp{<head>} of the output:
-@node Macros, Format/Print Hardcopy, Conditionals, Top
-@chapter Macros: Defining New Texinfo Commands
+@example
+<meta http-equiv="Content-Type" content="text/html; charset=@var{enc}">
+@end example
+
+
+@node Defining New Texinfo Commands
+@chapter Defining New Texinfo Commands
@cindex Macros
@cindex Defining new Texinfo commands
@cindex New Texinfo commands, defining
@cindex Texinfo commands, defining new
@cindex User-defined Texinfo commands
+Texinfo provides several ways to define new commands:
+
+@itemize @bullet
+@item
A Texinfo @dfn{macro} allows you to define a new Texinfo command as any
sequence of text and/or existing commands (including other macros). The
macro can have any number of @dfn{parameters}---text you supply each
-time you use the macro. (This has nothing to do with the
-@code{@@defmac} command, which is for documenting macros in the subject
-of the manual; @pxref{Def Cmd Template}.)
+time you use the macro.
+
+Incidentally, these macros have nothing to do with the @code{@@defmac}
+command, which is for documenting macros in the subject of the manual
+(@pxref{Def Cmd Template}).
+
+@item
+@samp{@@alias} is a convenient way to define a new name for an existing
+command.
+
+@item
+@samp{@@definfoenclose} allows you to define new commands with
+customized output in the Info file.
+
+@end itemize
@menu
-* Defining Macros:: Both defining and undefining new commands.
+* Defining Macros:: Defining and undefining new commands.
* Invoking Macros:: Using a macro, once you've defined it.
+* Macro Details:: Beyond basic macro usage.
+* alias:: Command aliases.
+* definfoenclose:: Customized highlighting.
@end menu
-@node Defining Macros, Invoking Macros, Macros, Macros
+@node Defining Macros
@section Defining Macros
@cindex Defining macros
@cindex Macro definitions
+@cindex Definitions, a.k.a.@: macros
@findex macro
-You use the Texinfo @code{@@macro} command to define a macro. For example:
+You use the Texinfo @code{@@macro} command to define a macro, like this:
@example
-@@macro @var{macro-name}@{@var{param1}, @var{param2}, @dots{}@}
+@@macro @var{macroname}@{@var{param1}, @var{param2}, @dots{}@}
@var{text} @dots{} \@var{param1}\ @dots{}
@@end macro
@end example
The @dfn{parameters} @var{param1}, @var{param2}, @dots{} correspond to
arguments supplied when the macro is subsequently used in the document
-(see the next section).
+(described in the next section).
+
+For a macro to work with @TeX{}, @var{macroname} must consist entirely
+of letters: no digits, hyphens, underscores, or other special characters.
If a macro needs no parameters, you can define it either with an empty
list (@samp{@@macro foo @{@}}) or with no braces at all (@samp{@@macro
@@ -11821,12 +12322,44 @@ foo}).
@cindex Body of a macro
@cindex Mutually recursive macros
@cindex Recursion, mutual
-The definition or @dfn{body} of the macro can contain any Texinfo
-commands, including previously-defined macros. (It is not possible to
-have mutually recursive Texinfo macros.) In the body, instances of a
-parameter name surrounded by backslashes, as in @samp{\@var{param1}\} in
-the example above, are replaced by the corresponding argument from the
-macro invocation.
+The definition or @dfn{body} of the macro can contain most Texinfo
+commands, including previously-defined macros. Not-yet-defined macro
+invocations are not allowed; thus, it is not possible to have mutually
+recursive Texinfo macros. Also, a macro definition that defines another
+macro does not work in @TeX{} due to limitations in the design of
+@code{@@macro}.
+
+@cindex Parameters to macros
+In the macro body, instances of a parameter name surrounded by
+backslashes, as in @samp{\@var{param1}\} in the example above, are
+replaced by the corresponding argument from the macro invocation. You
+can use parameter names any number of times in the body, including zero.
+
+@cindex Backslash in macros
+To get a single @samp{\} in the macro expansion, use @samp{\\}. Any
+other use of @samp{\} in the body yields a warning.
+
+@cindex Spaces in macros
+@cindex Whitespace in macros
+The newlines after the @code{@@macro} line and before the @code{@@end
+macro} line are ignored, that is, not included in the macro body. All
+other whitespace is treated according to the usual Texinfo rules.
+
+@cindex Recursive macro invocations
+@findex rmacro
+To allow a macro to be used recursively, that is, in an argument to a
+call to itself, you must define it with @samp{@@rmacro}, like this:
+
+@example
+@@rmacro rmac
+a\arg\b
+@@end rmacro
+@dots{}
+@@rmac@{1@@rmac@{text@}2@}
+@end example
+
+This produces the output `a1atextb2b'. With @samp{@@macro} instead of
+@samp{@@rmacro}, an error message is given.
@findex unmacro
@cindex Macros, undefining
@@ -11840,20 +12373,22 @@ For example:
@end example
-@node Invoking Macros, , Defining Macros, Macros
+@node Invoking Macros
@section Invoking Macros
@cindex Invoking macros
+@cindex Expanding macros
+@cindex Running macros
@cindex Macro invocation
After a macro is defined (see the previous section), you can use
(@dfn{invoke}) it in your document like this:
@example
-@@@var{macro-name} @{@var{arg1}, @var{arg2}, @dots{}@}
+@@@var{macroname} @{@var{arg1}, @var{arg2}, @dots{}@}
@end example
@noindent and the result will be just as if you typed the body of
-@var{macro-name} at that spot. For example:
+@var{macroname} at that spot. For example:
@example
@@macro foo @{p, q@}
@@ -11870,17 +12405,34 @@ Together: a & b.
@cindex Backslash, and macros
Thus, the arguments and parameters are separated by commas and delimited
-by braces; any whitespace after (but not before) a comma is ignored. To
-insert a comma, brace, or backslash in an argument, prepend a backslash,
-as in
+by braces; any whitespace after (but not before) a comma is ignored.
+The braces are required in the invocation (but not the definition), even
+when the macro takes no arguments, consistent with all other Texinfo
+commands. For example:
@example
-@@@var{macro-name} @{\\\@{\@}\,@}
+@@macro argless @{@}
+No arguments here.
+@@end macro
+@@argless@{@}
+@end example
+
+@noindent produces:
+
+@display
+No arguments here.
+@end display
+
+To insert a comma, brace, or backslash in an argument, prepend a
+backslash, as in
+
+@example
+@@@var{macname} @{\\\@{\@}\,@}
@end example
@noindent
which will pass the (almost certainly error-producing) argument
-@samp{\@{@},} to @var{macro-name}.
+@samp{\@{@},} to @var{macname}.
If the macro is defined to take a single argument, and is invoked
without any braces, the entire rest of the line after the macro name is
@@ -11888,22 +12440,199 @@ supplied as the argument. For example:
@example
@@macro bar @{p@}
-Twice: \p\, \p\.
+Twice: \p\ & \p\.
@@end macro
@@bar aah
@end example
@noindent produces:
+@c Sorry for cheating, but let's not require macros to process the manual.
@display
-Twice: aah, aah.
+Twice: aah & aah.
@end display
+If the macro is defined to take a single argument, and is invoked with
+braces, the braced text is passed as the argument, regardless of
+commas. For example:
-@node Format/Print Hardcopy, Create an Info File, Macros, Top
-@comment node-name, next, previous, up
-@chapter Format and Print Hardcopy
+@example
+@@macro bar @{p@}
+Twice: \p\ & \p\.
+@@end macro
+@@bar@{a,b@}
+@end example
+
+@noindent produces:
+
+@display
+Twice: a,b & a,b.
+@end display
+
+
+@node Macro Details
+@section Macro Details
+@cindex Macro details
+@cindex Details of macro usage
+
+Due to unavoidable disparities in the @TeX{} and @command{makeinfo}
+implementations, Texinfo macros have the following limitations.
+
+@itemize @bullet
+@item
+All macros are expanded inside at least one @TeX{} group. This means
+that @set and other such commands will have no effect inside a macro.
+
+@item
+Macros containing a command which must be on a line by itself, such as a
+conditional, cannot be invoked in the middle of a line.
+
+@item
+The @TeX{} implementation cannot construct macros that define macros in
+the natural way. To do this, you must use conditionals and raw @TeX{}.
+For example:
+
+@example
+@@ifinfo
+@@macro ctor @{name, arg@}
+@@macro \name\
+something involving \arg\ somehow
+@@end macro
+@@end macro
+@@end ifinfo
+@@tex
+\gdef\ctor#1@{\ctorx#1,@}
+\gdef\ctorx#1,#2,@{\def#1@{something involving #2 somehow@}@}
+@@end tex
+@end example
+
+@item
+It is best to avoid comments inside macro definitions.
+
+@end itemize
+
+
+@node alias
+@section @samp{@@alias @var{new}=@var{existing}}
+@cindex Aliases, command
+@cindex Command aliases
+@findex alias
+
+The @samp{@@alias} command defines a new command to be just like an
+existing one. This is useful for defining additional markup names, thus
+preserving semantic information in the input even though the output
+result may be the same.
+
+Write the @samp{@@alias} command on a line by itself, followed by the
+new command name, an equals sign, and the existing command name.
+Whitespace around the equals sign is ignored. Thus:
+@example
+@@alias @var{new} = @var{existing}
+@end example
+
+For example, if your document contains citations for both books and
+some other media (movies, for example), you might like to define a
+macro @code{@@moviecite@{@}} that does the same thing as an ordinary
+@code{@@cite@{@}} but conveys the extra semantic information as well.
+You'd do this as follows:
+
+@example
+@@alias moviecite = cite
+@end example
+
+Macros do not always have the same effect due to vagaries of argument
+parsing. Also, aliases are much simpler to define than macros. So the
+command is not redundant. (It was also heavily used in the Jargon File!)
+
+Aliases must not be recursive, directly or indirectly.
+
+@node definfoenclose
+@section @samp{definfoenclose}: Customized Highlighting
+@cindex Highlighting, customized
+@cindex Customized highlighting
+@findex definfoenclose
+
+A @code{@@definfoenclose} command may be used to define a highlighting
+command for Info, but not for TeX. A command defined using
+@code{@@definfoenclose} marks text by enclosing it in strings that
+precede and follow the text. You can use this to get closer control of
+your Info output.
+
+Presumably, if you define a command with @code{@@definfoenclose} for Info,
+you will create a corresponding command for @TeX{}, either in
+@file{texinfo.tex}, @file{texinfo.cnf}, or within an @samp{@@iftex} in
+your document.
+
+Write a @code{@@definfoenclose} command on a line and follow it with
+three arguments separated by commas. The first argument to
+@code{@@definfoenclose} is the @@-command name (without the @code{@@});
+the second argument is the Info start delimiter string; and the third
+argument is the Info end delimiter string. The latter two arguments
+enclose the highlighted text in the Info file. A delimiter string may
+contain spaces. Neither the start nor end delimiter is required. If
+you do not want a start delimiter but do want an end delimiter, you must
+follow the command name with two commas in a row; otherwise, the Info
+formatting commands will naturally misinterpret the end delimiter string
+you intended as the start delimiter string.
+
+If you do a @code{@@definfoenclose} on the name of a pre-defined macro
+(such as @code{@@emph}, @code{@@strong}, @code{@@t}, or @code{@@i}), the
+enclosure definition will override the built-in definition.
+
+An enclosure command defined this way takes one argument in braces; this
+is intended for new markup commands (@pxref{Marking Text}).
+
+@findex phoo
+For example, you can write:
+
+@example
+@@definfoenclose phoo,//,\\
+@end example
+
+@noindent
+near the beginning of a Texinfo file to define @code{@@phoo} as an Info
+formatting command that inserts `//' before and `\\' after the argument
+to @code{@@phoo}. You can then write @code{@@phoo@{bar@}} wherever you
+want `//bar\\' highlighted in Info.
+
+Also, for TeX formatting, you could write
+
+@example
+@@iftex
+@@global@@let@@phoo=@@i
+@@end iftex
+@end example
+
+@noindent
+to define @code{@@phoo} as a command that causes TeX to typeset the
+argument to @code{@@phoo} in italics.
+
+Note that each definition applies to its own formatter: one for TeX,
+the other for @code{texinfo-format-buffer} or
+@code{texinfo-format-region}. The @code{@@definfoenclose} command need
+not be within @samp{@@ifinfo}, but the raw @TeX{} commands do need to be
+in @samp{@@iftex}.
+
+@findex headword
+Here is another example: write
+
+@example
+@@definfoenclose headword, , :
+@end example
+
+@noindent
+near the beginning of the file, to define @code{@@headword} as an Info
+formatting command that inserts nothing before and a colon after the
+argument to @code{@@headword}.
+
+@samp{@@definfoenclose} definitions must not be recursive, directly or
+indirectly.
+
+
+@node Hardcopy
+@chapter Formatting and Printing Hardcopy
@cindex Format and print hardcopy
+@cindex Printing hardcopy
@cindex Hardcopy, printing it
@cindex Making a printed manual
@cindex Sorting indices
@@ -11916,49 +12645,49 @@ Texinfo file: one for converting the Texinfo file into a file that will be
printed, a second for sorting indices, and a third for printing the
formatted document. When you use the shell commands, you can either
work directly in the operating system shell or work within a shell
-inside GNU Emacs.@refill
+inside GNU Emacs.
If you are using GNU Emacs, you can use commands provided by Texinfo
mode instead of shell commands. In addition to the three commands to
format a file, sort the indices, and print the result, Texinfo mode
offers key bindings for commands to recenter the output buffer, show the
-print queue, and delete a job from the print queue.@refill
+print queue, and delete a job from the print queue.
@menu
* Use TeX:: Use @TeX{} to format for hardcopy.
-* Format with tex/texindex:: How to format in a shell.
-* Format with texi2dvi:: A simpler way to use the shell.
+* Format with tex/texindex:: How to format with explicit shell commands.
+* Format with texi2dvi:: A simpler way to format.
* Print with lpr:: How to print.
* Within Emacs:: How to format and print from an Emacs shell.
* Texinfo Mode Printing:: How to format and print in Texinfo mode.
* Compile-Command:: How to print using Emacs's compile command.
* Requirements Summary:: @TeX{} formatting requirements summary.
-* Preparing for TeX:: What you need to do to use @TeX{}.
+* Preparing for TeX:: What to do before you use @TeX{}.
* Overfull hboxes:: What are and what to do with overfull hboxes.
* smallbook:: How to print small format books and manuals.
* A4 Paper:: How to print on European A4 paper.
+* pagesizes:: How to print with customized page sizes.
* Cropmarks and Magnification:: How to print marks to indicate the size
of pages and how to print scaled up output.
+* PDF Output:: Portable Document Format output.
@end menu
-@node Use TeX, Format with tex/texindex, Format/Print Hardcopy, Format/Print Hardcopy
-@ifinfo
-@heading Use @TeX{}
-@end ifinfo
+@node Use TeX
+@section Use @TeX{}
The typesetting program called @TeX{} is used for formatting a Texinfo
-file. @TeX{} is a very powerful typesetting program and, if used right,
+file. @TeX{} is a very powerful typesetting program and, if used correctly,
does an exceptionally good job. (@xref{Obtaining TeX, , How to Obtain
@TeX{}}, for information on how to obtain @TeX{}.)
The @code{makeinfo}, @code{texinfo-format-region}, and
@code{texinfo-format-buffer} commands read the very same @@-commands
in the Texinfo file as does @TeX{}, but process them differently to
-make an Info file; see @ref{Create an Info File}.@refill
+make an Info file (@pxref{Creating an Info File}).
-@node Format with tex/texindex, Format with texi2dvi, Use TeX, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Format using @code{tex} and @code{texindex}
+
+@node Format with tex/texindex
+@section Format with @code{tex} and @code{texindex}
@cindex Shell formatting with @code{tex} and @code{texindex}
@cindex Formatting with @code{tex} and @code{texindex}
@cindex DVI file
@@ -11973,19 +12702,20 @@ tex foo.texi
@noindent @TeX{} will produce a @dfn{DVI file} as well as several auxiliary
files containing information for indices, cross references, etc. The
DVI file (for @dfn{DeVice Independent} file) can be printed on virtually
-any printe (see the following sections).
+any device (see the following sections).
@pindex texindex
The @code{tex} formatting command itself does not sort the indices; it
writes an output file of unsorted index data. (The @code{texi2dvi}
-command automatically generates indices; see @ref{Format with texi2dvi,,
-Format using @code{texi2dvi}}.) To generate a printed index after
+command automatically generates indices; @pxref{Format with texi2dvi,,
+Format with @code{texi2dvi}}.) To generate a printed index after
running the @code{tex} command, you first need a sorted index to work
from. The @code{texindex} command sorts indices. (The source file
@file{texindex.c} comes as part of the standard Texinfo distribution,
among other places.)@refill
@cindex Names of index files
+@cindex Index file names
The @code{tex} formatting command outputs unsorted index files under
names that obey a standard convention: the name of your main input file
with any @samp{.tex} (or similar, @pxref{tex invocation,,, web2c,
@@ -11993,14 +12723,14 @@ Web2c}) extension removed, followed by the two letter names of indices.
For example, the raw index output files for the input file
@file{foo.texinfo} would be @file{foo.cp}, @file{foo.vr}, @file{foo.fn},
@file{foo.tp}, @file{foo.pg} and @file{foo.ky}. Those are exactly the
-arguments to give to @code{texindex}.@refill
+arguments to give to @code{texindex}.
@need 1000
@cindex Wildcards
@cindex Globbing
Instead of specifying all the unsorted index file names explicitly, you
can use @samp{??} as shell wildcards and give the command in this
-form:@refill
+form:
@example
texindex foo.??
@@ -12012,13 +12742,13 @@ including any that you have defined yourself using @code{@@defindex}
or @code{@@defcodeindex}. (You may execute @samp{texindex foo.??}
even if there are similarly named files with two letter extensions
that are not index files, such as @samp{foo.el}. The @code{texindex}
-command reports but otherwise ignores such files.)@refill
+command reports but otherwise ignores such files.)
For each file specified, @code{texindex} generates a sorted index file
whose name is made by appending @samp{s} to the input file name. The
-@code{@@printindex} command knows to look for a file of that name
+@code{@@printindex} command looks for a file with that name
(@pxref{Printing Indices & Menus}). @code{texindex} does not alter the
-raw index output file.@refill
+raw index output file.
After you have sorted the indices, you need to rerun the @code{tex}
formatting command on the Texinfo file. This regenerates the DVI file,
@@ -12027,7 +12757,7 @@ this time with up-to-date index entries.
Finally, you may need to run @code{tex} one more time, to get the page
numbers in the cross-references correct.
-To summarize, this is a four step process:
+To summarize, this is a five step process:
@enumerate
@item
@@ -12045,43 +12775,84 @@ file, this time with indices and defined cross-references, but with page
numbers for the cross-references from last time, generally incorrect.
@item
+Sort the indices again, with @code{texindex}.
+
+@item
Run @code{tex} one last time. This time the correct page numbers are
written for the cross-references.
@end enumerate
@pindex texi2dvi
-Alternatively, it's a one-step process: run @code{texi2dvi}.
+Alternatively, it's a one-step process: run @code{texi2dvi}
+(@pxref{Format with texi2dvi}).
You need not run @code{texindex} each time after you run @code{tex}. If
you do not, on the next run, the @code{tex} formatting command will use
whatever sorted index files happen to exist from the previous use of
-@code{texindex}. This is usually ok while you are
-debugging.@refill
+@code{texindex}. This is usually ok while you are debugging.
+
+@cindex Auxiliary files, avoiding
+@findex novalidate
+@cindex Pointer validation, suppressing
+@cindex Chapters, formatting one at a time
+Sometimes you may wish to print a document while you know it is
+incomplete, or to print just one chapter of a document. In that case,
+the usual auxiliary files that @TeX{} creates and warnings @TeX{} gives
+when cross-references are not satisfied are just nuisances. You can
+avoid them with the @code{@@novalidate} command, which you must give
+@emph{before} the @code{@@setfilename} command
+(@pxref{setfilename,,@code{@@setfilename}}). Thus, the beginning of
+your file would look approximately like this:
+@example
+\input texinfo
+@@novalidate
+@@setfilename myfile.info
+@dots{}
+@end example
-@node Format with texi2dvi, Print with lpr, Format with tex/texindex, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Format using @code{texi2dvi}
+@noindent @code{@@novalidate} also turns off validation in
+@code{makeinfo}, just like its @code{--no-validate} option
+(@pxref{Pointer Validation}).
+
+
+@node Format with texi2dvi
+@section Format with @code{texi2dvi}
@pindex texi2dvi @r{(shell script)}
The @code{texi2dvi} command automatically runs both @code{tex} and
@code{texindex} as many times as necessary to produce a DVI file with
-up-to-date, sorted indices. It simplifies the
-@code{tex}---@code{texindex}---@code{tex} sequence described in the
-previous section.
+sorted indices and all cross-references resolved. It simplifies the
+@code{tex}---@code{texindex}---@code{tex}---@code{tex} sequence
+described in the previous section.
-The syntax for @code{texi2dvi} is like this (where @samp{prompt$} is your
-shell prompt):@refill
+To run @code{texi2dvi} on an input file @file{foo.texi}, do this (where
+@samp{prompt$ } is your shell prompt):
@example
-prompt$ @kbd{texi2dvi @var{filename}@dots{}}
+prompt$ @kbd{texi2dvi foo.texi}
@end example
-For a list of options, run @samp{texi2dvi --help}.
+As shown in this example, the input filenames to @code{texi2dvi} must
+include any extension (@samp{.texi}, @samp{.texinfo}, etc.). Under
+MS-DOS and perhaps in other circumstances, you may need to run @samp{sh
+texi2dvi foo.texi} instead of relying on the operating system to invoke
+the shell on the @samp{texi2dvi} script.
+Perhaps the most useful option to @code{texi2dvi} is
+@samp{--texinfo=@var{cmd}}. This inserts @var{cmd} on a line by itself
+after the @code{@@setfilename} in a temporary copy of the input file
+before running @TeX{}. With this, you can specify different printing
+formats, such as @code{@@smallbook} (@pxref{smallbook}),
+@code{@@afourpaper} (@pxref{A4 Paper}), or @code{@@pageparams}
+(@pxref{pagesizes}), without actually changing the document source.
+(You can also do this on a site-wide basis with @file{texinfo.cnf};
+@pxref{Preparing for TeX,,Preparing for @TeX{}}).
-@node Print with lpr, Within Emacs, Format with texi2dvi, Format/Print Hardcopy
-@comment node-name, next, previous, up
+For a list of other options, run @samp{texi2dvi --help}.
+
+
+@node Print with lpr, Within Emacs, Format with texi2dvi, Hardcopy
@section Shell Print Using @code{lpr -d}
@pindex lpr @r{(DVI print command)}
@@ -12090,7 +12861,7 @@ installation, but @samp{lpr -d} is common. The command may require the
DVI file name without any extension or with a @samp{.dvi}
extension. (If it is @samp{lpr}, you must include the @samp{.dvi}.)
-The following commands, for example, will (probably) suffice to sort the
+For example, the following commands, will (perhaps) suffice to sort the
indices, format, and print the @cite{Bison Manual}:
@example
@@ -12116,8 +12887,41 @@ lpr -d bison.dvi
@end group
@end example
-@node Within Emacs, Texinfo Mode Printing, Print with lpr, Format/Print Hardcopy
-@comment node-name, next, previous, up
+@cindex Shell printing, on MS-DOS/MS-Windows
+@cindex Printing DVI files, on MS-DOS/MS-Windows
+@pindex lpr@r{-d, replacements on MS-DOS/MS-Windows}
+@code{lpr} is a standard program on Unix systems, but it is usually
+absent on MS-DOS/MS-Windows. Some network packages come with a
+program named @code{lpr}, but these are usually limited to sending files
+to a print server over the network, and generally don't support the
+@samp{-d} option. If you are unfortunate enough to work on one of these
+systems, you have several alternative ways of printing DVI files:
+
+@itemize @bullet{}
+@item Find and install a Unix-like @code{lpr} program, or its clone.
+If you can do that, you will be able to print DVI files just like
+described above.
+
+@item Send the DVI files to a network printer queue for DVI files.
+Some network printers have special queues for printing DVI files. You
+should be able to set up your network software to send files to that
+queue. In some cases, the version of @code{lpr} which comes with your
+network software will have a special option to send a file to specific
+queues, like this:
+
+@example
+lpr -Qdvi -hprint.server.domain bison.dvi
+@end example
+
+@item Convert the DVI file to a Postscript or PCL file and send it to your
+local printer. @xref{dvips invocation,,, dvips, Dvips}, and the man
+pages for @code{dvilj}, for detailed description of these tools. Once
+the DVI file is converted to the format your local printer understands
+directly, just send it to the appropriate port, usually @samp{PRN}.
+@end itemize
+
+
+@node Within Emacs
@section From an Emacs Shell
@cindex Print, format from Emacs shell
@cindex Format, print from Emacs shell
@@ -12127,8 +12931,8 @@ lpr -d bison.dvi
You can give formatting and printing commands from a shell within GNU
Emacs. To create a shell within Emacs, type @kbd{M-x shell}. In this
-shell, you can format and print the document. @xref{Format/Print
-Hardcopy, , Format and Print Hardcopy}, for details.@refill
+shell, you can format and print the document. @xref{Hardcopy, , Format
+and Print Hardcopy}, for details.
You can switch to and from the shell buffer while @code{tex} is
running and do other editing. If you are formatting a long document
@@ -12150,7 +12954,8 @@ lpr -d gcc.dvi
and printing in Texinfo mode.@refill
@end ifinfo
-@node Texinfo Mode Printing, Compile-Command, Within Emacs, Format/Print Hardcopy
+
+@node Texinfo Mode Printing, Compile-Command, Within Emacs, Hardcopy
@section Formatting and Printing in Texinfo Mode
@cindex Region printing in Texinfo mode
@cindex Format and print in Texinfo mode
@@ -12193,7 +12998,7 @@ number shown by a preceding @kbd{C-c C-t C-q} command
@item C-c C-t C-k
@itemx M-x tex-kill-job
-Kill the currently running @TeX{} job started by
+Kill the currently running @TeX{} job started by either
@code{texinfo-tex-region} or @code{texinfo-tex-buffer}, or any other
process running in the Texinfo shell buffer.@refill
@@ -12257,8 +13062,17 @@ emacs, The GNU Emacs Manual}), with the @kbd{M-x set-variable} command
Emacs Manual}), or with your @file{.emacs} initialization file
(@pxref{Init File, , , emacs, The GNU Emacs Manual}).@refill
-@node Compile-Command, Requirements Summary, Texinfo Mode Printing, Format/Print Hardcopy
-@comment node-name, next, previous, up
+@cindex Customize Emacs package
+@findex Development/Docs/Texinfo Customize group
+Beginning with version 20, GNU Emacs offers a user-friendly interface,
+called @dfn{Customize}, for changing values of user-definable variables.
+@xref{Easy Customization, , Easy Customization Interface, emacs, The GNU
+Emacs Manual}, for more details about this. The Texinfo variables can
+be found in the @samp{Development/Docs/Texinfo} group, once you invoke
+the @kbd{M-x customize} command.
+
+
+@node Compile-Command, Requirements Summary, Texinfo Mode Printing, Hardcopy
@section Using the Local Variables List
@cindex Local variables
@cindex Compile command for formatting
@@ -12286,8 +13100,7 @@ This technique is most often used by programmers who also compile programs
this way; see @ref{Compilation, , , emacs, The GNU Emacs Manual}.@refill
-@node Requirements Summary, Preparing for TeX, Compile-Command, Format/Print Hardcopy
-@comment node-name, next, previous, up
+@node Requirements Summary
@section @TeX{} Formatting Requirements Summary
@cindex Requirements for formatting
@cindex Minimal requirements for formatting
@@ -12313,7 +13126,7 @@ processing and forces out unfinished pages:
@end example
Strictly speaking, these lines are all a Texinfo file needs to be
-processed successfully by @TeX{}.
+processed successfully by @TeX{}.
Usually, however, the beginning includes an @code{@@settitle} command to
define the title of the printed manual, an @code{@@setchapternewpage}
@@ -12321,31 +13134,20 @@ command, a title page, a copyright page, and permissions. Besides an
@code{@@bye}, the end of a file usually includes indices and a table of
contents. (And of course most manuals contain a body of text as well.)
-@iftex
-For more information, see
-@ref{settitle, , @code{@@settitle}},
-@ref{setchapternewpage, , @code{@@setchapternewpage}},
-@ref{Headings, ,Page Headings},
-@ref{Titlepage & Copyright Page},
-@ref{Printing Indices & Menus}, and
-@ref{Contents}.
-@end iftex
-@noindent
-@ifinfo
-For more information, see@*
-@ref{settitle, , @code{@@settitle}},@*
-@ref{setchapternewpage, , @code{@@setchapternewpage}},@*
-@ref{Headings, ,Page Headings},@*
-@ref{Titlepage & Copyright Page},@*
-@ref{Printing Indices & Menus}, and@*
-@ref{Contents}.
-@end ifinfo
+For more information, see:
+@itemize @bullet
+@item @ref{settitle, , @code{@@settitle}}
+@item @ref{setchapternewpage, , @code{@@setchapternewpage}}
+@item @ref{Headings, ,Page Headings}
+@item @ref{Titlepage & Copyright Page}
+@item @ref{Printing Indices & Menus}
+@item @ref{Contents}
+@end itemize
-@node Preparing for TeX, Overfull hboxes, Requirements Summary, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Preparing to Use @TeX{}
-@cindex Preparing to use @TeX{}
+@node Preparing for TeX
+@section Preparing for @TeX{}
+@cindex Preparing for @TeX{}
@cindex @TeX{} input initialization
@cindex @code{TEXINPUTS} environment variable
@vindex TEXINPUTS
@@ -12378,14 +13180,14 @@ distribution. This file is needed to support the @code{@@image} command
@cindex Customizing of @TeX{} for Texinfo
@cindex Site-wide Texinfo configuration file
Optionally, you may create an additional @file{texinfo.cnf}, and install
-it as well. This file is read by @TeX{} at the @code{@@setfilename}
-command (@pxref{setfilename,, @code{@@setfilename}}). You can put any
-commands you like there according to local site-wide conventions, and
-they will be read by @TeX{} when processing any Texinfo document. For
-example, if @file{texinfo.cnf} contains the a single line
-@samp{@@afourpaper} (@pxref{A4 Paper}), then all Texinfo documents will
-be processed with that page size in effect. If you have nothing to put
-in @file{texinfo.cnf}, you do not need to create it.
+it as well. This file is read by @TeX{} when the @code{@@setfilename}
+command is executed (@pxref{setfilename,, @code{@@setfilename}}). You can put any
+commands you like there, according to local site-wide conventions. They
+will be read by @TeX{} when processing any Texinfo document. For
+example, if @file{texinfo.cnf} contains the line @samp{@@afourpaper}
+(@pxref{A4 Paper}), then all Texinfo documents will be processed with
+that page size in effect. If you have nothing to put in
+@file{texinfo.cnf}, you do not need to create it.
@vindex TEXINPUTS
If neither of the above locations for these system files suffice for
@@ -12420,14 +13222,45 @@ export TEXINPUTS
@end group
@end example
+On MS-DOS/MS-Windows, you would say it like this@footnote{Note the use
+of the @samp{;} character, instead of @samp{:}, as directory separator
+on these systems.}:
+
+@example
+@group
+set TEXINPUTS=.;d:/home/me/mylib;c:/usr/lib/tex/macros
+@end group
+@end example
+
@noindent
-This would cause @TeX{} to look for @file{\input} file first in the current
-directory, indicated by the @samp{.}, then in a hypothetical user's
-@file{me/mylib} directory, and finally in a system directory.
+It is customary for DOS/Windows users to put such commands in the
+@file{autoexec.bat} file, or in the Windows Registry.@refill
+@noindent
+These settings would cause @TeX{} to look for @file{\input} file first
+in the current directory, indicated by the @samp{.}, then in a
+hypothetical user's @file{me/mylib} directory, and finally in a system
+directory @file{/usr/lib/tex/macros}.
-@node Overfull hboxes, smallbook, Preparing for TeX, Format/Print Hardcopy
-@comment node-name, next, previous, up
+@cindex Dumping a .fmt file
+@cindex Format file, dumping
+Finally, you may wish to dump a @file{.fmt} file (@pxref{Memory dumps,,,
+web2c, Web2c}) so that @TeX{} can load Texinfo faster. (The
+disadvantage is that then updating @file{texinfo.tex} requires
+redumping.) You can do this by running this command, assuming
+@file{epsf.tex} is findable by @TeX{}:
+
+@example
+initex texinfo @@dump
+@end example
+
+(@code{@@dump} is a @TeX{} primitive.) You'll then need to move
+@file{texinfo.fmt} to wherever your @code{.fmt} files are found;
+typically this will be in the subdirectory @file{web2c} of your @TeX{}
+installation, for example, @file{/usr/local/share/tex/web2c}.
+
+
+@node Overfull hboxes
@section Overfull ``hboxes''
@cindex Overfull @samp{hboxes}
@cindex @samp{hboxes}, overfull
@@ -12437,46 +13270,67 @@ directory, indicated by the @samp{.}, then in a hypothetical user's
the right margin. This can occur when @TeX{} comes upon what it
interprets as a long word that it cannot hyphenate, such as an
electronic mail network address or a very long title. When this
-happens, @TeX{} prints an error message like this:@refill
+happens, @TeX{} prints an error message like this:
@example
-Overfull \hbox (20.76302pt too wide)
+Overfull @@hbox (20.76302pt too wide)
@end example
+@findex hbox
@noindent
(In @TeX{}, lines are in ``horizontal boxes'', hence the term, ``hbox''.
-The backslash, @samp{\}, is the @TeX{} equivalent of @samp{@@}.)@refill
+@samp{@@hbox} is a @TeX{} primitive not needed in the Texinfo language.)
@TeX{} also provides the line number in the Texinfo source file and
the text of the offending line, which is marked at all the places that
-@TeX{} knows how to hyphenate words.
+@TeX{} considered hyphenation.
@xref{Debugging with TeX, , Catching Errors with @TeX{} Formatting},
-for more information about typesetting errors.@refill
+for more information about typesetting errors.
If the Texinfo file has an overfull hbox, you can rewrite the sentence
so the overfull hbox does not occur, or you can decide to leave it. A
small excursion into the right margin often does not matter and may not
-even be noticeable.@refill
+even be noticeable.
+
+If you have many overfull boxes and/or an antipathy to rewriting, you
+can coerce @TeX{} into greatly increasing the allowable interword
+spacing, thus (if you're lucky) avoiding many of the bad line breaks,
+like this:
+
+@findex \emergencystretch
+@example
+@@tex
+\global\emergencystretch = .9\hsize
+@@end tex
+@end example
+
+@noindent
+(You can adjust the fraction as needed.) This huge value for
+@code{\emergencystretch} cannot be the default, since then the typeset
+output would generally be of noticeably lower quality. The default
+value is @samp{.15\hsize}. @code{\hsize} is the @TeX{} dimension
+containing the current line width.
@cindex Black rectangle in hardcopy
-@cindex Rectangle, ugly, black in hardcopy
-However, unless told otherwise, @TeX{} will print a large, ugly, black
-rectangle beside the line that contains the overfull hbox. This is so
-you will notice the location of the problem if you are correcting a
-draft.@refill
+@cindex Rectangle, black in hardcopy
+@cindex Box, ugly black in hardcopy
+@cindex Ugly black rectangles in hardcopy
+For what overfull boxes you have, however, @TeX{} will print a large,
+ugly, black rectangle beside the line that contains the overfull hbox
+unless told otherwise. This is so you will notice the location of the
+problem if you are correcting a draft.
-@need 1000
@findex finalout
To prevent such a monstrosity from marring your final printout, write
the following in the beginning of the Texinfo file on a line of its own,
-before the @code{@@titlepage} command:@refill
+before the @code{@@titlepage} command:
@example
@@finalout
@end example
-@node smallbook, A4 Paper, Overfull hboxes, Format/Print Hardcopy
-@comment node-name, next, previous, up
+
+@node smallbook
@section Printing ``Small'' Books
@findex smallbook
@cindex Small book size
@@ -12495,43 +13349,35 @@ file, before the title page:@refill
@end example
@noindent
-(Since regular sized books are often about 7 by 9.25 inches, this
-command might better have been called the @code{@@regularbooksize}
-command, but it came to be called the @code{@@smallbook} command by
-comparison to the 8.5 by 11 inch format.)@refill
+(Since many books are about 7 by 9.25 inches, this command might better
+have been called the @code{@@regularbooksize} command, but it came to be
+called the @code{@@smallbook} command by comparison to the 8.5 by 11 inch format.)
If you write the @code{@@smallbook} command between the
start-of-header and end-of-header lines, the Texinfo mode @TeX{}
region formatting command, @code{texinfo-tex-region}, will format the
region in ``small'' book size (@pxref{Start of Header}).@refill
-The Free Software Foundation distributes printed copies of @cite{The GNU
-Emacs Manual} and other manuals in the ``small'' book size.
-@xref{smallexample & smalllisp, , @code{@@smallexample} and
-@code{@@smalllisp}}, for information about commands that make it easier
-to produce examples for a smaller manual.@refill
+@xref{small}, for information about
+commands that make it easier to produce examples for a smaller manual.
-Alternatively, to avoid embedding this physical paper size in your
-document, use @code{texi2dvi} to format your document (@pxref{Format
-with texi2dvi}), and supply @samp{-t @@smallbook} as an argument. Then
-other people do not have to change the document source file to format it
-differently.
+@xref{Format with texi2dvi}, and @ref{Preparing for TeX,,Preparing for
+@TeX{}}, for other ways to format with @code{@@smallbook} that do not
+require changing the source file.
-@node A4 Paper, Cropmarks and Magnification, smallbook, Format/Print Hardcopy
-@comment node-name, next, previous, up
+@node A4 Paper
@section Printing on A4 Paper
@cindex A4 paper, printing on
@cindex Paper size, European A4
@cindex European A4 paper
@findex afourpaper
-You can tell @TeX{} to typeset a document for printing on European size
+You can tell @TeX{} to format a document for printing on European size
A4 paper with the @code{@@afourpaper} command. Write the command on a
-line by itself between @code{@@iftex} and @code{@@end iftex} lines near
-the beginning of the Texinfo file, before the title page:@refill
-
-For example, this is how you would write the header for this manual:@refill
+line by itself near the beginning of the Texinfo file, before the title
+page. For example, this is how you would write the header for this
+manual:
@example
@group
@@ -12539,35 +13385,70 @@ For example, this is how you would write the header for this manual:@refill
@@c %**start of header
@@setfilename texinfo
@@settitle Texinfo
-@@syncodeindex vr fn
-@@iftex
@@afourpaper
-@@end iftex
@@c %**end of header
@end group
@end example
-Alternatively, to avoid embedding this physical paper size in your
-document, use @code{texi2dvi} to format your document (@pxref{Format
-with texi2dvi}), and supply @samp{-t @@afourpaper} as an argument. Then
-other people do not have to change the document source file to format it
-differently.
+@xref{Format with texi2dvi}, and @ref{Preparing for TeX,,Preparing for
+@TeX{}}, for other ways to format with @code{@@afourpaper} that do not
+require changing the source file.
-@pindex texinfo.cnf
-Another alternative: put the @code{@@afourpaper} command in the file
-@file{texinfo.cnf} that @TeX{} will read. (No need for @code{@@iftex}
-there.) This will automatically typeset all the Texinfo documents at
-your site with that paper size in effect.
+@findex afourlatex
+You may or may not prefer the formatting that results from the command
+@code{@@afourlatex}. There's also @code{@@afourwide} for A4 paper in
+wide format.
-@node Cropmarks and Magnification, , A4 Paper, Format/Print Hardcopy
-@comment node-name, next, previous, up
-@section Cropmarks and Magnification
+@node pagesizes
+@section @code{@@pagesizes} [@var{width}][, @var{height}]: Custom page sizes
+@findex pagesizes
+@cindex Custom page sizes
+@cindex Page sizes, customized
+@cindex Text width and height
+@cindex Width of text area
+@cindex Height of text area
+@cindex Depth of text area
+
+You can explicitly specify the height and (optionally) width of the main
+text area on the page with the @code{@@pagesizes} command. Write this
+on a line by itself near the beginning of the Texinfo file, before the
+title page. The height comes first, then the width if desired,
+separated by a comma. Examples:
+
+@example
+@@pagesizes 200mm,150mm @c for b5 paper
+@end example
+@noindent and
+@example
+@@pagesizes 11.5in @c for legal paper
+@end example
+
+@cindex B5 paper, printing on
+@cindex Legal paper, printing on
+This would be reasonable for printing on B5-size paper. To emphasize,
+this command specifies the size of the @emph{text area}, not the size of
+the paper (which is 250@dmn{mm} by 177@dmn{mm} for B5, 14@dmn{in} by
+8.5@dmn{in} for legal).
+
+@cindex Margins on page, not controllable
+To make more elaborate changes, such as changing any of the page
+margins, you must define a new command in @file{texinfo.tex} (or
+@file{texinfo.cnf}, @pxref{Preparing for TeX,,Preparing for @TeX{}}).
+@xref{Format with texi2dvi}, and @ref{Preparing for TeX,,Preparing for
+@TeX{}}, for other ways to specify @code{@@pagesizes} that do not
+require changing the source file.
+
+@code{@@pagesizes} is ignored by @code{makeinfo}.
+
+
+@node Cropmarks and Magnification
+@section Cropmarks and Magnification
@findex cropmarks
@cindex Cropmarks for printing
@cindex Printing cropmarks
-You can attempt to direct @TeX{} to print cropmarks at the corners of
+You can (attempt to) direct @TeX{} to print cropmarks at the corners of
pages with the @code{@@cropmarks} command. Write the @code{@@cropmarks}
command on a line by itself between @code{@@iftex} and @code{@@end
iftex} lines near the beginning of the Texinfo file, before the title
@@ -12587,8 +13468,8 @@ book set to 7 by 9.25 inches with the @code{@@smallbook} command.
(Printers will not produce cropmarks for regular sized output that is
printed on regular sized paper.) Since different printing machines work
in different ways, you should explore the use of this command with a
-spirit of adventure. You may have to redefine the command in the
-@file{texinfo.tex} definitions file.@refill
+spirit of adventure. You may have to redefine the command in
+@file{texinfo.tex}.
@findex mag @r{(@TeX{} command)}
@cindex Magnified printing
@@ -12604,7 +13485,7 @@ write this command between @code{@@tex} and @code{@@end tex}
Follow the @code{\mag} command with an @samp{=} and then a number that
is 1000 times the magnification you desire. For example, to print pages
at 1.2 normal size, write the following near the beginning of the
-Texinfo file, before the title page:@refill
+Texinfo file, before the title page:
@example
@group
@@ -12615,27 +13496,69 @@ Texinfo file, before the title page:@refill
@end example
With some printing technologies, you can print normal-sized copies that
-look better than usual by using a larger-than-normal master.@refill
+look better than usual by giving a larger-than-normal master to your
+print shop. They do the reduction, thus effectively increasing the
+resolution.
-Depending on your system, @code{\mag} may not work or may work only at
-certain magnifications. Be prepared to experiment.@refill
+Depending on your system, DVI files prepared with a
+nonstandard-@code{\mag} may not print or may print only with certain
+magnifications. Be prepared to experiment.
-@node Create an Info File, Install an Info File, Format/Print Hardcopy, Top
-@comment node-name, next, previous, up
-@chapter Creating an Info File
+
+@node PDF Output
+@section PDF Output
+@cindex PDF output
+
+@pindex pdftex
+You can generate a PDF output file from Texinfo source by using the
+@command{pdftex} program to process your file instead of plain
+@command{tex}. Just run @samp{pdftex foo.texi} instead of @samp{tex
+foo.texi}, or give the @samp{--pdf} option to @command{texi2dvi}.
+
+PDF stands for Portable Document Format, and was invented by Adobe
+Systems. The
+@uref{http://www.adobe.com/prodindex/acrobat/adobepdf.html, file format
+definition} is freely available, as is a
+@uref{http://www.foolabs.com/xpdf/, free viewer} for the X window
+system. Since PDF is a binary format, there is no @samp{@@ifpdf} or
+@samp{@@pdf} command by analogy with the other output formats.
+
+Despite the `portable' in the name, PDF files are nowhere near as
+portable in practice as the plain ASCII formats (Info, HTML) Texinfo
+also supports (portability relative to DVI is arguable). They also tend
+to be much larger and do not support the bitmap fonts used by @TeX{} (by
+default) very well. Nevertheless, a PDF file does preserve an actual
+printed document on a screen as faithfully as possible, unlike HTML,
+say, so have their place.
+
+PDF support in Texinfo is fairly rudimentary.
+
+
+@node Creating and Installing Info Files
+@chapter Creating and Installing Info Files
+
+This chapter describes how to create and install info files. @xref{Info
+Files}, for general information about the file format itself.
+
+
+@menu
+* Creating an Info File::
+* Install an Info File::
+@end menu
+
+@node Creating an Info File
+@section Creating an Info File
@cindex Creating an Info file
-@cindex Info, creating an on-line file
+@cindex Info, creating an online file
@cindex Formatting a file for Info
-@code{makeinfo} is a utility that converts a Texinfo file into an Info
-file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
-GNU Emacs functions that do the same.@refill
-
-A Texinfo file must contain an @code{@@setfilename} line near its
-beginning, otherwise the Info formatting commands will fail.
+@code{makeinfo} is a program that converts a Texinfo file into an Info
+file, HTML file, or plain text. @code{texinfo-format-region} and
+@code{texinfo-format-buffer} are GNU Emacs functions that convert
+Texinfo to Info.
-For information on installing the Info file in the Info system, see
-@ref{Install an Info File}.@refill
+For information on installing the Info file in the Info system,
+@pxref{Install an Info File}.
@menu
* makeinfo advantages:: @code{makeinfo} provides better error checking.
@@ -12649,21 +13572,22 @@ For information on installing the Info file in the Info system, see
* Batch Formatting:: How to format for Info in Emacs Batch mode.
* Tag and Split Files:: How tagged and split files help Info
to run better.
+* makeinfo html:: Generating HTML output.
@end menu
-@node makeinfo advantages, Invoking makeinfo, Create an Info File, Create an Info File
-@ifinfo
-@heading @code{makeinfo} Preferred
-@end ifinfo
+
+@node makeinfo advantages
+@subsection @code{makeinfo} Preferred
The @code{makeinfo} utility creates an Info file from a Texinfo source
file more quickly than either of the Emacs formatting commands and
provides better error messages. We recommend it. @code{makeinfo} is a
C program that is independent of Emacs. You do not need to run Emacs to
use @code{makeinfo}, which means you can use @code{makeinfo} on machines
-that are too small to run Emacs. You can run @code{makeinfo} in
-any one of three ways: from an operating system shell, from a shell
-inside Emacs, or by typing a key command in Texinfo mode in Emacs.
+that are too small to run Emacs. You can run @code{makeinfo} in any one
+of three ways: from an operating system shell, from a shell inside
+Emacs, or by typing the @kbd{C-c C-m C-r} or the @kbd{C-c C-m C-b}
+command in Texinfo mode in Emacs.
@refill
The @code{texinfo-format-region} and the @code{texinfo-format-buffer}
@@ -12671,13 +13595,12 @@ commands are useful if you cannot run @code{makeinfo}. Also, in some
circumstances, they format short regions or buffers more quickly than
@code{makeinfo}.@refill
-@node Invoking makeinfo, makeinfo options, makeinfo advantages, Create an Info File
-@section Running @code{makeinfo} from a Shell
+@node Invoking makeinfo
+@subsection Running @code{makeinfo} from a Shell
To create an Info file from a Texinfo file, type @code{makeinfo}
followed by the name of the Texinfo file. Thus, to create the Info
file for Bison, type the following to the shell:
-is the prompt):@refill
@example
makeinfo bison.texinfo
@@ -12698,9 +13621,9 @@ makeinfo --version
@end ifinfo
-@node makeinfo options, Pointer Validation, Invoking makeinfo, Create an Info File
+@node makeinfo options
@comment node-name, next, previous, up
-@section Options for @code{makeinfo}
+@subsection Options for @code{makeinfo}
@cindex @code{makeinfo} options
@cindex Options for @code{makeinfo}
@@ -12737,24 +13660,37 @@ The options are:
Cause the variable @var{var} to be defined. This is equivalent to
@code{@@set @var{var}} in the Texinfo file (@pxref{set clear value}).
+@item --commands-in-node-names
+@opindex --commands-in-node-names
+Allow @code{@@}-commands in node names. This is not recommended, as it
+can probably never be implemented in @TeX{}. It also makes
+@code{makeinfo} much slower. Also, this option is ignored when
+@samp{--no-validate} is used. @xref{Pointer Validation}, for more
+details.
+
@item --error-limit=@var{limit}
+@itemx -e @var{limit}
@opindex --error-limit=@var{limit}
+@opindex -e @var{limit}
Set the maximum number of errors that @code{makeinfo} will report
before exiting (on the assumption that continuing would be useless);
default 100.
-@need 150
@item --fill-column=@var{width}
+@itemx -f @var{width}
@opindex --fill-column=@var{width}
+@opindex -f @var{width}
Specify the maximum number of columns in a line; this is the right-hand
edge of a line. Paragraphs that are filled will be filled to this
width. (Filling is the process of breaking up and connecting lines so
that lines are the same length as or shorter than the number specified
as the fill column. Lines are broken between words.) The default value
-is 72.
+is 72. Ignored with @samp{--html}.
@item --footnote-style=@var{style}
+@itemx -s @var{style}
@opindex --footnote-style=@var{style}
+@opindex -s @var{style}
Set the footnote style to @var{style}, either @samp{end} for the end
node style (the default) or @samp{separate} for the separate node style.
The value set by this option overrides the value set in a Texinfo file
@@ -12762,45 +13698,78 @@ by an @code{@@footnotestyle} command (@pxref{Footnotes}). When the
footnote style is @samp{separate}, @code{makeinfo} makes a new node
containing the footnotes found in the current node. When the footnote
style is @samp{end}, @code{makeinfo} places the footnote references at
-the end of the current node.
+the end of the current node. Ignored with @samp{--html}.
@item --force
+@itemx -F
@opindex --force
+@opindex -F
Ordinarily, if the input file has errors, the output files are not
created. With this option, they are preserved.
@item --help
+@itemx -h
@opindex --help
+@opindex -h
Print a usage message listing all available options, then exit successfully.
+@item --html
+Generate HTML output rather than Info. @xref{makeinfo html}.
+
@item -I @var{dir}
@opindex -I @var{dir}
-Add @code{dir} to the directory search list for finding files that are
-included using the @code{@@include} command. By default,
-@code{makeinfo} searches only the current directory.
+Append @var{dir} to the directory search list for finding files that
+are included using the @code{@@include} command. By default,
+@code{makeinfo} searches only the current directory. If @var{dir} is
+not given, the current directory @file{.} is appended. Note that
+@var{dir} can actually be a list of several directories separated by the
+usual path separator character (@samp{:} on Unix, @samp{;} on
+MS-DOS/MS-Windows).
+
+@item --macro-expand=@var{file}
+@itemx -E @var{file}
+Output the Texinfo source with all the macros expanded to the named
+file. Normally, the results of macro expansion are used internally by
+@code{makeinfo} and then discarded. This option is used by
+@command{texi2dvi} if you are using an old version of @file{texinfo.tex}
+that does not support @code{@@macro}.
@item --no-headers
@opindex --no-headers
-Do not include menus or node lines in the output. This results in an
-@sc{ascii} file that you cannot read in Info since it does not contain
-the requisite nodes or menus. It is primarily useful to extract certain
-pieces of a manual into separate files to be included in a distribution,
-such as @file{INSTALL} files.
+@cindex Plain text output
+@cindex ASCII text output
+@cindex Generating plain text files
+@cindex @file{INSTALL} file, generating
+For Info output, do not include menus or node lines in the output and
+write to standard output (unless @option{--output} is specified). This
+results in an @sc{ascii} file that you cannot read in Info since it does
+not contain the requisite nodes or menus. It is primarily useful to
+extract certain pieces of a manual into separate files to be included in
+a distribution, such as @file{INSTALL} files.
+
+@cindex Navigation links, omitting
+For HTML output, if @samp{--no-split} is also specified, do not include a
+navigation links at the top of each node. @xref{makeinfo html}.
@item --no-split
@opindex --no-split
+@cindex Splitting of output files
+@cindex Output file splitting
Suppress the splitting stage of @code{makeinfo}. By default, large
output files (where the size is greater than 70k bytes) are split into
-smaller subfiles, each one approximately 50k bytes.
+smaller subfiles. For Info output, each one is approximately 50k bytes.
+For HTML output, each file contains one node (@pxref{makeinfo html}).
@item --no-pointer-validate
@itemx --no-validate
@opindex --no-pointer-validate
@opindex --no-validate
-Suppress the pointer-validation phase of @code{makeinfo}. Normally,
-after a Texinfo file is processed, some consistency checks are made to
-ensure that cross references can be resolved, etc.
-@xref{Pointer Validation}.@refill
+@cindex Pointer validation, suppressing
+Suppress the pointer-validation phase of @code{makeinfo}. This can also
+be done with the @code{@@novalidate} command (@pxref{Use TeX,,Use
+@TeX{}}). Normally, after a Texinfo file is processed, some consistency
+checks are made to ensure that cross references can be resolved, etc.
+@xref{Pointer Validation}.
@item --no-warn
@opindex --no-warn
@@ -12809,6 +13778,10 @@ want this if the file you are creating has examples of Texinfo cross
references within it, and the nodes that are referenced do not actually
exist.
+@item --number-sections
+@opindex --number-sections
+Output chapter, section, and appendix numbers as in printed manuals.
+
@item --no-number-footnotes
@opindex --no-number-footnotes
Suppress automatic footnote numbering. By default, @code{makeinfo}
@@ -12822,15 +13795,20 @@ current footnote number to 1 at the start of each node.
Specify that the output should be directed to @var{file} and not to the
file name specified in the @code{@@setfilename} command found in the
Texinfo source (@pxref{setfilename}). If @var{file} is @samp{-}, output
-goes to standard output and @samp{--no-split} is implied.
+goes to standard output and @samp{--no-split} is implied. For split
+HTML output, @var{file} is the name of the output file for the top node
+(@pxref{makeinfo html}).
@item -P @var{dir}
@opindex -P @var{dir}
-Prepend @code{dir} to the directory search list for @code{@@include}.
+Prepend @var{dir} to the directory search list for @code{@@include}.
+If @var{dir} is not given, the current directory @file{.} is prepended.
See @samp{-I} for more details.
@item --paragraph-indent=@var{indent}
+@itemx -p @var{indent}
@opindex --paragraph-indent=@var{indent}
+@opindex -p @var{indent}
Set the paragraph indentation style to @var{indent}. The value set by
this option overrides the value set in a Texinfo file by an
@code{@@paragraphindent} command (@pxref{paragraphindent}). The value
@@ -12844,11 +13822,13 @@ Preserve any existing indentation at the starts of paragraphs.
Delete any existing indentation.
@item @var{num}
-Indent each paragraph by that number of spaces.
+Indent each paragraph by @var{num} spaces.
@end table
@item --reference-limit=@var{limit}
+@itemx -r @var{limit}
@opindex --reference-limit=@var{limit}
+@opindex -r @var{limit}
Set the value of the number of references to a node that
@code{makeinfo} will make without reporting a warning. If a node has more
than this number of references in it, @code{makeinfo} will make the
@@ -12865,21 +13845,24 @@ Normally, @code{makeinfo} only outputs messages if there are errors or
warnings.
@item --version
+@itemx -V
@opindex --version
+@opindex -V
Print the version number, then exit successfully.
@end table
-@node Pointer Validation, makeinfo in Emacs, makeinfo options, Create an Info File
-@section Pointer Validation
+@node Pointer Validation
+@subsection Pointer Validation
@cindex Pointer validation with @code{makeinfo}
@cindex Validation of pointers
-If you do not suppress pointer-validation, @code{makeinfo} will check
-the validity of the final Info file. Mostly, this means ensuring that
-nodes you have referenced really exist. Here is a complete list of what
-is checked:@refill
+If you do not suppress pointer validation with the @samp{--no-validate}
+option or the @code{@@novalidate} command in the source file (@pxref{Use
+TeX,,Use @TeX{}}), @code{makeinfo} will check the validity of the final
+Info file. Mostly, this means ensuring that nodes you have referenced
+really exist. Here is a complete list of what is checked:
@enumerate
@item
@@ -12889,15 +13872,16 @@ node in the current file and is not an external reference such as to
@item
In every node, if the `Previous' node is different from the `Up' node,
-then the `Previous' node must also be pointed to by a `Next' node.@refill
+then the node pointed to by the `Previous' field must have a `Next'
+field which points back to this node.@refill
@item
Every node except the `Top' node must have an `Up' pointer.@refill
@item
-The node referenced by an `Up' pointer must contain a reference to the
-current node in some manner other than through a `Next' reference.
-This includes menu entries and cross references.@refill
+The node referenced by an `Up' pointer must itself reference the current
+node through a menu item, unless the node referenced by `Up'
+has the form `(@var{file})'.
@item
If the `Next' reference of a node is not the same as the `Next' reference
@@ -12905,10 +13889,62 @@ of the `Up' reference, then the node referenced by the `Next' pointer
must have a `Previous' pointer that points back to the current node.
This rule allows the last node in a section to point to the first node
of the next chapter.@refill
+
+@item
+Every node except `Top' should be referenced by at least one other node,
+either via the `Previous' or `Next' links, or via a menu or a
+cross-reference.@refill
@end enumerate
-@node makeinfo in Emacs, texinfo-format commands, Pointer Validation, Create an Info File
-@section Running @code{makeinfo} inside Emacs
+@cindex @@-commands in @@node, limited support
+Some Texinfo documents might fail during the validation phase because
+they use commands like @code{@@value} and @code{@@definfoenclose} in
+node definitions and cross-references inconsistently. Consider the
+following example:
+
+@example
+@group
+@@set nodename Node 1
+
+@@node @@value@{nodename@}, Node 2, Top, Top
+
+This is node 1.
+
+@@node Node 2, , Node 1, Top
+
+This is node 2.
+@end group
+@end example
+
+@noindent
+Here, the node ``Node 1'' was referenced both verbatim and through
+@code{@@value}.
+
+By default, @code{makeinfo} fails such cases, because node names are not
+fully expanded until they are written to the output file. You should
+always try to reference nodes consistently; e.g., in the above example,
+the second @code{@@node} line should have also used @code{@@value}.
+However, if, for some reason, you @emph{must} reference node names
+inconsistently, and @code{makeinfo} fails to validate the file, you can
+use the @samp{--commands-in-node-names} option to force @code{makeinfo}
+to perform the expensive expansion of all node names it finds in the
+document. This might considerably slow down the program, though;
+twofold increase in conversion time was measured for large documents
+such as the Jargon file.
+
+@cindex @@value in @@node lines
+The support for @code{@@}-commands in @code{@@node} directives is not
+general enough to be freely used. For example, if the example above
+redefined @code{nodename} somewhere in the document, @code{makeinfo}
+will fail to convert it, even if invoked with the
+@samp{--commands-in-node-names} option.
+
+@samp{--commands-in-node-names} has no effect if the @samp{--no-validate}
+option is given.
+
+
+@node makeinfo in Emacs
+@subsection Running @code{makeinfo} inside Emacs
@cindex Running @code{makeinfo} in Emacs
@cindex @code{makeinfo} inside Emacs
@cindex Shell, running @code{makeinfo} in
@@ -12959,8 +13995,8 @@ output.@refill
@item C-c C-m C-k
@itemx M-x makeinfo-kill-job
@findex makeinfo-kill-job
-Kill the current running @code{makeinfo} job created by
-@code{makeinfo-region} or @code{makeinfo-buffer}.@refill
+Kill the current running @code{makeinfo} job
+(from @code{makeinfo-region} or @code{makeinfo-buffer}).@refill
@item C-c C-m C-l
@itemx M-x makeinfo-recenter-output-buffer
@@ -12993,8 +14029,8 @@ For example, you could write the following in your @file{.emacs} file:@refill
@c three references to the same named manual, which looks strange.
@iftex
For more information, see @ref{makeinfo options, , Options for
-@code{makeinfo}}, as well as ``Editing Variable Values,''``Examining and
-Setting Variables,'' and ``Init File'' in the @cite{The GNU Emacs
+@code{makeinfo}}, as well as ``Editing Variable Values,'' ``Examining
+and Setting Variables,'' and ``Init File'' in @cite{The GNU Emacs
Manual}.
@end iftex
@noindent
@@ -13006,9 +14042,9 @@ For more information, see@*
@ref{makeinfo options, , Options for @code{makeinfo}}.
@end ifinfo
-@node texinfo-format commands, Batch Formatting, makeinfo in Emacs, Create an Info File
+@node texinfo-format commands
@comment node-name, next, previous, up
-@section The @code{texinfo-format@dots{}} Commands
+@subsection The @code{texinfo-format@dots{}} Commands
@findex texinfo-format-region
@findex texinfo-format-buffer
@@ -13043,9 +14079,9 @@ procedures are described in an appendix; see @ref{Catching Mistakes}.
However, the @code{makeinfo} program is often faster and
provides better error checking (@pxref{makeinfo in Emacs}).@refill
-@node Batch Formatting, Tag and Split Files, texinfo-format commands, Create an Info File
+@node Batch Formatting
@comment node-name, next, previous, up
-@section Batch Formatting
+@subsection Batch Formatting
@cindex Batch formatting for Info
@cindex Info batch formatting
@@ -13075,9 +14111,9 @@ you can continue working in it. (When you run
@code{texinfo-format-region} or @code{texinfo-format-buffer}, you cannot
use that Emacs for anything else until the command finishes.)@refill
-@node Tag and Split Files, , Batch Formatting, Create an Info File
+@node Tag and Split Files
@comment node-name, next, previous, up
-@section Tag Files and Split Files
+@subsection Tag Files and Split Files
@cindex Making a tag table automatically
@cindex Tag table, making automatically
@@ -13093,8 +14129,8 @@ bytes, @code{texinfo-format-buffer} and @code{makeinfo} split the
large Info file into shorter @dfn{indirect} subfiles of about 50,000
bytes each. Big files are split into smaller files so that Emacs does
not need to make a large buffer to hold the whole of a large Info
-file; instead, Emacs allocates just enough memory for the small, split
-off file that is needed at the time. This way, Emacs avoids wasting
+file; instead, Emacs allocates just enough memory for the small, split-off
+file that is needed at the time. This way, Emacs avoids wasting
memory when you run Info. (Before splitting was implemented, Info
files were always kept short and @dfn{include files} were designed as
a way to create a single, large printed manual out of the smaller Info
@@ -13104,16 +14140,16 @@ Reference Manual}, in which each chapter is a separate file.)@refill
When a file is split, Info itself makes use of a shortened version of
the original file that contains just the tag table and references to
-the files that were split off. The split off files are called
+the files that were split off. The split-off files are called
@dfn{indirect} files.@refill
-The split off files have names that are created by appending @w{@samp{-1}},
+The split-off files have names that are created by appending @w{@samp{-1}},
@w{@samp{-2}}, @w{@samp{-3}} and so on to the file name specified by the
@code{@@setfilename} command. The shortened version of the original file
continues to have the name specified by @code{@@setfilename}.@refill
At one stage in writing this document, for example, the Info file was saved
-as @file{test-texinfo} and that file looked like this:@refill
+as the file @file{test-texinfo} and that file looked like this:@refill
@example
@group
@@ -13143,7 +14179,7 @@ Node: conventions^?6855
@noindent
(But @file{test-texinfo} had far more nodes than are shown here.) Each of
-the split off, indirect files, @file{test-texinfo-1},
+the split-off, indirect files, @file{test-texinfo-1},
@file{test-texinfo-2}, and @file{test-texinfo-3}, is listed in this file
after the line that says @samp{Indirect:}. The tag table is listed after
the line that says @samp{Tag table:}. @refill
@@ -13153,7 +14189,7 @@ records the cumulative number of bytes in the preceding indirect files,
not counting the file list itself, the tag table, or the permissions
text in each file. In the tag table, the number following the node name
records the location of the beginning of the node, in bytes from the
-beginning.@refill
+beginning of the (unsplit) output.
If you are using @code{texinfo-format-buffer} to create Info files,
you may want to run the @code{Info-validate} command. (The
@@ -13165,9 +14201,50 @@ validate the structure of the nodes, see @ref{Using
Info-validate}.@refill
-@node Install an Info File, Command List, Create an Info File, Top
-@comment node-name, next, previous, up
-@chapter Installing an Info File
+@node makeinfo html
+@subsection Generating HTML
+@cindex HTML
+
+As an alternative to the normal Info format output you can use the
+@samp{--html} option to generate output in HTML format, for installation
+on a web site (for example). In this release, HTML output from
+@code{makeinfo} is monolithic, splitting the output by chapter or node
+is not supported. We hope to implement this feature soon.
+
+The HTML output file is named according to @code{@@setfilename}, but
+with any @samp{.info} extension replaced with @samp{.html}.
+
+Texinfo input marked up with the @code{@@ifhtml} command will produce
+output only with the @samp{--html} option supplied. Input marked up
+with the @code{@@html} is passed literally to the output (suppressing
+the normal escaping of input @samp{<}, @samp{>} and @samp{&} characters
+which have special significance in HTML).
+
+The @samp{--footnote-style} option is currently ignored for HTML output;
+footnotes are hyperlinked at the end of the output file.
+
+The HTML generated is mostly standard (i.e., HTML 2.0, RFC1866). The
+exception is that HTML 3.2 tables are generated from the
+@code{@@multitable} command, but tagged to degrade as well as possible
+in browsers without table support. Please report output from an
+error-free run of @code{makeinfo} which violates the HTML 3.2 DTD as a
+bug.
+
+Navigation bars are inserted at the start of nodes, similarly to Info
+output. The @samp{--no-headers} option will suppress this if used with
+@samp{--no-split}. Header @code{<link>} elements in split output can
+support info-like navigation with browsers like Lynx and @w{Emacs W3}
+which implement this @w{HTML 1.0} feature. You still won't normally get
+the multi-file regexp and index search facilities provided by Info
+readers. Otherwise, hyperlinks are generated from Texinfo commands
+where appropriate. @samp{@@xref} commands to other documents are
+generated assuming the other document is available in HTML form too, and
+@samp{.html} is appended to the @samp{@@xref} Info file name. This
+presumably will often not work.
+
+
+@node Install an Info File
+@section Installing an Info File
@cindex Installing an Info file
@cindex Info file installation
@cindex @file{dir} directory for Info installation
@@ -13177,7 +14254,7 @@ Info files using the standalone Info program or the Info reader built
into Emacs. (@inforef{Top, info, info}, for an introduction to Info.)
@menu
-* Directory file:: The top level menu for all Info files.
+* Directory File:: The top level menu for all Info files.
* New Info File:: Listing a new info file.
* Other Info Directories:: How to specify Info files that are
located in other directories.
@@ -13186,10 +14263,9 @@ into Emacs. (@inforef{Top, info, info}, for an introduction to Info.)
* Invoking install-info:: @code{install-info} options.
@end menu
-@node Directory file, New Info File, Install an Info File, Install an Info File
-@ifinfo
-@heading The @file{dir} File
-@end ifinfo
+
+@node Directory File
+@subsection The Directory File @file{dir}
For Info to work, the @file{info} directory must contain a file that
serves as a top level directory for the Info system. By convention,
@@ -13204,7 +14280,6 @@ this:@refill
@example
@group
* Menu:
-
* Info: (info). Documentation browsing system.
* Emacs: (emacs). The extensible, self-documenting
text editor.
@@ -13234,21 +14309,17 @@ File: emacs Node: Top, Up: (DIR), Next: Distrib
@end example
@noindent
-(Note that in this case, the @file{dir} file name is written in upper
-case letters---it can be written in either upper or lower case. Info
-has a feature that it will change the case of the file name to lower
-case if it cannot find the name as written.)@refill
-@c !!! Can any file name be written in upper or lower case,
-@c or is dir a special case?
-@c Yes, apparently so, at least with Gillespie's Info. --rjc 24mar92
+In this case, the @file{dir} file name is written in upper case
+letters---it can be written in either upper or lower case. This is not
+true in general, it is a special case for @file{dir}.
-@node New Info File, Other Info Directories, Directory file, Install an Info File
-@section Listing a New Info File
+@node New Info File
+@subsection Listing a New Info File
@cindex Adding a new info file
@cindex Listing a new info file
@cindex New info file, listing it in @file{dir} file
-@cindex Info file, listing new one
+@cindex Info file, listing a new
@cindex @file{dir} file listing
To add a new Info file to your system, you must write a menu entry to
@@ -13268,25 +14339,26 @@ followed by a period. The third part is the description.
The name of an Info file often has a @file{.info} extension. Thus, the
Info file for GDB might be called either @file{gdb} or @file{gdb.info}.
The Info reader programs automatically try the file name both with and
-without @file{.info}; so it is better to avoid clutter and not to write
-@samp{.info} explicitly in the menu entry. For example, the GDB menu
-entry should use just @samp{gdb} for the file name, not @samp{gdb.info}.
+without @file{.info}@footnote{On MS-DOS/MS-Windows systems, Info will
+try the @file{.inf} extension as well.}; so it is better to avoid
+clutter and not to write @samp{.info} explicitly in the menu entry. For
+example, the GDB menu entry should use just @samp{gdb} for the file
+name, not @samp{gdb.info}.
-@node Other Info Directories, Installing Dir Entries, New Info File, Install an Info File
-@comment node-name, next, previous, up
-@section Info Files in Other Directories
+@node Other Info Directories
+@subsection Info Files in Other Directories
@cindex Installing Info in another directory
@cindex Info installed in another directory
@cindex Another Info directory
+@cindex @file{dir} files and Info directories
If an Info file is not in the @file{info} directory, there are three
ways to specify its location:@refill
-@itemize @bullet
+@enumerate
@item
-Write the pathname in the @file{dir} file as the second part of the
-menu.@refill
+Write the pathname in the @file{dir} file as the second part of the menu.
@item
If you are using Emacs, list the name of the file in a second @file{dir}
@@ -13294,58 +14366,63 @@ file, in its directory; and then add the name of that directory to the
@code{Info-directory-list} variable in your personal or site
initialization file.
-This tells Emacs where to look for @file{dir} files. Emacs merges the
-files named @file{dir} from each of the listed directories. (In Emacs
-version 18, you can set the @code{Info-directory} variable to the name
-of only one directory.)@refill
+This variable tells Emacs where to look for @file{dir} files (the files
+must be named @file{dir}). Emacs merges the files named @file{dir} from
+each of the listed directories. (In Emacs version 18, you can set the
+@code{Info-directory} variable to the name of only one
+directory.)@refill
@item
Specify the Info directory name in the @code{INFOPATH} environment
variable in your @file{.profile} or @file{.cshrc} initialization file.
(Only you and others who set this environment variable will be able to
-find Info files whose location is specified this way.)@refill
-@end itemize
+find Info files whose location is specified this way.)
+@end enumerate
-For example, to reach a test file in the @file{/home/bob/manuals}
+For example, to reach a test file in the @file{/home/bob/info}
directory, you could add an entry like this to the menu in the
-@file{dir} file:@refill
+standard @file{dir} file:@refill
@example
-* Test: (/home/bob/manuals/info-test). Bob's own test file.
+* Test: (/home/bob/info/info-test). Bob's own test file.
@end example
@noindent
In this case, the absolute file name of the @file{info-test} file is
written as the second part of the menu entry.@refill
-@vindex Info-directory-list
Alternatively, you could write the following in your @file{.emacs}
file:@refill
+@vindex Info-directory-list
@example
@group
+(require 'info)
(setq Info-directory-list
- '("/home/bob/manuals"
- "/usr/local/info"))
+ (cons (expand-file-name "/home/bob/info") Info-directory-list))
@end group
@end example
-@c reworded to avoid overfill hbox
This tells Emacs to merge the @file{dir} file from the
-@file{/home/bob/manuals} directory with the @file{dir} file from the
-@file{/usr/local/info} directory. Info will list the
-@file{/home/bob/manuals/info-test} file as a menu entry in the
-@file{/home/bob/manuals/dir} file.@refill
+@file{/home/bob/info} directory with the system @file{dir} file. Info
+will list the @file{/home/bob/info/info-test} file as a menu entry in
+the @file{/home/bob/info/dir} file. Emacs does the merging only
+when @kbd{M-x info} is first run, so if you want to set
+@code{Info-directory-list} in an Emacs session where you've already run
+@code{info}, you must @code{(setq Info-dir-contents nil)} to force Emacs
+to recompose the @file{dir} file.
@vindex INFOPATH
Finally, you can tell Info where to look by setting the @code{INFOPATH}
-environment variable in your @file{.cshrc} or @file{.profile} file. If
-you use a Bourne-compatible shell such as @code{sh} or @code{bash} for
-your shell command interpreter, you set the @code{INFOPATH} environment
-variable in the @file{.profile} initialization file; but if you use
-@code{csh} or @code{tcsh}, you must set the variable in the
-@file{.cshrc} initialization file. The two types of shells use
-different syntax.
+environment variable in your shell startup file, such as @file{.cshrc},
+@file{.profile} or @file{autoexec.bat}. If you use a Bourne-compatible
+shell such as @code{sh} or @code{bash} for your shell command
+interpreter, you set the @code{INFOPATH} environment variable in the
+@file{.profile} initialization file; but if you use @code{csh} or
+@code{tcsh}, you set the variable in the @file{.cshrc} initialization
+file. On MS-DOS/MS-Windows systems, you must set @code{INFOPATH} in
+your @file{autoexec.bat} file or in the Registry. Each type of shell
+uses a different syntax.
@itemize @bullet
@item
@@ -13353,7 +14430,7 @@ In a @file{.cshrc} file, you could set the @code{INFOPATH}
variable as follows:@refill
@smallexample
-setenv INFOPATH .:~/manuals:/usr/local/emacs/info
+setenv INFOPATH .:~/info:/usr/local/emacs/info
@end smallexample
@item
@@ -13361,21 +14438,35 @@ In a @file{.profile} file, you would achieve the same effect by
writing:@refill
@smallexample
-INFOPATH=.:$HOME/manuals:/usr/local/emacs/info
+INFOPATH=.:$HOME/info:/usr/local/emacs/info
export INFOPATH
@end smallexample
+
+@item
+@pindex autoexec.bat
+In a @file{autoexec.bat} file, you write this command@footnote{Note the
+use of @samp{;} as the directory separator, and a different syntax for
+using values of other environment variables.}:
+
+@smallexample
+set INFOPATH=.;%HOME%/info;c:/usr/local/emacs/info
+@end smallexample
@end itemize
@noindent
The @samp{.} indicates the current directory as usual. Emacs uses the
@code{INFOPATH} environment variable to initialize the value of Emacs's
-own @code{Info-directory-list} variable.
-
-@cindex @samp{:} @r{last in @code{INFOPATH}}
-However you set @code{INFOPATH}, if its last character is a colon, this
+own @code{Info-directory-list} variable. The stand-alone Info reader
+merges any files named @file{dir} in any directory listed in the
+@env{INFOPATH} variable into a single menu presented to you in the node
+called @samp{(dir)Top}.
+
+@cindex @samp{:} @r{last in @env{INFOPATH}}
+However you set @env{INFOPATH}, if its last character is a
+colon@footnote{On MS-DOS/MS-Windows systems, use semi-colon instead.}, this
is replaced by the default (compiled-in) path. This gives you a way to
augment the default path with new directories without having to list all
-the standard places. For example (using @code{sh} syntax:
+the standard places. For example (using @code{sh} syntax):
@example
INFOPATH=/local/info:
@@ -13386,9 +14477,16 @@ export INFOPATH
will search @file{/local/info} first, then the standard directories.
Leading or doubled colons are not treated specially.
+@cindex @file{dir} file, creating your own
+When you create your own @file{dir} file for use with
+@code{Info-directory-list} or @env{INFOPATH}, it's easiest to start by
+copying an existing @file{dir} file and replace all the text after the
+@samp{* Menu:} with your desired entries. That way, the punctuation and
+special CTRL-_ characters that Info needs will be present.
+
@node Installing Dir Entries, Invoking install-info, Other Info Directories, Install an Info File
-@section Installing Info Directory Files
+@subsection Installing Info Directory Files
When you install an Info file onto your system, you can use the program
@code{install-info} to update the Info directory file @file{dir}.
@@ -13398,11 +14496,12 @@ after copying the Info file into its proper installed location.
@findex dircategory
@findex direntry
In order for the Info file to work with @code{install-info}, you should
-use the commands @code{@@dircategory} and @code{@@direntry} in the
-Texinfo source file. Use @code{@@direntry} to specify the menu entry to
-add to the Info directory file, and use @code{@@dircategory} to specify
-which part of the Info directory to put it in. Here is how these
-commands are used in this manual:
+use the commands @code{@@dircategory} and
+@code{@@direntry}@dots{}@code{@@end direntry} in the Texinfo source
+file. Use @code{@@direntry} to specify the menu entries to add to the
+Info directory file, and use @code{@@dircategory} to specify which part
+of the Info directory to put it in. Here is how these commands are used
+in this manual:
@smallexample
@@dircategory Texinfo documentation system
@@ -13434,38 +14533,50 @@ command. If you use them later on in the input, @code{install-info}
will not notice them.
If you use @code{@@dircategory} more than once in the Texinfo source,
-each usage specifies one category; the new menu entry is added to the
-Info directory file in each of the categories you specify. If you use
-@code{@@direntry} more than once, each usage specifies one menu entry;
-each of these menu entries is added to the directory in each of the
-specified categories.
+each usage specifies the `current' category; any subsequent
+@code{@@direntry} commands will add to that category.
+Here are some recommended @code{@@dircategory} categories: `GNU
+packages', `GNU programming tools', `GNU programming documentation',
+`GNU Emacs Lisp', `GNU libraries', `Linux', `TeX', `Individual
+utilities'. The idea is to include the `invoking' node for every
+program installed by a package under `Individual utilities', and an
+entry for the manual as a whole in the appropriate other category.
-@node Invoking install-info, , Installing Dir Entries, Install an Info File
-@section Invoking install-info
+
+@node Invoking install-info
+@subsection Invoking install-info
@pindex install-info
@code{install-info} inserts menu entries from an Info file into the
top-level @file{dir} file in the Info system (see the previous sections
for an explanation of how the @file{dir} file works). It's most often
-run as part of software installation, or when constructing a dir file
+run as part of software installation, or when constructing a @file{dir} file
for all manuals on a system. Synopsis:
@example
install-info [@var{option}]@dots{} [@var{info-file} [@var{dir-file}]]
@end example
-If @var{info-file} or @var{dir-file} are not specified, the various
-options (described below) that define them must be. There are no
-compile-time defaults, and standard input is never used.
-@code{install-info} can read only one info file and write only one dir
-file per invocation.
+If @var{info-file} or @var{dir-file} are not specified, the options
+(described below) that define them must be. There are no compile-time
+defaults, and standard input is never used. @code{install-info} can
+read only one Info file and write only one @file{dir} file per invocation.
@cindex @file{dir}, created by @code{install-info}
If @var{dir-file} (however specified) does not exist,
@code{install-info} creates it if possible (with no entries).
+@cindex Compressed files, reading
+@cindex Dir files, compressed
+If any input file is compressed with @code{gzip} (@pxref{Invoking
+gzip,,,gzip, Gzip}), @code{install-info} automatically uncompresses it
+for reading. And if @var{dir-file} is compressed, @code{install-info}
+also automatically leaves it compressed after writing any changes.
+If @var{dir-file} itself does not exist, @code{install-info} tries to
+open @file{@var{dir-file}.gz}.
+
Options:
@table @code
@@ -13476,12 +14587,16 @@ name in the entry in @var{dir-file} must be @var{info-file} (except for
an optional @samp{.info} in either one). Don't insert any new entries.
@item --dir-file=@var{name}
+@itemx -d @var{name}
@opindex --dir-file=@var{name}
+@opindex -d @var{name}
Specify file name of the Info directory file. This is equivalent to
using the @var{dir-file} argument.
@item --entry=@var{text}
+@itemx -e @var{text}
@opindex --entry=@var{text}
+@opindex -e @var{text}
Insert @var{text} as an Info directory entry; @var{text} should have the
form of an Info menu item line plus zero or more extra lines starting
with whitespace. If you specify more than one entry, they are all
@@ -13489,17 +14604,24 @@ added. If you don't specify any entries, they are determined from
information in the Info file itself.
@item --help
+@itemx -h
@opindex --help
+@opindex -h
Display a usage message listing basic usage and all available options,
then exit successfully.
@item --info-file=@var{file}
+@itemx -i @var{file}
@opindex --info-file=@var{file}
+@opindex -i @var{file}
Specify Info file to install in the directory.
-This is equivalent to using the @var{info-file} argument.
+Equivalent to using the @var{info-file} argument.
@item --info-dir=@var{dir}
+@itemx -D @var{dir}
@opindex --info-dir=@var{dir}
+@opindex -D @var{dir}
+Specify the directory where @file{dir} resides.
Equivalent to @samp{--dir-file=@var{dir}/dir}.
@item --item=@var{text}
@@ -13512,33 +14634,40 @@ a menu item.
Suppress warnings.
@item --remove
+@itemx -r
@opindex --remove
+@opindex -r
Same as @samp{--delete}.
@item --section=@var{sec}
+@itemx -s @var{sec}
@opindex --section=@var{sec}
+@opindex -s @var{sec}
Put this file's entries in section @var{sec} of the directory. If you
specify more than one section, all the entries are added in each of the
sections. If you don't specify any sections, they are determined from
information in the Info file itself.
@item --version
+@itemx -V
@opindex --version
+@opindex -V
@cindex version number, finding
Display version information and exit successfully.
@end table
-@node Command List, Tips, Install an Info File, Top
+@node Command List
@appendix @@-Command List
@cindex Alphabetical @@-command list
@cindex List of @@-commands
@cindex @@-command list
+@cindex Reference to @@-commands
Here is an alphabetical list of the @@-commands in Texinfo. Square
brackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis,
-@samp{@dots{}}, indicates repeated text.@refill
+@samp{@dots{}}, indicates repeated text.
@sp 1
@table @code
@@ -13575,10 +14704,10 @@ Indicate to @TeX{} that an immediately preceding period, question
mark, exclamation mark, or colon does not end a sentence. Prevent
@TeX{} from inserting extra whitespace as it does at the end of a
sentence. The command has no effect on the Info file output.
-@xref{Not Ending a Sentence}.@refill
+@xref{Not Ending a Sentence}.
@item @@=
-Generate a macro (bar) accent over the next character, as in @=o.
+Generate a macron (bar) accent over the next character, as in @=o.
@xref{Inserting Accents}.
@item @@?
@@ -13603,7 +14732,7 @@ Stands for a left brace, @samp{@{}.
Stands for a right-hand brace, @samp{@}}.@*
@xref{Braces Atsigns, , Inserting @@ and braces}.
-@item @@=
+@item @@~
Generate a tilde accent over the next character, as in @~N.
@xref{Inserting Accents}.
@@ -13612,15 +14741,27 @@ Generate a tilde accent over the next character, as in @~N.
Generate the uppercase and lowercase Scandinavian A-ring letters,
respectively: @AA{}, @aa{}. @xref{Inserting Accents}.
+@item @@acronym@{@var{abbrev}@}
+Tag @var{abbrev} as an acronym, that is, an abbreviation written in all
+capital letters, such as `NASA'. @xref{acronym,, @code{acronym}}.
+
@item @@AE@{@}
@itemx @@ae@{@}
Generate the uppercase and lowercase AE ligatures, respectively:
@AE{}, @ae{}. @xref{Inserting Accents}.
-@item @@afourpaper
-Change page dimensions for the A4 paper size.
-Only allowed inside @code{@@iftex} @dots{} @code{@@end iftex}.
-@xref{A4 Paper}.
+@item @@afourlatex
+@itemx @@afourpaper
+@itemx @@afourwide
+Change page dimensions for the A4 paper size. @xref{A4 Paper}.
+
+@item @@alias @var{new}=@var{existing}
+Make the command @samp{@@@var{new}} an alias for the existing command
+@samp{@@@var{existing}}. @xref{alias}.
+
+@item @@anchor@{@var{name}@}
+Define @var{name} as the current location for use as a cross-reference
+target. @xref{anchor,, @code{@@anchor}}.
@item @@appendix @var{title}
Begin an appendix. The title appears in the table
@@ -13724,10 +14865,14 @@ and @code{@@end ifset} commands, and preventing
Highlight text that is an expression, a syntactically complete token
of a program, or a program name. @xref{code, , @code{@@code}}.@refill
+@item @@command@{@var{command-name}@}
+Indicate a command name, such as @command{ls}.
+@xref{command,, @code{@@command}}.
+
@item @@comment @var{comment}
Begin a comment in Texinfo. The rest of the line does not appear in
either the Info file or the printed manual. A synonym for @code{@@c}.
-@xref{Comments, , Comments}.@refill
+@xref{Comments}.
@item @@contents
Print a complete table of contents. Has no effect in Info, which uses
@@ -13767,12 +14912,9 @@ entity, and its arguments, if any. @xref{Definition Commands}.@refill
Define a new index and its indexing command. Print entries in a roman
font. @xref{New Indices, , Defining New Indices}.@refill
-@c Unused so far as I can see and unsupported by makeinfo -- karl, 15sep96.
-@item @@definfoenclose @var{new-command}, @var{before}, @var{after},
-Create new @@-command for Info that marks text by enclosing it in
-strings that precede and follow the text. Write definition inside of
-@code{@@ifinfo} @dots{} @code{@@end ifinfo}. @xref{Customized
-Highlighting}.@refill
+@item @@definfoenclose @var{newcmd}, @var{before}, @var{after},
+Create new @@-command @var{newcmd} for Info that marks text by enclosing
+it in strings that precede and follow the text. @xref{definfoenclose}.
@item @@defivar @var{class} @var{instance-variable-name}
@itemx @@defivarx @var{class} @var{instance-variable-name}
@@ -13781,8 +14923,8 @@ object-oriented programming. The command is equivalent to @samp{@@defcv
@{Instance Variable@} @dots{}}. @xref{Definition Commands}, and
@ref{deffnx,, Def Cmds in Detail}.
-@item @@defmac @var{macro-name} @var{arguments}@dots{}
-@itemx @@defmacx @var{macro-name} @var{arguments}@dots{}
+@item @@defmac @var{macroname} @var{arguments}@dots{}
+@itemx @@defmacx @var{macroname} @var{arguments}@dots{}
Format a description for a macro. The command is equivalent to
@samp{@@deffn Macro @dots{}}. @xref{Definition Commands}, and
@ref{deffnx,, Def Cmds in Detail}.
@@ -13801,7 +14943,7 @@ Format a description for an operation in object-oriented programming.
@code{@@defop} takes as arguments the overall name of the category of
operation, the name of the class of the operation, the name of the
operation, and its arguments, if any. @xref{Definition
-Commands}, and @ref{deffnx,, Def Cmds in Detail}.
+Commands}, and @ref{Abstract Objects}.
@item @@defopt @var{option-name}
@itemx @@defoptx @var{option-name}
@@ -13820,7 +14962,7 @@ and @ref{deffnx,, Def Cmds in Detail}.
Format a description for a data type. @code{@@deftp} takes as arguments
the category, the name of the type (which is a word like @samp{int} or
@samp{float}), and then the names of attributes of objects of that type.
-@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
+@xref{Definition Commands}, and @ref{Data Types}.
@item @@deftypefn @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
@itemx @@deftypefnx @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
@@ -13834,16 +14976,29 @@ entity, and its arguments, if any. @xref{Definition Commands}, and
@itemx @@deftypefunx @var{data-type} @var{function-name} @var{arguments}@dots{}
Format a description for a function in a typed language.
The command is equivalent to @samp{@@deftypefn Function @dots{}}.
-@xref{Definition Commands},
-and @ref{deffnx,, Def Cmds in Detail}.
+@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
+
+@item @@deftypeivar @var{class} @var{data-type} @var{variable-name}
+@itemx @@deftypeivarx @var{class} @var{data-type} @var{variable-name}
+Format a description for a typed instance variable in object-oriented
+programming. @xref{Definition Commands}, and @ref{Abstract Objects}.
@item @@deftypemethod @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{}
@itemx @@deftypemethodx @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{}
Format a description for a typed method in object-oriented programming.
-Takes as arguments the name of the class of the method, the return type
-of the method, the name of the method, and its arguments, if any.
@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
+@item @@deftypeop @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
+@itemx @@deftypeopx @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
+Format a description for a typed operation in object-oriented programming.
+@xref{Definition Commands}, and @ref{Abstract Objects}.
+
+@item @@deftypevar @var{data-type} @var{variable-name}
+@itemx @@deftypevarx @var{data-type} @var{variable-name}
+Format a description for a variable in a typed language. The command is
+equivalent to @samp{@@deftypevr Variable @dots{}}. @xref{Definition
+Commands}, and @ref{deffnx,, Def Cmds in Detail}.
+
@item @@deftypevr @var{classification} @var{data-type} @var{name}
@itemx @@deftypevrx @var{classification} @var{data-type} @var{name}
Format a description for something like a variable in a typed
@@ -13852,12 +15007,6 @@ classification of entity being described, the type, and the name of the
entity. @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in
Detail}.
-@item @@deftypevar @var{data-type} @var{variable-name}
-@itemx @@deftypevarx @var{data-type} @var{variable-name}
-Format a description for a variable in a typed language. The command is
-equivalent to @samp{@@deftypevr Variable @dots{}}. @xref{Definition
-Commands}, and @ref{deffnx,, Def Cmds in Detail}.
-
@item @@defun @var{function-name} @var{arguments}@dots{}
@itemx @@defunx @var{function-name} @var{arguments}@dots{}
Format a description for functions. The command is equivalent to
@@ -13877,7 +15026,7 @@ as arguments the category of the entity and the name of the entity.
@xref{Definition Commands},
and @ref{deffnx,, Def Cmds in Detail}.
-@item @@detailmenu@{@}
+@item @@detailmenu
Avoid @code{makeinfo} confusion stemming from the detailed node listing
in a master menu. @xref{Master Menu Parts}.
@@ -13890,22 +15039,29 @@ Specify a part of the Info directory menu where this file's entry should
go. @xref{Installing Dir Entries}.
@item @@direntry
-Begin the Info directory menu entry for this file.
-@xref{Installing Dir Entries}.
+Begin the Info directory menu entry for this file. Pair with
+@code{@@end direntry}. @xref{Installing Dir Entries}.
-@need 100
@item @@display
-Begin a kind of example. Indent text, do not fill, do not select a
-new font. Pair with @code{@@end display}. @xref{display, ,
-@code{@@display}}.@refill
+Begin a kind of example. Like @code{@@example} (indent text, do not
+fill), but do not select a new font. Pair with @code{@@end display}.
+@xref{display, , @code{@@display}}.
@item @@dmn@{@var{dimension}@}
Format a unit of measure, as in 12@dmn{pt}. Causes @TeX{} to insert a
thin space before @var{dimension}. No effect in Info.
-@xref{dmn, , @code{@@dmn}}.@refill
+@xref{dmn, , @code{@@dmn}}.
+
+@item @@documentencoding @var{enc}
+Declare the input encoding as @var{enc}.
+@xref{documentencoding,, @code{@@documentencoding}}.
+
+@item @@documentlanguage @var{CC}
+Declare the document language as the two-character ISO-639 abbreviation
+@var{CC}. @xref{documentlanguage,, @code{@@documentlanguage}}.
@item @@dotaccent@{@var{c}@}
-Generate a dot accent over the character @var{c}, as in @dotaccent{oo}.
+Generate a dot accent over the character @var{c}, as in @dotaccent{o}.
@xref{Inserting Accents}.
@item @@dots@{@}
@@ -13914,9 +15070,8 @@ Insert an ellipsis: @samp{@dots{}}.
@item @@email@{@var{address}[, @var{displayed-text}]@}
Indicate an electronic mail address.
-@xref{email, , @code{@@email}}.@refill
+@xref{email, , @code{@@email}}.
-@need 100
@item @@emph@{@var{text}@}
Highlight @var{text}; text is displayed in @emph{italics} in printed
output, and surrounded by asterisks in Info. @xref{Emphasis, ,
@@ -13926,18 +15081,20 @@ Emphasizing Text}.
Ends @var{environment}, as in @samp{@@end example}. @xref{Formatting
Commands,,@@-commands}.
+@item @@env@{@var{environment-variable}@}
+Indicate an environment variable name, such as @env{PATH}.
+@xref{env,, @code{@@env}}.
+
@item @@enddots@{@}
Generate an end-of-sentence of ellipsis, like this @enddots{}
@xref{dots,,@code{@@dots@{@}}}.
-@need 100
@item @@enumerate [@var{number-or-letter}]
Begin a numbered list, using @code{@@item} for each entry.
Optionally, start list with @var{number-or-letter}. Pair with
@code{@@end enumerate}. @xref{enumerate, ,
@code{@@enumerate}}.@refill
-@need 100
@item @@equiv@{@}
Indicate to the reader the exact equivalence of two forms with a
glyph: @samp{@equiv{}}. @xref{Equivalence}.@refill
@@ -13962,6 +15119,10 @@ Begin an example. Indent text, do not fill, and select fixed-width font.
Pair with @code{@@end example}. @xref{example, ,
@code{@@example}}.@refill
+@item @@exampleindent @var{indent}
+Indent example-like environments by @var{indent} number of spaces
+(perhaps 0). @xref{exampleindent,, Paragraph Indenting}.
+
@item @@exclamdown@{@}
Produce an upside-down exclamation point. @xref{Inserting Accents}.
@@ -13982,12 +15143,10 @@ Highlight the name of a file, buffer, node, or directory. @xref{file, ,
Prevent @TeX{} from printing large black warning rectangles beside
over-wide lines. @xref{Overfull hboxes}.@refill
-@need 100
@item @@findex @var{entry}
Add @var{entry} to the index of functions. @xref{Index Entries, ,
Defining the Entries of an Index}.@refill
-@need 200
@item @@flushleft
@itemx @@flushright
Left justify every line but leave the right end ragged.
@@ -13996,7 +15155,6 @@ Leave font as is. Pair with @code{@@end flushleft}.
@xref{flushleft & flushright, , @code{@@flushleft} and
@code{@@flushright}}.@refill
-@need 200
@item @@footnote@{@var{text-of-footnote}@}
Enter a footnote. Footnote text is printed at the bottom of the page
by @TeX{}; Info may format in either `End' node or `Separate' node style.
@@ -14008,10 +15166,9 @@ node style or @samp{separate} for the separate node style.
@xref{Footnotes}.@refill
@item @@format
-Begin a kind of example. Like @code{@@example} or @code{@@display},
-but do not narrow the margins and do not select the fixed-width font.
-Pair with @code{@@end format}. @xref{example, ,
-@code{@@example}}.@refill
+Begin a kind of example. Like @code{@@display}, but do not narrow the
+margins. Pair with @code{@@end format}. @xref{example,,
+@code{@@example}}.
@item @@ftable @var{formatting-command}
Begin a two-column table, using @code{@@item} for each entry.
@@ -14154,16 +15311,15 @@ respectively: @L{}, @l{}.
@item @@lisp
Begin an example of Lisp code. Indent text, do not fill, and select
-fixed-width font. Pair with @code{@@end lisp}. @xref{Lisp Example, ,
-@code{@@lisp}}.@refill
+fixed-width font. Pair with @code{@@end lisp}. @xref{lisp, , @code{@@lisp}}.
@item @@lowersections
Change subsequent chapters to sections, sections to subsections, and so
on. @xref{Raise/lower sections, , @code{@@raisesections} and
@code{@@lowersections}}.@refill
-@item @@macro @var{macro-name} @{@var{params}@}
-Define a new Texinfo command @code{@@@var{macro-name}@{@var{params}@}}.
+@item @@macro @var{macroname} @{@var{params}@}
+Define a new Texinfo command @code{@@@var{macroname}@{@var{params}@}}.
Only supported by @code{makeinfo} and @code{texi2dvi}. @xref{Defining
Macros}.
@@ -14194,7 +15350,7 @@ Start a new page in a printed manual if fewer than @var{n} mils
(thousandths of an inch) remain on the current page. @xref{need, ,
@code{@@need}}.@refill
-@item @@node @var{name, next, previous, up}
+@item @@node @var{name}, @var{next}, @var{previous}, @var{up}
Define the beginning of a new node in Info, and serve as a locator for
references for @TeX{}. @xref{node, , @code{@@node}}.@refill
@@ -14202,6 +15358,10 @@ references for @TeX{}. @xref{node, , @code{@@node}}.@refill
Prevent text from being indented as if it were a new paragraph.
@xref{noindent, , @code{@@noindent}}.@refill
+@item @@novalidate
+Suppress validation of node references, omit creation of auxiliary files
+with @TeX{}. Use before @code{@@setfilename}. @xref{Pointer Validation}.
+
@item @@O@{@}
@itemx @@o@{@}
Generate the uppercase and lowercase O-with-slash letters, respectively:
@@ -14218,15 +15378,21 @@ How to Make Your Own Headings}.@refill
Generate the uppercase and lowercase OE ligatures, respectively:
@OE{}, @oe{}. @xref{Inserting Accents}.
+@item @@option@{@var{option-name}@}
+Indicate a command-line option, such as @option{-l} or @option{--help}.
+@xref{option,, @code{@@option}}.
+
@item @@page
Start a new page in a printed manual. No effect in Info.
@xref{page, , @code{@@page}}.@refill
+@item @@pagesizes [@var{width}][, @var{height}]
+Change page dimensions. @xref{pagesizes}.
+
@item @@paragraphindent @var{indent}
-Indent paragraphs by @var{indent} number of spaces; delete indentation
-if the value of @var{indent} is 0; and do not change indentation if
-@var{indent} is @code{asis}. @xref{paragraphindent, , Paragraph
-Indenting}.@refill
+Indent paragraphs by @var{indent} number of spaces (perhaps 0); preserve
+source file indentation if @var{indent} is @code{asis}.
+@xref{paragraphindent,, Paragraph Indenting}.
@item @@pindex @var{entry}
Add @var{entry} to the index of programs. @xref{Index Entries, , Defining
@@ -14266,7 +15432,6 @@ or imaginary work. Write command on a line of its own. Pair with
@code{@@end quotation}. @xref{quotation, ,
@code{@@quotation}}.@refill
-@need 100
@item @@r@{@var{text}@}
Print @var{text} in @r{roman} font. No effect in Info.
@xref{Fonts}.@refill
@@ -14276,20 +15441,17 @@ Change subsequent sections to chapters, subsections to sections, and so
on. @xref{Raise/lower sections, , @code{@@raisesections} and
@code{@@lowersections}}.@refill
-@need 300
@item @@ref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
Make a reference. In a printed manual, the reference does not start
with a `See'. Follow command with a punctuation mark. Only the first
argument is mandatory. @xref{ref, , @code{@@ref}}.@refill
-@need 300
@item @@refill
In Info, refill and indent the paragraph after all the other processing
has been done. No effect on @TeX{}, which always refills. This command
is no longer needed, since all formatters now automatically refill.
@xref{Refilling Paragraphs}.@refill
-@need 300
@item @@result@{@}
Indicate the result of an expression to the reader with a special
glyph: @samp{@result{}}. @xref{result, , @code{@@result}}.@refill
@@ -14319,17 +15481,26 @@ Make @var{flag} active, causing the Texinfo formatting commands to
format text between subsequent pairs of @code{@@ifset @var{flag}} and
@code{@@end ifset} commands. Optionally, set value of @var{flag} to
@var{string}.
-@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
+@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.
@item @@setchapternewpage @var{on-off-odd}
Specify whether chapters start on new pages, and if so, whether on
odd-numbered (right-hand) new pages. @xref{setchapternewpage, ,
-@code{@@setchapternewpage}}.@refill
+@code{@@setchapternewpage}}.
+
+@item @@setcontentsaftertitlepage
+Put the table of contents after the @samp{@@end titlepage} even if the
+@code{@@contents} command is not there. @xref{Contents}.
@item @@setfilename @var{info-file-name}
Provide a name to be used by the Info file. This command is essential
for @TeX{} formatting as well, even though it produces no output.
-@xref{setfilename, , @code{@@setfilename}}.@refill
+@xref{setfilename, , @code{@@setfilename}}.
+
+@item @@setshortcontentsaftertitlepage
+Place the short table of contents after the @samp{@@end titlepage}
+command even if the @code{@@shortcontents} command is not there.
+@xref{Contents}.
@item @@settitle @var{title}
Provide a title for page headers in a printed manual.
@@ -14341,40 +15512,45 @@ menus rather than tables of contents. A synonym for
@code{@@summarycontents}. @xref{Contents, , Generating a Table of
Contents}.@refill
-@item @@shorttitlepage@{@var{title}@}
+@item @@shorttitlepage @var{title}
Generate a minimal title page. @xref{titlepage,,@code{@@titlepage}}.
-@need 400
@item @@smallbook
Cause @TeX{} to produce a printed manual in a 7 by 9.25 inch format
rather than the regular 8.5 by 11 inch format. @xref{smallbook, ,
-Printing Small Books}. Also, see @ref{smallexample & smalllisp, ,
-@code{@@smallexample} and @code{@@smalllisp}}.@refill
+Printing Small Books}. Also, see @ref{small}.
+
+@item @@smalldisplay
+Begin a kind of example. Like @code{@@smallexample} (indent text, no
+filling), but do not select the fixed-width font. In @code{@@smallbook}
+format, print text in a smaller font than with @code{@@display}. Pair
+with @code{@@end smalldisplay}. @xref{small}.
-@need 400
@item @@smallexample
Indent text to indicate an example. Do not fill, select fixed-width
font. In @code{@@smallbook} format, print text in a smaller font than
with @code{@@example}. Pair with @code{@@end smallexample}.
-@xref{smallexample & smalllisp, , @code{@@smallexample} and
-@code{@@smalllisp}}.@refill
+@xref{small}.
+
+@item @@smallformat
+Begin a kind of example. Like @code{@@smalldisplay}, but do not narrow
+the margins and do not select the fixed-width font.
+In @code{@@smallbook} format, print text in a smaller font than
+with @code{@@format}. Pair with @code{@@end smallformat}.
+@xref{small}.
-@need 400
@item @@smalllisp
Begin an example of Lisp code. Indent text, do not fill, select
fixed-width font. In @code{@@smallbook} format, print text in a
-smaller font. Pair with @code{@@end smalllisp}. @xref{smallexample &
-smalllisp, , @code{@@smallexample} and @code{@@smalllisp}}.@refill
+smaller font. Pair with @code{@@end smalllisp}. @xref{small}.
-@need 700
@item @@sp @var{n}
Skip @var{n} blank lines. @xref{sp, , @code{@@sp}}.@refill
@item @@ss@{@}
Generate the German sharp-S es-zet letter, @ss{}. @xref{Inserting Accents}.
-@need 700
-@item @@strong @var{text}
+@item @@strong @{@var{text}@}
Emphasize @var{text} by typesetting it in a @strong{bold} font for the
printed manual and by surrounding it with asterisks for Info.
@xref{emph & strong, , Emphasizing Text}.@refill
@@ -14416,19 +15592,16 @@ menus rather than tables of contents. A synonym for
@code{@@shortcontents}. @xref{Contents, , Generating a Table of
Contents}.@refill
-@need 300
@item @@syncodeindex @var{from-index} @var{into-index}
Merge the index named in the first argument into the index named in
the second argument, printing the entries from the first index in
@code{@@code} font. @xref{Combining Indices}.@refill
-@need 300
@item @@synindex @var{from-index} @var{into-index}
Merge the index named in the first argument into the index named in
the second argument. Do not change the font of @var{from-index}
entries. @xref{Combining Indices}.@refill
-@need 100
@item @@t@{@var{text}@}
Print @var{text} in a @t{fixed-width}, typewriter-like font.
No effect in Info. @xref{Fonts}.@refill
@@ -14436,7 +15609,6 @@ No effect in Info. @xref{Fonts}.@refill
@item @@tab
Separate columns in a multitable. @xref{Multitable Rows}.
-@need 400
@item @@table @var{formatting-command}
Begin a two-column table, using @code{@@item} for each entry. Write
each first column entry on the same line as @code{@@item}. First
@@ -14480,21 +15652,18 @@ Not relevant to Info, which does not have title pages. @xref{title
subtitle author, , The @code{@@title} @code{@@subtitle} and
@code{@@author} Commands}.@refill
-@need 400
@item @@titlefont@{@var{text}@}
In a printed manual, print @var{text} in a larger than normal font.
Not relevant to Info, which does not have title pages.
@xref{titlefont center sp, , The @code{@@titlefont} @code{@@center}
and @code{@@sp} Commands}.@refill
-@need 300
@item @@titlepage
Indicate to Texinfo the beginning of the title page. Write command on
a line of its own. Pair with @code{@@end titlepage}. Nothing between
@code{@@titlepage} and @code{@@end titlepage} appears in Info.
@xref{titlepage, , @code{@@titlepage}}.@refill
-@need 150
@item @@today@{@}
Insert the current date, in `1 Jan 1900' style. @xref{Custom
Headings, , How to Make Your Own Headings}.@refill
@@ -14544,9 +15713,9 @@ chapter. The title appears in the table of contents of a printed
manual. In Info, the title is underlined with periods.
@xref{subsubsection, , The `subsub' Commands}.@refill
-@item @@uref@{@var{url}[, @var{displayed-text}@}
+@item @@uref@{@var{url}[, @var{displayed-text}][, @var{replacement}@}
Define a cross reference to an external uniform resource locator for the
-World Wide Web. @xref{url, , @code{@@url}}.@refill
+World Wide Web. @xref{uref, , @code{@@uref}}.@refill
@item @@url@{@var{url}@}
Indicate text that is a uniform resource locator for the World Wide
@@ -14566,12 +15735,10 @@ Highlight a metasyntactic variable, which is something that stands for
another piece of text. @xref{var, , Indicating Metasyntactic
Variables}.@refill
-@need 400
@item @@vindex @var{entry}
Add @var{entry} to the index of variables. @xref{Index Entries, ,
Defining the Entries of an Index}.@refill
-@need 400
@item @@vskip @var{amount}
In a printed manual, insert whitespace so as to push text on the
remainder of the page towards the bottom of the page. Used in
@@ -14580,7 +15747,6 @@ formatting the copyright page with the argument @samp{0pt plus
only in contexts ignored for Info. @xref{Copyright & Permissions, ,
The Copyright Page and Printed Permissions}.@refill
-@need 400
@item @@vtable @var{formatting-command}
Begin a two-column table, using @code{@@item} for each entry.
Automatically enter each of the items in the first column into the
@@ -14588,13 +15754,11 @@ index of variables. Pair with @code{@@end vtable}. The same as
@code{@@table}, except for indexing. @xref{ftable vtable, ,
@code{@@ftable} and @code{@@vtable}}.@refill
-@need 400
@item @@w@{@var{text}@}
Prevent @var{text} from being split across two lines. Do not end a
paragraph that uses @code{@@w} with an @code{@@refill} command.
@xref{w, , @code{@@w}}.@refill
-@need 400
@item @@xref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
Make a reference that starts with `See' in a printed manual. Follow
command with a punctuation mark. Only the first argument is
@@ -14602,7 +15766,7 @@ mandatory. @xref{xref, , @code{@@xref}}.@refill
@end table
-@node Tips, Sample Texinfo File, Command List, Top
+@node Tips
@appendix Tips and Hints
Here are some tips for writing Texinfo documentation:@refill
@@ -14665,9 +15829,8 @@ Lisp.
@item
Write the indexing commands that refer to a whole section immediately
after the section command, and write the indexing commands that refer to
-the paragraph before the paragraph.
+a paragraph before that paragraph.
-@need 1000
In the example that follows, a blank line comes after the index
entry for ``Leaping'':
@@ -15045,7 +16208,7 @@ Write notes for yourself at the very end of a Texinfo file after the
@end itemize
-@node Sample Texinfo File, Sample Permissions, Tips, Top
+@node Sample Texinfo File
@appendix A Sample Texinfo File
@cindex Sample Texinfo file, no comments
@@ -15123,9 +16286,10 @@ manual.
@end example
-@node Sample Permissions, Include Files, Sample Texinfo File, Top
+@node Sample Permissions
@appendix Sample Permissions
@cindex Permissions
+@cindex Sample permissions
@cindex Copying permissions
Texinfo files should contain sections that tell the readers that they
@@ -15149,7 +16313,7 @@ of how the copying conditions provide you with rights. @refill
@node Inserting Permissions, ifinfo Permissions, Sample Permissions, Sample Permissions
@ifinfo
-@appendixsec Inserting Permissions
+@section Inserting Permissions
@end ifinfo
In a Texinfo file, the first @code{@@ifinfo} section usually begins
@@ -15183,18 +16347,18 @@ To make it simple to insert a permission notice into each section of
the Texinfo file, sample permission notices for each section are
reproduced in full below.@refill
-Note that you may need to specify the correct name of a section
-mentioned in the permission notice. For example, in @cite{The GDB
-Manual}, the name of the section referring to the General Public
-License is called the ``GDB General Public License'', but in the
-sample shown below, that section is referred to generically as the
-``GNU General Public License''. If the Texinfo file does not carry a
-copy of the General Public License, leave out the reference to it, but
-be sure to include the rest of the sentence.@refill
+You may need to specify the correct name of a section mentioned in the
+permission notice. For example, in @cite{The GDB Manual}, the name of
+the section referring to the General Public License is called the ``GDB
+General Public License'', but in the sample shown below, that section is
+referred to generically as the ``GNU General Public License''. If the
+Texinfo file does not carry a copy of the General Public License, leave
+out the reference to it, but be sure to include the rest of the
+sentence.
@node ifinfo Permissions, Titlepage Permissions, Inserting Permissions, Sample Permissions
@comment node-name, next, previous, up
-@appendixsec @samp{ifinfo} Copying Permissions
+@section @samp{ifinfo} Copying Permissions
@cindex @samp{ifinfo} permissions
In the @code{@@ifinfo} section of a Texinfo file, the standard Free
@@ -15203,7 +16367,7 @@ Software Foundation permission notice reads as follows:@refill
@example
This file documents @dots{}
-Copyright 1998 Free Software Foundation, Inc.
+Copyright 1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim
copies of this manual provided the copyright notice and
@@ -15235,7 +16399,7 @@ translation approved by the Free Software Foundation.
@node Titlepage Permissions, , ifinfo Permissions, Sample Permissions
@comment node-name, next, previous, up
-@appendixsec Titlepage Copying Permissions
+@section Titlepage Copying Permissions
@cindex Titlepage permissions
In the @code{@@titlepage} section of a Texinfo file, the standard Free
@@ -15265,7 +16429,7 @@ translation approved by the Free Software Foundation.
@end example
-@node Include Files, Headings, Sample Permissions, Top
+@node Include Files
@appendix Include Files
@cindex Include files
@@ -15290,7 +16454,7 @@ conveniently small parts.@refill
@end menu
@node Using Include Files, texinfo-multiple-files-update, Include Files, Include Files
-@appendixsec How to Use Include Files
+@section How to Use Include Files
@findex include
To include another file within a Texinfo file, write the
@@ -15331,7 +16495,7 @@ Texinfo mode command, @code{texinfo-multiple-files-update}, that is
designed for @code{@@include} files.@refill
@node texinfo-multiple-files-update, Include File Requirements, Using Include Files, Include Files
-@appendixsec @code{texinfo-multiple-files-update}
+@section @code{texinfo-multiple-files-update}
@findex texinfo-multiple-files-update
GNU Emacs Texinfo mode provides the @code{texinfo-multiple-files-update}
@@ -15407,7 +16571,7 @@ updates @strong{every} pointer and menu in @strong{all} the files and then inser
master menu.@refill
@node Include File Requirements, Sample Include File, texinfo-multiple-files-update, Include Files
-@appendixsec Include File Requirements
+@section Include File Requirements
@cindex Include file requirements
@cindex Requirements for include files
@@ -15433,7 +16597,7 @@ should @emph{not} contain any nodes besides the single `Top' node. The
them.@refill
@node Sample Include File, Include Files Evolution, Include File Requirements, Include Files
-@appendixsec Sample File with @code{@@include}
+@section Sample File with @code{@@include}
@cindex Sample @code{@@include} file
@cindex Include file sample
@cindex @code{@@include} file sample
@@ -15463,7 +16627,7 @@ would insert a main or master menu:@refill
@group
@@page
@@vskip 0pt plus 1filll
-Copyright @@copyright@{@} 1998 Free Software Foundation, Inc.
+Copyright @@copyright@{@} 1999 Free Software Foundation, Inc.
@@end titlepage
@end group
@@ -15504,7 +16668,7 @@ The full contents of @file{concept-index.texinfo} might be as simple as this:
@example
@group
-@@node Concept Index, , Second, Top
+@@node Concept Index
@@unnumbered Concept Index
@@printindex cp
@@ -15518,7 +16682,7 @@ files.@refill
@node Include Files Evolution, , Sample Include File, Include Files
@comment node-name, next, previous, up
-@appendixsec Evolution of Include Files
+@section Evolution of Include Files
When Info was first created, it was customary to create many small
Info files on one subject. Each Info file was formatted from its own
@@ -15557,7 +16721,7 @@ you can write menus and cross references without naming the different
Texinfo files.@refill
-@node Headings, Catching Mistakes, Include Files, Top
+@node Headings
@appendix Page Headings
@cindex Headings
@cindex Footings
@@ -15616,7 +16780,7 @@ right part is set flushright.@refill
@node Heading Format, Heading Choice, Headings Introduced, Headings
@comment node-name, next, previous, up
-@appendixsec Standard Heading Formats
+@section Standard Heading Formats
Texinfo provides two standard heading formats, one for manuals printed
on one side of each sheet of paper, and the other for manuals printed
@@ -15685,7 +16849,7 @@ manual.@refill
@node Heading Choice, Custom Headings, Heading Format, Headings
@comment node-name, next, previous, up
-@appendixsec Specifying the Type of Heading
+@section Specifying the Type of Heading
@TeX{} does not begin to generate page headings for a standard Texinfo
file until it reaches the @code{@@end titlepage} command. Thus, the
@@ -15722,22 +16886,25 @@ Texinfo lacks an @code{@@setchapternewpage even} command.@refill
@node Custom Headings, , Heading Choice, Headings
@comment node-name, next, previous, up
-@appendixsec How to Make Your Own Headings
+@section How to Make Your Own Headings
You can use the standard headings provided with Texinfo or specify
your own. By default, Texinfo has no footers, so if you specify them,
the available page size for the main text will be slightly reduced.
-@c Following paragraph is verbose to prevent overfull hboxes.
Texinfo provides six commands for specifying headings and
-footings. The @code{@@everyheading} command and
-@code{@@everyfooting} command generate page headers and footers
-that are the same for both even- and odd-numbered pages.
-The @code{@@evenheading} command and @code{@@evenfooting}
-command generate headers and footers for even-numbered
-(left-hand) pages; and the @code{@@oddheading} command and
-@code{@@oddfooting} command generate headers and footers for
-odd-numbered (right-hand) pages.@refill
+footings:
+@itemize @bullet
+@item
+@code{@@everyheading} @code{@@everyfooting} generate page headers and
+footers that are the same for both even- and odd-numbered pages.
+@item
+@code{@@evenheading} and @code{@@evenfooting} command generate headers
+and footers for even-numbered (left-hand) pages.
+@item
+@code{@@oddheading} and @code{@@oddfooting} generate headers and footers
+for odd-numbered (right-hand) pages.
+@end itemize
Write custom heading specifications in the Texinfo file immediately
after the @code{@@end titlepage} command. Enclose your specifications
@@ -15869,7 +17036,7 @@ Beware of overlong titles: they may overlap another part of the
header or footer and blot it out.@refill
-@node Catching Mistakes, Refilling Paragraphs, Headings, Top
+@node Catching Mistakes
@appendix Formatting Mistakes
@cindex Structure, catching mistakes in
@cindex Nodes, catching mistakes
@@ -15925,7 +17092,7 @@ may want to use the tools described in this appendix.@refill
@node Debugging with Info, Debugging with TeX, makeinfo Preferred, Catching Mistakes
@comment node-name, next, previous, up
-@appendixsec Catching Errors with Info Formatting
+@section Catching Errors with Info Formatting
@cindex Catching errors with Info formatting
@cindex Debugging with Info formatting
@@ -16112,7 +17279,7 @@ Manual}, for more information.@refill
@node Debugging with TeX, Using texinfo-show-structure, Debugging with Info, Catching Mistakes
@comment node-name, next, previous, up
-@appendixsec Catching Errors with @TeX{} Formatting
+@section Catching Errors with @TeX{} Formatting
@cindex Catching errors with @TeX{} formatting
@cindex Debugging with @TeX{} formatting
@@ -16194,9 +17361,8 @@ You can tell @TeX{} to stop this run by typing @kbd{x @key{RET}}
at the @samp{?} prompt.@refill
@end enumerate
-Please note that if you are running @TeX{} inside Emacs, you need to
-switch to the shell buffer and line at which @TeX{} offers the @samp{?}
-prompt.@refill
+If you are running @TeX{} inside Emacs, you need to switch to the shell
+buffer and line at which @TeX{} offers the @samp{?} prompt.
Sometimes @TeX{} will format a file without producing error messages even
though there is a problem. This usually occurs if a command is not ended
@@ -16242,7 +17408,7 @@ directly with @TeX{}, not with Texinfo.)@refill
@node Using texinfo-show-structure, Using occur, Debugging with TeX, Catching Mistakes
@comment node-name, next, previous, up
-@appendixsec Using @code{texinfo-show-structure}
+@section Using @code{texinfo-show-structure}
@cindex Showing the structure of a file
@findex texinfo-show-structure
@@ -16314,7 +17480,7 @@ or left out a section, you can correct the mistake.@refill
@node Using occur, Running Info-Validate, Using texinfo-show-structure, Catching Mistakes
@comment node-name, next, previous, up
-@appendixsec Using @code{occur}
+@section Using @code{occur}
@cindex Occurrences, listing with @code{@@occur}
@findex occur
@@ -16354,7 +17520,7 @@ for more information.@refill
@node Running Info-Validate, , Using occur, Catching Mistakes
@comment node-name, next, previous, up
-@appendixsec Finding Badly Referenced Nodes
+@section Finding Badly Referenced Nodes
@findex Info-validate
@cindex Nodes, checking for badly referenced
@cindex Checking for badly referenced nodes
@@ -16383,7 +17549,7 @@ if you write an Info file from scratch.@refill
@end menu
@node Using Info-validate, Unsplit, Running Info-Validate, Running Info-Validate
-@appendixsubsec Running @code{Info-validate}
+@subsection Running @code{Info-validate}
@cindex Running @code{Info-validate}
@cindex Info validating a large file
@cindex Validating a large file
@@ -16396,9 +17562,9 @@ M-x Info-validate
@end example
@noindent
-(Note that the @code{Info-validate} command requires an upper case
+Note that the @code{Info-validate} command requires an upper case
`I'. You may also need to create a tag table before running
-@code{Info-validate}. @xref{Tagifying}.)@refill
+@code{Info-validate}. @xref{Tagifying}.
If your file is valid, you will receive a message that says ``File appears
valid''. However, if you have a pointer that does not point to a node,
@@ -16432,17 +17598,16 @@ This is because every `Next' pointer should be matched by a
@code{Info-validate} also checks that all menu entries and cross references
point to actual nodes.@refill
-Note that @code{Info-validate} requires a tag table and does not work
-with files that have been split. (The @code{texinfo-format-buffer}
-command automatically splits large files.) In order to use
-@code{Info-validate} on a large file, you must run
-@code{texinfo-format-buffer} with an argument so that it does not split
-the Info file; and you must create a tag table for the unsplit
-file.@refill
+@code{Info-validate} requires a tag table and does not work with files
+that have been split. (The @code{texinfo-format-buffer} command
+automatically splits large files.) In order to use @code{Info-validate}
+on a large file, you must run @code{texinfo-format-buffer} with an
+argument so that it does not split the Info file; and you must create a
+tag table for the unsplit file.
@node Unsplit, Tagifying, Using Info-validate, Running Info-Validate
@comment node-name, next, previous, up
-@appendixsubsec Creating an Unsplit File
+@subsection Creating an Unsplit File
@cindex Creating an unsplit file
@cindex Unsplit file creation
@@ -16479,7 +17644,7 @@ a tag table for it. @refill
@cindex Tag table, making manually
@node Tagifying, Splitting, Unsplit, Running Info-Validate
-@appendixsubsec Tagifying a File
+@subsection Tagifying a File
After creating an unsplit Info file, you must create a tag table for
it. Visit the Info file you wish to tagify and type:@refill
@@ -16517,14 +17682,14 @@ table and split the file manually.@refill
@node Splitting, , Tagifying, Running Info-Validate
@comment node-name, next, previous, up
-@appendixsubsec Splitting a File Manually
+@subsection Splitting a File Manually
@cindex Splitting an Info file manually
@cindex Info file, splitting manually
You should split a large file or else let the
@code{texinfo-format-buffer} or @code{makeinfo-buffer} command do it
for you automatically. (Generally you will let one of the formatting
-commands do this job for you. @xref{Create an Info File}.)@refill
+commands do this job for you. @xref{Creating an Info File}.)@refill
The split-off files are called the indirect subfiles.@refill
@@ -16567,10 +17732,11 @@ The primary file still functions as an Info file, but it contains just
the tag table and a directory of subfiles.@refill
-@node Refilling Paragraphs, Command Syntax, Catching Mistakes, Top
+@node Refilling Paragraphs
@appendix Refilling Paragraphs
@cindex Refilling paragraphs
@cindex Filling paragraphs
+@cindex Paragraphs, filling
@findex refill
The @code{@@refill} command refills and, optionally, indents the first
@@ -16606,10 +17772,11 @@ the ends of paragraphs that contain @code{@@*} or @w{@code{@@w@{ @dots{}@}}}
and therefore do not refill or indent them.@refill
-@node Command Syntax, Obtaining TeX, Refilling Paragraphs, Top
-@comment node-name, next, previous, up
+@node Command Syntax
@appendix @@-Command Syntax
@cindex @@-command syntax
+@cindex Syntax, of @@-commands
+@cindex Command syntax
The character @samp{@@} is used to start special Texinfo commands.
(It has the same meaning that @samp{\} has in plain @TeX{}.) Texinfo
@@ -16670,7 +17837,7 @@ Emacs paragraph commands because it cannot appear at the beginning of
a line.@refill
-@node Obtaining TeX, Command and Variable Index, Command Syntax, Top
+@node Obtaining TeX
@appendix How to Obtain @TeX{}
@cindex Obtaining @TeX{}
@cindex @TeX{}, how to obtain
@@ -16693,16 +17860,8 @@ available distributions:
@end example
The Free Software Foundation provides a core distribution on its Source
-Code CD-ROM suitable for printing Texinfo manuals; the University of
-Washington maintains and supports a tape distribution; the @TeX{} Users
-Group co-sponsors a complete CD-ROM @TeX{} distribution.
-
-@itemize @bullet
-
-@item
-For the FSF Source Code CD-ROM, please contact:
+Code CD-ROM suitable for printing Texinfo manuals. To order it, contact:
-@iftex
@display
@group
Free Software Foundation, Inc.
@@ -16717,53 +17876,6 @@ Free Dial Fax (in Japan):
Electronic mail: @code{gnu@@gnu.org}
@end group
@end display
-@end iftex
-@ifinfo
-@display
-@group
-Free Software Foundation, Inc.
-59 Temple Place Suite 330
-Boston, MA @w{ } 02111-1307
-USA
-
-Telephone: @w{+1-617-542-5942}
-Fax: (including Japan) @w{+1-617-542-2652}
-Free Dial Fax (in Japan):
-@w{ } @w{ } @w{ } 0031-13-2473 (KDD)
-@w{ } @w{ } @w{ } 0066-3382-0158 (IDC)
-Electronic mail: @code{gnu@@gnu.org}
-@end group
-@end display
-@end ifinfo
-
-@item
-To order a complete distribution on CD-ROM, please see
-@uref{http://tug.org/tex-live.html}. (This distribution is also
-available by FTP; see the URL's above.)
-
-@item
-To order a full distribution from the University of Washington on either
-a 1/4@dmn{in} 4-track QIC-24 cartridge or a 4@dmn{mm} DAT cartridge,
-send $210 to:
-
-@display
-@group
-Pierre A. MacKay
-Denny Hall, Mail Stop DH-10
-University of Washington
-Seattle, WA @w{ } 98195
-USA
-Telephone: +1-206-543-2268
-Electronic mail: @code{mackay@@cs.washington.edu}
-@end group
-@end display
-
-@noindent Please make checks payable to the University of Washington.
-Checks must be in U.S.@: dollars, drawn on a U.S.@: bank. Overseas
-sites: please add to the base cost, if desired, $20.00 for shipment via
-air parcel post, or $30.00 for shipment via courier.
-
-@end itemize
Many other @TeX{} distributions are available; see
@uref{http://tug.org/}.
@@ -16771,7 +17883,8 @@ Many other @TeX{} distributions are available; see
@c These are no longer ``new'', and the explanations
@c are all given elsewhere anyway, I think. --karl, 25apr97.
-@ignore (the entire appendix)
+@c So ignore the entire appendix.
+@ignore
@c node New Features, Command and Variable Index, Obtaining TeX, Top
@c appendix Second Edition Features
@@ -16789,10 +17902,10 @@ edition.@refill
Here is a brief description of the new commands.@refill
-@menu
+@c menu
* New Texinfo Mode Commands:: The updating commands are especially useful.
* New Commands:: Many newly described @@-commands.
-@end menu
+@c end menu
@c node New Texinfo Mode Commands, New Commands, Obtaining TeX, Obtaining TeX
@c appendixsec New Texinfo Mode Commands
@@ -16980,8 +18093,8 @@ Indent descriptions in menus.
Insert node pointers in strict sequence.
@end table
-@c node New Commands, , New Texinfo Mode Commands, Obtaining TeX
-@c appendixsec New Texinfo @@-Commands
+@c no.de New Commands, , New Texinfo Mode Commands, Obtaining TeX
+@c appendix.sec New Texinfo @@-Commands
The second edition of the Texinfo manual describes more than 50
commands that were not described in the first edition. A third or so
@@ -17258,8 +18371,8 @@ Insert the current date.
@end tex
@end ignore
-@node Command and Variable Index, Concept Index, Obtaining TeX, Top
-@comment node-name, next, previous, up
+
+@node Command and Variable Index
@unnumbered Command and Variable Index
This is an alphabetical list of all the @@-commands, assorted Emacs Lisp
@@ -17269,12 +18382,10 @@ commands are listed without their preceding @samp{@@}.@refill
@printindex fn
-@node Concept Index, , Command and Variable Index, Top
+@node Concept Index
@unnumbered Concept Index
@printindex cp
-@summarycontents
-@contents
@bye
diff --git a/gnu/usr.bin/texinfo/info/Makefile.am b/gnu/usr.bin/texinfo/info/Makefile.am
index 160b7eeac7e..7e9c77b81f5 100644
--- a/gnu/usr.bin/texinfo/info/Makefile.am
+++ b/gnu/usr.bin/texinfo/info/Makefile.am
@@ -1,11 +1,11 @@
## Makefile.am for texinfo/info.
-## $Id: Makefile.am,v 1.2 1999/01/11 16:38:06 espie Exp $
+## $Id: Makefile.am,v 1.3 2000/02/09 02:18:39 espie Exp $
## Run automake in .. to produce Makefile.in from this.
noinst_PROGRAMS = makedoc
# Use `ginfo' for building to avoid confusion with the standard `info'
-# target. The install rule removes the `g' before applying any
+# target. Removes the `g' in the install rule before applying any
# user-specified name transformations.
bin_PROGRAMS = ginfo
transform = s/ginfo/info/; @program_transform_name@
@@ -19,17 +19,7 @@ INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir)
DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
LDADD = ../lib/libtxi.a @TERMLIBS@ @INTLLIBS@
-makedoc_SOURCES = makedoc.c
-ginfo_SOURCES = dir.c display.c display.h doc.c doc.h dribble.c dribble.h \
- echo-area.c echo-area.h \
- filesys.c filesys.h footnotes.c footnotes.h funs.h gc.c gc.h \
- indices.c indices.h info-utils.c info-utils.h info.c info.h infodoc.c \
- infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \
- search.c search.h session.c session.h signals.c signals.h \
- termdep.h terminal.c terminal.h tilde.c tilde.h \
- variables.c variables.h window.c window.h
-
-EXTRA_DIST = README
+EXTRA_DIST = README pcterm.c
# The files `doc.c' and `funs.h' are created by ./makedoc run over the source
# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
@@ -37,9 +27,24 @@ EXTRA_DIST = README
# to those functions along with completable names and documentation strings.
BUILT_SOURCES = doc.c funs.h
+makedoc_SOURCES = makedoc.c
+ginfo_SOURCES = dir.c display.c display.h doc.h dribble.c dribble.h \
+ echo-area.c echo-area.h \
+ filesys.c filesys.h footnotes.c footnotes.h gc.c gc.h \
+ indices.c indices.h info-utils.c info-utils.h info.c info.h infodoc.c \
+ infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \
+ search.c search.h session.c session.h signals.c signals.h \
+ termdep.h terminal.c terminal.h tilde.c tilde.h \
+ variables.c variables.h window.c window.h $(BUILT_SOURCES)
+
+# Files with Info commands defined that makedoc should read.
cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
$(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
$(srcdir)/footnotes.c $(srcdir)/variables.c
$(BUILT_SOURCES): makedoc $(cmd_sources)
+# This is insufficient. We really need them not to be in the
+# distribution in the first place, but it seems Automake does not
+# currently allow that.
+ rm -f $(BUILT_SOURCES)
./makedoc $(cmd_sources)
diff --git a/gnu/usr.bin/texinfo/info/Makefile.in b/gnu/usr.bin/texinfo/info/Makefile.in
index c71d31959ec..e9234034330 100644
--- a/gnu/usr.bin/texinfo/info/Makefile.in
+++ b/gnu/usr.bin/texinfo/info/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.2f from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,7 +11,7 @@
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -32,6 +32,8 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
+DESTDIR =
+
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -44,7 +46,7 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -76,8 +78,6 @@ POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
-TEXMF = @TEXMF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
@@ -86,7 +86,7 @@ l = @l@
noinst_PROGRAMS = makedoc
# Use `ginfo' for building to avoid confusion with the standard `info'
-# target. The install rule removes the `g' before applying any
+# target. Removes the `g' in the install rule before applying any
# user-specified name transformations.
bin_PROGRAMS = ginfo
transform = s/ginfo/info/; @program_transform_name@
@@ -100,17 +100,7 @@ INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir)
DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
LDADD = ../lib/libtxi.a @TERMLIBS@ @INTLLIBS@
-makedoc_SOURCES = makedoc.c
-ginfo_SOURCES = dir.c display.c display.h doc.c doc.h dribble.c dribble.h \
- echo-area.c echo-area.h \
- filesys.c filesys.h footnotes.c footnotes.h funs.h gc.c gc.h \
- indices.c indices.h info-utils.c info-utils.h info.c info.h infodoc.c \
- infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \
- search.c search.h session.c session.h signals.c signals.h \
- termdep.h terminal.c terminal.h tilde.c tilde.h \
- variables.c variables.h window.c window.h
-
-EXTRA_DIST = README
+EXTRA_DIST = README pcterm.c
# The files `doc.c' and `funs.h' are created by ./makedoc run over the source
# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
@@ -118,9 +108,13 @@ EXTRA_DIST = README
# to those functions along with completable names and documentation strings.
BUILT_SOURCES = doc.c funs.h
-cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
- $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
- $(srcdir)/footnotes.c $(srcdir)/variables.c
+makedoc_SOURCES = makedoc.c
+ginfo_SOURCES = dir.c display.c display.h doc.h dribble.c dribble.h echo-area.c echo-area.h filesys.c filesys.h footnotes.c footnotes.h gc.c gc.h indices.c indices.h info-utils.c info-utils.h info.c info.h infodoc.c infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h search.c search.h session.c session.h signals.c signals.h termdep.h terminal.c terminal.h tilde.c tilde.h variables.c variables.h window.c window.h $(BUILT_SOURCES)
+
+
+# Files with Info commands defined that makedoc should read.
+cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c $(srcdir)/footnotes.c $(srcdir)/variables.c
+
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
@@ -129,10 +123,10 @@ PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-ginfo_OBJECTS = dir.o display.o doc.o dribble.o echo-area.o filesys.o \
+ginfo_OBJECTS = dir.o display.o dribble.o echo-area.o filesys.o \
footnotes.o gc.o indices.o info-utils.o info.o infodoc.o infomap.o \
m-x.o man.o nodemenu.o nodes.o search.o session.o signals.o terminal.o \
-tilde.o variables.o window.o
+tilde.o variables.o window.o doc.o
ginfo_LDADD = $(LDADD)
ginfo_DEPENDENCIES = ../lib/libtxi.a
ginfo_LDFLAGS =
@@ -141,26 +135,26 @@ makedoc_LDADD = $(LDADD)
makedoc_DEPENDENCIES = ../lib/libtxi.a
makedoc_LDFLAGS =
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
+TAR = gtar
+GZIP_ENV = --best
SOURCES = $(ginfo_SOURCES) $(makedoc_SOURCES)
OBJECTS = $(ginfo_OBJECTS) $(makedoc_OBJECTS)
-default: all
-
+all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps info/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -176,18 +170,18 @@ maintainer-clean-binPROGRAMS:
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(bindir)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
done
mostlyclean-noinstPROGRAMS:
@@ -229,8 +223,12 @@ makedoc: $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+ && mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
@@ -258,176 +256,202 @@ subdir = info
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
-dir.o: dir.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h tilde.h
-display.o: display.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-doc.o: doc.c doc.h info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h footnotes.h gc.h \
- funs.h
-dribble.o: dribble.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-echo-area.o: echo-area.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-filesys.o: filesys.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h tilde.h
-footnotes.o: footnotes.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-gc.o: gc.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h
-indices.o: indices.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h indices.h
-info-utils.o: info-utils.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h man.h
-info.o: info.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h \
- indices.h ../lib/getopt.h man.h
-infodoc.o: infodoc.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-infomap.o: infomap.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+dir.o: dir.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h tilde.h
+display.o: display.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h
+doc.o: doc.c doc.h info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h footnotes.h \
gc.h funs.h
-m-x.o: m-x.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h
-makedoc.o: makedoc.c info.h ../lib/system.h ../config.h filesys.h \
+dribble.o: dribble.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h
+echo-area.o: echo-area.c info.h ../lib/system.h ../config.h \
+ ../lib/getopt.h filesys.h display.h info-utils.h nodes.h \
+ window.h infomap.h search.h terminal.h session.h dribble.h \
+ echo-area.h doc.h footnotes.h gc.h
+filesys.o: filesys.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h tilde.h
+footnotes.o: footnotes.c info.h ../lib/system.h ../config.h \
+ ../lib/getopt.h filesys.h display.h info-utils.h nodes.h \
+ window.h infomap.h search.h terminal.h session.h dribble.h \
+ echo-area.h doc.h footnotes.h gc.h
+gc.o: gc.c info.h ../lib/system.h ../config.h ../lib/getopt.h filesys.h \
display.h info-utils.h nodes.h window.h infomap.h search.h \
terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
gc.h
-man.o: man.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h \
- signals.h tilde.h man.h
-nodemenu.o: nodemenu.c info.h ../lib/system.h ../config.h filesys.h \
+indices.o: indices.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h indices.h
+info-utils.o: info-utils.c info.h ../lib/system.h ../config.h \
+ ../lib/getopt.h filesys.h display.h info-utils.h nodes.h \
+ window.h infomap.h search.h terminal.h session.h dribble.h \
+ echo-area.h doc.h footnotes.h gc.h man.h
+info.o: info.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h indices.h man.h
+infodoc.o: infodoc.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h
+infokey.o: infokey.c info.h ../lib/system.h ../config.h filesys.h doc.h \
display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-nodes.o: nodes.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h man.h
-search.o: search.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-session.o: session.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h man.h
-signals.o: signals.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h signals.h
-terminal.o: terminal.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h termdep.h
-tilde.o: tilde.c info.h ../lib/system.h ../config.h filesys.h display.h \
- info-utils.h nodes.h window.h infomap.h search.h terminal.h \
- session.h dribble.h echo-area.h doc.h footnotes.h gc.h
-variables.o: variables.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h variables.h
-window.o: window.c info.h ../lib/system.h ../config.h filesys.h \
- display.h info-utils.h nodes.h window.h infomap.h search.h \
- terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
- gc.h
-
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec: install-binPROGRAMS
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall: uninstall-binPROGRAMS
-
-all: Makefile $(PROGRAMS)
-
+ terminal.h session.h dribble.h echo-area.h footnotes.h gc.h \
+ infokey.h key.h ../lib/getopt.h
+infomap.o: infomap.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h funs.h
+key.o: key.c key.h funs.h
+m-x.o: m-x.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h
+makedoc.o: makedoc.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h
+man.o: man.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h signals.h tilde.h man.h
+nodemenu.o: nodemenu.c info.h ../lib/system.h ../config.h \
+ ../lib/getopt.h filesys.h display.h info-utils.h nodes.h \
+ window.h infomap.h search.h terminal.h session.h dribble.h \
+ echo-area.h doc.h footnotes.h gc.h
+nodes.o: nodes.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h man.h
+search.o: search.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h
+session.o: session.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h man.h
+signals.o: signals.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h signals.h
+terminal.o: terminal.c info.h ../lib/system.h ../config.h \
+ ../lib/getopt.h filesys.h display.h info-utils.h nodes.h \
+ window.h infomap.h search.h terminal.h session.h dribble.h \
+ echo-area.h doc.h footnotes.h gc.h termdep.h
+tilde.o: tilde.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h
+variables.o: variables.c info.h ../lib/system.h ../config.h \
+ ../lib/getopt.h filesys.h display.h info-utils.h nodes.h \
+ window.h infomap.h search.h terminal.h session.h dribble.h \
+ echo-area.h doc.h footnotes.h gc.h variables.h
+window.o: window.c info.h ../lib/system.h ../config.h ../lib/getopt.h \
+ filesys.h display.h info-utils.h nodes.h window.h infomap.h \
+ search.h terminal.h session.h dribble.h echo-area.h doc.h \
+ footnotes.h gc.h
+
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-binPROGRAMS
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-binPROGRAMS
+uninstall: uninstall-am
+all-am: Makefile $(PROGRAMS)
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
- $(mkinstalldirs) $(bindir)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
+mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
mostlyclean-compile mostlyclean-tags \
mostlyclean-generic
-clean: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile clean-tags \
- clean-generic mostlyclean
+mostlyclean: mostlyclean-am
-distclean: distclean-binPROGRAMS distclean-noinstPROGRAMS \
+clean-am: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \
+ clean-tags clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-binPROGRAMS distclean-noinstPROGRAMS \
distclean-compile distclean-tags distclean-generic \
- clean
- -rm -f config.status
+ clean-am
-maintainer-clean: maintainer-clean-binPROGRAMS \
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-generic distclean
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-.PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
-clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
-install-binPROGRAMS mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info dvi installcheck \
-install-exec install-data install uninstall all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
$(BUILT_SOURCES): makedoc $(cmd_sources)
+# This is insufficient. We really need them not to be in the
+# distribution in the first place, but it seems Automake does not
+# currently allow that.
+ rm -f $(BUILT_SOURCES)
./makedoc $(cmd_sources)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/gnu/usr.bin/texinfo/info/dir.c b/gnu/usr.bin/texinfo/info/dir.c
index 3536cac3ffd..f36a920126f 100644
--- a/gnu/usr.bin/texinfo/info/dir.c
+++ b/gnu/usr.bin/texinfo/info/dir.c
@@ -1,7 +1,7 @@
-/* dir.c -- How to build a special "dir" node from "localdir" files.
- $Id: dir.c,v 1.2 1999/01/11 16:38:06 espie Exp $
+/* dir.c -- how to build a special "dir" node from "localdir" files.
+ $Id: dir.c,v 1.3 2000/02/09 02:18:39 espie Exp $
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -125,7 +125,7 @@ maybe_build_dir_node (dirname)
char *fullpath = xmalloc (3 + strlen (this_dir) + namelen);
strcpy (fullpath, this_dir);
- if (fullpath[strlen (fullpath) - 1] != '/')
+ if (!IS_SLASH (fullpath[strlen (fullpath) - 1]))
strcat (fullpath, "/");
strcat (fullpath, from_file);
@@ -135,8 +135,9 @@ maybe_build_dir_node (dirname)
if (statable && S_ISREG (finfo.st_mode) && new_dir_file_p (&finfo))
{
long filesize;
+ int compressed;
char *contents = filesys_read_info_file (fullpath, &filesize,
- &finfo);
+ &finfo, &compressed);
if (contents)
{
update_tags++;
diff --git a/gnu/usr.bin/texinfo/info/echo-area.c b/gnu/usr.bin/texinfo/info/echo-area.c
index 4642a28e095..96f0e356828 100644
--- a/gnu/usr.bin/texinfo/info/echo-area.c
+++ b/gnu/usr.bin/texinfo/info/echo-area.c
@@ -1,7 +1,7 @@
-/* echo-area.c -- How to read a line in the echo area.
- $Id: echo-area.c,v 1.2 1999/01/11 16:38:07 espie Exp $
+/* echo-area.c -- how to read a line in the echo area.
+ $Id: echo-area.c,v 1.3 2000/02/09 02:18:39 espie Exp $
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -940,7 +940,8 @@ DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions"))
initialize_message_buffer ();
printf_to_message_buffer (completions_found_index == 1
? _("One completion:\n")
- : _("%d completions:\n"));
+ : _("%d completions:\n"),
+ completions_found_index);
/* Find the maximum length of a label. */
for (i = 0; i < completions_found_index; i++)
@@ -1462,7 +1463,7 @@ echo_area_stack_contains_completions_p ()
static void
pause_or_input ()
{
-#if defined (FD_SET)
+#ifdef FD_SET
struct timeval timer;
fd_set readfds;
int ready;
@@ -1470,14 +1471,14 @@ pause_or_input ()
FD_ZERO (&readfds);
FD_SET (fileno (stdin), &readfds);
timer.tv_sec = 2;
- timer.tv_usec = 750;
+ timer.tv_usec = 0;
ready = select (fileno (stdin) + 1, &readfds, (fd_set *) NULL,
(fd_set *) NULL, &timer);
#endif /* FD_SET */
}
/* Print MESSAGE right after the end of the current line, and wait
- for input or 2.75 seconds, whichever comes first. Then flush the
+ for input or a couple of seconds, whichever comes first. Then flush the
informational message that was printed. */
void
inform_in_echo_area (message)
@@ -1487,8 +1488,9 @@ inform_in_echo_area (message)
char *text;
text = xstrdup (message);
- for (i = 0; text[i] && text[i] != '\n'; i++);
- text[i] = '\0';
+ for (i = 0; text[i] && text[i] != '\n'; i++)
+ ;
+ text[i] = 0;
echo_area_initialize_node ();
sprintf (&input_line[input_line_end], "%s[%s]\n",
diff --git a/gnu/usr.bin/texinfo/info/filesys.c b/gnu/usr.bin/texinfo/info/filesys.c
index 714b98843e6..a2dde47fd51 100644
--- a/gnu/usr.bin/texinfo/info/filesys.c
+++ b/gnu/usr.bin/texinfo/info/filesys.c
@@ -1,5 +1,5 @@
-/* filesys.c -- File system specific functions for hacking this system.
- $Id: filesys.c,v 1.2 1999/01/11 16:38:07 espie Exp $
+/* filesys.c -- filesystem specific functions.
+ $Id: filesys.c,v 1.3 2000/02/09 02:18:39 espie Exp $
Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
@@ -26,6 +26,7 @@
/* Local to this file. */
static char *info_file_in_path (), *lookup_info_filename ();
+static char *info_absolute_file ();
static void remember_info_filename (), maybe_initialize_infopath ();
typedef struct
@@ -35,18 +36,29 @@ typedef struct
} COMPRESSION_ALIST;
static char *info_suffixes[] = {
- "",
".info",
"-info",
"/index",
- (char *)NULL
+ ".inf", /* 8+3 file on filesystem which supports long file names */
+#ifdef __MSDOS__
+ /* 8+3 file names strike again... */
+ ".in", /* for .inz, .igz etc. */
+ ".i",
+#endif
+ "",
+ NULL
};
static COMPRESSION_ALIST compress_suffixes[] = {
+ { ".gz", "gunzip" },
+ { ".bz2", "bunzip2" },
+ { ".z", "gunzip" },
{ ".Z", "uncompress" },
{ ".Y", "unyabba" },
- { ".z", "gunzip" },
- { ".gz", "gunzip" },
+#ifdef __MSDOS__
+ { "gz", "gunzip" },
+ { "z", "gunzip" },
+#endif
{ (char *)NULL, (char *)NULL }
};
@@ -86,21 +98,22 @@ info_find_fullpath (partial)
/* If we have the full path to this file, we still may have to add
various extensions to it. I guess we have to stat this file
after all. */
- if (initial_character == '/')
- temp = info_file_in_path (partial + 1, "/");
+ if (IS_ABSOLUTE (partial))
+ temp = info_absolute_file (partial);
else if (initial_character == '~')
{
expansion = tilde_expand_word (partial);
- if (*expansion == '/')
+ if (IS_ABSOLUTE (expansion))
{
- temp = info_file_in_path (expansion + 1, "/");
+ temp = info_absolute_file (expansion);
free (expansion);
}
else
temp = expansion;
}
else if (initial_character == '.' &&
- (partial[1] == '/' || (partial[1] == '.' && partial[2] == '/')))
+ (IS_SLASH (partial[1]) ||
+ (partial[1] == '.' && IS_SLASH (partial[2]))))
{
if (local_temp_filename_size < 1024)
local_temp_filename = (char *)xrealloc
@@ -117,7 +130,9 @@ info_find_fullpath (partial)
strcat (local_temp_filename, "/");
strcat (local_temp_filename, partial);
- return (local_temp_filename);
+ temp = info_absolute_file (local_temp_filename); /* try extensions */
+ if (!temp)
+ partial = local_temp_filename;
}
else
temp = info_file_in_path (partial, infopath);
@@ -167,7 +182,7 @@ info_file_in_path (filename, path)
temp = (char *)xmalloc (30 + strlen (temp_dirname) + strlen (filename));
strcpy (temp, temp_dirname);
- if (temp[(strlen (temp)) - 1] != '/')
+ if (!IS_SLASH (temp[(strlen (temp)) - 1]))
strcat (temp, "/");
strcat (temp, filename);
@@ -229,8 +244,26 @@ info_file_in_path (filename, path)
return ((char *)NULL);
}
-/* Given a string containing units of information separated by colons,
- return the next one pointed to by IDX, or NULL if there are no more.
+/* Assume FNAME is an absolute file name, and check whether it is
+ a regular file. If it is, return it as a new string; otherwise
+ return a NULL pointer. We do it by taking the file name apart
+ into its directory and basename parts, and calling info_file_in_path.*/
+static char *
+info_absolute_file (fname)
+ char *fname;
+{
+ char *containing_dir = xstrdup (fname);
+ char *base = filename_non_directory (containing_dir);
+
+ if (base > containing_dir)
+ base[-1] = '\0';
+
+ return info_file_in_path (filename_non_directory (fname), containing_dir);
+}
+
+/* Given a string containing units of information separated by
+ the PATH_SEP character, return the next one pointed to by
+ IDX, or NULL if there are no more.
Advance IDX to the character after the colon. */
char *
extract_colon_unit (string, idx)
@@ -243,7 +276,7 @@ extract_colon_unit (string, idx)
if ((i >= strlen (string)) || !string)
return ((char *) NULL);
- while (string[i] && string[i] != ':')
+ while (string[i] && string[i] != PATH_SEP[0])
i++;
if (i == start)
{
@@ -285,7 +318,7 @@ lookup_info_filename (filename)
register int i;
for (i = 0; names_and_files[i]; i++)
{
- if (strcmp (names_and_files[i]->filename, filename) == 0)
+ if (FILENAME_CMP (names_and_files[i]->filename, filename) == 0)
return (names_and_files[i]->expansion);
}
}
@@ -354,14 +387,14 @@ info_add_path (path, where)
strcpy (infopath, path);
else if (where == INFOPATH_APPEND)
{
- strcat (infopath, ":");
+ strcat (infopath, PATH_SEP);
strcat (infopath, path);
}
else if (where == INFOPATH_PREPEND)
{
char *temp = xstrdup (infopath);
strcpy (infopath, path);
- strcat (infopath, ":");
+ strcat (infopath, PATH_SEP);
strcat (infopath, temp);
free (temp);
}
@@ -378,28 +411,70 @@ zap_infopath ()
infopath_size = 0;
}
+/* Given a chunk of text and its length, convert all CRLF pairs at every
+ end-of-line into a single Newline character. Return the length of
+ produced text.
+
+ This is required because the rest of code is too entrenched in having
+ a single newline at each EOL; in particular, searching for various
+ Info headers and cookies can become extremely tricky if that assumption
+ breaks.
+
+ FIXME: this could also support Mac-style text files with a single CR
+ at the EOL, but what about random CR characters in non-Mac files? Can
+ we afford converting them into newlines as well? Maybe implement some
+ heuristics here, like in Emacs 20.
+
+ FIXME: is it a good idea to show the EOL type on the modeline? */
+long
+convert_eols (text, textlen)
+ char *text;
+ long textlen;
+{
+ register char *s = text;
+ register char *d = text;
+
+ while (textlen--)
+ {
+ if (*s == '\r' && textlen && s[1] == '\n')
+ {
+ s++;
+ textlen--;
+ }
+ *d++ = *s++;
+ }
+
+ return (long)(d - text);
+}
+
/* Read the contents of PATHNAME, returning a buffer with the contents of
that file in it, and returning the size of that buffer in FILESIZE.
FINFO is a stat struct which has already been filled in by the caller.
+ If the file turns out to be compressed, set IS_COMPRESSED to non-zero.
If the file cannot be read, return a NULL pointer. */
char *
-filesys_read_info_file (pathname, filesize, finfo)
+filesys_read_info_file (pathname, filesize, finfo, is_compressed)
char *pathname;
long *filesize;
struct stat *finfo;
+ int *is_compressed;
{
long st_size;
*filesize = filesys_error_number = 0;
if (compressed_filename_p (pathname))
- return (filesys_read_compressed (pathname, filesize, finfo));
+ {
+ *is_compressed = 1;
+ return (filesys_read_compressed (pathname, filesize, finfo));
+ }
else
{
int descriptor;
char *contents;
- descriptor = open (pathname, O_RDONLY, 0666);
+ *is_compressed = 0;
+ descriptor = open (pathname, O_RDONLY | O_BINARY, 0666);
/* If the file couldn't be opened, give up. */
if (descriptor < 0)
@@ -413,15 +488,24 @@ filesys_read_info_file (pathname, filesize, finfo)
contents = (char *)xmalloc (1 + st_size);
if ((read (descriptor, contents, st_size)) != st_size)
{
- filesys_error_number = errno;
- close (descriptor);
- free (contents);
- return ((char *)NULL);
+ filesys_error_number = errno;
+ close (descriptor);
+ free (contents);
+ return ((char *)NULL);
}
close (descriptor);
- *filesize = st_size;
+ /* Convert any DOS-style CRLF EOLs into Unix-style NL.
+ Seems like a good idea to have even on Unix, in case the Info
+ files are coming from some Windows system across a network. */
+ *filesize = convert_eols (contents, st_size);
+
+ /* EOL conversion can shrink the text quite a bit. We don't
+ want to waste storage. */
+ if (*filesize < st_size)
+ contents = (char *)xrealloc (contents, 1 + *filesize);
+
return (contents);
}
}
@@ -449,8 +533,11 @@ filesys_read_compressed (pathname, filesize, finfo)
if (!decompressor)
return ((char *)NULL);
- command = (char *)xmalloc (10 + strlen (pathname) + strlen (decompressor));
- sprintf (command, "%s < %s", decompressor, pathname);
+ command = (char *)xmalloc (15 + strlen (pathname) + strlen (decompressor));
+ /* Explicit .exe suffix makes the diagnostics of `popen'
+ better on systems where COMMAND.COM is the stock shell. */
+ sprintf (command, "%s%s < %s",
+ decompressor, STRIP_DOT_EXE ? ".exe" : "", pathname);
#if !defined (BUILDING_LIBRARY)
if (info_windows_initialized_p)
@@ -464,7 +551,7 @@ filesys_read_compressed (pathname, filesize, finfo)
}
#endif /* !BUILDING_LIBRARY */
- stream = popen (command, "r");
+ stream = popen (command, FOPEN_RBIN);
free (command);
/* Read chunks from this file until there are none left to read. */
@@ -493,9 +580,18 @@ filesys_read_compressed (pathname, filesize, finfo)
}
free (chunk);
- pclose (stream);
- contents = (char *)xrealloc (contents, offset + 1);
- *filesize = offset;
+ if (pclose (stream) == -1)
+ {
+ if (contents)
+ free (contents);
+ contents = (char *)NULL;
+ filesys_error_number = errno;
+ }
+ else
+ {
+ *filesize = convert_eols (contents, offset);
+ contents = (char *)xrealloc (contents, 1 + *filesize);
+ }
}
else
{
@@ -547,9 +643,19 @@ filesys_decompressor_for_file (filename)
return ((char *)NULL);
for (i = 0; compress_suffixes[i].suffix; i++)
- if (strcmp (extension, compress_suffixes[i].suffix) == 0)
+ if (FILENAME_CMP (extension, compress_suffixes[i].suffix) == 0)
return (compress_suffixes[i].decompressor);
+#if defined (__MSDOS__)
+ /* If no other suffix matched, allow any extension which ends
+ with `z' to be decompressed by gunzip. Due to limited 8+3 DOS
+ file namespace, we can expect many such cases, and supporting
+ every weird suffix thus produced would be a pain. */
+ if (extension[strlen (extension) - 1] == 'z' ||
+ extension[strlen (extension) - 1] == 'Z')
+ return "gunzip";
+#endif
+
return ((char *)NULL);
}
@@ -582,3 +688,26 @@ filesys_error_string (filename, error_num)
return (errmsg_buf);
}
+
+/* Check for FILENAME eq "dir" first, then all the compression
+ suffixes. */
+
+int
+is_dir_name (filename)
+ char *filename;
+{
+ unsigned i;
+ if (strcasecmp (filename, "dir") == 0)
+ return 1;
+
+ for (i = 0; compress_suffixes[i].suffix; i++)
+ {
+ char dir_compressed[50]; /* can be short */
+ strcpy (dir_compressed, "dir");
+ strcat (dir_compressed, compress_suffixes[i].suffix);
+ if (strcasecmp (filename, dir_compressed) == 0)
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/gnu/usr.bin/texinfo/info/filesys.h b/gnu/usr.bin/texinfo/info/filesys.h
index 8c326ca3773..2c8501665ac 100644
--- a/gnu/usr.bin/texinfo/info/filesys.h
+++ b/gnu/usr.bin/texinfo/info/filesys.h
@@ -1,10 +1,7 @@
-/* filesys.h -- External declarations of functions and vars in filesys.c.
- $Id: filesys.h,v 1.2 1999/01/11 16:38:07 espie Exp $
+/* filesys.h -- external declarations for filesys.c.
+ $Id: filesys.h,v 1.3 2000/02/09 02:18:39 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,6 +43,11 @@ extern void info_add_path ();
If it can't find the file, it returns NULL. */
extern char *info_find_fullpath ();
+/* Given a chunk of text and its length, convert all CRLF pairs at the
+ EOLs into a single Newline character. Return the length of produced
+ text. */
+long convert_eols ();
+
/* Read the contents of PATHNAME, returning a buffer with the contents of
that file in it, and returning the size of that buffer in FILESIZE.
FINFO is a stat struct which has already been filled in by the caller.
@@ -69,6 +71,9 @@ extern int filesys_error_number;
Advance IDX to the character after the colon. */
extern char *extract_colon_unit ();
+/* Return true if FILENAME is `dir', with a possible compression suffix. */
+extern int is_dir_name ();
+
/* The default value of INFOPATH. */
#if !defined (DEFAULT_INFOPATH)
# define DEFAULT_INFOPATH "/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:."
diff --git a/gnu/usr.bin/texinfo/info/footnotes.c b/gnu/usr.bin/texinfo/info/footnotes.c
index ad69ceaaa8f..03e40054c6f 100644
--- a/gnu/usr.bin/texinfo/info/footnotes.c
+++ b/gnu/usr.bin/texinfo/info/footnotes.c
@@ -1,7 +1,7 @@
/* footnotes.c -- Some functions for manipulating footnotes.
- $Id: footnotes.c,v 1.2 1999/01/11 16:38:08 espie Exp $
+ $Id: footnotes.c,v 1.3 2000/02/09 02:18:39 espie Exp $
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -60,7 +60,7 @@ make_footnotes_node (node)
/* See if this node contains the magic footnote label. */
fn_start =
- info_search_in_node (FOOTNOTE_LABEL, node, 0, (WINDOW *)NULL, 1);
+ info_search_in_node (FOOTNOTE_LABEL, node, 0, (WINDOW *)NULL, 1, 0);
/* If it doesn't, check to see if it has an associated footnotes node. */
if (fn_start == -1)
@@ -73,16 +73,21 @@ make_footnotes_node (node)
{
register int i;
char *refname;
+ int reflen = strlen ("-Footnotes") + strlen (node->nodename);
- refname = (char *)xmalloc
- (1 + strlen ("-Footnotes") + strlen (node->nodename));
+ refname = (char *)xmalloc (reflen + 1);
strcpy (refname, node->nodename);
strcat (refname, "-Footnotes");
for (i = 0; refs[i]; i++)
if ((refs[i]->nodename != (char *)NULL) &&
- (strcmp (refs[i]->nodename, refname) == 0))
+ /* Support both the older "foo-Footnotes" and the new
+ style "foo-Footnote-NN" references. */
+ (strcmp (refs[i]->nodename, refname) == 0 ||
+ (strncmp (refs[i]->nodename, refname, reflen - 1) == 0 &&
+ refs[i]->nodename[reflen - 1] == '-' &&
+ isdigit (refs[i]->nodename[reflen]))))
{
char *filename;
@@ -110,6 +115,7 @@ make_footnotes_node (node)
/* Make the new node. */
result = (NODE *)xmalloc (sizeof (NODE));
result->flags = 0;
+ result->display_pos = 0;
/* Get the size of the footnotes appearing within this node. */
{
@@ -250,11 +256,11 @@ DECLARE_INFO_COMMAND (info_show_footnotes,
switch (result)
{
case FN_UNFOUND:
- info_error (NO_FOOT_NODE);
+ info_error (msg_no_foot_node);
break;
case FN_UNABLE:
- info_error (WIN_TOO_SMALL);
+ info_error (msg_win_too_small);
break;
}
}
diff --git a/gnu/usr.bin/texinfo/info/footnotes.h b/gnu/usr.bin/texinfo/info/footnotes.h
index dafe731608c..c9ed1448485 100644
--- a/gnu/usr.bin/texinfo/info/footnotes.h
+++ b/gnu/usr.bin/texinfo/info/footnotes.h
@@ -1,10 +1,7 @@
/* footnotes.h -- Some functions for manipulating footnotes.
- $Id: footnotes.h,v 1.2 1999/01/11 16:38:08 espie Exp $
+ $Id: footnotes.h,v 1.3 2000/02/09 02:18:39 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,7 +23,7 @@
#define INFO_FOOTNOTES_H
/* Magic string which indicates following text is footnotes. */
-#define FOOTNOTE_LABEL _("---------- Footnotes ----------")
+#define FOOTNOTE_LABEL N_("---------- Footnotes ----------")
#define FN_FOUND 0
#define FN_UNFOUND 1
diff --git a/gnu/usr.bin/texinfo/info/indices.c b/gnu/usr.bin/texinfo/info/indices.c
index 2a895e8a52b..21ad7bdf470 100644
--- a/gnu/usr.bin/texinfo/info/indices.c
+++ b/gnu/usr.bin/texinfo/info/indices.c
@@ -1,7 +1,7 @@
-/* indices.c -- Commands for dealing with an Info file Index.
- $Id: indices.c,v 1.2 1999/01/11 16:38:08 espie Exp $
+/* indices.c -- deal with an Info file index.
+ $Id: indices.c,v 1.3 2000/02/09 02:18:39 espie Exp $
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -199,7 +199,7 @@ do_info_index_search (window, count, search_string)
index for, build and remember an index now. */
fb = file_buffer_of_window (window);
if (!initial_index_filename ||
- (strcmp (initial_index_filename, fb->filename) != 0))
+ (FILENAME_CMP (initial_index_filename, fb->filename) != 0))
{
info_free_references (index_index);
window_message_in_echo_area (_("Finding index entries..."));
@@ -296,7 +296,7 @@ index_entry_exists (window, string)
fb = file_buffer_of_window (window);
if (!initial_index_filename
- || (strcmp (initial_index_filename, fb->filename) != 0))
+ || (FILENAME_CMP (initial_index_filename, fb->filename) != 0))
{
info_free_references (index_index);
index_index = info_indices_of_file_buffer (fb);
@@ -439,15 +439,12 @@ DECLARE_INFO_COMMAND (info_next_index_match,
if (!node)
{
- info_error (CANT_FILE_NODE,
+ info_error (msg_cant_file_node,
index_index[i]->filename, index_index[i]->nodename);
return;
}
- set_remembered_pagetop_and_point (window);
- window_set_node_of_window (window, node);
- remember_window_and_node (window, node);
-
+ info_set_node_of_window (1, window, node);
/* Try to find an occurence of LABEL in this node. */
{
@@ -497,11 +494,13 @@ apropos_in_all_indices (search_string, inform)
REFERENCE **this_index, *this_item;
NODE *this_node;
FILE_BUFFER *this_fb;
+ int dir_node_duplicated = 0;
this_item = dir_menu[dir_index];
if (!this_item->filename)
{
+ dir_node_duplicated = 1;
if (dir_node->parent)
this_item->filename = xstrdup (dir_node->parent);
else
@@ -517,7 +516,11 @@ apropos_in_all_indices (search_string, inform)
this_node = info_get_node (this_item->label, "Top");
if (!this_node)
- continue;
+ {
+ if (dir_node_duplicated)
+ free (this_item->filename);
+ continue;
+ }
/* Get the file buffer associated with this node. */
{
@@ -529,6 +532,19 @@ apropos_in_all_indices (search_string, inform)
this_fb = info_find_file (files_name);
+ /* If we already scanned this file, don't do that again.
+ In addition to being faster, this also avoids having
+ multiple identical entries in the *Apropos* menu. */
+ for (i = 0; i < dir_index; i++)
+ if (FILENAME_CMP (this_fb->filename, dir_menu[i]->filename) == 0)
+ break;
+ if (i < dir_index)
+ {
+ if (dir_node_duplicated)
+ free (this_item->filename);
+ continue;
+ }
+
if (this_fb && inform)
message_in_echo_area (_("Scanning indices of \"%s\"..."), files_name);
@@ -584,7 +600,7 @@ apropos_in_all_indices (search_string, inform)
}
#define APROPOS_NONE \
- _("No available info files reference \"%s\" in their indices.")
+ N_("No available info files have \"%s\" in their indices.")
void
info_apropos (string)
@@ -596,7 +612,7 @@ info_apropos (string)
if (!apropos_list)
{
- info_error (APROPOS_NONE, string);
+ info_error (_(APROPOS_NONE), string);
}
else
{
@@ -604,7 +620,7 @@ info_apropos (string)
REFERENCE *entry;
for (i = 0; (entry = apropos_list[i]); i++)
- fprintf (stderr, "\"(%s)%s\" -- %s\n",
+ fprintf (stdout, "\"(%s)%s\" -- %s\n",
entry->filename, entry->nodename, entry->label);
}
info_free_references (apropos_list);
@@ -638,7 +654,7 @@ DECLARE_INFO_COMMAND (info_index_apropos,
if (!apropos_list)
{
- info_error (APROPOS_NONE, line);
+ info_error (_(APROPOS_NONE), line);
}
else
{
@@ -653,10 +669,14 @@ DECLARE_INFO_COMMAND (info_index_apropos,
for (i = 0; apropos_list[i]; i++)
{
int len;
- sprintf (line_buffer, "* (%s)%s::",
+ /* The label might be identical to that of another index
+ entry in another Info file. Therefore, we make the file
+ name part of the menu entry, to make them all distinct. */
+ sprintf (line_buffer, "* %s [%s]: ",
+ apropos_list[i]->label, apropos_list[i]->filename);
+ len = pad_to (40, line_buffer);
+ sprintf (line_buffer + len, "(%s)%s.",
apropos_list[i]->filename, apropos_list[i]->nodename);
- len = pad_to (36, line_buffer);
- sprintf (line_buffer + len, "%s", apropos_list[i]->label);
printf_to_message_buffer ("%s\n", line_buffer);
}
free (line_buffer);
diff --git a/gnu/usr.bin/texinfo/info/info-utils.h b/gnu/usr.bin/texinfo/info/info-utils.h
index 2b2d6c250b6..c259da8f2be 100644
--- a/gnu/usr.bin/texinfo/info/info-utils.h
+++ b/gnu/usr.bin/texinfo/info/info-utils.h
@@ -1,10 +1,7 @@
-/* info-utils.h -- Exported functions and variables from info-util.c.
- $Id: info-utils.h,v 1.2 1999/01/11 16:38:08 espie Exp $
+/* info-utils.h -- Exported functions and variables from info-utils.c.
+ $Id: info-utils.h,v 1.3 2000/02/09 02:18:39 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 96 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,13 +22,6 @@
#ifndef INFO_UTILS_H
#define INFO_UTILS_H
-#if !defined (HAVE_STRCHR)
-# undef strchr
-# undef strrchr
-# define strchr index
-# define strrchr rindex
-#endif /* !HAVE_STRCHR */
-
#include "nodes.h"
#include "window.h"
#include "search.h"
@@ -118,22 +108,22 @@ extern void name_internal_node ();
Info window. */
extern WINDOW *get_internal_info_window ();
+/* Return a window displaying the node NODE. */
+extern WINDOW *get_window_of_node ();
+
/* Return the node addressed by LABEL in NODE (usually one of "Prev:",
"Next:", "Up:", "File:", or "Node:". After a call to this function,
- the global INFO_PARSED_NODENAME and INFO_PARSED_FILENAME contain
+ the globals `info_parsed_nodename' and `info_parsed_filename' contain
the information. */
extern void info_parse_label (/* label, node */);
-#define info_label_was_found \
- (info_parsed_nodename != NULL || info_parsed_filename != NULL)
-
#define info_file_label_of_node(n) info_parse_label (INFO_FILE_LABEL, n)
#define info_next_label_of_node(n) info_parse_label (INFO_NEXT_LABEL, n)
#define info_up_label_of_node(n) info_parse_label (INFO_UP_LABEL, n)
#define info_prev_label_of_node(n) \
do { \
info_parse_label (INFO_PREV_LABEL, n); \
- if (!info_label_was_found) \
+ if (!info_parsed_nodename && !info_parsed_filename) \
info_parse_label (INFO_ALTPREV_LABEL, n); \
} while (0)
diff --git a/gnu/usr.bin/texinfo/info/info.c b/gnu/usr.bin/texinfo/info/info.c
index ecca94c4e51..d7d0046f178 100644
--- a/gnu/usr.bin/texinfo/info/info.c
+++ b/gnu/usr.bin/texinfo/info/info.c
@@ -1,7 +1,7 @@
/* info.c -- Display nodes of Info files in multiple windows.
- $Id: info.c,v 1.4 1999/11/22 05:00:15 deraadt Exp $
+ $Id: info.c,v 1.5 2000/02/09 02:18:39 espie Exp $
- Copyright (C) 1993, 96, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,12 +27,7 @@
# include "man.h"
#endif /* HANDLE_MAN_PAGES */
-/* The version numbers of this version of Info. */
-int info_major_version = 2;
-int info_minor_version = 18;
-
-/* basename (argv[0]) */
-static char *program_name = NULL;
+static char *program_name = "info";
/* Non-zero means search all indices for APROPOS_SEARCH_STRING. */
static int apropos_p = 0;
@@ -44,8 +39,13 @@ static char *apropos_search_string = (char *)NULL;
apropos, this puts the user at the node, running info. */
static int index_search_p = 0;
+/* Non-zero means look for the node which describes the invocation
+ and command-line options of the program, and start the info
+ session at that node. */
+static int goto_invocation_p = 0;
+
/* Variable containing the string to search for when index_search_p is
- non-zero. */
+ non-zero. */
static char *index_search_string = (char *)NULL;
/* Non-zero means print version info only. */
@@ -73,6 +73,18 @@ static char *user_output_filename = (char *)NULL;
dumped in the order encountered. This basically can print a book. */
int dump_subnodes = 0;
+/* Non-zero means make default keybindings be loosely modeled on vi(1). */
+int vi_keys_p = 0;
+
+#ifdef __MSDOS__
+/* Non-zero indicates that screen output should be made 'speech-friendly'.
+ Since on MSDOS the usual behavior is to write directly to the video
+ memory, speech synthesizer software cannot grab the output. Therefore,
+ we provide a user option which tells us to avoid direct screen output
+ and use stdout instead (which loses the color output). */
+int speech_friendly = 0;
+#endif
+
/* Structure describing the options that Info accepts. We pass this structure
to getopt_long (). If you add or otherwise change this structure, you must
also change the string which follows it. */
@@ -87,22 +99,33 @@ static struct option long_options[] = {
{ "file", 1, 0, 'f' },
{ "subnodes", 0, &dump_subnodes, 1 },
{ "output", 1, 0, 'o' },
+ { "show-options", 0, 0, 'O' },
+ { "usage", 0, 0, 'O' },
+ { "vi-keys", 0, &vi_keys_p, 1 },
{ "help", 0, &print_help_p, 1 },
{ "version", 0, &print_version_p, 1 },
{ "dribble", 1, 0, DRIBBLE_OPTION },
{ "restore", 1, 0, RESTORE_OPTION },
+#ifdef __MSDOS__
+ { "speech-friendly", 0, &speech_friendly, 1 },
+#endif
{ "index-search", 1, 0, IDXSRCH_OPTION },
{NULL, 0, NULL, 0}
};
/* String describing the shorthand versions of the long options found above. */
-static char *short_options = "d:n:f:o:s";
+#ifdef __MSDOS__
+static char *short_options = "d:n:f:o:Osb";
+#else
+static char *short_options = "d:n:f:o:Os";
+#endif
/* When non-zero, the Info window system has been initialized. */
int info_windows_initialized_p = 0;
/* Some "forward" declarations. */
static void info_short_help (), remember_info_program_name ();
+static void init_messages ();
/* **************************************************************** */
@@ -119,8 +142,6 @@ main (argc, argv)
int getopt_long_index; /* Index returned by getopt_long (). */
NODE *initial_node; /* First node loaded by Info. */
- remember_info_program_name (argv[0]);
-
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
@@ -130,6 +151,8 @@ main (argc, argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ init_messages ();
+
while (1)
{
int option_character;
@@ -177,12 +200,25 @@ main (argc, argv)
user_output_filename = xstrdup (optarg);
break;
+ /* User has specified that she wants to find the "Options"
+ or "Invocation" node for the program. */
+ case 'O':
+ goto_invocation_p = 1;
+ break;
+
/* User is specifying that she wishes to dump the subnodes of
the node that she is dumping. */
case 's':
dump_subnodes = 1;
break;
+#ifdef __MSDOS__
+ /* User specifies that she wants speech-friendly output. */
+ case 'b':
+ speech_friendly = 1;
+ break;
+#endif /* __MSDOS__ */
+
/* User has specified a string to search all indices for. */
case APROPOS_OPTION:
apropos_p = 1;
@@ -210,7 +246,7 @@ main (argc, argv)
default:
fprintf (stderr, _("Try --help for more information.\n"));
- exit (1);
+ xexit (1);
}
}
@@ -226,23 +262,23 @@ main (argc, argv)
/* If the user specified --version, then show the version and exit. */
if (print_version_p)
{
- printf ("%s (GNU %s %s) %s\n", program_name, PACKAGE, VERSION,
- version_string ());
+ printf ("%s (GNU %s) %s\n", program_name, PACKAGE, VERSION);
+ puts ("");
printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
- "1998");
- exit (0);
+ "1999");
+ xexit (0);
}
/* If the `--help' option was present, show the help and exit. */
if (print_help_p)
{
info_short_help ();
- exit (0);
+ xexit (0);
}
-
+
/* If the user hasn't specified a path for Info files, default it.
Lowest priority is our messy hardwired list in filesys.h.
Then comes the user's INFODIR from the Makefile.
@@ -255,7 +291,7 @@ For more information about these matters, see the files named COPYING.\n"),
{
unsigned len = strlen (path_from_env);
/* Trailing : on INFOPATH means insert the default path. */
- if (len && path_from_env[len - 1] == ':')
+ if (len && path_from_env[len - 1] == PATH_SEP[0])
{
path_from_env[len - 1] = 0;
info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
@@ -283,7 +319,14 @@ For more information about these matters, see the files named COPYING.\n"),
if (temp != directory_name)
{
- *temp = 0;
+ if (HAVE_DRIVE (directory_name) && temp == directory_name + 2)
+ {
+ /* The directory of "d:foo" is stored as "d:.", to avoid
+ mixing it with "d:/" when a slash is appended. */
+ *temp = '.';
+ temp += 2;
+ }
+ temp[-1] = 0;
info_add_path (directory_name, INFOPATH_PREPEND);
}
@@ -295,13 +338,13 @@ For more information about these matters, see the files named COPYING.\n"),
if (apropos_p)
{
info_apropos (apropos_search_string);
- exit (0);
+ xexit (0);
}
/* Get the initial Info node. It is either "(dir)Top", or what the user
specifed with values in user_filename and user_nodenames. */
initial_node = info_get_node (user_filename,
- user_nodenames ? user_nodenames[0] : NULL);
+ user_nodenames ? user_nodenames[0] : 0);
/* If we couldn't get the initial node, this user is in trouble. */
if (!initial_node)
@@ -309,9 +352,9 @@ For more information about these matters, see the files named COPYING.\n"),
if (info_recent_file_error)
info_error (info_recent_file_error);
else
- info_error
- (CANT_FIND_NODE, user_nodenames ? user_nodenames[0] : "Top");
- exit (1);
+ info_error (msg_cant_find_node,
+ user_nodenames ? user_nodenames[0] : "Top");
+ xexit (1);
}
/* Special cases for when the user specifies multiple nodes. If we
@@ -328,228 +371,112 @@ For more information about these matters, see the files named COPYING.\n"),
else
begin_multiple_window_info_session (user_filename, user_nodenames);
- exit (0);
- }
-
- /* If the user specified `--index-search=STRING', start the info
- session in the node corresponding to the first match. */
- if (index_search_p)
- {
- int status = 0;
-
- initialize_info_session (initial_node, 0);
-
- if (index_entry_exists (windows, index_search_string))
- {
- terminal_clear_screen ();
- terminal_prep_terminal ();
- display_update_display (windows);
- info_last_executed_command = (VFunction *)NULL;
-
- do_info_index_search (windows, 0, index_search_string);
-
- info_read_and_dispatch ();
-
- terminal_unprep_terminal ();
-
- /* On program exit, leave the cursor at the bottom of the
- window, and restore the terminal IO. */
- terminal_goto_xy (0, screenheight - 1);
- terminal_clear_to_eol ();
- fflush (stdout);
- }
- else
- {
- fputs (_("no entries found\n"), stderr);
- status = 2;
- }
-
- close_dribble_file ();
- exit (status);
+ xexit (0);
}
/* If there are arguments remaining, they are the names of menu items
in sequential info files starting from the first one loaded. That
file name is either "dir", or the contents of user_filename if one
was specified. */
- while (optind != argc)
- {
- REFERENCE **menu;
- REFERENCE *entry;
- NODE *node;
- char *arg;
- static char *first_arg = (char *)NULL;
-
- /* Remember the name of the menu entry we want. */
- arg = argv[optind++];
-
- if (!first_arg)
- first_arg = arg;
-
- /* Build and return a list of the menu items in this node. */
- menu = info_menu_of_node (initial_node);
-
- /* If there wasn't a menu item in this node, stop here, but let
- the user continue to use Info. Perhaps they wanted this node
- and didn't realize it. */
- if (!menu)
- {
-#if defined (HANDLE_MAN_PAGES)
- if (first_arg == arg)
- {
- node = make_manpage_node (first_arg);
- if (node)
- goto maybe_got_node;
- }
-#endif /* HANDLE_MAN_PAGES */
- begin_info_session_with_error
- (initial_node, _("There is no menu in this node."));
- exit (0);
- }
-
- /* Find the specified menu item. */
- entry = info_get_labeled_reference (arg, menu);
-
- /* If the item wasn't found, search the list sloppily. Perhaps this
- user typed "buffer" when they really meant "Buffers". */
- if (!entry)
- {
- register int i;
- int best_guess = -1;
-
- for (i = 0; (entry = menu[i]); i++)
- {
- if (strcasecmp (entry->label, arg) == 0)
- break;
- else
- if (strncasecmp (entry->label, arg, strlen (arg)) == 0)
- best_guess = i;
- }
-
- if (!entry && best_guess != -1)
- entry = menu[best_guess];
- }
-
- /* If we failed to find the reference, start Info with the current
- node anyway. It is probably a misspelling. */
- if (!entry)
- {
- char *error_message = _("There is no menu item \"%s\" in this node.");
-
-#if defined (HANDLE_MAN_PAGES)
- if (first_arg == arg)
- {
- node = make_manpage_node (first_arg);
- if (node)
- goto maybe_got_node;
- }
-#endif /* HANDLE_MAN_PAGES */
-
- info_free_references (menu);
-
- /* If we were supposed to dump this node, complain. */
- if (user_output_filename)
- info_error (error_message, arg);
- else
- begin_info_session_with_error (initial_node, error_message, arg);
-
- exit (0);
- }
-
- /* We have found the reference that the user specified. Clean it
- up a little bit. */
- if (!entry->filename)
- {
- if (initial_node->parent)
- entry->filename = xstrdup (initial_node->parent);
- else
- entry->filename = xstrdup (initial_node->filename);
- }
-
- /* Find this node. If we can find it, then turn the initial_node
- into this one. If we cannot find it, try using the label of the
- entry as a file (i.e., "(LABEL)Top"). Otherwise the Info file is
- malformed in some way, and we will just use the current value of
- initial node. */
- node = info_get_node (entry->filename, entry->nodename);
-
-#if defined (HANDLE_MAN_PAGES)
- if ((first_arg == arg) && !node)
- {
- node = make_manpage_node (first_arg);
- if (node)
- goto maybe_got_node;
- }
-#endif /* HANDLE_MAN_PAGES */
-
- if (!node && entry->nodename &&
- (strcmp (entry->label, entry->nodename) == 0))
- node = info_get_node (entry->label, "Top");
-
- maybe_got_node:
- if (node)
- {
- free (initial_node);
- initial_node = node;
- info_free_references (menu);
- }
- else
- {
- char *temp = xstrdup (entry->label);
- char *error_message;
-
- error_message = _("Unable to find the node referenced by \"%s\".");
-
- info_free_references (menu);
-
- /* If we were trying to dump the node, then give up. Otherwise,
- start the session with an error message. */
- if (user_output_filename)
- info_error (error_message, temp);
- else
- begin_info_session_with_error (initial_node, error_message, temp);
-
- exit (0);
- }
- }
-
- /* If the user specified that this node should be output, then do that
- now. Otherwise, start the Info session with this node. */
- if (user_output_filename)
- dump_node_to_file (initial_node, user_output_filename, dump_subnodes);
- else
- begin_info_session (initial_node);
-
- exit (0);
-}
-
-/* Return a string describing the current version of Info. */
-char *
-version_string ()
-{
- static char *vstring = (char *)NULL;
-
- if (!vstring)
- {
- vstring = (char *)xmalloc (50);
- sprintf (vstring, "%d.%d", info_major_version, info_minor_version);
- }
- return (vstring);
+ {
+ char *errstr, *errarg1, *errarg2;
+ NODE *new_initial_node = info_follow_menus (initial_node, argv + optind,
+ &errstr, &errarg1, &errarg2);
+ if (new_initial_node && new_initial_node != initial_node)
+ initial_node = new_initial_node;
+
+ /* If the user specified that this node should be output, then do that
+ now. Otherwise, start the Info session with this node. Or act
+ accordingly if the initial node was not found. */
+ if (user_output_filename)
+ {
+ if (!errstr)
+ dump_node_to_file (initial_node, user_output_filename,
+ dump_subnodes);
+ else
+ info_error (errstr, errarg1, errarg2);
+ }
+ else
+ {
+
+ if (errstr)
+ begin_info_session_with_error (initial_node, errstr,
+ errarg1, errarg2);
+ /* If the user specified `--index-search=STRING' or
+ --show-options, start the info session in the node
+ corresponding to what they want. */
+ else if (index_search_p || goto_invocation_p)
+ {
+ int status = 0;
+
+ initialize_info_session (initial_node, 0);
+
+ if (goto_invocation_p
+ || index_entry_exists (windows, index_search_string))
+ {
+ terminal_prep_terminal ();
+ terminal_clear_screen ();
+ info_last_executed_command = (VFunction *)NULL;
+
+ if (index_search_p)
+ do_info_index_search (windows, 0, index_search_string);
+ else
+ {
+ /* If they said "info --show-options foo bar baz",
+ the last of the arguments is the program whose
+ options they want to see. */
+ char **p = argv + optind;
+ char *program;
+
+ if (*p)
+ {
+ while (p[1])
+ p++;
+ program = xstrdup (*p);
+ }
+ else if (user_filename)
+ /* If there's no command-line arguments to
+ supply the program name, use the Info file
+ name (sans extension and leading directories)
+ instead. */
+ program = program_name_from_file_name (user_filename);
+ else
+ program = xstrdup ("");
+
+ info_intuit_options_node (windows, initial_node, program);
+ free (program);
+ }
+
+ info_read_and_dispatch ();
+
+ /* On program exit, leave the cursor at the bottom of the
+ window, and restore the terminal IO. */
+ terminal_goto_xy (0, screenheight - 1);
+ terminal_clear_to_eol ();
+ fflush (stdout);
+ terminal_unprep_terminal ();
+ }
+ else
+ {
+ fprintf (stderr, _("no index entries found for `%s'\n"),
+ index_search_string);
+ status = 2;
+ }
+
+ close_dribble_file ();
+ xexit (status);
+ }
+ else
+ begin_info_session (initial_node);
+ }
+
+ xexit (0);
+ }
}
/* Error handling. */
-static void
-remember_info_program_name (fullpath)
- char *fullpath;
-{
- char *filename;
-
- filename = filename_non_directory (fullpath);
- program_name = xstrdup (filename);
-}
-
/* Non-zero if an error has been signalled. */
int info_error_was_printed = 0;
@@ -595,33 +522,99 @@ info_error (format, arg1, arg2)
}
}
+
/* Produce a scaled down description of the available options to Info. */
static void
info_short_help ()
{
printf (_("\
-Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n\
+Usage: %s [OPTION]... [MENU-ITEM...]\n\
\n\
Read documentation in Info format.\n\
-For more complete documentation on how to use Info, run `info info options'.\n\
\n\
Options:\n\
---directory DIR add DIR to INFOPATH.\n\
---dribble FILENAME remember user keystrokes in FILENAME.\n\
---file FILENAME specify Info file to visit.\n\
---node NODENAME specify nodes in first visited Info file.\n\
---output FILENAME output selected nodes to FILENAME.\n\
---restore FILENAME read initial keystrokes from FILENAME.\n\
---subnodes recursively output menu items.\n\
---help display this help and exit.\n\
---version display version information and exit.\n\
+ --apropos=SUBJECT look up SUBJECT in all indices of all manuals.\n\
+ --directory=DIR add DIR to INFOPATH.\n\
+ --dribble=FILENAME remember user keystrokes in FILENAME.\n\
+ --file=FILENAME specify Info file to visit.\n\
+ --help display this help and exit.\n\
+ --index-search=STRING go to node pointed by index entry STRING.\n\
+ --node=NODENAME specify nodes in first visited Info file.\n\
+ --output=FILENAME output selected nodes to FILENAME.\n\
+ --restore=FILENAME read initial keystrokes from FILENAME.\n\
+ --show-options, --usage go to command-line options node.\n\
+ --subnodes recursively output menu items.\n%s\
+ --vi-keys use vi-like and less-like key bindings.\n\
+ --version display version information and exit.\n\
\n\
-The first argument, if present, is the name of the Info file to read.\n\
+The first non-option argument, if present, is the menu entry to start from;\n\
+it is searched for in all `dir' files along INFOPATH.\n\
+If it is not present, info merges all `dir' files and shows the result.\n\
Any remaining arguments are treated as the names of menu\n\
-items in the initial node visited. For example, `info emacs buffers'\n\
-moves to the node `buffers' in the info file `emacs'.\n\
+items relative to the initial node visited.\n\
+\n\
+Examples:\n\
+ info show top-level dir menu\n\
+ info emacs start at emacs node from top-level dir\n\
+ info emacs buffers start at buffers node within emacs manual\n\
+ info --show-options emacs start at node with emacs' command line options\n\
+ info -f ./foo.info show file ./foo.info, not searching dir\n\
\n\
-Email bug reports to bug-texinfo@gnu.org.\n"), program_name);
+Email bug reports to bug-texinfo@gnu.org,\n\
+general questions and discussion to help-texinfo@gnu.org.\n\
+"),
+ program_name,
+#ifdef __MSDOS__
+"\
+ --speech-friendly be friendly to speech synthesizers.\n"
+#else
+""
+#endif
+ );
- exit (0);
+ xexit (0);
+}
+
+
+/* Initialize strings for gettext. Because gettext doesn't handle N_ or
+ _ within macro definitions, we put shared messages into variables and
+ use them that way. This also has the advantage that there's only one
+ copy of the strings. */
+
+char *msg_cant_find_node;
+char *msg_cant_file_node;
+char *msg_cant_find_window;
+char *msg_cant_find_point;
+char *msg_cant_kill_last;
+char *msg_no_menu_node;
+char *msg_no_foot_node;
+char *msg_no_xref_node;
+char *msg_no_pointer;
+char *msg_unknown_command;
+char *msg_term_too_dumb;
+char *msg_at_node_bottom;
+char *msg_at_node_top;
+char *msg_one_window;
+char *msg_win_too_small;
+char *msg_cant_make_help;
+
+static void
+init_messages ()
+{
+ msg_cant_find_node = _("Cannot find node `%s'.");
+ msg_cant_file_node = _("Cannot find node `(%s)%s'.");
+ msg_cant_find_window = _("Cannot find a window!");
+ msg_cant_find_point = _("Point doesn't appear within this window's node!");
+ msg_cant_kill_last = _("Cannot delete the last window.");
+ msg_no_menu_node = _("No menu in this node.");
+ msg_no_foot_node = _("No footnotes in this node.");
+ msg_no_xref_node = _("No cross references in this node.");
+ msg_no_pointer = _("No `%s' pointer for this node.");
+ msg_unknown_command = _("Unknown Info command `%c'; try `?' for help.");
+ msg_term_too_dumb = _("Terminal type `%s' is not smart enough to run Info.");
+ msg_at_node_bottom = _("You are already at the last page of this node.");
+ msg_at_node_top = _("You are already at the first page of this node.");
+ msg_one_window = _("Only one window.");
+ msg_win_too_small = _("Resulting window would be too small.");
+ msg_cant_make_help = _("Not enough room for a help window, please delete a window.");
}
diff --git a/gnu/usr.bin/texinfo/info/info.h b/gnu/usr.bin/texinfo/info/info.h
index 1be7f299e91..2e8cae21cbd 100644
--- a/gnu/usr.bin/texinfo/info/info.h
+++ b/gnu/usr.bin/texinfo/info/info.h
@@ -1,10 +1,7 @@
/* info.h -- Header file which includes all of the other headers.
- $Id: info.h,v 1.2 1999/01/11 16:38:08 espie Exp $
+ $Id: info.h,v 1.3 2000/02/09 02:18:40 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,7 +19,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (INFO_H)
+#ifndef INFO_H
#define INFO_H
/* We always want these, so why clutter up the compile command? */
@@ -119,6 +116,9 @@ extern int info_error_was_printed;
/* Non-zero means ring terminal bell on errors. */
extern int info_error_rings_bell_p;
+/* Non-zero means default keybindings are loosely modeled on vi(1). */
+extern int vi_keys_p;
+
/* Print FORMAT with ARG1 and ARG2. If the window system was initialized,
then the message is printed in the echo area. Otherwise, a message is
output to stderr. */
@@ -127,28 +127,23 @@ extern void info_error ();
/* The version numbers of Info. */
extern int info_major_version, info_minor_version;
-/* How to get the version string for this version of Info. Returns
- something similar to "2.11". */
-extern char *version_string ();
-
/* Error message defines. */
-#define CANT_FIND_NODE _("Cannot find the node \"%s\".")
-#define CANT_FILE_NODE _("Cannot find the node \"(%s)%s\".")
-#define CANT_FIND_WIND _("Cannot find a window!")
-#define CANT_FIND_POINT _("Point doesn't appear within this window's node!")
-#define CANT_KILL_LAST _("Cannot delete the last window.")
-#define NO_MENU_NODE _("No menu in this node.")
-#define NO_FOOT_NODE _("No footnotes in this node.")
-#define NO_XREF_NODE _("No cross references in this node.")
-#define NO_POINTER _("No \"%s\" pointer for this node.")
-#define UNKNOWN_COMMAND _("Unknown Info command `%c'. `?' for help.")
-#define TERM_TOO_DUMB _("Terminal type \"%s\" is not smart enough to run Info.")
-#define AT_NODE_BOTTOM _("You are already at the last page of this node.")
-#define AT_NODE_TOP _("You are already at the first page of this node.")
-#define ONE_WINDOW _("Only one window.")
-#define WIN_TOO_SMALL _("Resulting window would be too small.")
-#define CANT_MAKE_HELP \
-_("There isn't enough room to make a help window. Please delete a window.")
+extern char *msg_cant_find_node;
+extern char *msg_cant_file_node;
+extern char *msg_cant_find_window;
+extern char *msg_cant_find_point;
+extern char *msg_cant_kill_last;
+extern char *msg_no_menu_node;
+extern char *msg_no_foot_node;
+extern char *msg_no_xref_node;
+extern char *msg_no_pointer;
+extern char *msg_unknown_command;
+extern char *msg_term_too_dumb;
+extern char *msg_at_node_bottom;
+extern char *msg_at_node_top;
+extern char *msg_one_window;
+extern char *msg_win_too_small;
+extern char *msg_cant_make_help;
/* Found in info-utils.c. */
diff --git a/gnu/usr.bin/texinfo/info/infodoc.c b/gnu/usr.bin/texinfo/info/infodoc.c
index 90aa2f19ded..f3e15738d86 100644
--- a/gnu/usr.bin/texinfo/info/infodoc.c
+++ b/gnu/usr.bin/texinfo/info/infodoc.c
@@ -1,7 +1,7 @@
/* infodoc.c -- Functions which build documentation nodes.
- $Id: infodoc.c,v 1.2 1999/01/11 16:38:08 espie Exp $
+ $Id: infodoc.c,v 1.3 2000/02/09 02:18:40 espie Exp $
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,14 +21,9 @@
#include "info.h"
-/* Normally we do not define HELP_NODE_GETS_REGENERATED because the
- contents of the help node currently can never change once an info
- session has been started. You should consider defining this in
- the case that you place information about dynamic variables in the
- help text. When that happens, the contents of the help node will
- change dependent on the value of those variables, and the user will
- expect to see those changes. */
-/* #define HELP_NODE_GETS_REGENERATED 1 */
+/* HELP_NODE_GETS_REGENERATED is always defined now that keys may get
+ rebound, or other changes in the help text may occur. */
+#define HELP_NODE_GETS_REGENERATED 1
/* **************************************************************** */
/* */
@@ -47,40 +42,94 @@ static char *internal_info_help_node_contents = (char *)NULL;
/* The static text which appears in the internal info help node. */
static char *info_internal_help_text[] = {
- N_ ("Basic Commands in Info Windows"),
- "******************************",
- "",
- " h Invoke the Info tutorial.",
- " CTRL-x 0 Quit this help.",
- " q Quit Info altogether.",
- "",
- "Selecting other nodes:",
- "----------------------",
- " n Move to the \"next\" node of this node.",
- " p Move to the \"previous\" node of this node.",
- " u Move \"up\" from this node.",
- " m Pick menu item specified by name.",
- " Picking a menu item causes another node to be selected.",
- " f Follow a cross reference. Reads name of reference.",
- " l Move to the last node seen in this window.",
- " d Move to the `directory' node. Equivalent to `g(DIR)'.",
- "",
- "Moving within a node:",
- "---------------------",
- " SPC Scroll forward a page.",
- " DEL Scroll backward a page.",
- " b Go to the beginning of this node.",
- " e Go to the end of this node.",
- "",
- "Other commands:",
- "--------------------",
- " 1 Pick first item in node's menu.",
- " 2-9 Pick second ... ninth item in node's menu.",
- " 0 Pick last item in node's menu.",
- " g Move to node specified by name.",
- " You may include a filename as well, as in (FILENAME)NODENAME.",
- " s Search through this Info file for a specified string,",
- " and select the node in which the next occurrence is found.",
+ N_("Basic Commands in Info Windows\n"),
+ N_("******************************\n"),
+ "\n",
+ N_(" %-10s Quit this help.\n"),
+ N_(" %-10s Quit Info altogether.\n"),
+ N_(" %-10s Invoke the Info tutorial.\n"),
+ "\n",
+ N_("Moving within a node:\n"),
+ N_("---------------------\n"),
+ N_(" %-10s Scroll forward a page.\n"),
+ N_(" %-10s Scroll backward a page.\n"),
+ N_(" %-10s Go to the beginning of this node.\n"),
+ N_(" %-10s Go to the end of this node.\n"),
+ N_(" %-10s Scroll forward 1 line.\n"),
+ N_(" %-10s Scroll backward 1 line.\n"),
+ "\n",
+ N_("Selecting other nodes:\n"),
+ N_("----------------------\n"),
+ N_(" %-10s Move to the `next' node of this node.\n"),
+ N_(" %-10s Move to the `previous' node of this node.\n"),
+ N_(" %-10s Move `up' from this node.\n"),
+ N_(" %-10s Pick menu item specified by name.\n"),
+ N_(" Picking a menu item causes another node to be selected.\n"),
+ N_(" %-10s Follow a cross reference. Reads name of reference.\n"),
+ N_(" %-10s Move to the last node seen in this window.\n"),
+ N_(" %-10s Skip to next hypertext link within this node.\n"),
+ N_(" %-10s Follow the hypertext link under cursor.\n"),
+ N_(" %-10s Move to the `directory' node. Equivalent to `g (DIR)'.\n"),
+ N_(" %-10s Move to the Top node. Equivalent to `g Top'.\n"),
+ "\n",
+ N_("Other commands:\n"),
+ N_("---------------\n"),
+ N_(" %-10s Pick first ... ninth item in node's menu.\n"),
+ N_(" %-10s Pick last item in node's menu.\n"),
+ N_(" %-10s Search for a specified string in the index entries of this Info\n"),
+ N_(" file, and select the node referenced by the first entry found.\n"),
+ N_(" %-10s Move to node specified by name.\n"),
+ N_(" You may include a filename as well, as in (FILENAME)NODENAME.\n"),
+ N_(" %-10s Search forward through this Info file for a specified string,\n"),
+ N_(" and select the node in which the next occurrence is found.\n"),
+ N_(" %-10s Search backward in this Info file for a specified string,\n"),
+ N_(" and select the node in which the next occurrence is found.\n"),
+ NULL
+};
+
+static char *info_help_keys_text[][2] = {
+ { "", "" },
+ { "", "" },
+ { "", "" },
+ { "CTRL-x 0", "CTRL-x 0" },
+ { "q", "q" },
+ { "h", "ESC h" },
+ { "", "" },
+ { "", "" },
+ { "", "" },
+ { "SPC", "SPC" },
+ { "DEL", "b" },
+ { "b", "ESC b" },
+ { "e", "ESC e" },
+ { "ESC 1 SPC", "RET" },
+ { "ESC 1 DEL", "y" },
+ { "", "" },
+ { "", "" },
+ { "", "" },
+ { "n", "CTRL-x n" },
+ { "p", "CTRL-x p" },
+ { "u", "CTRL-x u" },
+ { "m", "ESC m" },
+ { "", "" },
+ { "f", "ESC f" },
+ { "l", "l" },
+ { "TAB", "TAB" },
+ { "RET", "CTRL-x RET" },
+ { "d", "ESC d" },
+ { "t", "ESC t" },
+ { "", "" },
+ { "", "" },
+ { "", "" },
+ { "1-9", "ESC 1-9" },
+ { "0", "ESC 0" },
+ { "i", "CTRL-x i" },
+ { "", "" },
+ { "g", "CTRL-x g" },
+ { "", "" },
+ { "s", "/" },
+ { "", "" },
+ { "ESC - s", "?" },
+ { "", "" },
NULL
};
@@ -163,15 +212,21 @@ dump_map_to_message_buffer (prefix, map)
}
}
-/* How to create internal_info_help_node. */
+/* How to create internal_info_help_node. HELP_IS_ONLY_WINDOW_P says
+ whether we're going to end up in a second (or more) window of our
+ own, or whether there's only one window and we're going to usurp it.
+ This determines how to quit the help window. Maybe we should just
+ make q do the right thing in both cases. */
+
static void
-create_internal_info_help_node ()
+create_internal_info_help_node (help_is_only_window_p)
+ int help_is_only_window_p;
{
register int i;
- char *contents = (char *)NULL;
NODE *node;
+ char *contents = NULL;
-#if !defined (HELP_NODE_GETS_REGENERATED)
+#ifndef HELP_NODE_GETS_REGENERATED
if (internal_info_help_node_contents)
contents = internal_info_help_node_contents;
#endif /* !HELP_NODE_GETS_REGENERATED */
@@ -183,16 +238,30 @@ create_internal_info_help_node ()
initialize_message_buffer ();
for (i = 0; info_internal_help_text[i]; i++)
- printf_to_message_buffer ("%s\n", info_internal_help_text[i]);
+ {
+ /* Don't translate blank lines, gettext outputs the po file
+ header in that case. We want a blank line. */
+ char *msg = *(info_internal_help_text[i])
+ ? _(info_internal_help_text[i])
+ : info_internal_help_text[i];
+ char *key = info_help_keys_text[i][vi_keys_p];
+
+ /* If we have only one window (because the window size was too
+ small to split it), CTRL-x 0 doesn't work to `quit' help. */
+ if (STREQ (key, "CTRL-x 0") && help_is_only_window_p)
+ key = "l";
+
+ printf_to_message_buffer (msg, key);
+ }
printf_to_message_buffer ("---------------------\n\n");
- printf_to_message_buffer ("The current search path is:\n");
- printf_to_message_buffer (" \"%s\"\n", infopath);
+ printf_to_message_buffer (_("The current search path is:\n"));
+ printf_to_message_buffer (" %s\n", infopath);
printf_to_message_buffer ("---------------------\n\n");
- printf_to_message_buffer ("Commands available in Info windows:\n\n");
+ printf_to_message_buffer (_("Commands available in Info windows:\n\n"));
dump_map_to_message_buffer ("", info_keymap);
printf_to_message_buffer ("---------------------\n\n");
- printf_to_message_buffer ("Commands available in the echo area:\n\n");
+ printf_to_message_buffer (_("Commands available in the echo area:\n\n"));
dump_map_to_message_buffer ("", echo_area_keymap);
#if defined (NAMED_FUNCTIONS)
@@ -215,7 +284,11 @@ create_internal_info_help_node ()
printf_to_message_buffer
("M-x %s\n %s\n",
function_doc_array[i].func_name,
- replace_in_documentation (function_doc_array[i].doc));
+ replace_in_documentation (strlen (function_doc_array[i].doc)
+ == 0
+ ? function_doc_array[i].doc
+ : _(function_doc_array[i].doc)));
+
}
}
@@ -258,17 +331,22 @@ create_internal_info_help_node ()
}
/* Return a window which is the window showing help in this Info. */
+
+/* If the eligible window's height is >= this, split it to make the help
+ window. Otherwise display the help window in the current window. */
+#define HELP_SPLIT_SIZE 24
+
static WINDOW *
info_find_or_create_help_window ()
{
- WINDOW *help_window, *eligible, *window;
-
- eligible = (WINDOW *)NULL;
- help_window = get_internal_info_window (info_help_nodename);
+ int help_is_only_window_p;
+ WINDOW *eligible = NULL;
+ WINDOW *help_window = get_window_of_node (internal_info_help_node);
/* If we couldn't find the help window, then make it. */
if (!help_window)
{
+ WINDOW *window;
int max = 0;
for (window = windows; window; window = window->next)
@@ -281,23 +359,29 @@ info_find_or_create_help_window ()
}
if (!eligible)
- return ((WINDOW *)NULL);
+ return NULL;
}
-#if !defined (HELP_NODE_GETS_REGENERATED)
+#ifndef HELP_NODE_GETS_REGENERATED
else
- return (help_window);
-#endif /* !HELP_NODE_GETS_REGENERATED */
-
- /* Make sure that we have a node containing the help text. */
- create_internal_info_help_node ();
+ /* help window is static, just return it. */
+ return help_window;
+#endif /* not HELP_NODE_GETS_REGENERATED */
+
+ /* Make sure that we have a node containing the help text. The
+ argument is false if help will be the only window (so l must be used
+ to quit help), true if help will be one of several visible windows
+ (so CTRL-x 0 must be used to quit help). */
+ help_is_only_window_p
+ = (help_window && !windows->next
+ || !help_window && eligible->height < HELP_SPLIT_SIZE);
+ create_internal_info_help_node (help_is_only_window_p);
/* Either use the existing window to display the help node, or create
a new window if there was no existing help window. */
if (!help_window)
- {
- /* Split the largest window into 2 windows, and show the help text
+ { /* Split the largest window into 2 windows, and show the help text
in that window. */
- if (eligible->height > 30)
+ if (eligible->height >= HELP_SPLIT_SIZE)
{
active_window = eligible;
help_window = window_make_window (internal_info_help_node);
@@ -310,8 +394,7 @@ info_find_or_create_help_window ()
}
}
else
- {
- /* Case where help node always gets regenerated, and we have an
+ { /* Case where help node always gets regenerated, and we have an
existing window in which to place the node. */
if (active_window != help_window)
{
@@ -321,7 +404,7 @@ info_find_or_create_help_window ()
window_set_node_of_window (active_window, internal_info_help_node);
}
remember_window_and_node (help_window, help_window->node);
- return (help_window);
+ return help_window;
}
/* Create or move to the help window. */
@@ -337,7 +420,7 @@ DECLARE_INFO_COMMAND (info_get_help_window, _("Display help message"))
}
else
{
- info_error (CANT_MAKE_HELP);
+ info_error (msg_cant_make_help);
}
}
@@ -381,7 +464,7 @@ DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'")
if (info_recent_file_error)
info_error (info_recent_file_error);
else
- info_error (CANT_FILE_NODE, "Info", nodename);
+ info_error (msg_cant_file_node, "Info", nodename);
}
else
{
@@ -418,7 +501,9 @@ function_documentation (function)
if (function == function_doc_array[i].func)
break;
- return (replace_in_documentation (function_doc_array[i].doc));
+ return replace_in_documentation ((strlen (function_doc_array[i].doc) == 0)
+ ? function_doc_array[i].doc
+ : _(function_doc_array[i].doc));
}
#if defined (NAMED_FUNCTIONS)
@@ -475,21 +560,21 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
char *rep;
Keymap map;
- keyname[0] = '\0';
+ keyname[0] = 0;
map = window->keymap;
- while (1)
+ for (;;)
{
message_in_echo_area (_("Describe key: %s"), keyname);
keystroke = info_get_input_char ();
unmessage_in_echo_area ();
- if (Meta_p (keystroke) && (!ISO_Latin_p || key < 160))
+ if (Meta_p (keystroke))
{
if (map[ESC].type != ISKMAP)
{
window_message_in_echo_area
- (_("ESC %s is undefined."), pretty_keyname (UnMeta (keystroke)));
+ (_("ESC %s is undefined."), pretty_keyname (UnMeta (keystroke)));
return;
}
@@ -627,7 +712,7 @@ replace_in_documentation (string)
/* Find a key which invokes this function in the info_keymap. */
function = named_function (fun_name);
- /* If the internal documentation string fails, there is a
+ /* If the internal documentation string fails, there is a
serious problem with the associated command's documentation.
We croak so that it can be fixed immediately. */
if (!function)
@@ -687,7 +772,7 @@ where_is_internal (map, function)
VFunction *function;
{
register int i;
-
+
/* If the function is directly invokable in MAP, return the representation
of that keystroke. */
for (i = 0; i < 256; i++)
@@ -718,13 +803,13 @@ where_is_internal (map, function)
}
}
- return ((char *)NULL);
+ return NULL;
}
extern char *read_function_name ();
DECLARE_INFO_COMMAND (info_where_is,
- "Show what to type to execute a given command")
+ _("Show what to type to execute a given command"))
{
char *command_name;
diff --git a/gnu/usr.bin/texinfo/info/infomap.c b/gnu/usr.bin/texinfo/info/infomap.c
index 9b46db1d319..47e388e190d 100644
--- a/gnu/usr.bin/texinfo/info/infomap.c
+++ b/gnu/usr.bin/texinfo/info/infomap.c
@@ -1,7 +1,7 @@
/* infomap.c -- Keymaps for Info.
- $Id: infomap.c,v 1.2 1999/01/11 16:38:08 espie Exp $
+ $Id: infomap.c,v 1.3 2000/02/09 02:18:40 espie Exp $
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@ keymap_copy_keymap (map)
return (keymap);
}
-/* Free the keymap and it's descendents. */
+/* Free the keymap and its descendants. */
void
keymap_discard_keymap (map)
Keymap (map);
@@ -141,49 +141,54 @@ keymap_bind_keyseq (map, keyseq, keyentry)
/* Initialize the standard info keymaps. */
-Keymap info_keymap = (Keymap)NULL;
-Keymap echo_area_keymap = (Keymap)NULL;
+Keymap info_keymap = NULL;
+Keymap echo_area_keymap = NULL;
-void
-initialize_info_keymaps ()
+static void
+initialize_emacs_like_keymaps ()
{
- register int i;
+ int i;
Keymap map;
if (!info_keymap)
{
info_keymap = keymap_make_keymap ();
- info_keymap[ESC].type = ISKMAP;
- info_keymap[ESC].function = (VFunction *)keymap_make_keymap ();
- info_keymap[Control ('x')].type = ISKMAP;
- info_keymap[Control ('x')].function = (VFunction *)keymap_make_keymap ();
echo_area_keymap = keymap_make_keymap ();
- echo_area_keymap[ESC].type = ISKMAP;
- echo_area_keymap[ESC].function = (VFunction *)keymap_make_keymap ();
- echo_area_keymap[Control ('x')].type = ISKMAP;
- echo_area_keymap[Control ('x')].function =
- (VFunction *)keymap_make_keymap ();
}
+ info_keymap[ESC].type = ISKMAP;
+ info_keymap[ESC].function = (VFunction *)keymap_make_keymap ();
+ info_keymap[Control ('x')].type = ISKMAP;
+ info_keymap[Control ('x')].function = (VFunction *)keymap_make_keymap ();
+
+ /* Bind the echo area insert routines. Let's make all characters
+ insertable by default, regardless of which character set we might
+ be using. */
+ for (i = 0; i < 256; i++)
+ echo_area_keymap[i].function = ea_insert;
+
+ echo_area_keymap[ESC].type = ISKMAP;
+ echo_area_keymap[ESC].function = (VFunction *) keymap_make_keymap ();
+ echo_area_keymap[Control ('x')].type = ISKMAP;
+ echo_area_keymap[Control ('x')].function
+ = (VFunction *) keymap_make_keymap ();
+
/* Bind numeric arg functions for both echo area and info window maps. */
for (i = '0'; i < '9' + 1; i++)
{
- ((Keymap) info_keymap[ESC].function)[i].function =
- ((Keymap) echo_area_keymap[ESC].function)[i].function =
- info_add_digit_to_numeric_arg;
+ ((Keymap) info_keymap[ESC].function)[i].function
+ = ((Keymap) echo_area_keymap[ESC].function)[i].function
+ = info_add_digit_to_numeric_arg;
}
((Keymap) info_keymap[ESC].function)['-'].function =
((Keymap) echo_area_keymap[ESC].function)['-'].function =
info_add_digit_to_numeric_arg;
+ info_keymap['-'].function = info_add_digit_to_numeric_arg;
+
/* Bind the echo area routines. */
map = echo_area_keymap;
- /* Bind the echo area insert routines. */
- for (i = 0; i < 160; i++)
- if (isprint (i))
- map[i].function = ea_insert;
-
map[Control ('a')].function = ea_beg_of_line;
map[Control ('b')].function = ea_backward;
map[Control ('d')].function = ea_delete;
@@ -203,7 +208,12 @@ initialize_info_keymaps ()
map[SPC].function = ea_complete;
map[TAB].function = ea_complete;
map['?'].function = ea_possible_completions;
+#ifdef __MSDOS__
+ /* PC users will lynch me if I don't give them their usual DEL effect... */
+ map[DEL].function = ea_delete;
+#else
map[DEL].function = ea_rubout;
+#endif
/* Bind the echo area ESC keymap. */
map = (Keymap)echo_area_keymap[ESC].function;
@@ -272,6 +282,7 @@ initialize_info_keymaps ()
map[Control ('u')].function = info_universal_argument;
map[Control ('v')].function = info_scroll_forward;
map[','].function = info_next_index_match;
+ map['/'].function = info_search;
for (i = '1'; i < '9' + 1; i++)
map[i].function = info_menu_digit;
@@ -288,15 +299,19 @@ initialize_info_keymaps ()
map['e'].function = info_end_of_node;
map['f'].function = info_xref_item;
map['g'].function = info_goto_node;
+ map['G'].function = info_menu_sequence;
map['h'].function = info_get_info_help_node;
map['i'].function = info_index_search;
+ map['I'].function = info_goto_invocation_node;
map['l'].function = info_history_node;
map['m'].function = info_menu_item;
map['n'].function = info_next_node;
+ map['O'].function = info_goto_invocation_node;
map['p'].function = info_prev_node;
map['q'].function = info_quit;
map['r'].function = info_xref_item;
map['s'].function = info_search;
+ map['S'].function = info_search_case_sensitively;
map['t'].function = info_top_node;
map['u'].function = info_up_node;
map[DEL].function = info_scroll_backward;
@@ -316,6 +331,281 @@ initialize_info_keymaps ()
#if defined (NAMED_FUNCTIONS)
map['x'].function = info_execute_command;
#endif /* NAMED_FUNCTIONS */
+ map[DEL].function = info_scroll_other_window_backward;
+
+ /* Bind members in the Control-X map for Info windows. */
+ map = (Keymap)info_keymap[Control ('x')].function;
+
+ map[Control ('b')].function = list_visited_nodes;
+ map[Control ('c')].function = info_quit;
+ map[Control ('f')].function = info_view_file;
+ map[Control ('g')].function = info_abort_key;
+ map[Control ('v')].function = info_view_file;
+ map['0'].function = info_delete_window;
+ map['1'].function = info_keep_one_window;
+ map['2'].function = info_split_window;
+ map['^'].function = info_grow_window;
+ map['b'].function = select_visited_node;
+ map['k'].function = info_kill_node;
+ map['n'].function = info_search_next;
+ map['N'].function = info_search_previous;
+ map['o'].function = info_next_window;
+ map['t'].function = info_tile_windows;
+ map['w'].function = info_toggle_wrap;
+
+ /* Arrow key bindings for Info windows keymap. */
+ map = info_keymap;
+ keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
+ keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
+ keymap_bind_keyseq (map, "\033OA", &map[Control ('p')]);
+ keymap_bind_keyseq (map, "\033[A", &map[Control ('p')]);
+ keymap_bind_keyseq (map, term_kd, &map[Control ('n')]); /* down */
+ keymap_bind_keyseq (map, "\033OB", &map[Control ('n')]);
+ keymap_bind_keyseq (map, "\033[B", &map[Control ('n')]);
+ keymap_bind_keyseq (map, term_kr, &map[Control ('f')]); /* right */
+ keymap_bind_keyseq (map, "\033OC", &map[Control ('f')]);
+ keymap_bind_keyseq (map, "\033[C", &map[Control ('f')]);
+ keymap_bind_keyseq (map, term_kl, &map[Control ('b')]); /* left */
+ keymap_bind_keyseq (map, "\033OD", &map[Control ('b')]);
+ keymap_bind_keyseq (map, "\033[D", &map[Control ('b')]);
+
+ map = (Keymap)info_keymap[ESC].function;
+ keymap_bind_keyseq (map, term_kl, &map['b']); /* left */
+ keymap_bind_keyseq (map, "\033OA", &map['b']);
+ keymap_bind_keyseq (map, "\033[A", &map['b']);
+ keymap_bind_keyseq (map, term_kr, &map['f']); /* right */
+ keymap_bind_keyseq (map, "\033OB", &map['f']);
+ keymap_bind_keyseq (map, "\033[B", &map['f']);
+ keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
+ keymap_bind_keyseq (map, term_kP, &map[DEL]); /* pageup */
+
+ /* The alternative to this definition of a `main map' key in the
+ `ESC map' section, is something like:
+ keymap_bind_keyseq (map, term_kP, &((KeyMap)map[ESC].function).map['v']);
+ */
+ keymap_bind_keyseq (info_keymap/*sic*/, term_kP, &map['v']); /* pageup */
+}
+
+static void
+initialize_vi_like_keymaps ()
+{
+ register int i;
+ Keymap map;
+
+ if (!info_keymap)
+ {
+ info_keymap = keymap_make_keymap ();
+ echo_area_keymap = keymap_make_keymap ();
+ }
+
+ info_keymap[ESC].type = ISKMAP;
+ info_keymap[ESC].function = (VFunction *)keymap_make_keymap ();
+ info_keymap[Control ('x')].type = ISKMAP;
+ info_keymap[Control ('x')].function = (VFunction *)keymap_make_keymap ();
+
+ /* Bind the echo area insert routines. */
+ for (i = 0; i < 256; i++)
+ echo_area_keymap[i].function = ea_insert;
+
+ echo_area_keymap[ESC].type = ISKMAP;
+ echo_area_keymap[ESC].function = (VFunction *)keymap_make_keymap ();
+ echo_area_keymap[Control ('x')].type = ISKMAP;
+ echo_area_keymap[Control ('x')].function =
+ (VFunction *)keymap_make_keymap ();
+
+ /* Bind numeric arg functions for both echo area and info window maps. */
+ for (i = '0'; i < '9' + 1; i++)
+ {
+ info_keymap[i].function =
+ ((Keymap) echo_area_keymap[ESC].function)[i].function =
+ info_add_digit_to_numeric_arg;
+ }
+ info_keymap['-'].function =
+ ((Keymap) echo_area_keymap[ESC].function)['-'].function =
+ info_add_digit_to_numeric_arg;
+
+ /* Bind the echo area routines. */
+ map = echo_area_keymap;
+
+ map[Control ('a')].function = ea_beg_of_line;
+ map[Control ('b')].function = ea_backward;
+ map[Control ('d')].function = ea_delete;
+ map[Control ('e')].function = ea_end_of_line;
+ map[Control ('f')].function = ea_forward;
+ map[Control ('g')].function = ea_abort;
+ map[Control ('h')].function = ea_rubout;
+ map[Control ('k')].function = ea_kill_line;
+ map[Control ('l')].function = info_redraw_display;
+ map[Control ('q')].function = ea_quoted_insert;
+ map[Control ('t')].function = ea_transpose_chars;
+ map[Control ('u')].function = ea_abort;
+ map[Control ('v')].function = ea_quoted_insert;
+ map[Control ('y')].function = ea_yank;
+
+ map[LFD].function = ea_newline;
+ map[RET].function = ea_newline;
+ map[SPC].function = ea_complete;
+ map[TAB].function = ea_complete;
+ map['?'].function = ea_possible_completions;
+#ifdef __MSDOS__
+ /* PC users will lynch me if I don't give them their usual DEL effect... */
+ map[DEL].function = ea_delete;
+#else
+ map[DEL].function = ea_rubout;
+#endif
+
+ /* Bind the echo area ESC keymap. */
+ map = (Keymap)echo_area_keymap[ESC].function;
+
+ map[Control ('g')].function = ea_abort;
+ map[Control ('h')].function = ea_backward_kill_word;
+ map[Control ('v')].function = ea_scroll_completions_window;
+ map['0'].function = ea_beg_of_line;
+ map['$'].function = ea_end_of_line;
+ map['b'].function = ea_backward_word;
+ map['d'].function = ea_kill_word;
+ map['f'].function = ea_forward_word;
+ map['h'].function = ea_forward;
+ map['l'].function = ea_backward;
+ map['w'].function = ea_forward_word;
+ map['x'].function = ea_delete;
+ map['X'].function = ea_kill_word;
+ map['y'].function = ea_yank_pop;
+ map['?'].function = ea_possible_completions;
+ map[TAB].function = ea_tab_insert;
+ map[DEL].function = ea_kill_word;
+
+ /* Bind the echo area Control-x keymap. */
+ map = (Keymap)echo_area_keymap[Control ('x')].function;
+
+ map['o'].function = info_next_window;
+ map[DEL].function = ea_backward_kill_line;
+
+ /* Arrow key bindings for echo area keymaps. It seems that some
+ terminals do not match their termcap entries, so it's best to just
+ define everything with both of the usual prefixes. */
+ map = echo_area_keymap;
+ keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
+ keymap_bind_keyseq (map, "\033OA", &map[Control ('p')]);
+ keymap_bind_keyseq (map, "\033[A", &map[Control ('p')]);
+ keymap_bind_keyseq (map, term_kd, &map[Control ('n')]); /* down */
+ keymap_bind_keyseq (map, "\033OB", &map[Control ('n')]);
+ keymap_bind_keyseq (map, "\033[B", &map[Control ('n')]);
+ keymap_bind_keyseq (map, term_kr, &map[Control ('f')]); /* right */
+ keymap_bind_keyseq (map, "\033OC", &map[Control ('f')]);
+ keymap_bind_keyseq (map, "\033[C", &map[Control ('f')]);
+ keymap_bind_keyseq (map, term_kl, &map[Control ('b')]); /* left */
+ keymap_bind_keyseq (map, "\033OD", &map[Control ('b')]);
+ keymap_bind_keyseq (map, "\033[D", &map[Control ('b')]);
+
+ map = (Keymap)echo_area_keymap[ESC].function;
+ keymap_bind_keyseq (map, term_kl, &map['b']); /* left */
+ keymap_bind_keyseq (map, "\033OA", &map['b']);
+ keymap_bind_keyseq (map, "\033[A", &map['b']);
+ keymap_bind_keyseq (map, term_kr, &map['f']); /* right */
+ keymap_bind_keyseq (map, "\033OB", &map['f']);
+ keymap_bind_keyseq (map, "\033[B", &map['f']);
+
+ /* Bind commands for Info window keymaps. */
+ map = info_keymap;
+ map[TAB].function = info_move_to_next_xref;
+ map[LFD].function = info_down_line;
+ map[RET].function = info_down_line;
+ map[SPC].function = info_scroll_forward;
+ map[Control ('a')].function = info_beginning_of_line;
+ map[Control ('b')].function = info_scroll_backward;
+ map[Control ('d')].function = info_scroll_half_screen_down;
+ map[Control ('e')].function = info_down_line;
+ map[Control ('f')].function = info_scroll_forward;
+ map[Control ('g')].function = info_abort_key;
+ map[Control ('k')].function = info_up_line;
+ map[Control ('l')].function = info_redraw_display;
+ map[Control ('n')].function = info_down_line;
+ map[Control ('p')].function = info_up_line;
+ map[Control ('r')].function = info_redraw_display;
+ map[Control ('s')].function = isearch_forward;
+ map[Control ('u')].function = info_scroll_half_screen_up;
+ map[Control ('v')].function = info_scroll_forward;
+ map[Control ('y')].function = info_up_line;
+ map[','].function = info_next_index_match;
+ map['/'].function = info_search;
+
+ for (i = '1'; i < '9' + 1; i++)
+ ((Keymap) info_keymap[ESC].function)[i].function = info_menu_digit;
+ ((Keymap) info_keymap[ESC].function)['0'].function = info_last_menu_item;
+
+ map['<'].function = info_first_node;
+ map['>'].function = info_last_node;
+ map['?'].function = info_search_backward;
+ map['['].function = info_global_prev_node;
+ map[']'].function = info_global_next_node;
+ map['\''].function = info_history_node;
+
+ map['b'].function = info_scroll_backward;
+ map['d'].function = info_scroll_half_screen_down;
+ map['e'].function = info_down_line;
+ map['E'].function = info_view_file;
+ map['f'].function = info_scroll_forward;
+ map['F'].function = info_scroll_forward;
+ map['g'].function = info_first_node;
+ map['G'].function = info_last_node;
+ map['h'].function = info_get_help_window;
+ map['H'].function = info_get_help_window;
+ map['i'].function = info_index_search;
+ map['I'].function = info_goto_invocation_node;
+ map['j'].function = info_down_line;
+ map['k'].function = info_up_line;
+ map['l'].function = info_history_node;
+ map['m'].function = info_menu_item;
+ map['n'].function = info_search_next;
+ map['N'].function = info_search_previous;
+ map['O'].function = info_goto_invocation_node;
+ map['p'].function = info_prev_node;
+ map['q'].function = info_quit;
+ map['Q'].function = info_quit;
+ map['r'].function = info_redraw_display;
+ map['R'].function = info_redraw_display;
+ map['s'].function = info_search;
+ map['S'].function = info_search_case_sensitively;
+ map['t'].function = info_top_node;
+ map['u'].function = info_scroll_half_screen_up;
+ map['w'].function = info_scroll_backward_set_window;
+ map['y'].function = info_up_line;
+ map['z'].function = info_scroll_forward_set_window;
+ map['Z'].function = NULL; /* unbind, so it works to bind "ZZ" below */
+ map[DEL].function = info_scroll_backward;
+ keymap_bind_keyseq (map, ":q", &map['q']);
+ keymap_bind_keyseq (map, ":Q", &map['q']);
+ keymap_bind_keyseq (map, "ZZ", &map['q']);
+
+ /* Bind members in the ESC map for Info windows. */
+ map = (Keymap)info_keymap[ESC].function;
+ map[Control ('f')].function = info_show_footnotes;
+ map[Control ('g')].function = info_abort_key;
+ map[TAB].function = info_move_to_prev_xref;
+ map[SPC].function = info_scroll_forward;
+ map[Control ('v')].function = info_scroll_other_window;
+ map['<'].function = info_beginning_of_node;
+ map['>'].function = info_end_of_node;
+ map['/'].function = info_search;
+ map['?'].function = info_search_backward;
+ map['b'].function = info_beginning_of_node;
+ map['d'].function = info_dir_node;
+ map['e'].function = info_end_of_node;
+ map['f'].function = info_xref_item;
+ map['g'].function = info_select_reference_this_line;
+ map['h'].function = info_get_info_help_node;
+ map['m'].function = info_menu_item;
+ map['n'].function = info_search;
+ map['N'].function = info_search_backward;
+ map['r'].function = isearch_backward;
+ map['s'].function = isearch_forward;
+ map['t'].function = info_top_node;
+ map['v'].function = info_scroll_backward;
+#if defined (NAMED_FUNCTIONS)
+ map['x'].function = info_execute_command;
+#endif /* NAMED_FUNCTIONS */
+ map[DEL].function = info_scroll_other_window_backward;
/* Bind members in the Control-X map for Info windows. */
map = (Keymap)info_keymap[Control ('x')].function;
@@ -325,15 +615,27 @@ initialize_info_keymaps ()
map[Control ('f')].function = info_view_file;
map[Control ('g')].function = info_abort_key;
map[Control ('v')].function = info_view_file;
+ map[LFD].function = info_select_reference_this_line;
+ map[RET].function = info_select_reference_this_line;
map['0'].function = info_delete_window;
map['1'].function = info_keep_one_window;
map['2'].function = info_split_window;
map['^'].function = info_grow_window;
map['b'].function = select_visited_node;
+ map['g'].function = info_goto_node;
+ map['i'].function = info_index_search;
+ map['I'].function = info_goto_invocation_node;
map['k'].function = info_kill_node;
+ map['n'].function = info_next_node;
map['o'].function = info_next_window;
+ map['O'].function = info_goto_invocation_node;
+ map['p'].function = info_prev_node;
+ map['r'].function = info_xref_item;
map['t'].function = info_tile_windows;
+ map['u'].function = info_up_node;
map['w'].function = info_toggle_wrap;
+ map[','].function = info_next_index_match;
+ keymap_bind_keyseq (info_keymap, ":e", &map[Control ('v')]);
/* Arrow key bindings for Info windows keymap. */
map = info_keymap;
@@ -359,6 +661,7 @@ initialize_info_keymaps ()
keymap_bind_keyseq (map, "\033OB", &map['f']);
keymap_bind_keyseq (map, "\033[B", &map['f']);
keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
+ keymap_bind_keyseq (map, term_kP, &map[DEL]); /* pageup */
/* The alternative to this definition of a `main map' key in the
`ESC map' section, is something like:
@@ -366,3 +669,13 @@ initialize_info_keymaps ()
*/
keymap_bind_keyseq (info_keymap/*sic*/, term_kP, &map['v']); /* pageup */
}
+
+void
+initialize_info_keymaps ()
+{
+ if (vi_keys_p)
+ initialize_vi_like_keymaps ();
+ else
+ initialize_emacs_like_keymaps ();
+}
+
diff --git a/gnu/usr.bin/texinfo/info/m-x.c b/gnu/usr.bin/texinfo/info/m-x.c
index b504feff3ca..bf4dc2ffcce 100644
--- a/gnu/usr.bin/texinfo/info/m-x.c
+++ b/gnu/usr.bin/texinfo/info/m-x.c
@@ -1,7 +1,7 @@
-/* m-x.c -- Meta-X minibuffer reader.
- $Id: m-x.c,v 1.2 1999/01/11 16:38:08 espie Exp $
+/* m-x.c -- Meta-x minibuffer reader.
+ $Id: m-x.c,v 1.3 2000/02/09 02:18:40 espie Exp $
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -149,7 +149,7 @@ DECLARE_INFO_COMMAND (info_execute_command,
DECLARE_INFO_COMMAND (set_screen_height,
_("Set the height of the displayed window"))
{
- int new_height;
+ int new_height, old_height = screenheight;
if (info_explicit_arg || count != 1)
new_height = count;
@@ -185,6 +185,20 @@ DECLARE_INFO_COMMAND (set_screen_height,
terminal_clear_screen ();
display_clear_display (the_display);
screenheight = new_height;
- display_initialize_display (screenwidth, screenheight);
- window_new_screen_size (screenwidth, screenheight);
+#ifdef SET_SCREEN_SIZE_HELPER
+ SET_SCREEN_SIZE_HELPER;
+#endif
+ if (screenheight == old_height)
+ {
+ /* Display dimensions didn't actually change, so
+ window_new_screen_size won't do anything, but we've
+ already cleared the display above. Undo the damage. */
+ window_mark_chain (windows, W_UpdateWindow);
+ display_update_display (windows);
+ }
+ else
+ {
+ display_initialize_display (screenwidth, screenheight);
+ window_new_screen_size (screenwidth, screenheight);
+ }
}
diff --git a/gnu/usr.bin/texinfo/info/makedoc.c b/gnu/usr.bin/texinfo/info/makedoc.c
index 6e52af8478d..2a0b27a5236 100644
--- a/gnu/usr.bin/texinfo/info/makedoc.c
+++ b/gnu/usr.bin/texinfo/info/makedoc.c
@@ -1,10 +1,7 @@
-/* makedoc.c -- Make doc.c and funs.h from input files.
- $Id: makedoc.c,v 1.2 1999/01/11 16:38:08 espie Exp $
+/* makedoc.c -- make doc.c and funs.h from input files.
+ $Id: makedoc.c,v 1.3 2000/02/09 02:18:40 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -96,6 +93,15 @@ main (argc, argv)
int tags_only = 0;
FILE *funs_stream, *doc_stream;
+#if STRIP_DOT_EXE
+ {
+ char *dot = strrchr (argv[0], '.');
+
+ if (dot && FILENAME_CMP (dot, ".exe") == 0)
+ *dot = 0;
+ }
+#endif
+
for (i = 1; i < argc; i++)
if (strcmp (argv[i], "-tags") == 0)
{
@@ -105,8 +111,8 @@ main (argc, argv)
if (tags_only)
{
- funs_filename = "/dev/null";
- doc_filename = "/dev/null";
+ funs_filename = NULL_DEVICE;
+ doc_filename = NULL_DEVICE;
}
funs_stream = must_fopen (funs_filename, "w");
@@ -157,7 +163,7 @@ main (argc, argv)
if (tags_only)
maybe_dump_tags (stdout);
- exit (0);
+ xexit (0);
}
/* Dumping out the contents of an Emacs tags table. */
@@ -167,6 +173,12 @@ maybe_dump_tags (stream)
{
register int i;
+ /* Emacs needs its TAGS file to be in Unix text format (i.e., only
+ newline at end of every line, no CR), so when we generate a
+ TAGS table, we must switch the output stream to binary mode.
+ (If the table is written to a terminal, this is obviously not needed.) */
+ SET_BINARY (fileno (stream));
+
/* Print out the information for each block. */
for (i = 0; i < emacs_tags_index; i++)
{
@@ -261,7 +273,10 @@ process_one_file (filename, doc_stream, funs_stream)
file_size = (long) finfo.st_size;
buffer = (char *)xmalloc (1 + file_size);
- read (descriptor, buffer, file_size);
+ /* On some systems, the buffer will actually contain
+ less characters than the full file's size, because
+ the CR characters are removed from line endings. */
+ file_size = read (descriptor, buffer, file_size);
close (descriptor);
offset = 0;
@@ -448,7 +463,7 @@ fatal_file_error (filename)
char *filename;
{
fprintf (stderr, _("Couldn't manipulate the file %s.\n"), filename);
- exit (2);
+ xexit (2);
}
static FILE *
diff --git a/gnu/usr.bin/texinfo/info/man.c b/gnu/usr.bin/texinfo/info/man.c
index 08052185c89..f0ff1032f12 100644
--- a/gnu/usr.bin/texinfo/info/man.c
+++ b/gnu/usr.bin/texinfo/info/man.c
@@ -1,7 +1,7 @@
/* man.c: How to read and format man files.
- $Id: man.c,v 1.2 1999/01/11 16:38:08 espie Exp $
+ $Id: man.c,v 1.3 2000/02/09 02:18:40 espie Exp $
- Copyright (C) 1995, 97 Free Software Foundation, Inc.
+ Copyright (C) 1995, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,6 +44,14 @@
# endif /* !hpux */
#endif /* FD_SET */
+#if STRIP_DOT_EXE
+static char const * const exec_extensions[] = {
+ ".exe", ".com", ".bat", ".btm", ".sh", ".ksh", ".pl", ".sed", "", NULL
+};
+#else
+static char const * const exec_extensions[] = { "", NULL };
+#endif
+
static char *read_from_fd ();
static void clean_manpage ();
static NODE *manpage_node_of_file_buffer ();
@@ -76,6 +84,7 @@ get_manpage_node (file_buffer, pagename)
char header[1024];
long oldsize, newsize;
int hlen, plen;
+ char *old_contents = file_buffer->contents;
sprintf (header, "\n\n%c\n%s %s, %s %s, %s (dir)\n\n",
INFO_COOKIE,
@@ -89,13 +98,49 @@ get_manpage_node (file_buffer, pagename)
file_buffer->contents =
(char *)xrealloc (file_buffer->contents, 1 + newsize);
memcpy (file_buffer->contents + oldsize, header, hlen);
- oldsize += hlen;
- memcpy (file_buffer->contents + oldsize, page, plen);
+ memcpy (file_buffer->contents + oldsize + hlen, page, plen);
file_buffer->contents[newsize] = '\0';
file_buffer->filesize = newsize;
file_buffer->finfo.st_size = newsize;
build_tags_and_nodes (file_buffer);
free (page);
+ /* We have just relocated file_buffer->contents from under
+ the feet of info_windows[] array. Therefore, all the
+ nodes on that list which are showing man pages have their
+ contents member pointing into the blue. Undo that harm. */
+ if (old_contents && oldsize && old_contents != file_buffer->contents)
+ {
+ int iw;
+ INFO_WINDOW *info_win;
+ char *old_contents_end = old_contents + oldsize;
+
+ for (iw = 0; (info_win = info_windows[iw]); iw++)
+ {
+ int in;
+
+ for (in = 0; in < info_win->nodes_index; in++)
+ {
+ NODE *node = info_win->nodes[in];
+
+ /* It really only suffices to see that node->filename
+ is "*manpages*". But after several hours of
+ debugging this, would you blame me for being a bit
+ paranoid? */
+ if (node && node->filename && node->contents &&
+ strcmp (node->filename,
+ MANPAGE_FILE_BUFFER_NAME) == 0 &&
+ node->contents >= old_contents &&
+ node->contents + node->nodelen <= old_contents_end)
+ {
+ info_win->nodes[in] =
+ manpage_node_of_file_buffer (file_buffer,
+ node->nodename);
+ free (node->nodename);
+ free (node);
+ }
+ }
+ }
+ }
}
node = manpage_node_of_file_buffer (file_buffer, pagename);
@@ -134,6 +179,8 @@ executable_file_in_path (filename, path)
while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
{
char *temp;
+ char *temp_end;
+ int i;
/* Expand a leading tilde if one is present. */
if (*temp_dirname == '~')
@@ -145,22 +192,30 @@ executable_file_in_path (filename, path)
temp_dirname = expanded_dirname;
}
- temp = (char *)xmalloc (30 + strlen (temp_dirname) + strlen (filename));
+ temp = (char *)xmalloc (34 + strlen (temp_dirname) + strlen (filename));
strcpy (temp, temp_dirname);
- if (temp[(strlen (temp)) - 1] != '/')
+ if (!IS_SLASH (temp[(strlen (temp)) - 1]))
strcat (temp, "/");
strcat (temp, filename);
+ temp_end = temp + strlen (temp);
free (temp_dirname);
- statable = (stat (temp, &finfo) == 0);
-
- /* If we have found a regular executable file, then use it. */
- if ((statable) && (S_ISREG (finfo.st_mode)) &&
- (access (temp, X_OK) == 0))
- return (temp);
- else
- free (temp);
+ /* Look for FILENAME, possibly with any of the extensions
+ in EXEC_EXTENSIONS[]. */
+ for (i = 0; exec_extensions[i]; i++)
+ {
+ if (exec_extensions[i][0])
+ strcpy (temp_end, exec_extensions[i]);
+ statable = (stat (temp, &finfo) == 0);
+
+ /* If we have found a regular executable file, then use it. */
+ if ((statable) && (S_ISREG (finfo.st_mode)) &&
+ (access (temp, X_OK) == 0))
+ return (temp);
+ }
+
+ free (temp);
}
return ((char *)NULL);
}
@@ -210,13 +265,14 @@ get_page_and_section (pagename)
}
}
+#if PIPE_USE_FORK
static void
reap_children (sig)
int sig;
{
- int status;
- wait (&status);
+ wait (NULL);
}
+#endif
static char *
get_manpage_contents (pagename)
@@ -225,7 +281,8 @@ get_manpage_contents (pagename)
static char *formatter_args[4] = { (char *)NULL };
int pipes[2];
pid_t child;
- char *formatted_page = (char *)NULL;
+ RETSIGTYPE (*sigsave) ();
+ char *formatted_page = NULL;
int arg_index = 1;
if (formatter_args[0] == (char *)NULL)
@@ -245,12 +302,12 @@ get_manpage_contents (pagename)
/* Open a pipe to this program, read the output, and save it away
in FORMATTED_PAGE. The reader end of the pipe is pipes[0]; the
writer end is pipes[1]. */
+#if PIPE_USE_FORK
pipe (pipes);
- signal (SIGCHLD, reap_children);
+ sigsave = signal (SIGCHLD, reap_children);
child = fork ();
-
if (child == -1)
return ((char *)NULL);
@@ -261,14 +318,14 @@ get_manpage_contents (pagename)
close (pipes[1]);
formatted_page = read_from_fd (pipes[0]);
close (pipes[0]);
+ signal (SIGCHLD, sigsave);
}
else
- {
- /* In the child, close the read end of the pipe, make the write end
+ { /* In the child, close the read end of the pipe, make the write end
of the pipe be stdout, and execute the man page formatter. */
close (pipes[0]);
- close (fileno (stderr));
- close (fileno (stdin)); /* Don't print errors. */
+ freopen (NULL_DEVICE, "w", stderr);
+ freopen (NULL_DEVICE, "r", stdin);
dup2 (pipes[1], fileno (stdout));
execv (formatter_args[0], formatter_args);
@@ -276,8 +333,39 @@ get_manpage_contents (pagename)
/* If we get here, we couldn't exec, so close out the pipe and
exit. */
close (pipes[1]);
- exit (0);
+ xexit (0);
}
+#else /* !PIPE_USE_FORK */
+ /* Cannot fork/exec, but can popen/pclose. */
+ {
+ FILE *fpipe;
+ char *cmdline = xmalloc (strlen (formatter_args[0])
+ + strlen (manpage_pagename)
+ + (arg_index > 2 ? strlen (manpage_section) : 0)
+ + 3);
+ int save_stderr = dup (fileno (stderr));
+ int fd_err = open (NULL_DEVICE, O_WRONLY, 0666);
+
+ if (fd_err > 2)
+ dup2 (fd_err, fileno (stderr)); /* Don't print errors. */
+ sprintf (cmdline, "%s %s %s", formatter_args[0], manpage_pagename,
+ arg_index > 2 ? manpage_section : "");
+ fpipe = popen (cmdline, "r");
+ free (cmdline);
+ if (fd_err > 2)
+ close (fd_err);
+ dup2 (save_stderr, fileno (stderr));
+ if (fpipe == 0)
+ return ((char *)NULL);
+ formatted_page = read_from_fd (fileno (fpipe));
+ if (pclose (fpipe) == -1)
+ {
+ if (formatted_page)
+ free (formatted_page);
+ return ((char *)NULL);
+ }
+ }
+#endif /* !PIPE_USE_FORK */
/* If we have the page, then clean it up. */
if (formatted_page)
@@ -342,10 +430,11 @@ manpage_node_of_file_buffer (file_buffer, pagename)
{
node = (NODE *)xmalloc (sizeof (NODE));
node->filename = file_buffer->filename;
- node->nodename = tag->nodename;
+ node->nodename = xstrdup (tag->nodename);
node->contents = file_buffer->contents + tag->nodestart;
node->nodelen = tag->nodelen;
node->flags = 0;
+ node->display_pos = 0;
node->parent = (char *)NULL;
node->flags = (N_HasTagsTable | N_IsManPage);
node->contents += skip_node_separator (node->contents);
diff --git a/gnu/usr.bin/texinfo/info/nodemenu.c b/gnu/usr.bin/texinfo/info/nodemenu.c
index 70878f4ca92..1e92a2b6b8c 100644
--- a/gnu/usr.bin/texinfo/info/nodemenu.c
+++ b/gnu/usr.bin/texinfo/info/nodemenu.c
@@ -1,7 +1,7 @@
-/* nodemenu.c -- Produce a menu of all visited nodes.
- $Id: nodemenu.c,v 1.2 1999/01/11 16:38:08 espie Exp $
+/* nodemenu.c -- produce a menu of all visited nodes.
+ $Id: nodemenu.c,v 1.3 2000/02/09 02:18:40 espie Exp $
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -168,7 +168,9 @@ get_visited_nodes (filter_func)
/* Delete duplicates. */
for (i = 0, newlen = 1; i < lines_index - 1; i++)
{
- if (strcmp (lines[i], lines[i + 1]) == 0)
+ /* Use FILENAME_CMP here, since the most important piece
+ of info in each line is the file name of the node. */
+ if (FILENAME_CMP (lines[i], lines[i + 1]) == 0)
{
free (lines[i]);
lines[i] = (char *)NULL;
diff --git a/gnu/usr.bin/texinfo/info/nodes.h b/gnu/usr.bin/texinfo/info/nodes.h
index c39b4bc81b1..1c196a2fc51 100644
--- a/gnu/usr.bin/texinfo/info/nodes.h
+++ b/gnu/usr.bin/texinfo/info/nodes.h
@@ -1,10 +1,7 @@
/* nodes.h -- How we represent nodes internally.
- $Id: nodes.h,v 1.2 1999/01/11 16:38:08 espie Exp $
+ $Id: nodes.h,v 1.3 2000/02/09 02:18:40 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,16 +19,12 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (NODES_H)
+#ifndef NODES_H
#define NODES_H
#include "info.h"
-/* **************************************************************** */
-/* */
-/* User Code Interface */
-/* */
-/* **************************************************************** */
+/* User code interface. */
/* Callers generally only want the node itself. This structure is used
to pass node information around. None of the information in this
@@ -47,6 +40,7 @@ typedef struct {
char *nodename; /* The name of this node. */
char *contents; /* Characters appearing in this node. */
long nodelen; /* The length of the CONTENTS member. */
+ unsigned long display_pos; /* Where to display at, if nonzero. */
int flags; /* See immediately below. */
} NODE;
@@ -57,18 +51,14 @@ typedef struct {
#define N_IsCompressed 0x08 /* The file is compressed on disk. */
#define N_IsInternal 0x10 /* This node was made by Info. */
#define N_CannotGC 0x20 /* File buffer cannot be gc'ed. */
-#define N_IsManPage 0x40 /* This node is a Un*x manpage. */
+#define N_IsManPage 0x40 /* This node is a manpage. */
+#define N_FromAnchor 0x80 /* Synthesized for an anchor reference. */
-/* **************************************************************** */
-/* */
-/* Internal Data Structures */
-/* */
-/* **************************************************************** */
-
-/* Some defines describing details about Info file contents. */
+/* Internal data structures. */
-/* String Constants. */
+/* String constants. */
#define INFO_FILE_LABEL "File:"
+#define INFO_REF_LABEL "Ref:"
#define INFO_NODE_LABEL "Node:"
#define INFO_PREV_LABEL "Prev:"
#define INFO_ALTPREV_LABEL "Previous:"
@@ -82,7 +72,7 @@ typedef struct {
#define INDIRECT_TAGS_TABLE_LABEL "Indirect:\n"
#define TAGS_TABLE_IS_INDIRECT_LABEL "(Indirect)"
-/* Character Constants. */
+/* Character constants. */
#define INFO_COOKIE '\037'
#define INFO_FF '\014'
#define INFO_TAGSEP '\177'
@@ -119,12 +109,8 @@ typedef struct {
int tags_slots; /* Number of slots allocated for TAGS. */
int flags; /* Various flags. Mimics of N_* flags. */
} FILE_BUFFER;
-
-/* **************************************************************** */
-/* */
-/* Externally Visible Functions */
-/* */
-/* **************************************************************** */
+
+/* Externally visible functions. */
/* Array of FILE_BUFFER * which represents the currently loaded info files. */
extern FILE_BUFFER **info_loaded_files;
@@ -166,4 +152,4 @@ extern char *info_recent_file_error;
/* Create a new, empty file buffer. */
extern FILE_BUFFER *make_file_buffer ();
-#endif /* !NODES_H */
+#endif /* not NODES_H */
diff --git a/gnu/usr.bin/texinfo/info/search.h b/gnu/usr.bin/texinfo/info/search.h
index 0fafa165eea..bf10560032e 100644
--- a/gnu/usr.bin/texinfo/info/search.h
+++ b/gnu/usr.bin/texinfo/info/search.h
@@ -1,10 +1,7 @@
/* search.h -- Structure used to search large bodies of text, with bounds.
- $Id: search.h,v 1.2 1999/01/11 16:38:09 espie Exp $
+ $Id: search.h,v 1.3 2000/02/09 02:18:40 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -53,11 +50,6 @@ extern int looking_at ();
after the string. */
extern int string_in_line ();
-/* Some unixes don't have strcasecmp or strncasecmp. */
-#if !defined (HAVE_STRCASECMP)
-extern int strcasecmp (), strncasecmp ();
-#endif /* !HAVE_STRCASECMP */
-
/* Function names that start with "skip" are passed a string, and return
an offset from the start of that string. Function names that start
with "find" are passed a SEARCH_BINDING, and return an absolute position
diff --git a/gnu/usr.bin/texinfo/info/session.c b/gnu/usr.bin/texinfo/info/session.c
index 00cdb62dab2..0eb60a80576 100644
--- a/gnu/usr.bin/texinfo/info/session.c
+++ b/gnu/usr.bin/texinfo/info/session.c
@@ -1,7 +1,7 @@
-/* session.c -- The user windowing interface to Info.
- $Id: session.c,v 1.3 1999/11/22 05:13:39 deraadt Exp $
+/* session.c -- user windowing interface to Info.
+ $Id: session.c,v 1.4 2000/02/09 02:18:40 espie Exp $
- Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,6 +31,12 @@
# include "man.h"
#endif
+#ifdef M_XENIX
+/* SCO 3.2v5.0.2 defines but does not correctly declare strncasecmp.
+ Since we use it as a symbol, have to get it right. --gildea, 1jul99. */
+extern int strncasecmp (const char *, const char *, size_t);
+#endif
+
static void info_clear_pending_input (), info_set_pending_input ();
static void info_handle_pointer ();
@@ -94,7 +100,7 @@ begin_multiple_window_info_session (filename, nodenames)
/* Find the largest window in WINDOWS, and make that be the active
one. Then split it and add our window and node to the list
of remembered windows and nodes. Then tile the windows. */
- register WINDOW *win, *largest = (WINDOW *)NULL;
+ WINDOW *win, *largest = NULL;
int max_height = 0;
for (win = windows; win; win = win->next)
@@ -107,9 +113,9 @@ begin_multiple_window_info_session (filename, nodenames)
if (!largest)
{
display_update_display (windows);
- info_error (CANT_FIND_WIND);
+ info_error (msg_cant_find_window);
info_session ();
- exit (0);
+ xexit (0);
}
active_window = largest;
@@ -122,9 +128,9 @@ begin_multiple_window_info_session (filename, nodenames)
else
{
display_update_display (windows);
- info_error (WIN_TOO_SMALL);
+ info_error (msg_win_too_small);
info_session ();
- exit (0);
+ xexit (0);
}
}
}
@@ -134,13 +140,14 @@ begin_multiple_window_info_session (filename, nodenames)
/* Start an info session with INITIAL_NODE, and an error message in the echo
area made from FORMAT and ARG. */
void
-begin_info_session_with_error (initial_node, format, arg)
+begin_info_session_with_error (initial_node, format, arg1, arg2)
NODE *initial_node;
char *format;
- void *arg;
+ void *arg1;
+ void *arg2;
{
initialize_info_session (initial_node, 1);
- info_error (format, arg, (void *)NULL);
+ info_error (format, arg1, arg2);
info_session ();
}
@@ -159,9 +166,9 @@ display_startup_message_and_start ()
char *format;
format = replace_in_documentation
- (_("Welcome to Info version %s. \"\\[get-help-window]\" for help, \"\\[menu-item]\" for menu item."));
+ (_("Welcome to Info version %s. Type \\[get-help-window] for help, \\[menu-item] for menu item."));
- window_message_in_echo_area (format, version_string ());
+ window_message_in_echo_area (format, VERSION);
info_session ();
}
@@ -267,8 +274,8 @@ initialize_info_session (node, clear_screen)
if (!term_name)
term_name = "dumb";
- info_error (TERM_TOO_DUMB, term_name);
- exit (1);
+ info_error (msg_term_too_dumb, term_name);
+ xexit (1);
}
if (clear_screen)
@@ -281,7 +288,7 @@ initialize_info_session (node, clear_screen)
window_initialize_windows (screenwidth, screenheight);
initialize_info_signal_handler ();
display_initialize_display (screenwidth, screenheight);
- info_set_node_of_window (active_window, node);
+ info_set_node_of_window (0, active_window, node);
/* Tell the window system how to notify us when a window needs to be
asynchronously deleted (e.g., user resizes window very small). */
@@ -291,7 +298,7 @@ initialize_info_session (node, clear_screen)
standard input. */
if (!info_input_stream)
{
- setbuf(stdin, NULL);
+ setbuf (stdin, NULL);
info_input_stream = stdin;
}
@@ -305,7 +312,8 @@ info_set_input_from_file (filename)
{
FILE *stream;
- stream = fopen (filename, "r");
+ /* Input may include binary characters. */
+ stream = fopen (filename, FOPEN_RBIN);
if (!stream)
return;
@@ -484,12 +492,17 @@ forget_window_and_nodes (window)
/* Set WINDOW to show NODE. Remember the new window in our list of Info
windows. If we are doing automatic footnote display, also try to display
- the footnotes for this window. */
+ the footnotes for this window. If REMEMBER is nonzero, first call
+ set_remembered_pagetop_and_point. */
void
-info_set_node_of_window (window, node)
+info_set_node_of_window (remember, window, node)
+ int remember;
WINDOW *window;
NODE *node;
{
+ if (remember)
+ set_remembered_pagetop_and_point (window);
+
/* Put this node into the window. */
window_set_node_of_window (window, node);
@@ -607,7 +620,7 @@ move_to_new_line (old, new, window)
{
if (old == -1)
{
- info_error (CANT_FIND_POINT);
+ info_error (msg_cant_find_point);
}
else
{
@@ -686,7 +699,7 @@ DECLARE_INFO_COMMAND (info_beginning_of_line, _("Move to the start of the line")
for (; (point) && (buffer[point - 1] != '\n'); point--);
- /* If at a line start alreay, do nothing. */
+ /* If at a line start already, do nothing. */
if (point != window->point)
{
window->point = point;
@@ -827,38 +840,6 @@ DECLARE_INFO_COMMAND (info_backward_word, _("Move backward a word"))
info_show_point (window);
}
-/* Here is a list of time counter names which correspond to ordinal numbers.
- It is used to print "once" instead of "1". */
-static char *counter_names[] = {
- "not at all", "once", "twice", "three", "four", "five", "six",
- (char *)NULL
-};
-
-/* Buffer used to return values from times_description (). */
-static char td_buffer[50];
-
-/* Function returns a static string fully describing the number of times
- present in COUNT. */
-static char *
-times_description (count)
- int count;
-{
- register int i;
-
- td_buffer[0] = '\0';
-
- for (i = 0; counter_names[i]; i++)
- if (count == i)
- break;
-
- if (counter_names[i])
- sprintf (td_buffer, "%s%s", counter_names[i], count > 2 ? _(" times") : "");
- else
- sprintf (td_buffer, _("%d times"), count);
-
- return (td_buffer);
-}
-
/* Variable controlling the behaviour of default scrolling when you are
already at the bottom of a node. Possible values are defined in session.h.
The meanings are:
@@ -877,6 +858,14 @@ char *info_scroll_choices[] = {
"Continuous", "Next Only", "Page Only", (char *)NULL
};
+/* Default window sizes for scrolling commands. */
+int default_window_size = -1; /* meaning 1 window-full */
+int default_scroll_size = -1; /* meaning half screen size */
+
+#define INFO_LABEL_FOUND() \
+ (info_parsed_nodename || (info_parsed_filename \
+ && !is_dir_name (info_parsed_filename)))
+
/* Move to 1st menu item, Next, Up/Next, or error in this window. */
static void
forward_move_node_structure (window, behaviour)
@@ -886,17 +875,17 @@ forward_move_node_structure (window, behaviour)
switch (behaviour)
{
case IS_PageOnly:
- info_error (AT_NODE_BOTTOM);
+ info_error (msg_at_node_bottom);
break;
case IS_NextOnly:
info_next_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename)
- info_error (_("No \"Next\" pointer for this node."));
+ info_error (msg_no_pointer, _("Next"));
else
{
- window_message_in_echo_area (_("Following \"Next\" node..."));
- info_handle_pointer (_("Next"), window);
+ window_message_in_echo_area (_("Following Next node..."));
+ info_handle_pointer ("Next", window);
}
break;
@@ -921,10 +910,10 @@ forward_move_node_structure (window, behaviour)
/* Okay, this node does not contain a menu. If it contains a
"Next:" pointer, use that. */
info_next_label_of_node (window->node);
- if (info_label_was_found)
+ if (INFO_LABEL_FOUND ())
{
- window_message_in_echo_area (_("Selecting \"Next\" node..."));
- info_handle_pointer (_("Next"), window);
+ window_message_in_echo_area (_("Selecting Next node..."));
+ info_handle_pointer ("Next", window);
return;
}
@@ -945,9 +934,9 @@ forward_move_node_structure (window, behaviour)
while (!info_error_was_printed)
{
info_up_label_of_node (window->node);
- if (info_label_was_found)
+ if (INFO_LABEL_FOUND ())
{
- info_handle_pointer (_("Up"), window);
+ info_handle_pointer ("Up", window);
if (info_error_was_printed)
continue;
@@ -956,7 +945,7 @@ forward_move_node_structure (window, behaviour)
info_next_label_of_node (window->node);
/* If no "Next" pointer, keep backing up. */
- if (!info_label_was_found)
+ if (!INFO_LABEL_FOUND ())
continue;
/* If this node's first menu item is the same as this node's
@@ -993,10 +982,10 @@ forward_move_node_structure (window, behaviour)
/* This node has a "Next" pointer, and it is not the
same as the first menu item found in this node. */
window_message_in_echo_area
- ("Moving \"Up\" %s, then \"Next\".",
- times_description (up_counter));
+ (_("Moving Up %d time(s), then Next."),
+ up_counter);
- info_handle_pointer (_("Next"), window);
+ info_handle_pointer ("Next", window);
return;
}
else
@@ -1017,7 +1006,7 @@ forward_move_node_structure (window, behaviour)
window->point = info_win->points[old_current];
recalculate_line_starts (window);
window->flags |= W_UpdateWindow;
- info_error (_("No more nodes."));
+ info_error (_("No more nodes within this document."));
}
}
}
@@ -1035,32 +1024,34 @@ backward_move_node_structure (window, behaviour)
switch (behaviour)
{
case IS_PageOnly:
- info_error (AT_NODE_TOP);
+ info_error (msg_at_node_top);
break;
case IS_NextOnly:
info_prev_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename)
- info_error (_("No \"Prev\" for this node."));
+ info_error (_("No `Prev' for this node."));
else
{
- window_message_in_echo_area (_("Moving \"Prev\" in this window."));
- info_handle_pointer (_("Prev"), window);
+ window_message_in_echo_area (_("Moving Prev in this window."));
+ info_handle_pointer ("Prev", window);
}
break;
case IS_Continuous:
info_prev_label_of_node (window->node);
- if (!info_parsed_nodename && !info_parsed_filename)
+ if (!info_parsed_nodename && (!info_parsed_filename
+ || is_dir_name (info_parsed_filename)))
{
info_up_label_of_node (window->node);
- if (!info_parsed_nodename && !info_parsed_filename)
- info_error (_("No \"Prev\" or \"Up\" for this node."));
+ if (!info_parsed_nodename && (!info_parsed_filename
+ || is_dir_name (info_parsed_filename)))
+ info_error (_("No `Prev' or `Up' for this node within this document."));
else
{
- window_message_in_echo_area (_("Moving \"Up\" in this window."));
- info_handle_pointer (_("Up"), window);
+ window_message_in_echo_area (_("Moving Up in this window."));
+ info_handle_pointer ("Up", window);
}
}
else
@@ -1097,8 +1088,8 @@ backward_move_node_structure (window, behaviour)
/* Move to the previous node. If this node now contains a menu,
and we have not inhibited movement to it, move to the node
corresponding to the last menu item. */
- window_message_in_echo_area (_("Moving \"Prev\" in this window."));
- info_handle_pointer (_("Prev"), window);
+ window_message_in_echo_area (_("Moving Prev in this window."));
+ info_handle_pointer ("Prev", window);
if (!inhibit_menu_traversing)
{
@@ -1107,7 +1098,7 @@ backward_move_node_structure (window, behaviour)
{
info_free_references (menu);
window_message_in_echo_area
- (_("Moving to \"Prev\"'s last menu item."));
+ (_("Moving to `Prev's last menu item."));
info_menu_digit (window, 1, '0');
}
}
@@ -1161,7 +1152,9 @@ DECLARE_INFO_COMMAND (info_scroll_forward, _("Scroll forward in this window"))
lines to the top of this window, Or, if at bottom of window,
and the user wishes to scroll through nodes get the "Next" node
for this window. */
- if (!info_explicit_arg && count == 1)
+ if (default_window_size > 0)
+ desired_top = window->pagetop + default_window_size;
+ else if (!info_explicit_arg && count == 1)
{
desired_top = window->pagetop + (window->height - 2);
@@ -1193,6 +1186,16 @@ DECLARE_INFO_COMMAND (info_scroll_forward, _("Scroll forward in this window"))
}
}
+/* Like info_scroll_forward, but sets default_window_size as a side
+ effect. */
+DECLARE_INFO_COMMAND (info_scroll_forward_set_window,
+ _("Scroll forward in this window and set default window size"))
+{
+ if (info_explicit_arg)
+ default_window_size = count;
+ info_scroll_forward (window, count, key);
+}
+
/* Show the previous screen of WINDOW's node. */
DECLARE_INFO_COMMAND (info_scroll_backward, _("Scroll backward in this window"))
{
@@ -1205,7 +1208,9 @@ DECLARE_INFO_COMMAND (info_scroll_backward, _("Scroll backward in this window"))
/* Without an explicit numeric argument, scroll the top two lines
to the bottom of this window, or move to the previous, or Up'th
node. */
- if (!info_explicit_arg && count == 1)
+ if (default_window_size > 0)
+ desired_top = window->pagetop - default_window_size;
+ else if (!info_explicit_arg && count == 1)
{
desired_top = window->pagetop - (window->height - 2);
@@ -1233,6 +1238,16 @@ DECLARE_INFO_COMMAND (info_scroll_backward, _("Scroll backward in this window"))
}
}
+/* Like info_scroll_backward, but sets default_window_size as a side
+ effect. */
+DECLARE_INFO_COMMAND (info_scroll_backward_set_window,
+ _("Scroll backward in this window and set default window size"))
+{
+ if (info_explicit_arg)
+ default_window_size = count;
+ info_scroll_backward (window, count, key);
+}
+
/* Move to the beginning of the node. */
DECLARE_INFO_COMMAND (info_beginning_of_node, _("Move to the start of this node"))
{
@@ -1246,6 +1261,90 @@ DECLARE_INFO_COMMAND (info_end_of_node, _("Move to the end of this node"))
window->point = window->node->nodelen - 1;
info_show_point (window);
}
+
+/* Scroll the window forward by N lines. */
+DECLARE_INFO_COMMAND (info_down_line, _("Scroll down by lines"))
+{
+ if (count < 0)
+ info_up_line (window, -count, key);
+ else
+ {
+ int desired_top = window->pagetop + count;
+
+ if (desired_top >= window->line_count)
+ desired_top = window->line_count - 2;
+
+ if (window->pagetop <= desired_top)
+ set_window_pagetop (window, desired_top);
+ }
+}
+
+/* Scroll the window backward by N lines. */
+DECLARE_INFO_COMMAND (info_up_line, _("Scroll up by lines"))
+{
+ if (count < 0)
+ info_down_line (window, -count, key);
+ else
+ {
+ int desired_top = window->pagetop - count;
+
+ if (desired_top < 0)
+ desired_top = 0;
+
+ set_window_pagetop (window, desired_top);
+ }
+}
+
+/* Scroll the window forward by N lines and remember N as default for
+ subsequent commands. */
+DECLARE_INFO_COMMAND (info_scroll_half_screen_down,
+ _("Scroll down by half screen size"))
+{
+ if (count < 0)
+ info_scroll_half_screen_up (window -count, key);
+ else
+ {
+ int scroll_size = (the_screen->height + 1) / 2;
+ int desired_top;
+
+ if (info_explicit_arg)
+ default_scroll_size = count;
+ if (default_scroll_size > 0)
+ scroll_size = default_scroll_size;
+
+ desired_top = window->pagetop + scroll_size;
+ if (desired_top >= window->line_count)
+ desired_top = window->line_count - 2;
+
+ if (window->pagetop <= desired_top)
+ set_window_pagetop (window, desired_top);
+ }
+}
+
+/* Scroll the window backward by N lines and remember N as default for
+ subsequent commands. */
+DECLARE_INFO_COMMAND (info_scroll_half_screen_up,
+ _("Scroll up by half screen size"))
+{
+ if (count < 0)
+ info_scroll_half_screen_down (window -count, key);
+ else
+ {
+ int scroll_size = (the_screen->height + 1) / 2;
+ int desired_top;
+
+ if (info_explicit_arg)
+ default_scroll_size = count;
+ if (default_scroll_size > 0)
+ scroll_size = default_scroll_size;
+
+ desired_top = window->pagetop - scroll_size;
+ if (desired_top < 0)
+ desired_top = 0;
+
+ set_window_pagetop (window, desired_top);
+ }
+}
/* **************************************************************** */
/* */
@@ -1265,7 +1364,7 @@ DECLARE_INFO_COMMAND (info_next_window, _("Select the next window"))
/* If no other window, error now. */
if (!windows->next && !echo_area_is_active)
{
- info_error (ONE_WINDOW);
+ info_error (msg_one_window);
return;
}
@@ -1305,7 +1404,7 @@ DECLARE_INFO_COMMAND (info_prev_window, _("Select the previous window"))
if (!windows->next && !echo_area_is_active)
{
- info_error (ONE_WINDOW);
+ info_error (msg_one_window);
return;
}
@@ -1361,7 +1460,7 @@ DECLARE_INFO_COMMAND (info_split_window, _("Split the current window"))
if (!split)
{
- info_error (WIN_TOO_SMALL);
+ info_error (msg_win_too_small);
}
else
{
@@ -1429,7 +1528,7 @@ DECLARE_INFO_COMMAND (info_delete_window, _("Delete the current window"))
{
if (!windows->next)
{
- info_error (CANT_KILL_LAST);
+ info_error (msg_cant_kill_last);
}
else if (window->flags & W_WindowIsPerm)
{
@@ -1519,7 +1618,7 @@ DECLARE_INFO_COMMAND (info_scroll_other_window, _("Scroll the other window"))
/* If only one window, give up. */
if (!windows->next)
{
- info_error (ONE_WINDOW);
+ info_error (msg_one_window);
return;
}
@@ -1531,6 +1630,13 @@ DECLARE_INFO_COMMAND (info_scroll_other_window, _("Scroll the other window"))
info_scroll_forward (other, count, key);
}
+/* Scroll the "other" window of WINDOW. */
+DECLARE_INFO_COMMAND (info_scroll_other_window_backward,
+ _("Scroll the other window backward"))
+{
+ info_scroll_other_window (window, -count, key);
+}
+
/* Change the size of WINDOW by AMOUNT. */
DECLARE_INFO_COMMAND (info_grow_window, _("Grow (or shrink) this window"))
{
@@ -1561,6 +1667,28 @@ DECLARE_INFO_COMMAND (info_toggle_wrap,
/* */
/* **************************************************************** */
+/* Return (FILENAME)NODENAME for NODE, or just NODENAME if NODE's
+ filename is not set. */
+char *
+node_printed_rep (node)
+ NODE *node;
+{
+ char *rep;
+
+ if (node->filename)
+ {
+ char *filename
+ = filename_non_directory (node->parent ? node->parent : node->filename);
+ rep = xmalloc (1 + strlen (filename) + 1 + strlen (node->nodename) + 1);
+ sprintf (rep, "(%s)%s", filename, node->nodename);
+ }
+ else
+ rep = node->nodename;
+
+ return rep;
+}
+
+
/* Using WINDOW for various defaults, select the node referenced by ENTRY
in it. If the node is selected, the window and node are remembered. */
void
@@ -1613,7 +1741,7 @@ info_select_reference (window, entry)
if (file_system_error)
info_error (file_system_error);
else
- info_error (CANT_FIND_NODE, nodename);
+ info_error (msg_cant_find_node, nodename);
}
maybe_free (file_system_error);
@@ -1621,10 +1749,7 @@ info_select_reference (window, entry)
maybe_free (nodename);
if (node)
- {
- set_remembered_pagetop_and_point (window);
- info_set_node_of_window (window, node);
- }
+ info_set_node_of_window (1, window, node);
}
/* Parse the node specification in LINE using WINDOW to default the filename.
@@ -1689,15 +1814,14 @@ info_handle_pointer (label, window)
info_win->pagetops[info_win->current] = window->pagetop;
info_win->points[info_win->current] = window->point;
}
- set_remembered_pagetop_and_point (window);
- info_set_node_of_window (window, node);
+ info_set_node_of_window (1, window, node);
}
else
{
if (info_recent_file_error)
info_error (info_recent_file_error);
else
- info_error (CANT_FILE_NODE, filename, nodename);
+ info_error (msg_cant_file_node, filename, nodename);
}
free (filename);
@@ -1705,32 +1829,32 @@ info_handle_pointer (label, window)
}
else
{
- info_error (NO_POINTER, label);
+ info_error (msg_no_pointer, label);
}
}
/* Make WINDOW display the "Next:" node of the node currently being
displayed. */
-DECLARE_INFO_COMMAND (info_next_node, _("Select the `Next' node"))
+DECLARE_INFO_COMMAND (info_next_node, _("Select the Next node"))
{
info_next_label_of_node (window->node);
- info_handle_pointer (_("Next"), window);
+ info_handle_pointer ("Next", window);
}
/* Make WINDOW display the "Prev:" node of the node currently being
displayed. */
-DECLARE_INFO_COMMAND (info_prev_node, _("Select the `Prev' node"))
+DECLARE_INFO_COMMAND (info_prev_node, _("Select the Prev node"))
{
info_prev_label_of_node (window->node);
- info_handle_pointer (_("Prev"), window);
+ info_handle_pointer ("Prev", window);
}
/* Make WINDOW display the "Up:" node of the node currently being
displayed. */
-DECLARE_INFO_COMMAND (info_up_node, _("Select the `Up' node"))
+DECLARE_INFO_COMMAND (info_up_node, _("Select the Up node"))
{
info_up_label_of_node (window->node);
- info_handle_pointer (_("Up"), window);
+ info_handle_pointer ("Up", window);
}
/* Make WINDOW display the last node of this info file. */
@@ -1742,17 +1866,28 @@ DECLARE_INFO_COMMAND (info_last_node, _("Select the last node in this file"))
if (fb && fb->tags)
{
- for (i = 0; fb->tags[i]; i++);
- node = info_get_node (fb->filename, fb->tags[i - 1]->nodename);
+ int last_node_tag_idx = -1;
+
+ /* If no explicit argument, or argument of zero, default to the
+ last node. */
+ if (count == 0 || (count == 1 && !info_explicit_arg))
+ count = -1;
+ for (i = 0; count && fb->tags[i]; i++)
+ if (fb->tags[i]->nodelen != 0) /* don't count anchor tags */
+ {
+ count--;
+ last_node_tag_idx = i;
+ }
+ if (count > 0)
+ i = last_node_tag_idx + 1;
+ if (i > 0)
+ node = info_get_node (fb->filename, fb->tags[i - 1]->nodename);
}
if (!node)
info_error (_("This window has no additional nodes"));
else
- {
- set_remembered_pagetop_and_point (window);
- info_set_node_of_window (window, node);
- }
+ info_set_node_of_window (1, window, node);
}
/* Make WINDOW display the first node of this info file. */
@@ -1761,16 +1896,31 @@ DECLARE_INFO_COMMAND (info_first_node, _("Select the first node in this file"))
FILE_BUFFER *fb = file_buffer_of_window (window);
NODE *node = (NODE *)NULL;
+ /* If no explicit argument, or argument of zero, default to the
+ first node. */
+ if (count == 0)
+ count = 1;
if (fb && fb->tags)
- node = info_get_node (fb->filename, fb->tags[0]->nodename);
+ {
+ register int i;
+ int last_node_tag_idx = -1;
+
+ for (i = 0; count && fb->tags[i]; i++)
+ if (fb->tags[i]->nodelen != 0) /* don't count anchor tags */
+ {
+ count--;
+ last_node_tag_idx = i;
+ }
+ if (count > 0)
+ i = last_node_tag_idx + 1;
+ if (i > 0)
+ node = info_get_node (fb->filename, fb->tags[i - 1]->nodename);
+ }
if (!node)
info_error (_("This window has no additional nodes"));
else
- {
- set_remembered_pagetop_and_point (window);
- info_set_node_of_window (window, node);
- }
+ info_set_node_of_window (1, window, node);
}
/* Select the last menu item in WINDOW->node. */
@@ -1790,7 +1940,7 @@ DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item"))
if (!menu)
{
- info_error (NO_MENU_NODE);
+ info_error (msg_no_menu_node);
return;
}
@@ -1837,9 +1987,9 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
if (!menu)
{
if (builder == info_menu_of_node)
- info_error (NO_MENU_NODE);
+ info_error (msg_no_menu_node);
else
- info_error (NO_XREF_NODE);
+ info_error (msg_no_xref_node);
return;
}
@@ -1998,12 +2148,11 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
info_error (_("The reference disappeared! (%s)."), line);
else
{
- NODE *orig;
-
- orig = window->node;
+ NODE *orig = window->node;
info_select_reference (window, entry);
- if ((builder == info_xrefs_of_node) && (window->node != orig))
- {
+ if (builder == info_xrefs_of_node && window->node != orig
+ && !(window->node->flags & N_FromAnchor))
+ { /* Search for this reference in the node. */
long offset;
long start;
@@ -2068,7 +2217,7 @@ DECLARE_INFO_COMMAND (info_find_menu, _("Move to the start of this node's menu")
position = search (INFO_MENU_LABEL, &binding);
if (position == -1)
- info_error (NO_MENU_NODE);
+ info_error (msg_no_menu_node);
else
{
window->point = position;
@@ -2087,7 +2236,7 @@ DECLARE_INFO_COMMAND (info_visit_menu,
menu = info_menu_of_node (window->node);
if (!menu)
- info_error (NO_MENU_NODE);
+ info_error (msg_no_menu_node);
for (i = 0; (!info_error_was_printed) && (entry = menu[i]); i++)
{
@@ -2097,7 +2246,7 @@ DECLARE_INFO_COMMAND (info_visit_menu,
window_tile_windows (TILE_INTERNALS);
if (!new)
- info_error (WIN_TOO_SMALL);
+ info_error (msg_win_too_small);
else
{
active_window = new;
@@ -2146,33 +2295,27 @@ DECLARE_INFO_COMMAND (info_goto_node, _("Read a node name and select it"))
{
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->filename = entry->nodename = (char *)NULL;
- entry->label = (char *) xmalloc
- (4 + strlen (fb->filename) + strlen (fb->tags[i]->nodename));
- sprintf (entry->label, "(%s)%s",
- fb->filename, fb->tags[i]->nodename);
+ if (this_is_the_current_fb)
+ entry->label = xstrdup (fb->tags[i]->nodename);
+ else
+ {
+ entry->label = (char *) xmalloc
+ (4 + strlen (fb->filename) +
+ strlen (fb->tags[i]->nodename));
+ sprintf (entry->label, "(%s)%s",
+ fb->filename, fb->tags[i]->nodename);
+ }
add_pointer_to_array
(entry, items_index, items, items_slots, 100, REFERENCE *);
- }
-
- if (this_is_the_current_fb)
- {
- for (i = 0; fb->tags[i]; i++)
- {
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->filename = entry->nodename = (char *)NULL;
- entry->label = xstrdup (fb->tags[i]->nodename);
- add_pointer_to_array (entry, items_index, items,
- items_slots, 100, REFERENCE *);
- }
}
}
}
- line = info_read_maybe_completing (window, _("Goto Node: "), items);
+ line = info_read_maybe_completing (window, _("Goto node: "), items);
info_free_references (items);
}
#else /* !GOTO_COMPLETES */
- line = info_read_in_echo_area (window, _("Goto Node: "));
+ line = info_read_in_echo_area (window, _("Goto node: "));
#endif /* !GOTO_COMPLETES */
/* If the user aborted, quit now. */
@@ -2191,7 +2334,413 @@ DECLARE_INFO_COMMAND (info_goto_node, _("Read a node name and select it"))
if (!info_error_was_printed)
window_clear_echo_area ();
}
+
+/* Follow the menu list in MENUS (list of strings terminated by a NULL
+ entry) from INITIAL_NODE. If can't continue at any point (no menu or
+ no menu entry for the next item), return the node so far -- that
+ might be INITIAL_NODE itself. If error, *ERRSTR and *ERRARG[12] will
+ be set to the error message and argument for message, otherwise they
+ will be NULL. */
+
+NODE *
+info_follow_menus (initial_node, menus, errstr, errarg1, errarg2)
+ NODE *initial_node;
+ char **menus;
+ char **errstr, **errarg1, **errarg2;
+{
+ NODE *node = NULL;
+ *errstr = *errarg1 = *errarg2 = NULL;
+
+ for (; *menus; menus++)
+ {
+ static char *first_arg = NULL;
+ REFERENCE **menu;
+ REFERENCE *entry;
+ char *arg = *menus; /* Remember the name of the menu entry we want. */
+
+ /* A leading space is certainly NOT part of a node name. Most
+ probably, they typed a space after the separating comma. The
+ strings in menus[] have their whitespace canonicalized, so
+ there's at most one space to ignore. */
+ if (*arg == ' ')
+ arg++;
+ if (!first_arg)
+ first_arg = arg;
+
+ /* Build and return a list of the menu items in this node. */
+ menu = info_menu_of_node (initial_node);
+
+ /* If no menu item in this node, stop here, but let the user
+ continue to use Info. Perhaps they wanted this node and didn't
+ realize it. */
+ if (!menu)
+ {
+ if (arg == first_arg)
+ {
+ node = make_manpage_node (first_arg);
+ if (node)
+ goto maybe_got_node;
+ }
+ *errstr = _("No menu in node `%s'.");
+ *errarg1 = node_printed_rep (initial_node);
+ return initial_node;
+ }
+
+ /* Find the specified menu item. */
+ entry = info_get_labeled_reference (arg, menu);
+
+ /* If the item wasn't found, search the list sloppily. Perhaps this
+ user typed "buffer" when they really meant "Buffers". */
+ if (!entry)
+ {
+ int i;
+ int best_guess = -1;
+
+ for (i = 0; (entry = menu[i]); i++)
+ {
+ if (strcasecmp (entry->label, arg) == 0)
+ break;
+ else
+ if (strncasecmp (entry->label, arg, strlen (arg)) == 0)
+ best_guess = i;
+ }
+
+ if (!entry && best_guess != -1)
+ entry = menu[best_guess];
+ }
+
+ /* If we still failed to find the reference, start Info with the current
+ node anyway. It is probably a misspelling. */
+ if (!entry)
+ {
+ if (arg == first_arg)
+ {
+ node = make_manpage_node (first_arg);
+ if (node)
+ goto maybe_got_node;
+ }
+
+ info_free_references (menu);
+ *errstr = _("No menu item `%s' in node `%s'.");
+ *errarg1 = arg;
+ *errarg2 = node_printed_rep (initial_node);
+ return initial_node;
+ }
+
+ /* We have found the reference that the user specified. If no
+ filename in this reference, define it. */
+ if (!entry->filename)
+ entry->filename = xstrdup (initial_node->parent ? initial_node->parent
+ : initial_node->filename);
+
+ /* Try to find this node. */
+ node = info_get_node (entry->filename, entry->nodename);
+ if (!node && arg == first_arg)
+ {
+ node = make_manpage_node (first_arg);
+ if (node)
+ goto maybe_got_node;
+ }
+
+ /* Since we cannot find it, try using the label of the entry as a
+ file, i.e., "(LABEL)Top". */
+ if (!node && entry->nodename
+ && strcmp (entry->label, entry->nodename) == 0)
+ node = info_get_node (entry->label, "Top");
+
+ maybe_got_node:
+ if (!node)
+ {
+ *errstr = _("Unable to find node referenced by `%s' in `%s'.");
+ *errarg1 = xstrdup (entry->label);
+ *errarg2 = node_printed_rep (initial_node);
+ info_free_references (menu);
+ return initial_node;
+ }
+
+ info_free_references (menu);
+
+ /* Success. Go round the loop again. */
+ free (initial_node);
+ initial_node = node;
+ }
+
+ return initial_node;
+}
+
+/* Split STR into individual node names by writing null bytes in wherever
+ there are commas and constructing a list of the resulting pointers.
+ (We can do this since STR has had canonicalize_whitespace called on it.)
+ Return array terminated with NULL. */
+
+static char **
+split_list_of_nodenames (str)
+ char *str;
+{
+ unsigned len = 2;
+ char **nodes = xmalloc (len * sizeof (char *));
+
+ nodes[len - 2] = str;
+
+ while (*str++)
+ {
+ if (*str == ',')
+ {
+ *str++ = 0; /* get past the null byte */
+ len++;
+ nodes = xrealloc (nodes, len * sizeof (char *));
+ nodes[len - 2] = str;
+ }
+ }
+
+ nodes[len - 1] = NULL;
+
+ return nodes;
+}
+
+/* Read a line of input which is a sequence of menus (starting from
+ dir), and follow them. */
+DECLARE_INFO_COMMAND (info_menu_sequence,
+ _("Read a list of menus starting from dir and follow them"))
+{
+ char *line = info_read_in_echo_area (window, _("Follow menus: "));
+
+ /* If the user aborted, quit now. */
+ if (!line)
+ {
+ info_abort_key (window, 0, 0);
+ return;
+ }
+
+ canonicalize_whitespace (line);
+
+ if (*line)
+ {
+ char *errstr, *errarg1, *errarg2;
+ NODE *dir_node = info_get_node (NULL, NULL);
+ char **nodes = split_list_of_nodenames (line);
+ NODE *node;
+
+ /* If DIR_NODE is NULL, they might be reading a file directly,
+ like in "info -d . -f ./foo". Try using "Top" instead. */
+ if (!dir_node)
+ {
+ char *file_name = window->node->parent;
+
+ if (!file_name)
+ file_name = window->node->filename;
+ dir_node = info_get_node (file_name, NULL);
+ }
+
+ /* If we still cannot find the starting point, give up.
+ We cannot allow a NULL pointer inside info_follow_menus. */
+ if (!dir_node)
+ info_error (msg_cant_find_node, "Top");
+ else
+ node
+ = info_follow_menus (dir_node, nodes, &errstr, &errarg1, &errarg2);
+
+ free (nodes);
+ if (!errstr)
+ info_set_node_of_window (1, window, node);
+ else
+ info_error (errstr, errarg1, errarg2);
+ }
+
+ free (line);
+ if (!info_error_was_printed)
+ window_clear_echo_area ();
+}
+
+/* Search the menu MENU for a (possibly mis-spelled) entry ARG.
+ Return the menu entry, or the best guess for what they meant by ARG,
+ or NULL if there's nothing in this menu seems to fit the bill.
+ If EXACT is non-zero, allow only exact matches. */
+static REFERENCE *
+entry_in_menu (arg, menu, exact)
+ char *arg;
+ REFERENCE **menu;
+ int exact;
+{
+ REFERENCE *entry;
+
+ /* First, try to find the specified menu item verbatim. */
+ entry = info_get_labeled_reference (arg, menu);
+
+ /* If the item wasn't found, search the list sloppily. Perhaps we
+ have "Option Summary", but ARG is "option". */
+ if (!entry && !exact)
+ {
+ int i;
+ int best_guess = -1;
+
+ for (i = 0; (entry = menu[i]); i++)
+ {
+ if (strcasecmp (entry->label, arg) == 0)
+ break;
+ else
+ if (strncasecmp (entry->label, arg, strlen (arg)) == 0)
+ best_guess = i;
+ }
+
+ if (!entry && best_guess != -1)
+ entry = menu[best_guess];
+ }
+
+ return entry;
+}
+
+/* Find the node that is the best candidate to list the PROGRAM's
+ invocation info and its command-line options, by looking for menu
+ items and chains of menu items with characteristic names. */
+void
+info_intuit_options_node (window, initial_node, program)
+ WINDOW *window;
+ NODE *initial_node;
+ char *program;
+{
+ /* The list of node names typical for GNU manuals where the program
+ usage and specifically the command-line arguments are described.
+ This is pure heuristics. I gathered these node names by looking
+ at all the Info files I could put my hands on. If you are
+ looking for evidence to complain to the GNU project about
+ non-uniform style of documentation, here you have your case! */
+ static const char *invocation_nodes[] = {
+ "%s invocation",
+ "Invoking %s",
+ "Preliminaries", /* m4 has Invoking under Preliminaries! */
+ "Invocation",
+ "Command Arguments",/* Emacs */
+ "Invoking `%s'",
+ "%s options",
+ "Options",
+ "Option ", /* e.g. "Option Summary" */
+ "Invoking",
+ "All options", /* tar, paxutils */
+ "Arguments",
+ "%s cmdline", /* ar */
+ "%s", /* last resort */
+ (const char *)0
+ };
+ NODE *node = NULL;
+ REFERENCE **menu;
+ const char **try_node;
+
+ /* We keep looking deeper and deeper in the menu structure until
+ there are no more menus or no menu items from the above list.
+ Some manuals have the invocation node sitting 3 or 4 levels deep
+ in the menu hierarchy... */
+ for (node = initial_node; node; initial_node = node)
+ {
+ REFERENCE *entry;
+
+ /* Build and return a list of the menu items in this node. */
+ menu = info_menu_of_node (initial_node);
+
+ /* If no menu item in this node, stop here. Perhaps this node
+ is the one they need. */
+ if (!menu)
+ break;
+
+ /* Look for node names typical for usage nodes in this menu. */
+ for (try_node = invocation_nodes; *try_node; try_node++)
+ {
+ char nodename[200];
+
+ sprintf (nodename, *try_node, program);
+ /* The last resort "%s" is dangerous, so we restrict it
+ to exact matches here. */
+ entry = entry_in_menu (nodename, menu,
+ strcmp (*try_node, "%s") == 0);
+ if (entry)
+ break;
+ }
+
+ if (!entry)
+ break;
+
+ if (!entry->filename)
+ entry->filename = xstrdup (initial_node->parent ? initial_node->parent
+ : initial_node->filename);
+ /* Try to find this node. */
+ node = info_get_node (entry->filename, entry->nodename);
+ info_free_references (menu);
+ if (!node)
+ break;
+ }
+
+ /* We've got our best shot at the invocation node. Now select it. */
+ if (initial_node)
+ info_set_node_of_window (1, window, initial_node);
+ if (!info_error_was_printed)
+ window_clear_echo_area ();
+}
+
+/* Given a name of an Info file, find the name of the package it
+ describes by removing the leading directories and extensions. */
+char *
+program_name_from_file_name (file_name)
+ char *file_name;
+{
+ int i;
+ char *program_name = xstrdup (filename_non_directory (file_name));
+
+ for (i = strlen (program_name) - 1; i > 0; i--)
+ if (program_name[i] == '.'
+ && (FILENAME_CMPN (program_name + i, ".info", 5) == 0
+ || FILENAME_CMPN (program_name + i, ".inf", 4) == 0
+#ifdef __MSDOS__
+ || FILENAME_CMPN (program_name + i, ".i", 2) == 0
+#endif
+ || isdigit (program_name[i + 1]))) /* a man page foo.1 */
+ {
+ program_name[i] = 0;
+ break;
+ }
+ return program_name;
+}
+
+DECLARE_INFO_COMMAND (info_goto_invocation_node,
+ _("Find the node describing program invocation"))
+{
+ char *invocation_prompt = _("Find Invocation node of [%s]: ");
+ char *program_name, *line;
+ char *default_program_name, *prompt, *file_name;
+ NODE *top_node;
+
+ /* Intuit the name of the program they are likely to want.
+ We use the file name of the current Info file as a hint. */
+ file_name = window->node->parent ? window->node->parent
+ : window->node->filename;
+ default_program_name = program_name_from_file_name (file_name);
+
+ prompt = (char *)xmalloc (strlen (default_program_name) +
+ strlen (invocation_prompt));
+ sprintf (prompt, invocation_prompt, default_program_name);
+ line = info_read_in_echo_area (window, prompt);
+ free (prompt);
+ if (!line)
+ {
+ info_abort_key ();
+ return;
+ }
+ if (*line)
+ program_name = line;
+ else
+ program_name = default_program_name;
+
+ /* In interactive usage they'd probably expect us to begin looking
+ from the Top node. */
+ top_node = info_get_node (file_name, NULL);
+ if (!top_node)
+ info_error (msg_cant_find_node, "Top");
+
+ info_intuit_options_node (window, top_node, program_name);
+ free (line);
+ free (default_program_name);
+}
+
#if defined (HANDLE_MAN_PAGES)
DECLARE_INFO_COMMAND (info_man, _("Read a manpage reference and select it"))
{
@@ -2229,7 +2778,7 @@ DECLARE_INFO_COMMAND (info_man, _("Read a manpage reference and select it"))
/* Move to the "Top" node in this file. */
DECLARE_INFO_COMMAND (info_top_node, _("Select the node `Top' in this file"))
{
- info_parse_and_select (_("Top"), window);
+ info_parse_and_select ("Top", window);
}
/* Move to the node "(dir)Top". */
@@ -2290,7 +2839,7 @@ kill_node (window, nodename)
int iw, i;
INFO_WINDOW *info_win;
NODE *temp;
-
+
/* If there is no nodename to kill, quit now. */
if (!nodename)
{
@@ -2300,7 +2849,8 @@ kill_node (window, nodename)
/* If there is a nodename, find it in our window list. */
for (iw = 0; (info_win = info_windows[iw]); iw++)
- if (strcmp (nodename, info_win->nodes[info_win->current]->nodename) == 0)
+ if (strcmp (nodename, info_win->nodes[info_win->current]->nodename) == 0
+ && info_win->window == window)
break;
if (!info_win)
@@ -2323,7 +2873,7 @@ kill_node (window, nodename)
/* INFO_WIN contains the node that the user wants to stop viewing. Delete
this node from the list of nodes previously shown in this window. */
for (i = info_win->current; i < info_win->nodes_index; i++)
- info_win->nodes[i] = info_win->nodes[i++];
+ info_win->nodes[i] = info_win->nodes[i + 1];
/* There is one less node in this window's history list. */
info_win->nodes_index--;
@@ -2361,7 +2911,7 @@ kill_node (window, nodename)
/* Copy this node. */
{
NODE *copy = xmalloc (sizeof (NODE));
-
+
temp = stealer->nodes[which];
point = stealer->points[which];
pagetop = stealer->pagetops[which];
@@ -2372,6 +2922,7 @@ kill_node (window, nodename)
copy->contents = temp->contents;
copy->nodelen = temp->nodelen;
copy->flags = temp->flags;
+ copy->display_pos = temp->display_pos;
temp = copy;
}
@@ -2384,6 +2935,7 @@ kill_node (window, nodename)
else
{
temp = info_win->nodes[info_win->current];
+ temp->display_pos = info_win->points[info_win->current];
window_set_node_of_window (info_win->window, temp);
}
@@ -2435,13 +2987,11 @@ DECLARE_INFO_COMMAND (info_view_file, _("Read the name of a file and select it")
if (info_recent_file_error)
info_error (info_recent_file_error);
else
- info_error (_("Cannot find \"%s\"."), line);
+ info_error (_("Cannot find `%s'."), line);
}
else
- {
- set_remembered_pagetop_and_point (active_window);
- info_set_node_of_window (window, node);
- }
+ info_set_node_of_window (1, window, node);
+
free (line);
}
@@ -2482,7 +3032,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes)
if (!output_stream)
{
- info_error (_("Could not create output file \"%s\"."), output_filename);
+ info_error (_("Could not create output file `%s'."), output_filename);
return;
}
@@ -2531,10 +3081,10 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes)
else
{
if (filename && *nodename != '(')
- info_error
- (CANT_FILE_NODE, filename_non_directory (filename), nodename);
+ info_error (msg_cant_file_node, filename_non_directory (filename),
+ nodename);
else
- info_error (CANT_FIND_NODE, nodename);
+ info_error (msg_cant_find_node, nodename);
}
return;
}
@@ -2551,11 +3101,7 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes)
#if defined (VERBOSE_NODE_DUMPING)
/* Maybe we should print some information about the node being output. */
- if (node->filename)
- info_error (_("Writing node \"(%s)%s\"..."),
- filename_non_directory (node->filename), node->nodename);
- else
- info_error (_("Writing node \"%s\"..."), node->nodename);
+ info_error (_("Writing node %s..."), node_printed_rep (node));
#endif /* VERBOSE_NODE_DUMPING */
write_node_to_stream (node, stream);
@@ -2607,7 +3153,7 @@ dump_node_to_file (node, filename, dump_subnodes)
if (!output_stream)
{
- info_error (_("Could not create output file \"%s\"."), filename);
+ info_error (_("Could not create output file `%s'."), filename);
return;
}
@@ -2645,29 +3191,44 @@ print_node (node)
{
FILE *printer_pipe;
char *print_command = getenv ("INFO_PRINT_COMMAND");
+ int piping = 0;
if (!print_command || !*print_command)
print_command = DEFAULT_INFO_PRINT_COMMAND;
- printer_pipe = popen (print_command, "w");
+ /* Note that on MS-DOS/MS-Windows, this MUST open the pipe in the
+ (default) text mode, since the printer drivers there need to see
+ DOS-style CRLF pairs at the end of each line.
+
+ FIXME: if we are to support Mac-style text files, we might need
+ to convert the text here. */
+
+ /* INFO_PRINT_COMMAND which says ">file" means write to that file.
+ Presumably, the name of the file is the local printer device. */
+ if (*print_command == '>')
+ printer_pipe = fopen (++print_command, "w");
+ else
+ {
+ printer_pipe = popen (print_command, "w");
+ piping = 1;
+ }
if (!printer_pipe)
{
- info_error (_("Cannot open pipe to \"%s\"."), print_command);
+ info_error (_("Cannot open pipe to `%s'."), print_command);
return;
}
#if defined (VERBOSE_NODE_DUMPING)
/* Maybe we should print some information about the node being output. */
- if (node->filename)
- info_error (_("Printing node \"(%s)%s\"..."),
- filename_non_directory (node->filename), node->nodename);
- else
- info_error (_("Printing node \"%s\"..."), node->nodename);
+ info_error (_("Printing node %s..."), node_printed_rep (node));
#endif /* VERBOSE_NODE_DUMPING */
write_node_to_stream (node, printer_pipe);
- pclose (printer_pipe);
+ if (piping)
+ pclose (printer_pipe);
+ else
+ fclose (printer_pipe);
#if defined (VERBOSE_NODE_DUMPING)
info_error (_("Done."));
@@ -2695,12 +3256,16 @@ write_node_to_stream (node, stream)
int gc_compressed_files = 0;
static void info_gc_file_buffers ();
+static void info_search_1 ();
static char *search_string = (char *)NULL;
static int search_string_index = 0;
static int search_string_size = 0;
static int isearch_is_active = 0;
+static int last_search_direction = 0;
+static int last_search_case_sensitive = 0;
+
/* Return the file buffer which belongs to WINDOW's node. */
FILE_BUFFER *
file_buffer_of_window (window)
@@ -2726,12 +3291,12 @@ file_buffer_of_window (window)
DIR says which direction to search in. If it is positive, search
forward, else backwards. */
long
-info_search_in_node (string, node, start, window, dir)
+info_search_in_node (string, node, start, window, dir, case_sensitive)
char *string;
NODE *node;
long start;
WINDOW *window;
- int dir;
+ int dir, case_sensitive;
{
SEARCH_BINDING binding;
long offset;
@@ -2739,7 +3304,9 @@ info_search_in_node (string, node, start, window, dir)
binding.buffer = node->contents;
binding.start = start;
binding.end = node->nodelen;
- binding.flags = S_FoldCase;
+ binding.flags = 0;
+ if (!case_sensitive)
+ binding.flags |= S_FoldCase;
if (dir < 0)
{
@@ -2788,7 +3355,7 @@ info_target_search_node (node, string, start)
while (i)
{
target[i] = '\0';
- offset = info_search_in_node (target, node, start, (WINDOW *)NULL, 1);
+ offset = info_search_in_node (target, node, start, (WINDOW *)NULL, 1, 0);
if (offset != -1)
break;
@@ -2805,12 +3372,11 @@ info_target_search_node (node, string, start)
associated with WINDOW's node, and search through each node in that file.
If the search fails, return non-zero, else zero. Side-effect window
leaving the node and point where the string was found current. */
-static char *last_searched_for_string = (char *)NULL;
static int
-info_search_internal (string, window, dir)
+info_search_internal (string, window, dir, case_sensitive)
char *string;
WINDOW *window;
- int dir;
+ int dir, case_sensitive;
{
register int i;
FILE_BUFFER *file_buffer;
@@ -2820,21 +3386,14 @@ info_search_internal (string, window, dir)
file_buffer = file_buffer_of_window (window);
initial_nodename = window->node->nodename;
- if ((info_last_executed_command == info_search) &&
- (last_searched_for_string) &&
- (strcmp (last_searched_for_string, string) == 0))
- {
- ret = info_search_in_node
- (string, window->node, window->point + dir, window, dir);
- }
- else
- {
- ret = info_search_in_node
- (string, window->node, window->point, window, dir);
- }
-
- maybe_free (last_searched_for_string);
- last_searched_for_string = xstrdup (string);
+ /* This used to begin from window->point, unless this was a repeated
+ search command. But invoking search with an argument loses with
+ that logic, since info_last_executed_command is then set to
+ info_add_digit_to_numeric_arg. I think there's no sense in
+ ``finding'' a string that is already under the cursor, anyway. */
+ ret = info_search_in_node
+ (string, window->node, window->point + dir, window, dir,
+ case_sensitive);
if (ret != -1)
{
@@ -2883,19 +3442,28 @@ info_search_internal (string, window, dir)
/* Allow C-g to quit the search, failing it if pressed. */
return_if_control_g (-1);
- current_tag += dir;
+ /* Find the next tag that isn't an anchor. */
+ for (i = current_tag + dir; i != current_tag; i += dir)
+ {
+ if (i < 0)
+ i = number_of_tags - 1;
+ else if (i == number_of_tags)
+ i = 0;
- if (current_tag < 0)
- current_tag = number_of_tags - 1;
- else if (current_tag == number_of_tags)
- current_tag = 0;
+ tag = file_buffer->tags[i];
+ if (tag->nodelen != 0)
+ break;
+ }
- tag = file_buffer->tags[current_tag];
+ /* If we got past out starting point, bail out. */
+ if (i == current_tag)
+ return (-1);
+ current_tag = i;
if (!echo_area_is_active && (last_subfile != tag->filename))
{
window_message_in_echo_area
- (_("Searching subfile \"%s\"..."),
+ (_("Searching subfile %s ..."),
filename_non_directory (tag->filename));
last_subfile = tag->filename;
@@ -2911,7 +3479,7 @@ info_search_internal (string, window, dir)
if (info_recent_file_error)
info_error (info_recent_file_error);
else
- info_error (CANT_FILE_NODE,
+ info_error (msg_cant_file_node,
filename_non_directory (file_buffer->filename),
tag->nodename);
}
@@ -2922,7 +3490,8 @@ info_search_internal (string, window, dir)
start = tag->nodelen;
ret =
- info_search_in_node (string, node, start, window, dir);
+ info_search_in_node (string, node, start, window, dir,
+ case_sensitive);
/* Did we find the string in this node? */
if (ret != -1)
@@ -2945,16 +3514,52 @@ info_search_internal (string, window, dir)
return (-1);
}
+DECLARE_INFO_COMMAND (info_search_case_sensitively,
+ _("Read a string and search for it case-sensitively"))
+{
+ last_search_direction = count > 0 ? 1 : -1;
+ last_search_case_sensitive = 1;
+ info_search_1 (window, count, key, 1, 1);
+}
+
DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
{
+ last_search_direction = count > 0 ? 1 : -1;
+ last_search_case_sensitive = 0;
+ info_search_1 (window, count, key, 0, 1);
+}
+
+DECLARE_INFO_COMMAND (info_search_backward,
+ _("Read a string and search backward for it"))
+{
+ last_search_direction = count > 0 ? -1 : 1;
+ last_search_case_sensitive = 0;
+ info_search_1 (window, -count, key, 0, 1);
+}
+
+static void
+info_search_1 (window, count, key, case_sensitive, ask_for_string)
+ WINDOW *window;
+ int count;
+ unsigned char key;
+ int case_sensitive;
+ int ask_for_string;
+{
char *line, *prompt;
int result, old_pagetop;
int direction;
if (count < 0)
- direction = -1;
+ {
+ direction = -1;
+ count = -count;
+ }
else
- direction = 1;
+ {
+ direction = 1;
+ if (count == 0)
+ count = 1; /* for backward compatibility */
+ }
/* Read a string from the user, defaulting the search to SEARCH_STRING. */
if (!search_string)
@@ -2963,34 +3568,50 @@ DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
search_string[0] = '\0';
}
- prompt = (char *)xmalloc (50 + strlen (search_string));
+ if (ask_for_string)
+ {
+ prompt = (char *)xmalloc (50 + strlen (search_string));
- sprintf (prompt, _("%s for string [%s]: "),
- direction < 0 ? _("Search backward") : _("Search"),
- search_string);
+ sprintf (prompt, _("%s%sfor string [%s]: "),
+ direction < 0 ? _("Search backward") : _("Search"),
+ case_sensitive ? _(" case-sensitively ") : _(" "),
+ search_string);
- line = info_read_in_echo_area (window, prompt);
- free (prompt);
+ line = info_read_in_echo_area (window, prompt);
+ free (prompt);
- if (!line)
- {
- info_abort_key ();
- return;
- }
+ if (!line)
+ {
+ info_abort_key ();
+ return;
+ }
- if (*line)
- {
- if (strlen (line) + 1 > search_string_size)
- search_string = (char *)
- xrealloc (search_string, (search_string_size += 50 + strlen (line)));
+ if (*line)
+ {
+ if (strlen (line) + 1 > search_string_size)
+ search_string = (char *) xrealloc
+ (search_string, (search_string_size += 50 + strlen (line)));
- strcpy (search_string, line);
- search_string_index = strlen (line);
- free (line);
+ strcpy (search_string, line);
+ search_string_index = strlen (line);
+ free (line);
+ }
}
+ /* If the search string includes upper-case letters, make the search
+ case-sensitive. */
+ if (case_sensitive == 0)
+ for (line = search_string; *line; line++)
+ if (isupper (*line))
+ {
+ case_sensitive = 1;
+ break;
+ }
+
old_pagetop = active_window->pagetop;
- result = info_search_internal (search_string, active_window, direction);
+ for (result = 0; result == 0 && count--; )
+ result = info_search_internal (search_string,
+ active_window, direction, case_sensitive);
if (result != 0 && !info_error_was_printed)
info_error (_("Search failed."));
@@ -3010,6 +3631,26 @@ DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
info_gc_file_buffers ();
}
+DECLARE_INFO_COMMAND (info_search_next,
+ _("Repeat last search in the same direction"))
+{
+ if (!last_search_direction)
+ info_error (_("No previous search string"));
+ else
+ info_search_1 (window, last_search_direction * count,
+ key, last_search_case_sensitive, 0);
+}
+
+DECLARE_INFO_COMMAND (info_search_previous,
+ _("Repeat last search in the reverse direction"))
+{
+ if (!last_search_direction)
+ info_error (_("No previous search string"));
+ else
+ info_search_1 (window, -last_search_direction * count,
+ key, last_search_case_sensitive, 0);
+}
+
/* **************************************************************** */
/* */
/* Incremental Searching */
@@ -3164,6 +3805,8 @@ incremental_search (window, count, ignore)
unsigned char key;
int last_search_result, search_result, dir;
SEARCH_STATE mystate, orig_state;
+ char *p;
+ int case_sensitive = 0;
if (count < 0)
dir = -1;
@@ -3230,7 +3873,7 @@ incremental_search (window, count, ignore)
if (quoted)
goto insert_and_search;
- if (!Meta_p (key) || (ISO_Latin_p && key < 160))
+ if (!Meta_p (key) || key > 32)
{
func = window->keymap[key].function;
@@ -3322,7 +3965,16 @@ incremental_search (window, count, ignore)
last_isearch_accepted = xstrdup (isearch_string);
}
- if (key != isearch_terminate_search_key)
+ /* If the key is the isearch_terminate_search_key, but some buffered
+ input is pending, it is almost invariably because the ESC key is
+ actually the beginning of an escape sequence, like in case they
+ pressed an arrow key. So don't gobble the ESC key, push it back
+ into pending input. */
+ /* FIXME: this seems like a kludge! We need a more reliable
+ mechanism to know when ESC is a separate key and when it is
+ part of an escape sequence. */
+ if (key != isearch_terminate_search_key ||
+ info_any_buffered_input_p ())
info_set_pending_input (key);
if (func == info_abort_key)
@@ -3345,17 +3997,29 @@ incremental_search (window, count, ignore)
search_now:
show_isearch_prompt (dir, isearch_string, search_result);
+ /* If the search string includes upper-case letters, make the
+ search case-sensitive. */
+ for (p = isearch_string; *p; p++)
+ if (isupper (*p))
+ {
+ case_sensitive = 1;
+ break;
+ }
+
+
if (search_result == 0)
{
/* Check to see if the current search string is right here. If
we are looking at it, then don't bother calling the search
function. */
if (((dir < 0) &&
- (strncasecmp (window->node->contents + window->point,
+ ((case_sensitive ? strncmp : strncasecmp)
+ (window->node->contents + window->point,
isearch_string, isearch_string_index) == 0)) ||
((dir > 0) &&
((window->point - isearch_string_index) >= 0) &&
- (strncasecmp (window->node->contents +
+ ((case_sensitive ? strncmp : strncasecmp)
+ (window->node->contents +
(window->point - (isearch_string_index - 1)),
isearch_string, isearch_string_index) == 0)))
{
@@ -3363,7 +4027,8 @@ incremental_search (window, count, ignore)
window->point++;
}
else
- search_result = info_search_internal (isearch_string, window, dir);
+ search_result = info_search_internal (isearch_string,
+ window, dir, case_sensitive);
}
/* If this search failed, and we didn't already have a failed search,
@@ -3439,8 +4104,8 @@ info_gc_file_buffers ()
{
for (i = 0; iw->nodes && iw->nodes[i]; i++)
{
- if ((strcmp (fb->fullpath, iw->nodes[i]->filename) == 0) ||
- (strcmp (fb->filename, iw->nodes[i]->filename) == 0))
+ if ((FILENAME_CMP (fb->fullpath, iw->nodes[i]->filename) == 0) ||
+ (FILENAME_CMP (fb->filename, iw->nodes[i]->filename) == 0))
{
fb_referenced_p = 1;
break;
@@ -3485,7 +4150,7 @@ info_move_to_xref (window, count, key, dir)
found is moved to. */
firstmenu = info_search_in_node
- (INFO_MENU_ENTRY_LABEL, node, start, (WINDOW *)NULL, dir);
+ (INFO_MENU_ENTRY_LABEL, node, start, (WINDOW *)NULL, dir, 0);
/* FIRSTMENU may point directly to the line defining the menu. Skip that
and go directly to the first item. */
@@ -3496,11 +4161,11 @@ info_move_to_xref (window, count, key, dir)
if (strncmp (text, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL)) == 0)
firstmenu = info_search_in_node
- (INFO_MENU_ENTRY_LABEL, node, firstmenu + dir, (WINDOW *)NULL, dir);
+ (INFO_MENU_ENTRY_LABEL, node, firstmenu + dir, (WINDOW *)NULL, dir, 0);
}
firstxref =
- info_search_in_node (INFO_XREF_LABEL, node, start, (WINDOW *)NULL, dir);
+ info_search_in_node (INFO_XREF_LABEL, node, start, (WINDOW *)NULL, dir, 0);
#if defined (HANDLE_MAN_PAGES)
if ((firstxref == -1) && (node->flags & N_IsManPage))
@@ -3511,7 +4176,7 @@ info_move_to_xref (window, count, key, dir)
if (firstmenu == -1 && firstxref == -1)
{
- info_error (_("No cross references in this node."));
+ info_error (msg_no_xref_node);
return;
}
@@ -3519,10 +4184,10 @@ info_move_to_xref (window, count, key, dir)
Try hard to find the next available one. */
nextmenu = info_search_in_node
- (INFO_MENU_ENTRY_LABEL, node, window->point + dir, (WINDOW *)NULL, dir);
+ (INFO_MENU_ENTRY_LABEL, node, window->point + dir, (WINDOW *)NULL, dir, 0);
nextxref = info_search_in_node
- (INFO_XREF_LABEL, node, window->point + dir, (WINDOW *)NULL, dir);
+ (INFO_XREF_LABEL, node, window->point + dir, (WINDOW *)NULL, dir, 0);
#if defined (HANDLE_MAN_PAGES)
if ((nextxref == -1) && (node->flags & N_IsManPage) && (firstxref != -1))
@@ -3536,7 +4201,7 @@ info_move_to_xref (window, count, key, dir)
if (strncmp (text, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL)) == 0)
nextmenu = info_search_in_node
- (INFO_MENU_ENTRY_LABEL, node, nextmenu + dir, (WINDOW *)NULL, dir);
+ (INFO_MENU_ENTRY_LABEL, node, nextmenu + dir, (WINDOW *)NULL, dir, 0);
}
/* If there is both a next menu entry, and a next xref entry, choose the
@@ -3635,7 +4300,7 @@ DECLARE_INFO_COMMAND (info_abort_key, _("Cancel current operation"))
/* Move the cursor to the desired line of the window. */
DECLARE_INFO_COMMAND (info_move_to_window_line,
- _("Move to the cursor to a specific line of the window"))
+ _("Move the cursor to a specific line of the window"))
{
int line;
@@ -3730,10 +4395,7 @@ dispatch_error (keyseq)
info_error (_("Unknown command (%s)."), rep);
else
{
- char *temp;
-
- temp = (char *)xmalloc (1 + strlen (rep) + strlen (_("\"\" is invalid")));
-
+ char *temp = xmalloc (1 + strlen (rep) + strlen (_("\"\" is invalid")));
sprintf (temp, _("\"%s\" is invalid"), rep);
terminal_ring_bell ();
inform_in_echo_area (temp);
@@ -4174,6 +4836,31 @@ info_gather_typeahead ()
if (chars_avail == -1)
chars_avail = 0;
}
+# else /* !O_NDELAY */
+# ifdef __DJGPP__
+ {
+ extern long pc_term_chars_avail (void);
+
+ if (isatty (tty))
+ chars_avail = pc_term_chars_avail ();
+ else
+ {
+ /* We could be more accurate by calling ltell, but we have no idea
+ whether tty is buffered by stdio functions, and if so, how many
+ characters are already waiting in the buffer. So we punt. */
+ struct stat st;
+
+ if (fstat (tty, &st) < 0)
+ chars_avail = 1;
+ else
+ chars_avail = st.st_size;
+ }
+ if (chars_avail > space_avail)
+ chars_avail = space_avail;
+ if (chars_avail)
+ chars_avail = read (tty, &input[0], chars_avail);
+ }
+# endif/* __DJGPP__ */
# endif /* O_NDELAY */
#endif /* !FIONREAD */
@@ -4231,6 +4918,7 @@ info_get_input_char ()
{
fclose (info_input_stream);
info_input_stream = stdin;
+ tty = fileno (info_input_stream);
display_inhibited = 0;
display_update_display (windows);
display_cursor_at_point (active_window);
@@ -4242,7 +4930,7 @@ info_get_input_char ()
{
terminal_unprep_terminal ();
close_dribble_file ();
- exit (0);
+ xexit (0);
}
}
}
diff --git a/gnu/usr.bin/texinfo/info/termdep.h b/gnu/usr.bin/texinfo/info/termdep.h
index 6ba89ab89bc..4ed9db7108b 100644
--- a/gnu/usr.bin/texinfo/info/termdep.h
+++ b/gnu/usr.bin/texinfo/info/termdep.h
@@ -1,10 +1,7 @@
/* termdep.h -- System things that terminal.c depends on.
- $Id: termdep.h,v 1.2 1999/01/11 16:38:09 espie Exp $
+ $Id: termdep.h,v 1.3 2000/02/09 02:18:40 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,6 +30,9 @@
#ifdef HAVE_TERMIOS_H
# include <termios.h>
+# ifdef GWINSZ_IN_SYS_IOCTL
+# include <sys/ioctl.h>
+# endif
#else
# if defined (HAVE_TERMIO_H)
# include <termio.h>
diff --git a/gnu/usr.bin/texinfo/info/terminal.c b/gnu/usr.bin/texinfo/info/terminal.c
index e1e3d2d4d0c..48db13be1aa 100644
--- a/gnu/usr.bin/texinfo/info/terminal.c
+++ b/gnu/usr.bin/texinfo/info/terminal.c
@@ -1,7 +1,7 @@
/* terminal.c -- How to handle the physical terminal for Info.
- $Id: terminal.c,v 1.4 1999/01/11 16:38:09 espie Exp $
+ $Id: terminal.c,v 1.5 2000/02/09 02:18:40 espie Exp $
- Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 97, 98
+ Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 97, 98, 99
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <signal.h>
+#include <sys/ioctl.h> /* TIOCGWINSZ on LynxOS, at least */
/* The Unix termcap interface code. */
#ifdef HAVE_NCURSES_TERMCAP_H
@@ -76,9 +77,10 @@ VFunction *terminal_scroll_terminal_hook = (VFunction *)NULL;
/* **************************************************************** */
/* A buffer which holds onto the current terminal description, and a pointer
- used to float within it. */
-static char *term_buffer = (char *)NULL;
-static char *term_string_buffer = (char *)NULL;
+ used to float within it. And the name of the terminal. */
+static char *term_buffer = NULL;
+static char *term_string_buffer = NULL;
+static char *term_name;
/* Some strings to control terminal actions. These are output by tputs (). */
static char *term_goto, *term_clreol, *term_cr, *term_clrpag;
@@ -146,12 +148,13 @@ terminal_begin_using_terminal ()
#endif
send_to_terminal (term_begin_use);
- /* Without this fflush and sleep, running info in a shelltool or
- cmdtool (TERM=sun-cmd) with scrollbars loses -- the scrollbars are
- not restored properly.
- From: strube@physik3.gwdg.de (Hans Werner Strube). */
fflush (stdout);
- sleep (1);
+ if (STREQ (term_name, "sun-cmd"))
+ /* Without this fflush and sleep, running info in a shelltool or
+ cmdtool (TERM=sun-cmd) with scrollbars loses -- the scrollbars are
+ not restored properly.
+ From: strube@physik3.gwdg.de (Hans Werner Strube). */
+ sleep (1);
#ifdef SIGWINCH
signal (SIGWINCH, sigsave);
@@ -177,7 +180,9 @@ terminal_end_using_terminal ()
send_to_terminal (term_end_use);
fflush (stdout);
- sleep (1);
+ if (STREQ (term_name, "sun-cmd"))
+ /* See comments at other sleep. */
+ sleep (1);
#ifdef SIGWINCH
signal (SIGWINCH, sigsave);
@@ -516,7 +521,7 @@ void
terminal_initialize_terminal (terminal_name)
char *terminal_name;
{
- char *term, *buffer;
+ char *buffer;
terminal_is_dumb_p = 0;
@@ -526,37 +531,46 @@ terminal_initialize_terminal (terminal_name)
return;
}
- term = terminal_name ? terminal_name : getenv ("TERM");
+ term_name = terminal_name ? terminal_name : getenv ("TERM");
+ if (!term_name)
+ term_name = "dumb";
if (!term_string_buffer)
- term_string_buffer = (char *)xmalloc (2048);
+ term_string_buffer = xmalloc (2048);
if (!term_buffer)
- term_buffer = (char *)xmalloc (2048);
+ term_buffer = xmalloc (2048);
buffer = term_string_buffer;
- term_clrpag = term_cr = term_clreol = (char *)NULL;
+ term_clrpag = term_cr = term_clreol = NULL;
- if (!term)
- term = "dumb";
-
- if (tgetent (term_buffer, term) <= 0)
+ /* HP-UX 11.x returns 0 for OK --jeff.hull@state.co.us. */
+ if (tgetent (term_buffer, term_name) < 0)
{
terminal_is_dumb_p = 1;
screenwidth = 80;
screenheight = 24;
term_cr = "\r";
- term_up = term_dn = audible_bell = visible_bell = (char *)NULL;
- term_ku = term_kd = term_kl = term_kr = (char *)NULL;
- term_kP = term_kN = (char *)NULL;
+ term_up = term_dn = audible_bell = visible_bell = NULL;
+ term_ku = term_kd = term_kl = term_kr = NULL;
+ term_kP = term_kN = NULL;
return;
}
BC = tgetstr ("pc", &buffer);
PC = BC ? *BC : 0;
-#if defined (TIOCGETP)
+#if defined (HAVE_TERMIOS_H)
+ {
+ struct termios ti;
+ if (tcgetattr (fileno(stdout), &ti) != -1)
+ ospeed = cfgetospeed (&ti);
+ else
+ ospeed = B9600;
+ }
+#else
+# if defined (TIOCGETP)
{
struct sgttyb sg;
@@ -565,16 +579,17 @@ terminal_initialize_terminal (terminal_name)
else
ospeed = B9600;
}
-#else
+# else
ospeed = B9600;
-#endif /* !TIOCGETP */
+# endif /* !TIOCGETP */
+#endif
term_cr = tgetstr ("cr", &buffer);
term_clreol = tgetstr ("ce", &buffer);
term_clrpag = tgetstr ("cl", &buffer);
term_goto = tgetstr ("cm", &buffer);
- /* Find out about this terminals scrolling capability. */
+ /* Find out about this terminal's scrolling capability. */
term_AL = tgetstr ("AL", &buffer);
term_DL = tgetstr ("DL", &buffer);
term_al = tgetstr ("al", &buffer);
@@ -633,23 +648,7 @@ terminal_initialize_terminal (terminal_name)
terminal_is_dumb_p = 1;
}
-/* **************************************************************** */
-/* */
-/* How to Read Characters From the Terminal */
-/* */
-/* **************************************************************** */
-
-#if defined (TIOCGETC)
-/* A buffer containing the terminal interrupt characters upon entry
- to Info. */
-struct tchars original_tchars;
-#endif
-
-#if defined (TIOCGLTC)
-/* A buffer containing the local terminal mode characters upon entry
- to Info. */
-struct ltchars original_ltchars;
-#endif
+/* How to read characters from the terminal. */
#if defined (HAVE_TERMIOS_H)
struct termios original_termios, ttybuff;
@@ -662,6 +661,25 @@ struct termio original_termio, ttybuff;
int original_tty_flags = 0;
int original_lmode;
struct sgttyb ttybuff;
+
+# if defined(TIOCGETC) && defined(M_XENIX)
+/* SCO 3.2v5.0.2 defines but does not support TIOCGETC. Gak. Maybe
+ better fix would be to use Posix termios in preference. --gildea,
+ 1jul99. */
+# undef TIOCGETC
+# endif
+
+# if defined (TIOCGETC)
+/* A buffer containing the terminal interrupt characters upon entry
+ to Info. */
+struct tchars original_tchars;
+# endif
+
+# if defined (TIOCGLTC)
+/* A buffer containing the local terminal mode characters upon entry
+ to Info. */
+struct ltchars original_ltchars;
+# endif
# endif /* !HAVE_TERMIO_H */
#endif /* !HAVE_TERMIOS_H */
@@ -835,3 +853,6 @@ terminal_unprep_terminal ()
terminal_end_using_terminal ();
}
+#ifdef __MSDOS__
+# include "pcterm.c"
+#endif
diff --git a/gnu/usr.bin/texinfo/info/tilde.c b/gnu/usr.bin/texinfo/info/tilde.c
index 38cdf395396..59d4fe6b6b7 100644
--- a/gnu/usr.bin/texinfo/info/tilde.c
+++ b/gnu/usr.bin/texinfo/info/tilde.c
@@ -1,10 +1,7 @@
-/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo).
- $Id: tilde.c,v 1.2 1999/01/11 16:38:10 espie Exp $
+/* tilde.c -- tilde expansion code (~/foo := $HOME/foo).
+ $Id: tilde.c,v 1.3 2000/02/09 02:18:40 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 98
+ Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 98, 99
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -23,27 +20,9 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-/* Indent #pragma so that older Cpp's don't try to parse it. */
-#ifdef _AIX
- #pragma alloca
-#endif /* _AIX */
-
/* Include config.h before doing alloca. */
#include "info.h"
-#ifdef __GNUC__
-# undef alloca
-# define alloca __builtin_alloca
-#else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifndef _AIX
-char *alloca ();
-# endif
-# endif
-#endif
-
#if defined (TEST) || defined (STATIC_MALLOC)
static void *xmalloc (), *xrealloc ();
#endif /* TEST || STATIC_MALLOC */
@@ -123,7 +102,7 @@ tilde_find_suffix (string)
for (i = 0; i < string_len; i++)
{
- if (string[i] == '/' || !string[i])
+ if (IS_SLASH (string[i]) || !string[i])
break;
for (j = 0; suffixes && suffixes[j]; j++)
@@ -203,14 +182,12 @@ char *
tilde_expand_word (filename)
char *filename;
{
- char *dirname;
-
- dirname = filename ? xstrdup (filename) : (char *)NULL;
+ char *dirname = filename ? xstrdup (filename) : NULL;
if (dirname && *dirname == '~')
{
char *temp_name;
- if (!dirname[1] || dirname[1] == '/')
+ if (!dirname[1] || IS_SLASH (dirname[1]))
{
/* Prepend $HOME to the rest of the string. */
char *temp_home = getenv ("HOME");
@@ -226,30 +203,31 @@ tilde_expand_word (filename)
temp_home = entry->pw_dir;
}
- temp_name = (char *)
- alloca (1 + strlen (&dirname[1])
- + (temp_home ? strlen (temp_home) : 0));
- temp_name[0] = '\0';
+ temp_name = xmalloc (1 + strlen (&dirname[1])
+ + (temp_home ? strlen (temp_home) : 0));
if (temp_home)
strcpy (temp_name, temp_home);
+ else
+ temp_name[0] = 0;
strcat (temp_name, &dirname[1]);
free (dirname);
dirname = xstrdup (temp_name);
+ free (temp_name);
}
else
{
struct passwd *user_entry;
- char *username = (char *)alloca (257);
+ char *username = xmalloc (257);
int i, c;
for (i = 1; (c = dirname[i]); i++)
{
- if (c == '/')
+ if (IS_SLASH (c))
break;
else
username[i - 1] = c;
}
- username[i - 1] = '\0';
+ username[i - 1] = 0;
if (!(user_entry = (struct passwd *) getpwnam (username)))
{
@@ -264,8 +242,8 @@ tilde_expand_word (filename)
if (expansion)
{
- temp_name = (char *)alloca
- (1 + strlen (expansion) + strlen (&dirname[i]));
+ temp_name = xmalloc (1 + strlen (expansion)
+ + strlen (&dirname[i]));
strcpy (temp_name, expansion);
strcat (temp_name, &dirname[i]);
free (expansion);
@@ -276,18 +254,22 @@ tilde_expand_word (filename)
}
else
{
- temp_name = (char *)alloca
- (1 + strlen (user_entry->pw_dir) + strlen (&dirname[i]));
+ temp_name = xmalloc (1 + strlen (user_entry->pw_dir)
+ + strlen (&dirname[i]));
strcpy (temp_name, user_entry->pw_dir);
strcat (temp_name, &dirname[i]);
+
return_name:
free (dirname);
dirname = xstrdup (temp_name);
+ free (temp_name);
}
- endpwent ();
+
+ endpwent ();
+ free (username);
}
}
- return (dirname);
+ return dirname;
}
@@ -322,7 +304,7 @@ main (argc, argv)
printf (" --> %s\n", result);
free (result);
}
- exit (0);
+ xexit (0);
}
static void memory_error_and_abort ();
diff --git a/gnu/usr.bin/texinfo/info/variables.c b/gnu/usr.bin/texinfo/info/variables.c
index d1e29499714..e56dae2b60d 100644
--- a/gnu/usr.bin/texinfo/info/variables.c
+++ b/gnu/usr.bin/texinfo/info/variables.c
@@ -1,5 +1,5 @@
/* variables.c -- How to manipulate user visible variables in Info.
- $Id: variables.c,v 1.2 1999/01/11 16:38:10 espie Exp $
+ $Id: variables.c,v 1.3 2000/02/09 02:18:40 espie Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
diff --git a/gnu/usr.bin/texinfo/info/window.c b/gnu/usr.bin/texinfo/info/window.c
index 944a8ce10be..4bc8eb229ab 100644
--- a/gnu/usr.bin/texinfo/info/window.c
+++ b/gnu/usr.bin/texinfo/info/window.c
@@ -1,10 +1,7 @@
-/* window.c -- Windows in Info.
- $Id: window.c,v 1.2 1999/01/11 16:38:10 espie Exp $
+/* window.c -- windows in Info.
+ $Id: window.c,v 1.3 2000/02/09 02:18:40 espie Exp $
- This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,16 +27,16 @@
#include "infomap.h"
/* The window which describes the screen. */
-WINDOW *the_screen = (WINDOW *)NULL;
+WINDOW *the_screen = NULL;
/* The window which describes the echo area. */
-WINDOW *the_echo_area = (WINDOW *)NULL;
+WINDOW *the_echo_area = NULL;
/* The list of windows in Info. */
-WINDOW *windows = (WINDOW *)NULL;
+WINDOW *windows = NULL;
/* Pointer to the active window in WINDOW_LIST. */
-WINDOW *active_window = (WINDOW *)NULL;
+WINDOW *active_window = NULL;
/* The size of the echo area in Info. It never changes, irregardless of the
size of the screen. */
@@ -56,9 +53,9 @@ void
window_initialize_windows (width, height)
int width, height;
{
- the_screen = (WINDOW *)xmalloc (sizeof (WINDOW));
- the_echo_area = (WINDOW *)xmalloc (sizeof (WINDOW));
- windows = (WINDOW *)xmalloc (sizeof (WINDOW));
+ the_screen = xmalloc (sizeof (WINDOW));
+ the_echo_area = xmalloc (sizeof (WINDOW));
+ windows = xmalloc (sizeof (WINDOW));
active_window = windows;
zero_mem (the_screen, sizeof (WINDOW));
@@ -85,7 +82,7 @@ window_initialize_windows (width, height)
area. */
the_echo_area->height = ECHO_AREA_HEIGHT;
active_window->height = the_screen->height - 1 - the_echo_area->height;
- window_new_screen_size (width, height, (VFunction *)NULL);
+ window_new_screen_size (width, height, NULL);
/* The echo area uses a different keymap than normal info windows. */
the_echo_area->keymap = echo_area_keymap;
@@ -102,7 +99,7 @@ window_initialize_windows (width, height)
/* If non-null, a function to call with WINDOW as argument when the function
window_new_screen_size () has deleted WINDOW. */
-VFunction *window_deletion_notifier = (VFunction *)NULL;
+VFunction *window_deletion_notifier = NULL;
void
window_new_screen_size (width, height)
@@ -139,7 +136,7 @@ window_new_screen_size (width, height)
{
windows->height = 0;
maybe_free (windows->line_starts);
- windows->line_starts = (char **)NULL;
+ windows->line_starts = NULL;
windows->line_count = 0;
break;
}
@@ -187,7 +184,7 @@ window_new_screen_size (width, height)
{
win->width = width;
maybe_free (win->modeline);
- win->modeline = (char *)xmalloc (1 + width);
+ win->modeline = xmalloc (1 + width);
}
win->height += delta_each;
@@ -274,14 +271,14 @@ window_make_window (node)
/* If there isn't enough room to make another window, return now. */
if ((active_window->height / 2) < WINDOW_MIN_SIZE)
- return ((WINDOW *)NULL);
+ return (NULL);
/* Make and initialize the new window.
The fudging about with -1 and +1 is because the following window in the
chain cannot start at window->height, since that is where the modeline
for the previous window is displayed. The inverse adjustment is made
in window_delete_window (). */
- window = (WINDOW *)xmalloc (sizeof (WINDOW));
+ window = xmalloc (sizeof (WINDOW));
window->width = the_screen->width;
window->height = (active_window->height / 2) - 1;
#if defined (SPLIT_BEFORE_ACTIVE)
@@ -292,8 +289,8 @@ window_make_window (node)
#endif
window->keymap = info_keymap;
window->goal_column = -1;
- window->modeline = (char *)xmalloc (1 + window->width);
- window->line_starts = (char **)NULL;
+ window->modeline = xmalloc (1 + window->width);
+ window->line_starts = NULL;
window->flags = W_UpdateWindow | W_WindowVisible;
window_set_node_of_window (window, node);
@@ -538,7 +535,7 @@ window_tile_windows (style)
per_win_height = avail / numwins;
leftover = avail - (per_win_height * numwins);
- last_adjusted = (WINDOW *)NULL;
+ last_adjusted = NULL;
for (win = windows; win; win = win->next)
{
if (do_internals || !win->node ||
@@ -610,10 +607,12 @@ window_set_node_of_window (window, node)
window->point = 0;
recalculate_line_starts (window);
window->flags |= W_UpdateWindow;
+ /* The display_pos member is nonzero if we're displaying an anchor. */
+ window->point = node ? node->display_pos : 0;
window_adjust_pagetop (window);
window_make_modeline (window);
}
-
+
/* Delete WINDOW from the list of known windows. If this window was the
active window, make the next window in the chain be the active window.
If the active window is the next or previous window, choose that window
@@ -766,7 +765,7 @@ string_width (string, hpos)
return (width);
}
-/* Quickly guess the approximate number of lines to that NODE would
+/* Quickly guess the approximate number of lines that NODE would
take to display. This really only counts carriage returns. */
int
window_physical_lines (node)
@@ -793,12 +792,12 @@ calculate_line_starts (window)
WINDOW *window;
{
register int i, hpos;
- char **line_starts = (char **)NULL;
+ char **line_starts = NULL;
int line_starts_index = 0, line_starts_slots = 0;
int bump_index;
NODE *node;
- window->line_starts = (char **)NULL;
+ window->line_starts = NULL;
window->line_count = 0;
node = window->node;
@@ -1079,9 +1078,9 @@ window_make_modeline (window)
/* Calculate the maximum size of the information to stick in MODELINE. */
{
int modeline_len = 0;
- char *parent = (char *)NULL, *filename = "*no file*";
+ char *parent = NULL, *filename = "*no file*";
char *nodename = "*no node*";
- char *update_message = (char *)NULL;
+ char *update_message = NULL;
NODE *node = window->node;
if (node)
@@ -1113,7 +1112,7 @@ window_make_modeline (window)
modeline_len += 10 + strlen (_("-----Info: (), lines ----, "));
modeline_len += window->width;
- modeline = (char *)xmalloc (1 + modeline_len);
+ modeline = xmalloc (1 + modeline_len);
/* Special internal windows have no filename. */
if (!parent && !*filename)
@@ -1194,14 +1193,10 @@ window_set_state (window, state)
}
-/* **************************************************************** */
-/* */
-/* Manipulating Home-Made Nodes */
-/* */
-/* **************************************************************** */
+/* Manipulating home-made nodes. */
/* A place to buffer echo area messages. */
-static NODE *echo_area_node = (NODE *)NULL;
+static NODE *echo_area_node = NULL;
/* Make the node of the_echo_area be an empty one. */
static void
@@ -1213,7 +1208,7 @@ free_echo_area ()
free (echo_area_node);
}
- echo_area_node = (NODE *)NULL;
+ echo_area_node = NULL;
window_set_node_of_window (the_echo_area, echo_area_node);
}
@@ -1245,7 +1240,7 @@ window_message_in_echo_area (format, arg1, arg2)
and ARG2. The message appears immediately, but does not destroy
any existing message. A future call to unmessage_in_echo_area ()
restores the old contents. */
-static NODE **old_echo_area_nodes = (NODE **)NULL;
+static NODE **old_echo_area_nodes = NULL;
static int old_echo_area_nodes_index = 0;
static int old_echo_area_nodes_slots = 0;
@@ -1260,7 +1255,7 @@ message_in_echo_area (format, arg1, arg2)
old_echo_area_nodes, old_echo_area_nodes_slots,
4, NODE *);
}
- echo_area_node = (NODE *)NULL;
+ echo_area_node = NULL;
window_message_in_echo_area (format, arg1, arg2);
}
@@ -1277,7 +1272,7 @@ unmessage_in_echo_area ()
}
/* A place to build a message. */
-static char *message_buffer = (char *)NULL;
+static char *message_buffer = NULL;
static int message_buffer_index = 0;
static int message_buffer_size = 0;
@@ -1290,7 +1285,7 @@ message_buffer_resize (length)
if (!message_buffer)
{
message_buffer_size = length + 1;
- message_buffer = (char *)xmalloc (message_buffer_size);
+ message_buffer = xmalloc (message_buffer_size);
message_buffer_index = 0;
}
@@ -1328,14 +1323,44 @@ build_message_buffer (format, arg1, arg2)
else
{
char c;
+ char *fmt_start = format + i;
+ char *fmt;
+ int fmt_len, formatted_len;
+
+ i++;
+ while (format[i] && strchr ("-. +0123456789", format[i]))
+ i++;
+ c = format[i];
+
+ if (c == '\0')
+ abort ();
+
+ fmt_len = format + i - fmt_start + 1;
+ fmt = (char *) xmalloc (fmt_len + 1);
+ strncpy (fmt, fmt_start, fmt_len);
+ fmt[fmt_len] = '\0';
- c = format[++i];
+ /* If we have "%-98s", maybe 98 calls for a longer string. */
+ if (fmt_len > 2)
+ {
+ int j;
+
+ for (j = 0; j < fmt_len; j++)
+ if (isdigit (fmt[j]))
+ break;
+
+ formatted_len = atoi (fmt + j);
+ }
+ else
+ formatted_len = c == 's' ? 0 : 1; /* %s can produce empty string */
switch (c)
{
case '%': /* Insert a percent sign. */
- message_buffer_resize (len + 1);
- message_buffer[message_buffer_index++] = '%';
+ message_buffer_resize (len + formatted_len);
+ sprintf
+ (message_buffer + message_buffer_index, fmt, "%");
+ message_buffer_index += formatted_len;
break;
case 's': /* Insert the current arg as a string. */
@@ -1346,9 +1371,11 @@ build_message_buffer (format, arg1, arg2)
string = (char *)args[arg_index++];
string_len = strlen (string);
+ if (formatted_len > string_len)
+ string_len = formatted_len;
message_buffer_resize (len + string_len);
sprintf
- (message_buffer + message_buffer_index, "%s", string);
+ (message_buffer + message_buffer_index, fmt, string);
message_buffer_index += string_len;
}
break;
@@ -1361,9 +1388,10 @@ build_message_buffer (format, arg1, arg2)
long_val = (long)args[arg_index++];
integer = (int)long_val;
- message_buffer_resize (len + 32);
+ message_buffer_resize (len + formatted_len > 32
+ ? formatted_len : 32);
sprintf
- (message_buffer + message_buffer_index, "%d", integer);
+ (message_buffer + message_buffer_index, fmt, integer);
message_buffer_index = strlen (message_buffer);
}
break;
@@ -1376,14 +1404,17 @@ build_message_buffer (format, arg1, arg2)
long_val = (long)args[arg_index++];
character = (int)long_val;
- message_buffer_resize (len + 1);
- message_buffer[message_buffer_index++] = character;
+ message_buffer_resize (len + formatted_len);
+ sprintf
+ (message_buffer + message_buffer_index, fmt, character);
+ message_buffer_index += formatted_len;
}
break;
default:
abort ();
}
+ free (fmt);
}
}
message_buffer[message_buffer_index] = '\0';
@@ -1411,15 +1442,16 @@ message_buffer_to_node ()
{
NODE *node;
- node = (NODE *)xmalloc (sizeof (NODE));
- node->filename = (char *)NULL;
- node->parent = (char *)NULL;
- node->nodename = (char *)NULL;
+ node = xmalloc (sizeof (NODE));
+ node->filename = NULL;
+ node->parent = NULL;
+ node->nodename = NULL;
node->flags = 0;
+ node->display_pos =0;
/* Make sure that this buffer ends with a newline. */
node->nodelen = 1 + strlen (message_buffer);
- node->contents = (char *)xmalloc (1 + node->nodelen);
+ node->contents = xmalloc (1 + node->nodelen);
strcpy (node->contents, message_buffer);
node->contents[node->nodelen - 1] = '\n';
node->contents[node->nodelen] = '\0';
diff --git a/gnu/usr.bin/texinfo/lib/Makefile.am b/gnu/usr.bin/texinfo/lib/Makefile.am
index 9e9f8776cbe..3aef660bf40 100644
--- a/gnu/usr.bin/texinfo/lib/Makefile.am
+++ b/gnu/usr.bin/texinfo/lib/Makefile.am
@@ -1,12 +1,13 @@
## Makefile.am for texinfo/lib.
-## $Id: Makefile.am,v 1.2 1999/01/11 16:38:11 espie Exp $
+## $Id: Makefile.am,v 1.3 2000/02/09 02:18:41 espie Exp $
## Run automake in .. to produce Makefile.in from this.
noinst_LIBRARIES = libtxi.a
INCLUDES = -I../intl
# Don't need to list alloca.c, etc., Automake includes them.
-libtxi_a_SOURCES = getopt.c getopt.h getopt1.c system.h xmalloc.c xstrdup.c
+libtxi_a_SOURCES = getopt.c getopt.h getopt1.c substring.c system.h \
+ xexit.c xmalloc.c xstrdup.c
libtxi_a_LIBADD = @LIBOBJS@ @ALLOCA@
libtxi_a_DEPENDENCIES = $(libtxi_a_LIBADD)
diff --git a/gnu/usr.bin/texinfo/lib/system.h b/gnu/usr.bin/texinfo/lib/system.h
index fd2e858a381..6cc359b655a 100644
--- a/gnu/usr.bin/texinfo/lib/system.h
+++ b/gnu/usr.bin/texinfo/lib/system.h
@@ -1,7 +1,7 @@
-/* system.h: System-dependent declarations. Include this first.
- $Id: system.h,v 1.2 1999/01/11 16:38:11 espie Exp $
+/* system.h: system-dependent declarations; include this first.
+ $Id: system.h,v 1.3 2000/02/09 02:18:41 espie Exp $
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,7 +37,22 @@
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
+#ifndef HAVE_SETLOCALE
+#define setlocale(category,locale) /* empty */
+#endif
+
+/* For gettext (NLS). */
#include <libintl.h>
+#define _(String) gettext (String)
+#define N_(String) (String)
+
+#ifdef STDC_HEADERS
+#define getopt system_getopt
+#include <stdlib.h>
+#undef getopt
+#else
+extern char *getenv ();
+#endif
/* Don't use bcopy! Use memmove if source and destination may overlap,
memcpy otherwise. */
@@ -51,18 +66,6 @@
char *memchr ();
#endif
-#ifdef STDC_HEADERS
-#define getopt system_getopt
-#include <stdlib.h>
-#undef getopt
-#else
-extern char *getenv ();
-#endif
-
-#ifndef HAVE_STRERROR
-extern char *strerror ();
-#endif
-
#include <errno.h>
#ifndef errno
extern int errno;
@@ -71,7 +74,29 @@ extern int errno;
#include <perror.h>
#endif
+#ifndef HAVE_DECL_STRERROR
+extern char *strerror ();
+#endif
+
+#ifndef HAVE_DECL_STRCASECMP
+extern int strcasecmp ();
+#endif
+
+#ifndef HAVE_DECL_STRNCASECMP
+extern int strncasecmp ();
+#endif
+
+#ifndef HAVE_DECL_STRCOLL
+extern int strcoll ();
+#endif
+
#include <sys/stat.h>
+#if STAT_MACROS_BROKEN
+# undef S_ISDIR
+#endif
+#if !defined(S_ISDIR) && defined(S_IFDIR)
+# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
+#endif
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
@@ -89,6 +114,77 @@ extern int errno;
#endif /* not HAVE_FCNTL_H */
#endif /* not O_RDONLY */
+/* MS-DOS and similar non-Posix systems have some peculiarities:
+ - they distinguish between binary and text files;
+ - they use both `/' and `\\' as directory separator in file names;
+ - they can have a drive letter X: prepended to a file name;
+ - they have a separate root directory on each drive;
+ - their filesystems are case-insensitive;
+ - directories in environment variables (like INFOPATH) are separated
+ by `;' rather than `:';
+ - text files can have their lines ended either with \n or with \r\n pairs;
+
+ These are all parameterized here except the last, which is
+ handled by the source code as appropriate (mostly, in info/). */
+#ifndef O_BINARY
+# ifdef _O_BINARY
+# define O_BINARY _O_BINARY
+# else
+# define O_BINARY 0
+# endif
+#endif /* O_BINARY */
+
+#if O_BINARY
+# include <io.h>
+# ifdef __MSDOS__
+# include <limits.h>
+# ifdef __DJGPP__
+# define HAVE_LONG_FILENAMES(dir) (pathconf (dir, _PC_NAME_MAX) > 12)
+# define NULL_DEVICE "/dev/null"
+# else /* !__DJGPP__ */
+# define HAVE_LONG_FILENAMES(dir) (0)
+# define NULL_DEVICE "NUL"
+# endif /* !__DJGPP__ */
+# define SET_SCREEN_SIZE_HELPER terminal_prep_terminal()
+# define DEFAULT_INFO_PRINT_COMMAND ">PRN"
+# else /* !__MSDOS__ */
+# define setmode(f,m) _setmode(f,m)
+# define HAVE_LONG_FILENAMES(dir) (1)
+# define NULL_DEVICE "NUL"
+# endif /* !__MSDOS__ */
+# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0)
+# define FOPEN_RBIN "rb"
+# define FOPEN_WBIN "wb"
+# define IS_SLASH(c) ((c) == '/' || (c) == '\\')
+# define HAVE_DRIVE(n) ((n)[0] && (n)[1] == ':')
+# define IS_ABSOLUTE(n) (IS_SLASH((n)[0]) || ((n)[0] && (n)[1] == ':'))
+# define FILENAME_CMP strcasecmp
+# define FILENAME_CMPN strncasecmp
+# define PATH_SEP ";"
+# define STRIP_DOT_EXE 1
+# define DEFAULT_TMPDIR "c:/"
+# define PIPE_USE_FORK 0
+#else /* not O_BINARY */
+# define SET_BINARY(f) (void)0
+# define FOPEN_RBIN "r"
+# define FOPEN_WBIN "w"
+# define IS_SLASH(c) ((c) == '/')
+# define HAVE_DRIVE(n) (0)
+# define IS_ABSOLUTE(n) ((n)[0] == '/')
+# define FILENAME_CMP strcmp
+# define FILENAME_CMPN strncmp
+# define HAVE_LONG_FILENAMES(dir) (1)
+# define PATH_SEP ":"
+# define STRIP_DOT_EXE 0
+# ifdef VMS
+# define DEFAULT_TMPDIR "sys$scratch:"
+# else
+# define DEFAULT_TMPDIR "/tmp/"
+# endif
+# define NULL_DEVICE "/dev/null"
+# define PIPE_USE_FORK 1
+#endif /* not O_BINARY */
+
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
@@ -98,5 +194,10 @@ struct passwd *getpwnam ();
/* Our library routines not included in any system library. */
extern void *xmalloc (), *xrealloc ();
extern char *xstrdup ();
+extern void xexit ();
+extern char *substring ();
+
+/* For convenience. */
+#define STREQ(s1,s2) (strcmp (s1, s2) == 0)
#endif /* TEXINFO_SYSTEM_H */
diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile.am b/gnu/usr.bin/texinfo/makeinfo/Makefile.am
index 4668600367f..676e7b3022f 100644
--- a/gnu/usr.bin/texinfo/makeinfo/Makefile.am
+++ b/gnu/usr.bin/texinfo/makeinfo/Makefile.am
@@ -1,5 +1,5 @@
## Makefile.am for texinfo/makeinfo.
-## $Id: Makefile.am,v 1.2 1999/01/11 16:38:11 espie Exp $
+## $Id: Makefile.am,v 1.3 2000/02/09 02:18:41 espie Exp $
## Run automake in .. to produce Makefile.in from this.
bin_PROGRAMS = makeinfo
@@ -8,6 +8,12 @@ localedir = $(datadir)/locale
INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
LDADD = ../lib/libtxi.a @INTLLIBS@
-makeinfo_SOURCES = makeinfo.c makeinfo.h multi.c
+makeinfo_SOURCES = \
+ cmds.c cmds.h defun.c defun.h files.c files.h footnote.c footnote.h \
+ html.c html.h index.c index.h insertion.c insertion.h lang.c lang.h \
+ macro.c macro.h makeinfo.c makeinfo.h multi.c node.c node.h \
+ sectioning.c sectioning.h toc.c toc.h
EXTRA_DIST = README
+
+SUBDIRS = tests
diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile.in b/gnu/usr.bin/texinfo/makeinfo/Makefile.in
index dd691215b41..101997fb1e7 100644
--- a/gnu/usr.bin/texinfo/makeinfo/Makefile.in
+++ b/gnu/usr.bin/texinfo/makeinfo/Makefile.in
@@ -1,111 +1,412 @@
-# Makefile for GNU makeinfo. -*- Indented-Text -*-
-# Copyright (C) 1993 Free Software Foundation, Inc.
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#### Start of system configuration section. ####
+SHELL = @SHELL@
srcdir = @srcdir@
-VPATH = $(srcdir):$(common)
-
-common = $(srcdir)/../libtxi
-
-CC = @CC@
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-LN = ln
-RM = rm -f
-TAR = tar
-MKDIR = mkdir
-COMPRESS= compress
-
-DEFS = @DEFS@
-LIBS = -L../libtxi -ltxi @LIBS@
-LOADLIBES = $(LIBS)
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
-bindir = $(exec_prefix)/bin
-# Prefix for each installed program, normally empty or `g'.
-binprefix =
-libdir = $(prefix)/lib
-# Prefix for each installed man page, normally empty or `g'.
-manprefix =
-mandir = $(prefix)/man/man1
-manext = 1
-infodir = $(prefix)/info
-#### End of system configuration section. ####
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
-SRCS = makeinfo.c
-OBJS = makeinfo.o
+DESTDIR =
-PROGS = makeinfo
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
-all: $(PROGS) makeinfo.info
-sub-all: all
+top_builddir = ..
-.c.o:
- $(CC) -c $(CPPFLAGS) -I. -I$(srcdir) -I$(common) $(DEFS) $(CFLAGS) $<
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
-makeinfo: $(OBJS) ../libtxi/libtxi.a
- $(CC) $(LDFLAGS) -o makeinfo $(OBJS) $(LOADLIBES)
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+DATADIRNAME = @DATADIRNAME@
+GENCAT = @GENCAT@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GT_NO = @GT_NO@
+GT_YES = @GT_YES@
+INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+INSTOBJEXT = @INSTOBJEXT@
+INTLDEPS = @INTLDEPS@
+INTLLIBS = @INTLLIBS@
+INTLOBJS = @INTLOBJS@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+PACKAGE = @PACKAGE@
+POFILES = @POFILES@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+TERMLIBS = @TERMLIBS@
+USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+l = @l@
+
+bin_PROGRAMS = makeinfo
+
+localedir = $(datadir)/locale
+INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
+LDADD = ../lib/libtxi.a @INTLLIBS@
+
+makeinfo_SOURCES = cmds.c cmds.h defun.c defun.h files.c files.h footnote.c footnote.h html.c html.h index.c index.h insertion.c insertion.h lang.c lang.h macro.c macro.h makeinfo.c makeinfo.h multi.c node.c node.h sectioning.c sectioning.h toc.c toc.h
+
+
+EXTRA_DIST = README
+
+SUBDIRS = tests
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(bin_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+makeinfo_OBJECTS = cmds.o defun.o files.o footnote.o html.o index.o \
+insertion.o lang.o macro.o makeinfo.o multi.o node.o sectioning.o toc.o
+makeinfo_LDADD = $(LDADD)
+makeinfo_DEPENDENCIES = ../lib/libtxi.a
+makeinfo_LDFLAGS =
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README Makefile.am Makefile.in
-../libtxi/libtxi.a:
- (cd ../libtxi; $(MAKE) $(MFLAGS) libtxi.a)
-makeinfo.o: makeinfo.c $(common)/getopt.h
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-makeinfo.info: ./makeinfo makeinfo.texi macro.texi
- ./makeinfo --no-split -I$(srcdir) makeinfo.texi
+TAR = gtar
+GZIP_ENV = --best
+SOURCES = $(makeinfo_SOURCES)
+OBJECTS = $(makeinfo_OBJECTS)
-# makeinfo.texi: ./makeinfo makeinfo.mki
-# ./makeinfo -E makeinfo.texi -I$(srcdir) makeinfo.mki
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps makeinfo/Makefile
-install: all
- for f in $(PROGS); do $(INSTALL_PROGRAM) $$f $(bindir)/$(binprefix)$$f; done
- -d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-uninstall:
- for f in $(PROGS); do rm -f $(bindir)/$(binprefix)$$f; done
- rm -f $(infodir)/makeinfo.info
-TAGS: $(SRCS)
- etags $(SRCS)
+mostlyclean-binPROGRAMS:
-clean:
- rm -f *.o a.out core core.* $(PROGS)
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-mostlyclean: clean
+distclean-binPROGRAMS:
-distclean: clean
- rm -f TAGS Makefile config.status *.info */*.info
+maintainer-clean-binPROGRAMS:
-realclean: distclean
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ else :; fi; \
+ done
-Makefile: Makefile.in ../config.status
- cd ..; sh config.status
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ list='$(bin_PROGRAMS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
-# Prevent GNU make v3 from overflowing arg limit on SysV.
+.c.o:
+ $(COMPILE) -c $<
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+makeinfo: $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES)
+ @rm -f makeinfo
+ $(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ if test "$$subdir" = "."; then dot_seen=yes; fi; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = makeinfo
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+cmds.o: cmds.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h \
+ defun.h insertion.h files.h footnote.h lang.h macro.h \
+ makeinfo.h node.h sectioning.h toc.h
+defun.o: defun.c ../lib/system.h ../config.h ../lib/getopt.h defun.h \
+ insertion.h makeinfo.h
+files.o: files.c ../lib/system.h ../config.h ../lib/getopt.h files.h \
+ macro.h makeinfo.h
+footnote.o: footnote.c ../lib/system.h ../config.h ../lib/getopt.h \
+ footnote.h macro.h makeinfo.h
+html.o: html.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h html.h \
+ lang.h makeinfo.h sectioning.h
+index.o: index.c ../lib/system.h ../config.h ../lib/getopt.h index.h \
+ makeinfo.h cmds.h lang.h macro.h toc.h
+insertion.o: insertion.c ../lib/system.h ../config.h ../lib/getopt.h \
+ cmds.h defun.h insertion.h macro.h makeinfo.h
+lang.o: lang.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h lang.h \
+ makeinfo.h
+macro.o: macro.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h \
+ macro.h makeinfo.h insertion.h
+makeinfo.o: makeinfo.c ../lib/system.h ../config.h ../lib/getopt.h \
+ makeinfo.h cmds.h files.h footnote.h html.h index.h insertion.h \
+ macro.h node.h toc.h
+multi.o: multi.c ../lib/system.h ../config.h ../lib/getopt.h insertion.h \
+ makeinfo.h
+node.o: node.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h \
+ files.h footnote.h macro.h makeinfo.h node.h sectioning.h \
+ insertion.h
+sectioning.o: sectioning.c ../lib/system.h ../config.h ../lib/getopt.h \
+ cmds.h macro.h makeinfo.h node.h toc.h sectioning.h
+toc.o: toc.c ../lib/system.h ../config.h ../lib/getopt.h makeinfo.h \
+ cmds.h files.h macro.h node.h lang.h sectioning.h toc.h
+
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-exec-am: install-binPROGRAMS
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am: uninstall-binPROGRAMS
+uninstall: uninstall-recursive
+all-am: Makefile $(PROGRAMS)
+all-redirect: all-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
+ mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \
+ mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
+ distclean-generic clean-am
+
+distclean: distclean-recursive
+
+maintainer-clean-am: maintainer-clean-binPROGRAMS \
+ maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+
+.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
-
-# eof
diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c
index ae44121aa82..44ad466c51c 100644
--- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c
+++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c
@@ -1,7 +1,7 @@
-/* Makeinfo -- convert Texinfo source files into Info files.
- $Id: makeinfo.c,v 1.5 1999/01/11 16:38:11 espie Exp $
+/* makeinfo -- convert Texinfo source into other formats.
+ $Id: makeinfo.c,v 1.6 2000/02/09 02:18:41 espie Exp $
- Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98
+ Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98, 99
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -20,35 +20,20 @@
Makeinfo was authored by Brian Fox (bfox@ai.mit.edu). */
-/* Indent #pragma so that older Cpp's don't try to parse it. */
-#ifdef _AIX
- #pragma alloca
-#endif /* _AIX */
-
-int major_version = 1;
-int minor_version = 68;
-
#include "system.h"
#include "getopt.h"
-#ifdef TM_IN_SYS_TIME
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif /* !TM_IN_SYS_TIME */
-
-#ifdef __GNUC__
-# undef alloca
-# define alloca __builtin_alloca
-#else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifndef _AIX
-char *alloca ();
-# endif
-# endif
-#endif
+#define COMPILING_MAKEINFO
+#include "makeinfo.h"
+#include "cmds.h"
+#include "files.h"
+#include "footnote.h"
+#include "html.h"
+#include "index.h"
+#include "insertion.h"
+#include "macro.h"
+#include "node.h"
+#include "toc.h"
/* We'd like to take advantage of _doprnt if it's around, a la error.c,
but then we'd have no VA_SPRINTF. */
@@ -69,6 +54,15 @@ char *alloca ();
# define va_end(args)
#endif
+/* DJGPP supports /dev/null, which is okay for Unix aficionados,
+ shell scripts and Makefiles, but interactive DOS die-hards
+ would probably want to have NUL as well. */
+#ifdef __DJGPP__
+# define ALSO_NULL_DEVICE "NUL"
+#else
+# define ALSO_NULL_DEVICE ""
+#endif
+
/* You can change some of the behavior of Makeinfo by changing the
following defines: */
@@ -78,11 +72,6 @@ char *alloca ();
no starting indentation. */
/* #define INDENT_PARAGRAPHS_IN_TABLE */
-/* Define DEFAULT_INDENTATION_INCREMENT as an integer which is the amount
- that @example should increase indentation by. This incremement is used
- for all insertions which indent the enclosed text. */
-#define DEFAULT_INDENTATION_INCREMENT 5
-
/* Define PARAGRAPH_START_INDENT to be the amount of indentation that
the first lines of paragraphs receive by default, where no other
value has been specified. Users can change this value on the command
@@ -95,103 +84,23 @@ char *alloca ();
line between paragraphs. Paragraphs are defined by 2 or more consecutive
newlines in the input file (i.e., one or more blank lines). */
#define DEFAULT_PARAGRAPH_SPACING 1
-
-/* Define HAVE_MACROS to enable the macro facility of Texinfo. Using this
- facility, users can create their own command procedures with
- arguments. Must always be defined. */
-#define HAVE_MACROS
-
-
-#define COMPILING_MAKEINFO
-#include "makeinfo.h"
-
-/* Nonzero means that we are currently hacking the insides of an
- insertion which would use a fixed width font. */
-static int in_fixed_width_font = 0;
-
-/* Nonzero means that start_paragraph () MUST be called before we pay
- any attention to close_paragraph () calls. */
-int must_start_paragraph = 0;
-
-/* Nonzero means a string is in execution, as opposed to a file. */
-static int executing_string = 0;
-
-/* Nonzero means a macro string is in execution, as opposed to a file. */
-static int me_executing_string = 0;
-
-#if defined (HAVE_MACROS)
-/* If non-NULL, this is an output stream to write the full macro expansion
- of the input text to. The result is another texinfo file, but
- missing @include, @infoinclude, @macro, and macro invocations. Instead,
- all of the text is placed within the file. */
-FILE *macro_expansion_output_stream = (FILE *)NULL;
-char *macro_expansion_filename;
-
-/* Here is a structure used to remember input text strings and offsets
- within them. */
-typedef struct {
- char *pointer; /* Pointer to the input text. */
- int offset; /* Offset of the last character output. */
-} ITEXT;
-
-static ITEXT **itext_info = (ITEXT **)NULL;
-static int itext_size = 0;
-
-/* Nonzero means to inhibit writing macro expansions to the output
- stream, because it has already been written. */
-int me_inhibit_expansion = 0;
-
-ITEXT *remember_itext ();
-void forget_itext (), me_append_before_this_command ();
-void append_to_expansion_output (), write_region_to_macro_output ();
-void maybe_write_itext (), me_execute_string ();
-#endif /* HAVE_MACROS */
-
-/* **************************************************************** */
-/* */
-/* Global Variables */
-/* */
-/* **************************************************************** */
-
-/* Global pointer to argv[0]. */
-char *progname;
-
-/* Return nonzero if STRING is the text at input_text + input_text_offset,
- else zero. */
-#define looking_at(string) \
- (strncmp (input_text + input_text_offset, string, strlen (string)) == 0)
-
-/* And writing to the output. */
+/* Global variables. */
/* The output file name. */
-char *output_filename = (char *)NULL;
-char *pretty_output_filename;
+char *output_filename = NULL;
/* Name of the output file that the user elected to pass on the command line.
Such a name overrides any name found with the @setfilename command. */
-char *command_output_filename = (char *)NULL;
-
-/* A colon separated list of directories to search for files included
- with @include. This can be controlled with the `-I' option to makeinfo. */
-char *include_files_path = (char *)NULL;
+char *command_output_filename = NULL;
-/* Position in the output file. */
-int output_position;
+/* Flags which control initial output string for xrefs. */
+int px_ref_flag = 0;
+int ref_flag = 0;
#define INITIAL_PARAGRAPH_SPACE 5000
int paragraph_buffer_len = INITIAL_PARAGRAPH_SPACE;
-/* Nonzero indicates that filling will take place on long lines. */
-int filling_enabled = 1;
-
-/* Nonzero means that words are not to be split, even in long lines. This
- gets changed for cm_w (). */
-int non_splitting_words = 0;
-
-/* Nonzero indicates that filling a line also indents the new line. */
-int indented_fill = 0;
-
/* The amount of indentation to add at the starts of paragraphs.
0 means don't change existing indentation at paragraph starts.
> 0 is amount to indent new paragraphs by.
@@ -202,170 +111,26 @@ int indented_fill = 0;
this is 3. */
int paragraph_start_indent = PARAGRAPH_START_INDENT;
-/* Nonzero means that the use of paragraph_start_indent is inhibited.
- @example uses this to line up the left columns of the example text.
- A negative value for this variable is incremented each time it is used.
- @noindent uses this to inhibit indentation for a single paragraph. */
-int inhibit_paragraph_indentation = 0;
-
/* Indentation that is pending insertion. We have this for hacking lines
which look blank, but contain whitespace. We want to treat those as
blank lines. */
int pending_indent = 0;
-/* The amount that indentation increases/decreases by. */
-int default_indentation_increment = DEFAULT_INDENTATION_INCREMENT;
-
-/* Nonzero indicates that indentation is temporarily turned off. */
-int no_indent = 1;
-
-/* Nonzero means forcing output text to be flushright. */
-int force_flush_right = 0;
-
-/* Nonzero means that the footnote style for this document was set on
- the command line, which overrides any other settings. */
-int footnote_style_preset = 0;
-
-/* Nonzero means that we automatically number footnotes that have no
- specified marker. */
-int number_footnotes = 1;
-
-/* The current footnote number in this node. Each time a new node is
- started this is reset to 1. */
-int current_footnote_number = 1;
-
-/* Command name in the process of being hacked. */
-char *command;
-
/* The index in our internal command table of the currently
executing command. */
int command_index;
-/* A search string which is used to find a line defining a node. */
-char node_search_string[] =
- { '\n', COMMAND_PREFIX, 'n', 'o', 'd', 'e', ' ', 0 };
-
-/* A search string which is used to find a line defining a menu. */
-char menu_search_string[] =
- { '\n', COMMAND_PREFIX, 'm', 'e', 'n', 'u', 0 };
-
/* A search string which is used to find the first @setfilename. */
char setfilename_search[] =
{ COMMAND_PREFIX,
's', 'e', 't', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', 0 };
-/* A stack of file information records. If a new file is read in with
- "@input", we remember the old input file state on this stack. */
-typedef struct fstack
-{
- struct fstack *next;
- char *filename;
- char *text;
- int size;
- int offset;
- int line_number;
-} FSTACK;
-
-FSTACK *filestack = (FSTACK *) NULL;
-
-/* Stuff for nodes. */
-/* The current nodes node name. */
-char *current_node = (char *)NULL;
-
-/* The current nodes section level. */
-int current_section = 0;
-
-/* The filename of the current input file. This is never freed. */
-char *node_filename = (char *)NULL;
-
-/* What we remember for each node. */
-typedef struct tentry
-{
- struct tentry *next_ent;
- char *node; /* name of this node. */
- char *prev; /* name of "Prev:" for this node. */
- char *next; /* name of "Next:" for this node. */
- char *up; /* name of "Up:" for this node. */
- int position; /* output file position of this node. */
- int line_no; /* defining line in source file. */
- char *filename; /* The file that this node was found in. */
- int touched; /* Nonzero means this node has been referenced. */
- int flags; /* Room for growth. Right now, contains 1 bit. */
-} TAG_ENTRY;
-
-/* If node-a has a "Next" for node-b, but node-b has no "Prev" for node-a,
- we turn on this flag bit in node-b's tag entry. This means that when
- it is time to validate node-b, we don't report an additional error
- if there was no "Prev" field. */
-#define PREV_ERROR 0x1
-#define NEXT_ERROR 0x2
-#define UP_ERROR 0x4
-#define NO_WARN 0x8
-#define IS_TOP 0x10
-
-TAG_ENTRY *tag_table = (TAG_ENTRY *) NULL;
-
/* Values for calling handle_variable_internal (). */
#define SET 1
#define CLEAR 2
#define IFSET 3
#define IFCLEAR 4
-#if defined (HAVE_MACROS)
-#define ME_RECURSE 0x01
-#define ME_QUOTE_ARG 0x02
-
-/* Macro definitions for user-defined commands. */
-typedef struct {
- char *name; /* Name of the macro. */
- char **arglist; /* Args to replace when executing. */
- char *body; /* Macro body. */
- char *source_file; /* File where this macro is defined. */
- int source_lineno; /* Line number within FILENAME. */
- int inhibited; /* Nonzero means make find_macro () fail. */
- int flags; /* ME_RECURSE, ME_QUOTE_ARG, etc. */
-} MACRO_DEF;
-
-void add_macro (), execute_macro ();
-MACRO_DEF *find_macro (), *delete_macro ();
-#endif /* HAVE_MACROS */
-
-/* Menu reference, *note reference, and validation hacking. */
-
-/* The various references that we know about. */
-enum reftype
-{
- menu_reference, followed_reference
-};
-
-/* A structure to remember references with. A reference to a node is
- either an entry in a menu, or a cross-reference made with [px]ref. */
-typedef struct node_ref
-{
- struct node_ref *next;
- char *node; /* Name of node referred to. */
- char *containing_node; /* Name of node containing this reference. */
- int line_no; /* Line number where the reference occurs. */
- int section; /* Section level where the reference occurs. */
- char *filename; /* Name of file where the reference occurs. */
- enum reftype type; /* Type of reference, either menu or note. */
-} NODE_REF;
-
-/* The linked list of such structures. */
-NODE_REF *node_references = (NODE_REF *) NULL;
-
-/* Flag which tells us whether to examine menu lines or not. */
-int in_menu = 0;
-
-/* Flag which tells us how to examine menu lines. */
-int in_detailmenu = 0;
-
-/* Nonzero means that we have seen "@top" once already. */
-int top_node_seen = 0;
-
-/* Nonzero means that we have seen a non-"@top" node already. */
-int non_top_node_seen = 0;
-
/* Flags controlling the operation of the program. */
/* Default is to remove output if there were errors. */
@@ -374,81 +139,78 @@ int force = 0;
/* Default is to notify users of bad choices. */
int print_warnings = 1;
-/* Default is to check node references. */
-int validating = 1;
-
-/* Nonzero means do not output "Node: Foo" for node separations. */
-int no_headers = 0;
-
/* Number of errors that we tolerate on a given fileset. */
int max_error_level = 100;
-/* Maximum number of references to a single node before complaining. */
-int reference_warning_limit = 1000;
-
-/* Nonzero means print out information about what is going on when it
- is going on. */
-int verbose_mode = 0;
+/* The actual last inserted character. Note that this may be something
+ other than NEWLINE even if last_char_was_newline is 1. */
+int last_inserted_character = 0;
-/* Nonzero means to be relaxed about the input file. This is useful when
- we can successfully format the input, but it doesn't strictly match our
- somewhat pedantic ideas of correctness. Right now, it affects what
- @table and @itemize do without arguments. */
-int allow_lax_format = 0;
+/* Nonzero means that a newline character has already been
+ inserted, so close_paragraph () should insert one less. */
+int line_already_broken = 0;
-/* The list of commands that we hack in texinfo. Each one
- has an associated function. When the command is encountered in the
- text, the associated function is called with START as the argument.
- If the function expects arguments in braces, it remembers itself on
- the stack. When the corresponding close brace is encountered, the
- function is called with END as the argument. */
+/* When nonzero we have finished an insertion (see end_insertion ()) and we
+ want to ignore false continued paragraph closings. */
+int insertion_paragraph_closed = 0;
-#define START 0
-#define END 1
+/* Nonzero means attempt to make all of the lines have fill_column width. */
+int do_justification = 0;
typedef struct brace_element
{
struct brace_element *next;
COMMAND_FUNCTION *proc;
+ char *command;
int pos, line;
int in_fixed_width_font;
} BRACE_ELEMENT;
-BRACE_ELEMENT *brace_stack = (BRACE_ELEMENT *) NULL;
+BRACE_ELEMENT *brace_stack = NULL;
-extern void do_multitable ();
+extern void do_multitable (), end_multitable ();
-void print_version_info ();
-void usage ();
void push_node_filename (), pop_node_filename ();
-void remember_error (), flush_file_stack ();
+void remember_error ();
void convert_from_stream (), convert_from_file (), convert_from_loaded_file ();
void init_internals (), init_paragraph (), init_brace_stack ();
void init_insertion_stack (), init_indices ();
void init_tag_table (), write_tag_table (), write_tag_table_internal ();
void validate_file (), validate_other_references (), split_file ();
-void free_node_references (), do_enumeration (), handle_variable ();
+void free_node_references (), handle_variable ();
void handle_variable_internal ();
void normalize_node_name ();
-void undefindex (), top_defindex (), gen_defindex ();
-void define_user_command ();
-void free_pending_notes (), output_pending_notes ();
+void add_anchor_name ();
+void free_node_node_references (), remember_node_node_reference ();
char **get_brace_args ();
-char *expansion ();
int array_len ();
void free_array ();
static int end_of_sentence_p ();
static void isolate_nodename ();
-void reader_loop (), read_command ();
+void reader_loop ();
void remember_brace (), remember_brace_1 ();
void pop_and_call_brace (), discard_braces ();
void add_word (), add_char (), insert (), flush_output ();
void insert_string ();
-void close_paragraph_with_lines (), close_paragraph ();
+void close_paragraph ();
void ignore_blank_line ();
void do_flush_right_indentation (), discard_insertions ();
void start_paragraph (), indent ();
+void inhibit_output_flushing (), uninhibit_output_flushing ();
+int set_paragraph_indent ();
+int self_delimiting (), search_forward ();
+int multitable_item (), number_of_node ();
+extern void add_link (), add_escaped_anchor_name ();
+
+void me_execute_string_keep_state ();
+void maybe_update_execution_strings ();
+
+extern char *escape_string ();
+extern void insert_html_tag ();
+extern void sectioning_html ();
+extern void add_link ();
+
#if defined (VA_FPRINTF) && __STDC__
/* Unfortunately we must use prototypes if we are to use <stdarg.h>. */
void add_word_args (char *, ...);
@@ -456,356 +218,9 @@ void execute_string (char *, ...);
#else
void add_word_args ();
void execute_string ();
-#endif /* will not use prototypes */
-
-void insert_self (), insert_space (), cm_ignore_line ();
-
-void
- cm_TeX (), cm_asterisk (), cm_bullet (), cm_cite (),
- cm_code (), cm_copyright (), cm_ctrl (), cm_dfn (), cm_dircategory (),
- cm_direntry (), cm_dots (), cm_emph (), cm_enddots (),
- cm_kbd (), cm_key (), cm_no_op (), cm_no_op_line_arg (),
- cm_not_fixed_width (), cm_strong (), cm_var_sc (), cm_w (), cm_image ();
-
-/* Sectioning. */
-void
- cm_chapter (), cm_unnumbered (), cm_appendix (), cm_top (),
- cm_section (), cm_unnumberedsec (), cm_appendixsec (),
- cm_subsection (), cm_unnumberedsubsec (), cm_appendixsubsec (),
- cm_subsubsection (), cm_unnumberedsubsubsec (), cm_appendixsubsubsec (),
- cm_heading (), cm_chapheading (), cm_subheading (), cm_subsubheading (),
- cm_majorheading (), cm_raisesections (), cm_lowersections ();
-
-/* All @def... commands map to cm_defun, most accent commands map to
- cm_accent, most non-English letters map to cm_special_char. */
-void cm_defun (), cm_accent (), cm_special_char (), cm_dotless ();
-
-void
- cm_node (), cm_menu (), cm_xref (), cm_ftable (), cm_vtable (), cm_pxref (),
- cm_inforef (), cm_uref (), cm_email (), cm_quotation (),
- cm_display (), cm_itemize (),
- cm_enumerate (), cm_tab (), cm_table (), cm_itemx (), cm_noindent (),
- cm_setfilename (), cm_br (), cm_sp (), cm_page (), cm_group (),
- cm_center (), cm_include (), cm_bye (), cm_item (), cm_end (),
- cm_ifinfo (), cm_ifnothtml (), cm_ifnottex (), cm_kindex (), cm_cindex (),
- cm_findex (), cm_pindex (), cm_vindex (), cm_tindex (),
- cm_synindex (), cm_printindex (), cm_minus (), cm_footnote (),
- cm_example (), cm_smallexample (), cm_lisp (), cm_format (), cm_exdent (),
- cm_defindex (), cm_defcodeindex (), cm_result (), cm_expansion (),
- cm_equiv (), cm_print (), cm_error (), cm_point (), cm_today (),
- cm_flushleft (), cm_flushright (), cm_smalllisp (), cm_finalout (),
- cm_cartouche (), cm_detailmenu (), cm_multitable ();
-
-/* Conditionals. */
-void cm_set (), cm_clear (), cm_ifset (), cm_ifclear ();
-void cm_value (), cm_ifeq ();
-
-#if defined (HAVE_MACROS)
-/* Define a user-defined command which is simple substitution. */
-void cm_macro (), cm_unmacro ();
-#endif /* HAVE_MACROS */
-
-/* Options. */
-void cm_paragraphindent (), cm_footnotestyle ();
-
-/* Internals. */
-void command_name_condition (), misplaced_brace (), cm_obsolete (),
- cm_ideprecated ();
-
-typedef struct
-{
- char *name;
- COMMAND_FUNCTION *proc;
- int argument_in_braces;
-} COMMAND;
-
-/* Stuff for defining commands on the fly. */
-COMMAND **user_command_array = (COMMAND **) NULL;
-int user_command_array_len = 0;
-
-#define NO_BRACE_ARGS 0
-#define BRACE_ARGS 1
-
-static COMMAND command_table[] = {
- { "\t", insert_space, NO_BRACE_ARGS },
- { "\n", insert_space, NO_BRACE_ARGS },
- { " ", insert_self, NO_BRACE_ARGS },
- { "!", insert_self, NO_BRACE_ARGS },
- { "\"", insert_self, NO_BRACE_ARGS },
- { "'", insert_self, NO_BRACE_ARGS },
- { "*", cm_asterisk, NO_BRACE_ARGS },
- { ",", cm_accent, BRACE_ARGS },
- { "-", cm_no_op, NO_BRACE_ARGS },
- { ".", insert_self, NO_BRACE_ARGS },
- { ":", cm_no_op, NO_BRACE_ARGS },
- { "=", insert_self, NO_BRACE_ARGS },
- { "?", insert_self, NO_BRACE_ARGS },
- { "@", insert_self, NO_BRACE_ARGS },
- { "^", insert_self, NO_BRACE_ARGS },
- { "`", insert_self, NO_BRACE_ARGS },
- { "{", insert_self, NO_BRACE_ARGS },
- { "|", cm_no_op, NO_BRACE_ARGS },
- { "}", insert_self, NO_BRACE_ARGS },
- { "~", insert_self, NO_BRACE_ARGS },
- { "AA", insert_self, BRACE_ARGS },
- { "AE", insert_self, BRACE_ARGS },
- { "H", cm_accent, BRACE_ARGS },
- { "L", cm_special_char, BRACE_ARGS },
- { "O", cm_special_char, BRACE_ARGS },
- { "OE", insert_self, BRACE_ARGS },
- { "TeX", cm_TeX, BRACE_ARGS },
- { "aa", insert_self, BRACE_ARGS },
- { "ae", insert_self, BRACE_ARGS },
- { "appendix", cm_appendix, NO_BRACE_ARGS },
- { "appendixsection", cm_appendixsec, NO_BRACE_ARGS },
- { "appendixsec", cm_appendixsec, NO_BRACE_ARGS },
- { "appendixsubsec", cm_appendixsubsec, NO_BRACE_ARGS },
- { "appendixsubsubsec", cm_appendixsubsubsec, NO_BRACE_ARGS },
- { "asis", cm_no_op, BRACE_ARGS },
- { "b", cm_not_fixed_width, BRACE_ARGS },
- { "bullet", cm_bullet, BRACE_ARGS },
- { "bye", cm_bye, NO_BRACE_ARGS },
- { "c", cm_ignore_line, NO_BRACE_ARGS },
- { "cartouche", cm_cartouche, NO_BRACE_ARGS },
- { "center", cm_center, NO_BRACE_ARGS },
- { "centerchap", cm_unnumbered, NO_BRACE_ARGS },
- { "chapheading", cm_chapheading, NO_BRACE_ARGS },
- { "chapter", cm_chapter, NO_BRACE_ARGS },
- { "cindex", cm_cindex, NO_BRACE_ARGS },
- { "cite", cm_cite, BRACE_ARGS },
- { "clear", cm_clear, NO_BRACE_ARGS },
- { "code", cm_code, BRACE_ARGS },
- { "comment", cm_ignore_line, NO_BRACE_ARGS },
- { "contents", cm_no_op, NO_BRACE_ARGS },
- { "copyright", cm_copyright, BRACE_ARGS },
- { "ctrl", cm_obsolete, BRACE_ARGS },
- { "defcodeindex", cm_defcodeindex, NO_BRACE_ARGS },
- { "defindex", cm_defindex, NO_BRACE_ARGS },
-/* The `def' commands. */
- { "defcv", cm_defun, NO_BRACE_ARGS },
- { "defcvx", cm_defun, NO_BRACE_ARGS },
- { "deffn", cm_defun, NO_BRACE_ARGS },
- { "deffnx", cm_defun, NO_BRACE_ARGS },
- { "defivar", cm_defun, NO_BRACE_ARGS },
- { "defivarx", cm_defun, NO_BRACE_ARGS },
- { "defmac", cm_defun, NO_BRACE_ARGS },
- { "defmacx", cm_defun, NO_BRACE_ARGS },
- { "defmethod", cm_defun, NO_BRACE_ARGS },
- { "defmethodx", cm_defun, NO_BRACE_ARGS },
- { "defop", cm_defun, NO_BRACE_ARGS },
- { "defopt", cm_defun, NO_BRACE_ARGS },
- { "defoptx", cm_defun, NO_BRACE_ARGS },
- { "defopx", cm_defun, NO_BRACE_ARGS },
- { "defspec", cm_defun, NO_BRACE_ARGS },
- { "defspecx", cm_defun, NO_BRACE_ARGS },
- { "deftp", cm_defun, NO_BRACE_ARGS },
- { "deftpx", cm_defun, NO_BRACE_ARGS },
- { "deftypefn", cm_defun, NO_BRACE_ARGS },
- { "deftypefnx", cm_defun, NO_BRACE_ARGS },
- { "deftypefun", cm_defun, NO_BRACE_ARGS },
- { "deftypefunx", cm_defun, NO_BRACE_ARGS },
- { "deftypemethod", cm_defun, NO_BRACE_ARGS },
- { "deftypemethodx", cm_defun, NO_BRACE_ARGS },
- { "deftypevar", cm_defun, NO_BRACE_ARGS },
- { "deftypevarx", cm_defun, NO_BRACE_ARGS },
- { "deftypevr", cm_defun, NO_BRACE_ARGS },
- { "deftypevrx", cm_defun, NO_BRACE_ARGS },
- { "defun", cm_defun, NO_BRACE_ARGS },
- { "defunx", cm_defun, NO_BRACE_ARGS },
- { "defvar", cm_defun, NO_BRACE_ARGS },
- { "defvarx", cm_defun, NO_BRACE_ARGS },
- { "defvr", cm_defun, NO_BRACE_ARGS },
- { "defvrx", cm_defun, NO_BRACE_ARGS },
-/* The end of the `def' commands. */
- { "detailmenu", cm_detailmenu, NO_BRACE_ARGS },
- { "dfn", cm_dfn, BRACE_ARGS },
- { "dircategory", cm_dircategory, NO_BRACE_ARGS },
- { "direntry", cm_direntry, NO_BRACE_ARGS },
- { "display", cm_display, NO_BRACE_ARGS },
- { "dmn", cm_no_op, BRACE_ARGS },
- { "dotaccent", cm_accent, BRACE_ARGS },
- { "dotless", cm_dotless, BRACE_ARGS },
- { "dots", cm_dots, BRACE_ARGS },
- { "email", cm_email, BRACE_ARGS },
- { "emph", cm_emph, BRACE_ARGS },
- { "end", cm_end, NO_BRACE_ARGS },
- { "enddots", cm_enddots, BRACE_ARGS },
- { "enumerate", cm_enumerate, NO_BRACE_ARGS },
- { "equiv", cm_equiv, BRACE_ARGS },
- { "error", cm_error, BRACE_ARGS },
- { "example", cm_example, NO_BRACE_ARGS },
- { "exclamdown", cm_special_char, BRACE_ARGS },
- { "exdent", cm_exdent, NO_BRACE_ARGS },
- { "expansion", cm_expansion, BRACE_ARGS },
- { "file", cm_code, BRACE_ARGS },
- { "finalout", cm_no_op, NO_BRACE_ARGS },
- { "findex", cm_findex, NO_BRACE_ARGS },
- { "flushleft", cm_flushleft, NO_BRACE_ARGS },
- { "flushright", cm_flushright, NO_BRACE_ARGS },
- { "footnote", cm_footnote, NO_BRACE_ARGS}, /* self-arg eater */
- { "footnotestyle", cm_footnotestyle, NO_BRACE_ARGS },
- { "format", cm_format, NO_BRACE_ARGS },
- { "ftable", cm_ftable, NO_BRACE_ARGS },
- { "group", cm_group, NO_BRACE_ARGS },
- { "heading", cm_heading, NO_BRACE_ARGS },
- { "headings", cm_ignore_line, NO_BRACE_ARGS },
- { "html", command_name_condition, NO_BRACE_ARGS },
- { "hyphenation", cm_no_op, BRACE_ARGS },
- { "i", cm_not_fixed_width, BRACE_ARGS },
- { "ifclear", cm_ifclear, NO_BRACE_ARGS },
- { "ifeq", cm_ifeq, NO_BRACE_ARGS },
- { "ifhtml", command_name_condition, NO_BRACE_ARGS },
- { "ifinfo", cm_ifinfo, NO_BRACE_ARGS },
- { "ifnothtml", cm_ifnothtml, NO_BRACE_ARGS },
- { "ifnotinfo", command_name_condition, NO_BRACE_ARGS },
- { "ifnottex", cm_ifnottex, NO_BRACE_ARGS },
- { "ifset", cm_ifset, NO_BRACE_ARGS },
- { "iftex", command_name_condition, NO_BRACE_ARGS },
- { "ignore", command_name_condition, NO_BRACE_ARGS },
- { "image", cm_image, BRACE_ARGS },
- { "include", cm_include, NO_BRACE_ARGS },
- { "inforef", cm_inforef, BRACE_ARGS },
- { "item", cm_item, NO_BRACE_ARGS },
- { "itemize", cm_itemize, NO_BRACE_ARGS },
- { "itemx", cm_itemx, NO_BRACE_ARGS },
- { "kbd", cm_kbd, BRACE_ARGS },
- { "kbdinputstyle", cm_no_op_line_arg, NO_BRACE_ARGS },
- { "key", cm_key, BRACE_ARGS },
- { "kindex", cm_kindex, NO_BRACE_ARGS },
- { "l", cm_special_char, BRACE_ARGS },
- { "lisp", cm_lisp, NO_BRACE_ARGS },
- { "lowersections", cm_lowersections, NO_BRACE_ARGS },
- { "macro", cm_macro, NO_BRACE_ARGS },
- { "majorheading", cm_majorheading, NO_BRACE_ARGS },
- { "math", cm_no_op, BRACE_ARGS },
- { "menu", cm_menu, NO_BRACE_ARGS },
- { "minus", cm_minus, BRACE_ARGS },
- { "multitable", cm_multitable, NO_BRACE_ARGS },
- { "need", cm_ignore_line, NO_BRACE_ARGS },
- { "node", cm_node, NO_BRACE_ARGS },
- { "noindent", cm_noindent, NO_BRACE_ARGS },
- { "nwnode", cm_node, NO_BRACE_ARGS },
- { "o", cm_special_char, BRACE_ARGS },
- { "oe", insert_self, BRACE_ARGS },
- { "page", cm_no_op, NO_BRACE_ARGS },
- { "paragraphindent", cm_paragraphindent, NO_BRACE_ARGS },
- { "pindex", cm_pindex, NO_BRACE_ARGS },
- { "point", cm_point, BRACE_ARGS },
- { "pounds", cm_special_char, BRACE_ARGS },
- { "print", cm_print, BRACE_ARGS },
- { "printindex", cm_printindex, NO_BRACE_ARGS },
- { "pxref", cm_pxref, BRACE_ARGS },
- { "questiondown", cm_special_char, BRACE_ARGS },
- { "quotation", cm_quotation, NO_BRACE_ARGS },
- { "r", cm_not_fixed_width, BRACE_ARGS },
- { "raisesections", cm_raisesections, NO_BRACE_ARGS },
- { "ref", cm_xref, BRACE_ARGS },
- { "refill", cm_no_op, NO_BRACE_ARGS },
- { "result", cm_result, BRACE_ARGS },
- { "ringaccent", cm_accent, BRACE_ARGS },
- { "samp", cm_code, BRACE_ARGS },
- { "sc", cm_var_sc, BRACE_ARGS },
- { "section", cm_section, NO_BRACE_ARGS },
- { "set", cm_set, NO_BRACE_ARGS },
- { "setchapternewpage", cm_ignore_line, NO_BRACE_ARGS },
- { "setchapterstyle", cm_obsolete, NO_BRACE_ARGS },
- { "setfilename", cm_setfilename, NO_BRACE_ARGS },
- { "settitle", cm_ignore_line, NO_BRACE_ARGS },
- { "shortcontents", cm_no_op, NO_BRACE_ARGS },
- { "shorttitlepage", cm_ignore_line, NO_BRACE_ARGS },
- { "smallbook", cm_ignore_line, NO_BRACE_ARGS },
- { "smallexample", cm_smallexample, NO_BRACE_ARGS },
- { "smalllisp", cm_smalllisp, NO_BRACE_ARGS },
- { "sp", cm_sp, NO_BRACE_ARGS },
- { "ss", insert_self, BRACE_ARGS },
- { "strong", cm_strong, BRACE_ARGS },
- { "subheading", cm_subheading, NO_BRACE_ARGS },
- { "subsection", cm_subsection, NO_BRACE_ARGS },
- { "subsubheading", cm_subsubheading, NO_BRACE_ARGS },
- { "subsubsection", cm_subsubsection, NO_BRACE_ARGS },
- { "summarycontents", cm_no_op, NO_BRACE_ARGS },
- { "syncodeindex", cm_synindex, NO_BRACE_ARGS },
- { "synindex", cm_synindex, NO_BRACE_ARGS },
- { "t", cm_no_op, BRACE_ARGS },
- { "tab", cm_tab, NO_BRACE_ARGS },
- { "table", cm_table, NO_BRACE_ARGS },
- { "tex", command_name_condition, NO_BRACE_ARGS },
- { "tieaccent", cm_accent, BRACE_ARGS },
- { "tindex", cm_tindex, NO_BRACE_ARGS },
- { "titlefont", cm_not_fixed_width, BRACE_ARGS },
- { "titlepage", command_name_condition, NO_BRACE_ARGS },
- { "today", cm_today, BRACE_ARGS },
- { "top", cm_top, NO_BRACE_ARGS },
- { "u", cm_accent, BRACE_ARGS },
- { "ubaraccent", cm_accent, BRACE_ARGS },
- { "udotaccent", cm_accent, BRACE_ARGS },
-#if defined (HAVE_MACROS)
- { "unmacro", cm_unmacro, NO_BRACE_ARGS },
-#endif
- { "unnumbered", cm_unnumbered, NO_BRACE_ARGS },
- { "unnumberedsec", cm_unnumberedsec, NO_BRACE_ARGS },
- { "unnumberedsubsec", cm_unnumberedsubsec, NO_BRACE_ARGS },
- { "unnumberedsubsubsec", cm_unnumberedsubsubsec, NO_BRACE_ARGS },
- { "uref", cm_uref, BRACE_ARGS },
- { "url", cm_code, BRACE_ARGS },
- { "v", cm_accent, BRACE_ARGS },
- { "value", cm_value, BRACE_ARGS },
- { "var", cm_var_sc, BRACE_ARGS },
- { "vindex", cm_vindex, NO_BRACE_ARGS },
- { "vtable", cm_vtable, NO_BRACE_ARGS },
- { "w", cm_w, BRACE_ARGS },
- { "xref", cm_xref, BRACE_ARGS },
-
- /* Deprecated commands. These used to be for italics. */
- { "iappendix", cm_ideprecated, NO_BRACE_ARGS },
- { "iappendixsec", cm_ideprecated, NO_BRACE_ARGS },
- { "iappendixsection", cm_ideprecated, NO_BRACE_ARGS },
- { "iappendixsubsec", cm_ideprecated, NO_BRACE_ARGS },
- { "iappendixsubsubsec", cm_ideprecated, NO_BRACE_ARGS },
- { "ichapter", cm_ideprecated, NO_BRACE_ARGS },
- { "isection", cm_ideprecated, NO_BRACE_ARGS },
- { "isubsection", cm_ideprecated, NO_BRACE_ARGS },
- { "isubsubsection", cm_ideprecated, NO_BRACE_ARGS },
- { "iunnumbered", cm_ideprecated, NO_BRACE_ARGS },
- { "iunnumberedsec", cm_ideprecated, NO_BRACE_ARGS },
- { "iunnumberedsubsec", cm_ideprecated, NO_BRACE_ARGS },
- { "iunnumberedsubsubsec", cm_ideprecated, NO_BRACE_ARGS },
-
- /* Now @include does what this was used to. */
- { "infoinclude", cm_obsolete, NO_BRACE_ARGS },
- { "titlespec", cm_obsolete, NO_BRACE_ARGS },
-
- { NULL, NULL, NO_BRACE_ARGS }
-};
-
-struct option long_options[] =
-{
- { "error-limit", 1, 0, 'e' }, /* formerly -el */
- { "fill-column", 1, 0, 'f' }, /* formerly -fc */
- { "footnote-style", 1, 0, 's' }, /* formerly -ft */
- { "force", 0, 0, 'F' }, /* do not remove output */
- { "no-headers", 0, &no_headers, 1 }, /* do not output Node: foo */
- { "no-pointer-validate", 0, &validating, 0 }, /* formerly -nv */
- { "no-validate", 0, &validating, 0 }, /* formerly -nv */
- { "no-split", 0, &splitting, 0 }, /* formerly -ns */
- { "no-warn", 0, &print_warnings, 0 }, /* formerly -nw */
- { "macro-expand", 1, 0, 'E' },
- { "number-footnotes", 0, &number_footnotes, 1 },
- { "no-number-footnotes", 0, &number_footnotes, 0 },
- { "output", 1, 0, 'o' },
- { "paragraph-indent", 1, 0, 'p' }, /* formerly -pi */
- { "reference-limit", 1, 0, 'r' }, /* formerly -rl */
- { "verbose", 0, &verbose_mode, 1 }, /* formerly -verbose */
- { "help", 0, 0, 'h' },
- { "version", 0, 0, 'V' },
- {NULL, 0, NULL, 0}
-};
+#endif /* no prototypes */
-/* **************************************************************** */
-/* */
-/* Error Handling */
-/* */
-/* **************************************************************** */
+/* Error handling. */
/* Number of errors encountered. */
int errors_printed = 0;
@@ -817,7 +232,7 @@ fs_error (filename)
{
remember_error ();
perror (filename);
- return (0);
+ return 0;
}
/* Print an error message, and return false. */
@@ -916,15 +331,136 @@ remember_error ()
fprintf (stderr, _("Too many errors! Gave up.\n"));
flush_file_stack ();
cm_bye ();
- exit (FATAL);
+ xexit (1);
}
}
+
+/* The other side of a malformed expression. */
+void
+misplaced_brace ()
+{
+ line_error (_("Misplaced %c"), '}');
+}
-/* **************************************************************** */
-/* */
-/* Main () Start of code */
-/* */
-/* **************************************************************** */
+/* Main. */
+
+/* Display the version info of this invocation of Makeinfo. */
+static void
+print_version_info ()
+{
+ printf ("makeinfo (GNU %s) %s\n", PACKAGE, VERSION);
+}
+
+/* If EXIT_VALUE is zero, print the full usage message to stdout.
+ Otherwise, just say to use --help for more info.
+ Then exit with EXIT_VALUE. */
+static void
+usage (exit_value)
+ int exit_value;
+{
+ if (exit_value != 0)
+ fprintf (stderr, _("Try `%s --help' for more information.\n"), progname);
+ else
+ {
+ printf (_("Usage: %s [OPTION]... TEXINFO-FILE...\n\
+\n\
+Translate Texinfo source documentation to various other formats:\n\
+Info files suitable for reading online with Emacs or standalone GNU Info\n\
+(by default); plain text (with --no-headers); or HTML (with --html).\n\
+\n\
+Options:\n\
+ --commands-in-node-names allow @ commands in node names.\n\
+ -D VAR define a variable, as with @set.\n\
+ -E, --macro-expand FILE output macro-expanded source to FILE.\n\
+ --error-limit=NUM quit after NUM errors (default %d).\n\
+ --fill-column=NUM break Info lines at NUM characters (default %d).\n\
+ --footnote-style=STYLE output footnotes according to STYLE:\n\
+ `separate' to place footnotes in their own node,\n\
+ `end' to place the footnotes at the end of the\n\
+ node in which they are defined (the default).\n\
+ --force preserve output even if errors.\n\
+ --help display this help and exit.\n\
+ --html output HTML rather than Info format;\n\
+ -I DIR append DIR to the @include search path.\n\
+ --ifhtml process @ifhtml and @html text even when not\n\
+ generating HTML.\n\
+ --ifinfo process @ifinfo text even when generating HTML.\n\
+ --iftex process @iftex and @tex text.\n\
+ implies --no-split.\n"),
+ progname, max_error_level, fill_column);
+ printf (_("\
+ --no-headers suppress Info node separators and Node: lines and\n\
+ write to standard output without --output.\n\
+ --no-ifhtml do not process @ifhtml and @html text.\n\
+ --no-ifinfo do not process @ifinfo text.\n\
+ --no-iftex do not process @iftex and @tex text.\n\
+ --no-split suppress splitting of large Info output files or\n\
+ generation of one HTML file per node.\n\
+ --no-validate suppress node cross-reference validation.\n\
+ --no-warn suppress warnings (but not errors).\n\
+ --number-sections include chapter, section, etc. numbers in output.\n\
+ -o, --output=FILE output to FILE, ignoring any @setfilename.\n\
+ -P DIR prepend DIR to the @include search path.\n\
+ --paragraph-indent=VAL indent Info paragraphs by VAL spaces (default %d).\n\
+ if VAL is `none', do not indent;\n\
+ if VAL is `asis', preserve existing indentation.\n\
+ --reference-limit=NUM warn about at most NUM references (default %d).\n\
+ -U VAR undefine a variable, as with @clear.\n\
+ -v, --verbose explain what is being done.\n\
+ --version display version information and exit.\n\
+"),
+ paragraph_start_indent, reference_warning_limit);
+ }
+
+ puts (_("\n\
+The defaults for the @if... conditionals depend on the output format:\n\
+if generating HTML, --ifhtml is on and the others are off;\n\
+if generating Info or plain text, --ifinfo is on and the others are off.\n\
+\n\
+Examples:\n\
+ makeinfo foo.texi write Info to foo's @setfilename\n\
+ makeinfo --html foo.texi write HTML to foo's @setfilename\n\
+ makeinfo --no-headers -o - foo.texi write plain text to standard output\n\
+ makeinfo --number-sections foo.texi write Info with numbered sections\n\
+ makeinfo --no-split foo.texi write one Info file however big\n\
+\n\
+Email bug reports to bug-texinfo@gnu.org,\n\
+general questions and discussion to help-texinfo@gnu.org."));
+ xexit (exit_value);
+}
+
+struct option long_options[] =
+{
+ { "commands-in-node-names", 0, &expensive_validation, 1 },
+ { "error-limit", 1, 0, 'e' },
+ { "fill-column", 1, 0, 'f' },
+ { "footnote-style", 1, 0, 's' },
+ { "force", 0, &force, 1 },
+ { "help", 0, 0, 'h' },
+ { "html", 0, 0, 'w' },
+ { "ifhtml", 0, &process_html, 1 },
+ { "ifinfo", 0, &process_info, 1 },
+ { "iftex", 0, &process_tex, 1 },
+ { "macro-expand", 1, 0, 'E' },
+ { "no-headers", 0, &no_headers, 1 },
+ { "no-ifhtml", 0, &process_html, 0 },
+ { "no-ifinfo", 0, &process_info, 0 },
+ { "no-iftex", 0, &process_tex, 0 },
+ { "no-number-footnotes", 0, &number_footnotes, 0 },
+ { "no-number-sections", 0, &number_sections, 0 },
+ { "no-pointer-validate", 0, &validating, 0 },
+ { "no-split", 0, &splitting, 0 },
+ { "no-validate", 0, &validating, 0 },
+ { "no-warn", 0, &print_warnings, 0 },
+ { "number-footnotes", 0, &number_footnotes, 1 },
+ { "number-sections", 0, &number_sections, 1 },
+ { "output", 1, 0, 'o' },
+ { "paragraph-indent", 1, 0, 'p' },
+ { "reference-limit", 1, 0, 'r' },
+ { "verbose", 0, &verbose_mode, 1 },
+ { "version", 0, 0, 'V' },
+ {NULL, 0, NULL, 0}
+};
/* For each file mentioned in the command line, process it, turning
Texinfo commands into wonderfully formatted output text. */
@@ -934,18 +470,16 @@ main (argc, argv)
char **argv;
{
extern int errors_printed;
- char *filename_part ();
int c, ind;
int reading_from_stdin = 0;
- /* The name of this program is the last filename in argv[0]. */
- progname = filename_part (argv[0]);
-
#ifdef HAVE_SETLOCALE
/* Do not use LC_ALL, because LC_NUMERIC screws up the scanf parsing
of the argument to @multicolumn. */
setlocale (LC_TIME, "");
setlocale (LC_MESSAGES, "");
+ setlocale (LC_CTYPE, "");
+ setlocale (LC_COLLATE, "");
#endif
/* Set the text message domain. */
@@ -953,7 +487,7 @@ main (argc, argv)
textdomain (PACKAGE);
/* Parse argument flags from the input line. */
- while ((c = getopt_long (argc, argv, "D:e:E:f:I:o:p:P:r:s:U:V",
+ while ((c = getopt_long (argc, argv, "D:e:E:f:hI:o:p:P:r:s:U:vV:w",
long_options, &ind)) != EOF)
{
if (c == 0 && long_options[ind].flag == 0)
@@ -967,19 +501,17 @@ main (argc, argv)
handle_variable_internal ((c == 'D') ? SET : CLEAR, optarg);
break;
- case 'e':
- /* User specified error level. */
+ case 'e': /* --error-limit */
if (sscanf (optarg, "%d", &max_error_level) != 1)
{
fprintf (stderr,
_("%s: %s arg must be numeric, not `%s'.\n"),
"--error-limit", progname, optarg);
- usage (stderr, FATAL);
+ usage (stderr, 1);
}
break;
- case 'E':
- /* User specified a macro expansion output file. */
+ case 'E': /* --macro-expand */
if (!macro_expansion_output_stream)
{
macro_expansion_filename = optarg;
@@ -992,23 +524,18 @@ main (argc, argv)
error (_("Cannot specify more than one macro expansion output"));
break;
- case 'f':
- /* User specified fill_column. */
+ case 'f': /* --fill-column */
if (sscanf (optarg, "%d", &fill_column) != 1)
{
fprintf (stderr,
- _("%s: %s arg must be numeric, not `%s'.\n"),
+ _("%s: %s arg must be numeric, not `%s'.\n"),
"--fill-column", progname, optarg);
- usage (FATAL);
+ usage (1);
}
break;
- case 'F':
- force++; /* Do not remove erroneous output. */
- break;
-
- case 'h':
- usage (NO_ERROR);
+ case 'h': /* --help */
+ usage (0);
break;
case 'I':
@@ -1019,23 +546,21 @@ main (argc, argv)
include_files_path = (char *)
xrealloc (include_files_path,
2 + strlen (include_files_path) + strlen (optarg));
- strcat (include_files_path, ":");
+ strcat (include_files_path, PATH_SEP);
strcat (include_files_path, optarg);
break;
- case 'o':
- /* User specified output file. */
+ case 'o': /* --output */
command_output_filename = xstrdup (optarg);
break;
- case 'p':
- /* User specified paragraph indent (paragraph_start_index). */
+ case 'p': /* --paragraph-indent */
if (set_paragraph_indent (optarg) < 0)
{
fprintf (stderr,
- _("%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n"),
+ _("%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n"),
progname, optarg);
- usage (FATAL);
+ usage (1);
}
break;
@@ -1044,14 +569,14 @@ main (argc, argv)
if (!include_files_path)
{
include_files_path = xstrdup (optarg);
- include_files_path = (char *) xrealloc (include_files_path,
+ include_files_path = xrealloc (include_files_path,
strlen (include_files_path) + 3); /* 3 for ":.\0" */
- strcat (include_files_path, ":.");
+ strcat (strcat (include_files_path, PATH_SEP), ".");
}
else
{
char *tmp = xstrdup (include_files_path);
- include_files_path = (char *) xrealloc (include_files_path,
+ include_files_path = xrealloc (include_files_path,
strlen (include_files_path) + strlen (optarg) + 2); /* 2 for ":\0" */
strcpy (include_files_path, optarg);
strcat (include_files_path, ":");
@@ -1059,47 +584,59 @@ main (argc, argv)
free (tmp);
}
break;
-
- case 'r':
- /* User specified reference warning limit. */
+
+ case 'r': /* --reference-limit */
if (sscanf (optarg, "%d", &reference_warning_limit) != 1)
{
fprintf (stderr,
- _("%s: %s arg must be numeric, not `%s'.\n"),
+ _("%s: %s arg must be numeric, not `%s'.\n"),
"--reference-limit", progname, optarg);
- usage (FATAL);
+ usage (1);
}
break;
- case 's':
- /* User specified footnote style. */
+ case 's': /* --footnote-style */
if (set_footnote_style (optarg) < 0)
{
fprintf (stderr,
- _("%s: --footnote-style arg must be `separate' or `end', not `%s'.\n"),
+ _("%s: --footnote-style arg must be `separate' or `end', not `%s'.\n"),
progname, optarg);
- usage (FATAL);
+ usage (1);
}
footnote_style_preset = 1;
break;
- case 'V':
- /* User requested version info. */
+ case 'v':
+ verbose_mode++;
+ break;
+
+ case 'V': /* --version */
print_version_info ();
- printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
+ puts ("");
+ printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
- "1998");
- exit (NO_ERROR);
+ "1999");
+ exit (0);
+ break;
+
+ case 'w': /* --html */
+ html = 1;
+ process_html = 1;
+ process_info = 0;
+ splitting = 0; /* too complicated for now */
break;
case '?':
- usage (FATAL);
+ usage (1);
break;
}
}
+ if (!validating)
+ expensive_validation = 0;
+
if (optind == argc)
{
/* Check to see if input is a file. If so, process that. */
@@ -1108,19 +645,24 @@ For more information about these matters, see the files named COPYING.\n"),
else
{
fprintf (stderr, _("%s: missing file argument.\n"), progname);
- usage (FATAL);
+ usage (1);
}
}
- /* If the user has specified --no-headers, this should imply --no-split.
- Do that here. I think it might also imply that we should ignore the
- setfilename at the top of the file, but this might break some FSF things,
- so I will hold off on that. */
if (no_headers)
{
+ if (html && splitting)
+ { /* --no-headers --no-split --html indicates confusion. */
+ fprintf (stderr,
+ "%s: --no-headers conflicts with --no-split for --html.\n",
+ progname);
+ usage (1);
+ }
+
+ /* --no-headers implies --no-split. */
splitting = 0;
- /* If the user has not specified an output file, use stdout. */
+ /* If the user did not specify an output file, use stdout. */
if (!command_output_filename)
command_output_filename = xstrdup ("-");
}
@@ -1138,491 +680,11 @@ For more information about these matters, see the files named COPYING.\n"),
else
convert_from_stream (stdin, "stdin");
- if (errors_printed)
- return (SYNTAX);
- else
- return (NO_ERROR);
-}
-
-/* Display the version info of this invocation of Makeinfo. */
-void
-print_version_info ()
-{
- printf ("makeinfo (GNU %s %s) %d.%d\n", PACKAGE, VERSION,
- major_version, minor_version);
-}
-
-/* If EXIT_VALUE is zero, print the full usage message to stdout.
- Otherwise, just say to use --help for more info.
- Then exit with EXIT_VALUE. */
-void
-usage (exit_value)
- int exit_value;
-{
- if (exit_value != 0)
- fprintf (stderr, _("Try `%s --help' for more information.\n"), progname);
- else
- printf (_("Usage: %s [OPTION]... TEXINFO-FILE...\n\
-\n\
-Translate Texinfo source documentation to a format suitable for reading\n\
-with GNU Info.\n\
-\n\
-Options:\n\
--D VAR define a variable, as with @set.\n\
--E MACRO-OFILE process macros only, output texinfo source.\n\
--I DIR append DIR to the @include directory search path.\n\
--P DIR prepend DIR to the @include directory search path.\n\
--U VAR undefine a variable, as with @clear.\n\
---error-limit NUM quit after NUM errors (default %d).\n\
---fill-column NUM break lines at NUM characters (default %d).\n\
---footnote-style STYLE output footnotes according to STYLE:\n\
- `separate' to place footnotes in their own node,\n\
- `end' to place the footnotes at the end of\n\
- the node in which they are defined (the default).\n\
---force preserve output even if errors.\n\
---help display this help and exit.\n\
---no-validate suppress node cross-reference validation.\n\
---no-warn suppress warnings (but not errors).\n\
---no-split suppress splitting of large files.\n\
---no-headers suppress node separators and Node: Foo headers.\n\
---output FILE, -o FILE output to FILE, and ignore any @setfilename.\n\
---paragraph-indent VAL indent paragraphs with VAL spaces (default %d).\n\
- if VAL is `none', do not indent; if VAL is `asis',\n\
- preserve any existing indentation.\n\
---reference-limit NUM complain about at most NUM references (default %d).\n\
---verbose report about what is being done.\n\
---version display version information and exit.\n\
-\n\
-Email bug reports to bug-texinfo@gnu.org.\n\
-"),
- progname, max_error_level, fill_column,
- paragraph_start_indent, reference_warning_limit);
- exit (exit_value);
-}
-
-/* Manipulating Lists */
-
-typedef struct generic_list {
- struct generic_list *next;
-} GENERIC_LIST;
-
-/* Reverse the chain of structures in LIST. Output the new head
- of the chain. You should always assign the output value of this
- function to something, or you will lose the chain. */
-GENERIC_LIST *
-reverse_list (list)
- register GENERIC_LIST *list;
-{
- register GENERIC_LIST *next;
- register GENERIC_LIST *prev = (GENERIC_LIST *) NULL;
-
- while (list)
- {
- next = list->next;
- list->next = prev;
- prev = list;
- list = next;
- }
- return (prev);
-}
-
-/* Pushing and Popping Files */
-
-/* Find and load the file named FILENAME. Return a pointer to
- the loaded file, or NULL if it can't be loaded. */
-char *
-find_and_load (filename)
- char *filename;
-{
- struct stat fileinfo;
- long file_size;
- int file = -1, count = 0;
- char *fullpath, *result, *get_file_info_in_path ();
-
- result = fullpath = (char *)NULL;
-
- fullpath = get_file_info_in_path (filename, include_files_path, &fileinfo);
-
- if (!fullpath)
- goto error_exit;
-
- filename = fullpath;
- file_size = (long) fileinfo.st_size;
-
- file = open (filename, O_RDONLY);
- if (file < 0)
- goto error_exit;
-
- /* Load the file, with enough room for a newline and a null. */
- result = xmalloc (file_size + 2);
-
- /* VMS stat lies about the st_size value. The actual number of
- readable bytes is always less than this value. The arcane
- mysteries of VMS/RMS are too much to probe, so this hack
- suffices to make things work. */
-#if defined (VMS) || defined (WIN32)
-#ifdef VMS
- while ((n = read (file, result + count, file_size)) > 0)
-#else /* WIN32 */
- while ((n = read (file, result + count, 1)) > 0)
-#endif /* WIN32 */
- count += n;
- if (n == -1)
-#else /* !VMS && !WIN32 */
- count = file_size;
- if (read (file, result, file_size) != file_size)
-#endif /* !VMS && !WIN32 */
- error_exit:
- {
- if (result)
- free (result);
-
- if (fullpath)
- free (fullpath);
-
- if (file != -1)
- close (file);
-
- return ((char *) NULL);
- }
- close (file);
-
- /* Set the globals to the new file. */
- input_text = result;
- size_of_input_text = count;
- input_filename = fullpath;
- node_filename = xstrdup (fullpath);
- input_text_offset = 0;
- line_number = 1;
- /* Not strictly necessary. This magic prevents read_token () from doing
- extra unnecessary work each time it is called (that is a lot of times).
- SIZE_OF_INPUT_TEXT is one past the actual end of the text. */
- input_text[size_of_input_text] = '\n';
- /* This, on the other hand, is always necessary. */
- input_text[size_of_input_text+1] = 0;
- return (result);
-}
-
-/* Save the state of the current input file. */
-void
-pushfile ()
-{
- FSTACK *newstack = (FSTACK *) xmalloc (sizeof (FSTACK));
- newstack->filename = input_filename;
- newstack->text = input_text;
- newstack->size = size_of_input_text;
- newstack->offset = input_text_offset;
- newstack->line_number = line_number;
- newstack->next = filestack;
-
- filestack = newstack;
- push_node_filename ();
-}
-
-/* Make the current file globals be what is on top of the file stack. */
-void
-popfile ()
-{
- FSTACK *tos = filestack;
-
- if (!tos)
- abort (); /* My fault. I wonder what I did? */
-
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
- {
- maybe_write_itext (input_text, input_text_offset);
- forget_itext (input_text);
- }
-#endif /* HAVE_MACROS */
-
- /* Pop the stack. */
- filestack = filestack->next;
-
- /* Make sure that commands with braces have been satisfied. */
- if (!executing_string && !me_executing_string)
- discard_braces ();
-
- /* Get the top of the stack into the globals. */
- input_filename = tos->filename;
- input_text = tos->text;
- size_of_input_text = tos->size;
- input_text_offset = tos->offset;
- line_number = tos->line_number;
- free (tos);
-
- /* Go back to the (now) current node. */
- pop_node_filename ();
-}
-
-/* Flush all open files on the file stack. */
-void
-flush_file_stack ()
-{
- while (filestack)
- {
- char *fname = input_filename;
- char *text = input_text;
- popfile ();
- free (fname);
- free (text);
- }
-}
-
-int node_filename_stack_index = 0;
-int node_filename_stack_size = 0;
-char **node_filename_stack = (char **)NULL;
-
-void
-push_node_filename ()
-{
- if (node_filename_stack_index + 1 > node_filename_stack_size)
- node_filename_stack = (char **)xrealloc
- (node_filename_stack, (node_filename_stack_size += 10) * sizeof (char *));
-
- node_filename_stack[node_filename_stack_index] = node_filename;
- node_filename_stack_index++;
-}
-
-void
-pop_node_filename ()
-{
- node_filename = node_filename_stack[--node_filename_stack_index];
-}
-
-/* Return just the simple part of the filename; i.e. the
- filename without the path information, or extensions.
- This conses up a new string. */
-char *
-filename_part (filename)
- char *filename;
-{
- char *basename;
-
- basename = strrchr (filename, '/');
- if (!basename)
- basename = filename;
- else
- basename++;
-
- basename = xstrdup (basename);
-#if defined (REMOVE_OUTPUT_EXTENSIONS)
-
- /* See if there is an extension to remove. If so, remove it. */
- {
- char *temp;
-
- temp = strrchr (basename, '.');
- if (temp)
- *temp = 0;
- }
-#endif /* REMOVE_OUTPUT_EXTENSIONS */
- return (basename);
-}
-
-/* Return the pathname part of filename. This can be NULL. */
-char *
-pathname_part (filename)
- char *filename;
-{
- char *expand_filename ();
- char *result = (char *) NULL;
- register int i;
-
- filename = expand_filename (filename, "");
-
- i = strlen (filename) - 1;
-
- while (i && filename[i] != '/')
- i--;
- if (filename[i] == '/')
- i++;
-
- if (i)
- {
- result = (char *)xmalloc (1 + i);
- strncpy (result, filename, i);
- result[i] = 0;
- }
- free (filename);
- return (result);
-}
-
-char *
-filename_non_directory (name)
- char *name;
-{
- register int i;
-
- for (i = strlen (name) - 1; i; i--)
- if (name[i] == '/')
- return (xstrdup (name + i + 1));
-
- return (xstrdup (name));
+ return errors_printed ? 2 : 0;
}
-/* Return the expansion of FILENAME. */
-char *
-expand_filename (filename, input_name)
- char *filename, *input_name;
-{
- register int i;
- char *full_pathname ();
-
- if (filename)
- filename = full_pathname (filename);
- else
- {
- filename = filename_non_directory (input_name);
-
- if (!*filename)
- {
- free (filename);
- filename = xstrdup ("noname.texi");
- }
-
- for (i = strlen (filename) - 1; i; i--)
- if (filename[i] == '.')
- break;
-
- if (!i)
- i = strlen (filename);
-
- if (i + 6 > (strlen (filename)))
- filename = (char *)xrealloc (filename, i + 6);
- strcpy (filename + i, ".info");
- return (filename);
- }
-
- if (filename[0] == '.' || filename[0] == '/')
- return (filename);
-
- if (filename[0] != '/' && input_name[0] == '/')
- {
- /* Make it so that relative names work. */
- char *result;
-
- i = strlen (input_name) - 1;
-
- result = (char *)xmalloc (1 + strlen (input_name) + strlen (filename));
- strcpy (result, input_name);
-
- while (result[i] != '/' && i)
- i--;
-
- if (result[i] == '/')
- i++;
-
- strcpy (&result[i], filename);
- free (filename);
- return (result);
- }
- return (filename);
-}
-
-/* Return the full path to FILENAME. */
-char *
-full_pathname (filename)
- char *filename;
-{
- int initial_character;
- char *result;
-
- /* No filename given? */
- if (!filename || !(initial_character = *filename))
- return (xstrdup (""));
-
- /* Already absolute? */
- if ((initial_character == '/') ||
- ((strncmp (filename, "./", 2) == 0) ||
- (strncmp (filename, "../", 3) == 0)))
- return (xstrdup (filename));
-
- if (initial_character != '~')
- {
- char *localdir;
-
- localdir = (char *)xmalloc (1025);
-#if defined (HAVE_GETCWD)
- if (!getcwd (localdir, 1024))
-#else /* !HAVE_GETCWD */
- if (!getwd (localdir))
-#endif /* !HAVE_GETCWD */
- {
- fprintf (stderr, _("%s: getwd: %s, %s\n"),
- progname, filename, localdir);
- exit (1);
- }
-
- strcat (localdir, "/");
- strcat (localdir, filename);
- result = xstrdup (localdir);
- free (localdir);
- }
- else
- {
-#ifndef WIN32
- if (filename[1] == '/')
- {
- /* Return the concatenation of the environment variable HOME
- and the rest of the string. */
- char *temp_home;
-
- temp_home = (char *) getenv ("HOME");
- result = (char *)xmalloc (strlen (&filename[1])
- + 1
- + temp_home ? strlen (temp_home)
- : 0);
- *result = 0;
-
- if (temp_home)
- strcpy (result, temp_home);
-
- strcat (result, &filename[1]);
- }
- else
- {
- struct passwd *user_entry;
- int i, c;
- char *username = (char *)xmalloc (257);
-
- for (i = 1; (c = filename[i]); i++)
- {
- if (c == '/')
- break;
- else
- username[i - 1] = c;
- }
- if (c)
- username[i - 1] = 0;
-
- user_entry = getpwnam (username);
-
- if (!user_entry)
- return (xstrdup (filename));
-
- result = (char *)xmalloc (1 + strlen (user_entry->pw_dir)
- + strlen (&filename[i]));
- strcpy (result, user_entry->pw_dir);
- strcat (result, &filename[i]);
- }
- }
-#endif /* not WIN32 */
- return (result);
-}
-
-char *
-output_name_from_input_name (name)
- char *name;
-{
- return (expand_filename ((char *)NULL, name));
-}
-/* **************************************************************** */
-/* */
-/* Hacking Tokens and Strings */
-/* */
-/* **************************************************************** */
+/* Hacking tokens and strings. */
/* Return the next token as a string pointer. We cons the string. */
char *
@@ -1643,17 +705,17 @@ read_token ()
result = xstrdup (" ");
*result = character;
- return (result);
+ return result;
}
- for (i = 0; ((input_text_offset != size_of_input_text)
+ for (i = 0; ((input_text_offset != input_text_length)
&& (character = curchar ())
&& command_char (character));
i++, input_text_offset++);
- result = (char *)xmalloc (i + 1);
+ result = xmalloc (i + 1);
memcpy (result, &input_text[input_text_offset - i], i);
result[i] = 0;
- return (result);
+ return result;
}
/* Return nonzero if CHARACTER is self-delimiting. */
@@ -1663,7 +725,7 @@ self_delimiting (character)
{
/* @; and @\ are not Texinfo commands, but they are listed here
anyway. I don't know why. --karl, 10aug96. */
- return member (character, "~{|}`^\\@?=;:.-,*\'\" !\n\t");
+ return strchr ("~{|}`^\\@?=;:.-,*\'\" !\n\t", character) != NULL;
}
/* Clear whitespace from the front and end of string. */
@@ -1698,7 +760,7 @@ void
fix_whitespace (string)
char *string;
{
- char *temp = (char *)xmalloc (strlen (string) + 1);
+ char *temp = xmalloc (strlen (string) + 1);
int string_index = 0;
int temp_index = 0;
int c;
@@ -1731,7 +793,7 @@ discard_until (string)
{
int temp = search_forward (string, input_text_offset);
- int tt = (temp < 0) ? size_of_input_text : temp + strlen (string);
+ int tt = (temp < 0) ? input_text_length : temp + strlen (string);
int from = input_text_offset;
/* Find out what line we are on. */
@@ -1741,7 +803,7 @@ discard_until (string)
if (temp < 0)
{
- input_text_offset = size_of_input_text - strlen (string);
+ input_text_offset = input_text_length - strlen (string);
if (strcmp (string, "\n") != 0)
{
@@ -1769,7 +831,7 @@ get_until (match, string)
new_point = search_forward (match, input_text_offset);
if (new_point < 0)
- new_point = size_of_input_text;
+ new_point = input_text_length;
len = new_point - current_point;
/* Keep track of which line number we are at. */
@@ -1778,7 +840,7 @@ get_until (match, string)
if (input_text[x++] == '\n')
line_number++;
- *string = (char *)xmalloc (len + 1);
+ *string = xmalloc (len + 1);
memcpy (*string, &input_text[current_point], len);
(*string)[len] = 0;
@@ -1786,86 +848,144 @@ get_until (match, string)
/* Now leave input_text_offset in a consistent state. */
input_text_offset = tem;
- if (input_text_offset > size_of_input_text)
- input_text_offset = size_of_input_text;
+ if (input_text_offset > input_text_length)
+ input_text_offset = input_text_length;
+
+ return new_point;
+}
+
+/* Replace input_text[FROM .. TO] with its expansion. */
+void
+replace_with_expansion (from, to)
+ int from, *to;
+{
+ char *xp;
+ unsigned xp_len, new_len;
+ char *old_input = input_text;
+ unsigned raw_len = *to - from;
+ char *str;
+
+ /* The rest of the code here moves large buffers, so let's
+ not waste time if the input cannot possibly expand
+ into anything. Unfortunately, we cannot avoid expansion
+ when we see things like @code etc., even if they only
+ asked for expansion of macros, since any Texinfo command
+ can be potentially redefined with a macro. */
+ if (only_macro_expansion &&
+ memchr (input_text + from, COMMAND_PREFIX, raw_len) == 0)
+ return;
- return (new_point);
+ /* Get original string from input. */
+ str = xmalloc (raw_len + 1);
+ memcpy (str, input_text + from, raw_len);
+ str[raw_len] = 0;
+
+ /* We are going to relocate input_text, so we had better output
+ pending portion of input_text now, before the pointer changes. */
+ if (macro_expansion_output_stream && !executing_string
+ && !me_inhibit_expansion)
+ append_to_expansion_output (from);
+
+ /* Expand it. */
+ xp = expansion (str, 0);
+ xp_len = strlen (xp);
+ free (str);
+
+ /* Plunk the expansion into the middle of `input_text' --
+ which is terminated by a newline, not a null. Avoid
+ expensive move of the rest of the input if the expansion
+ has the same length as the original string. */
+ if (xp_len != raw_len)
+ {
+ new_len = from + xp_len + input_text_length - *to + 1;
+ if (executing_string)
+ { /* If we are in execute_string, we might need to update
+ the relevant element in the execution_strings[] array,
+ since it could have to be relocated from under our
+ feet. (input_text is reallocated here as well, if needed.) */
+ maybe_update_execution_strings (&input_text, new_len);
+ }
+ else if (new_len > input_text_length + 1)
+ /* Don't bother to realloc if we have enough space. */
+ input_text = xrealloc (input_text, new_len);
+
+ memmove (input_text + from + xp_len,
+ input_text + *to, input_text_length - *to + 1);
+
+ *to += xp_len - raw_len;
+ /* Since we change input_text_length here, the comparison above
+ isn't really valid, but it seems the worst that might happen is
+ an extra xrealloc or two, so let's not worry. */
+ input_text_length += xp_len - raw_len;
+ }
+ memcpy (input_text + from, xp, xp_len);
+ free (xp);
+
+ /* Synchronize the macro-expansion pointers with our new input_text. */
+ if (input_text != old_input)
+ forget_itext (old_input);
+ if (macro_expansion_output_stream && !executing_string)
+ remember_itext (input_text, from);
}
/* Read characters from the file until we are at MATCH or end of line.
- Place the characters read into STRING. */
+ Place the characters read into STRING. If EXPAND is nonzero,
+ expand the text before looking for MATCH for those cases where
+ MATCH might be produced by some macro. */
void
get_until_in_line (expand, match, string)
int expand;
char *match, **string;
{
- int real_bottom = size_of_input_text;
+ int real_bottom = input_text_length;
int limit = search_forward ("\n", input_text_offset);
if (limit < 0)
- limit = size_of_input_text;
+ limit = input_text_length;
- /* Replace input_text[input_text_offset .. limit-1] with its macro
- expansion (actually, we expand all commands). This allows the node
- names themselves to be constructed via a macro, as in:
+ /* Replace input_text[input_text_offset .. limit-1] with its expansion.
+ This allows the node names and menu entries themselves to be
+ constructed via a macro, as in:
@macro foo{p, q}
Together: \p\ & \q\.
@end macro
@node @foo{A,B}, next, prev, top
-
+
Otherwise, the `,' separating the macro args A and B is taken as
the node argument separator, so the node name is `@foo{A'. This
expansion is only necessary on the first call, since we expand the
- whole line then.
-
- Furthermore, if we're executing a string, don't do it -- we'll end
- up shrinking the execution string which is currently aliased to
- `input_text', so it might get moved, and not updated in the
- `execution_strings' array. This happens when processing the
- (synthetic) Overview-Footnotes node in the Texinfo manual. */
-
- if (expand && !executing_string && !me_executing_string)
+ whole line then. */
+ if (expand)
{
- char *xp;
- unsigned xp_len, new_len;
-
- /* Get original string from input. */
- unsigned raw_len = limit - input_text_offset;
- char *str = xmalloc (raw_len + 1);
- strncpy (str, input_text + input_text_offset, raw_len);
- str[raw_len] = 0;
-
- /* Expand it. */
- xp = expansion (str, 0);
- xp_len = strlen (xp);
- free (str);
-
- /* Plunk the expansion into the middle of `input_text' --
- which is terminated by a newline, not a null. */
- str = xmalloc (real_bottom - limit + 1);
- strncpy (str, input_text + limit, real_bottom - limit + 1);
- new_len = input_text_offset + xp_len + real_bottom - limit + 1;
- input_text = xrealloc (input_text, new_len);
- strcpy (input_text + input_text_offset, xp);
- strncpy (input_text + input_text_offset + xp_len, str,
- real_bottom - limit + 1);
- free (str);
- free (xp);
-
- limit += xp_len - raw_len;
- real_bottom += xp_len - raw_len;
+ replace_with_expansion (input_text_offset, &limit);
}
- size_of_input_text = limit;
+ real_bottom = input_text_length;
+ input_text_length = limit;
get_until (match, string);
- size_of_input_text = real_bottom;
+ input_text_length = real_bottom;
}
void
-get_rest_of_line (string)
+get_rest_of_line (expand, string)
+ int expand;
char **string;
{
- get_until ("\n", string);
+ if (expand)
+ {
+ char *tem;
+
+ /* Don't expand non-macros in input, since we want them
+ intact in the macro-expanded output. */
+ only_macro_expansion++;
+ get_until_in_line (1, "\n", &tem);
+ only_macro_expansion--;
+ *string = expansion (tem, 0);
+ free (tem);
+ }
+ else
+ get_until_in_line (0, "\n", string);
+
canon_white (*string);
if (curchar () == '\n') /* as opposed to the end of the file... */
@@ -1898,7 +1018,7 @@ get_until_in_braces (match, string)
int i, brace = 0;
int match_len = strlen (match);
- for (i = input_text_offset; i < size_of_input_text; i++)
+ for (i = input_text_offset; i < input_text_length; i++)
{
if (input_text[i] == '{')
brace++;
@@ -1913,27 +1033,27 @@ get_until_in_braces (match, string)
}
match_len = i - input_text_offset;
- temp = (char *)xmalloc (2 + match_len);
- strncpy (temp, input_text + input_text_offset, match_len);
+ temp = xmalloc (2 + match_len);
+ memcpy (temp, input_text + input_text_offset, match_len);
temp[match_len] = 0;
input_text_offset = i;
*string = temp;
}
-/* **************************************************************** */
-/* */
-/* Converting the File */
-/* */
-/* **************************************************************** */
+/* Converting a file. */
/* Convert the file named by NAME. The output is saved on the file
named as the argument to the @setfilename command. */
static char *suffixes[] = {
+ /* ".txi" is checked first so that on 8+3 DOS filesystems, if they
+ have "texinfo.txi" and "texinfo.tex" in the same directory, the
+ former is used rather than the latter, due to file name truncation. */
+ ".txi",
".texinfo",
".texi",
".txinfo",
"",
- (char *)NULL
+ NULL
};
void
@@ -1951,6 +1071,30 @@ initialize_conversion ()
output_position = 0;
}
+typedef struct generic_list {
+ struct generic_list *next;
+} GENERIC_LIST;
+
+/* Reverse the chain of structures in LIST. Output the new head
+ of the chain. You should always assign the output value of this
+ function to something, or you will lose the chain. */
+GENERIC_LIST *
+reverse_list (list)
+ GENERIC_LIST *list;
+{
+ GENERIC_LIST *next;
+ GENERIC_LIST *prev = NULL;
+
+ while (list)
+ {
+ next = list->next;
+ list->next = prev;
+ prev = list;
+ list = next;
+ }
+ return prev;
+}
+
/* We read in multiples of 4k, simply because it is a typical pipe size
on unix systems. */
#define READ_BUFFER_GROWTH (4 * 4096)
@@ -1962,7 +1106,7 @@ convert_from_stream (stream, name)
FILE *stream;
char *name;
{
- char *buffer = (char *)NULL;
+ char *buffer = NULL;
int buffer_offset = 0, buffer_size = 0;
initialize_conversion ();
@@ -1983,7 +1127,7 @@ convert_from_stream (stream, name)
if (count < 0)
{
perror (name);
- exit (FATAL);
+ xexit (1);
}
buffer_offset += count;
@@ -1993,7 +1137,7 @@ convert_from_stream (stream, name)
/* Set the globals to the new file. */
input_text = buffer;
- size_of_input_text = buffer_offset;
+ input_text_length = buffer_offset;
input_filename = xstrdup (name);
node_filename = xstrdup (name);
input_text_offset = 0;
@@ -2001,8 +1145,8 @@ convert_from_stream (stream, name)
/* Not strictly necessary. This magic prevents read_token () from doing
extra unnecessary work each time it is called (that is a lot of times).
- The SIZE_OF_INPUT_TEXT is one past the actual end of the text. */
- input_text[size_of_input_text] = '\n';
+ The INPUT_TEXT_LENGTH is one past the actual end of the text. */
+ input_text[input_text_length] = '\n';
convert_from_loaded_file (name);
}
@@ -2011,8 +1155,8 @@ void
convert_from_file (name)
char *name;
{
- register int i;
- char *filename = (char *)xmalloc (strlen (name) + 50);
+ int i;
+ char *filename = xmalloc (strlen (name) + 50);
initialize_conversion ();
@@ -2046,29 +1190,32 @@ convert_from_file (name)
convert_from_loaded_file (name);
}
-
+
void
convert_from_loaded_file (name)
char *name;
{
- char *expand_filename (), *filename_part ();
- char *real_output_filename = (char *)NULL;
+ char *real_output_filename = NULL;
-#if defined (HAVE_MACROS)
remember_itext (input_text, 0);
-#endif /* HAVE_MACROS */
+
+ input_text_offset = 0;
+
+ /* Avoid the `\input texinfo' line in HTML output (assuming it starts
+ the file). */
+ if (looking_at ("\\input"))
+ discard_until ("\n");
/* Search this file looking for the special string which starts conversion.
Once found, we may truly begin. */
- input_text_offset = 0;
while (input_text_offset >= 0)
{
input_text_offset =
search_forward (setfilename_search, input_text_offset);
- if ((input_text_offset == 0) ||
- ((input_text_offset > 0) &&
- (input_text[input_text_offset -1] == '\n')))
+ if (input_text_offset == 0
+ || (input_text_offset > 0
+ && input_text[input_text_offset -1] == '\n'))
break;
else if (input_text_offset > 0)
input_text_offset++;
@@ -2082,35 +1229,62 @@ convert_from_loaded_file (name)
error (_("No `%s' found in `%s'"), setfilename_search, name);
goto finished;
#else
- register int i, end_of_first_line;
-
- /* Find the end of the first line in the file. */
- for (i = 0; i < size_of_input_text - 1; i++)
- if (input_text[i] == '\n')
- break;
-
- end_of_first_line = i + 1;
-
- input_text_offset = 0;
-
- for (i = 0; i < end_of_first_line; i++)
- {
- if ((input_text[i] == '\\') &&
- (strncmp (input_text + i + 1, "include", 7) == 0))
- {
- input_text_offset = end_of_first_line;
- break;
- }
- }
command_output_filename = output_name_from_input_name (name);
#endif /* !REQUIRE_SETFILENAME */
}
+
+ {
+ int i, end_of_first_line;
+
+ /* Find the end of the first line in the file. */
+ for (i = 0; i < input_text_length - 1; i++)
+ if (input_text[i] == '\n')
+ break;
+
+ end_of_first_line = i + 1;
+
+ for (i = 0; i < end_of_first_line; i++)
+ {
+ if ((input_text[i] == '\\') &&
+ (strncmp (input_text + i + 1, "input", 5) == 0))
+ {
+ input_text_offset = i;
+ break;
+ }
+ }
+ }
}
else
input_text_offset += strlen (setfilename_search);
if (!command_output_filename)
- get_until ("\n", &output_filename);
+ {
+ get_until ("\n", &output_filename); /* read rest of line */
+ if (html)
+ { /* Change any extension to .html. */
+ char *html_name, *directory_part, *basename_part, *temp;
+
+ canon_white (output_filename);
+ directory_part = pathname_part (output_filename);
+ basename_part = filename_part (output_filename);
+
+ /* Zap any existing extension. */
+ temp = strrchr (basename_part, '.');
+ if (temp)
+ *temp = 0;
+
+ /* Construct new filename. */
+ html_name = xmalloc (strlen (directory_part)
+ + strlen (basename_part) + 6);
+ strcpy (html_name, directory_part);
+ strcat (html_name, basename_part);
+ strcat (html_name, ".html");
+
+ /* Replace name from @setfilename with the html name. */
+ free (output_filename);
+ output_filename = html_name;
+ }
+ }
else
{
if (input_text_offset != -1)
@@ -2119,7 +1293,7 @@ convert_from_loaded_file (name)
input_text_offset = 0;
real_output_filename = output_filename = command_output_filename;
- command_output_filename = (char *)NULL;
+ command_output_filename = NULL;
}
canon_white (output_filename);
@@ -2147,9 +1321,12 @@ convert_from_loaded_file (name)
output_stream = fopen (real_output_filename, "w");
}
- if (output_stream != stdout)
+ set_current_output_filename (real_output_filename);
+
+ if (verbose_mode)
printf (_("Making %s file `%s' from `%s'.\n"),
- no_headers ? "text" : "info", output_filename, input_filename);
+ no_headers ? "text" : (html ? "HTML" : "info"),
+ output_filename, input_filename);
if (output_stream == NULL)
{
@@ -2176,12 +1353,10 @@ convert_from_loaded_file (name)
line_number++;
}
- if (!no_headers)
- {
- add_word_args (_("This is Info file %s, produced by Makeinfo version %d.%d"),
- output_filename, major_version, minor_version);
- add_word_args (_(" from the input file %s.\n"), input_filename);
- }
+ /* html fixxme: should output this as trailer on first page. */
+ if (!no_headers && !html)
+ add_word_args (_("This is %s, produced by makeinfo version %s from %s.\n"),
+ output_filename, VERSION, input_filename);
close_paragraph ();
reader_loop ();
@@ -2191,13 +1366,13 @@ finished:
close_paragraph ();
flush_file_stack ();
-#if defined (HAVE_MACROS)
if (macro_expansion_output_stream)
{
fclose (macro_expansion_output_stream);
if (errors_printed && !force
&& strcmp (macro_expansion_filename, "-") != 0
- && strcmp (macro_expansion_filename, "/dev/null") != 0)
+ && FILENAME_CMP (macro_expansion_filename, NULL_DEVICE) != 0
+ && FILENAME_CMP (macro_expansion_filename, ALSO_NULL_DEVICE) != 0)
{
fprintf (stderr, _("%s: Removing macro output file `%s' due to errors; use --force to preserve.\n"),
progname, macro_expansion_filename);
@@ -2205,19 +1380,24 @@ finished:
perror (macro_expansion_filename);
}
}
-#endif /* HAVE_MACROS */
if (output_stream)
{
output_pending_notes ();
- free_pending_notes ();
- if (tag_table != NULL)
+ if (tag_table)
{
tag_table = (TAG_ENTRY *) reverse_list (tag_table);
- if (!no_headers)
+ if (!no_headers && !html)
write_tag_table ();
}
+ if (html)
+ {
+ start_paragraph ();
+ add_word ("</body></html>\n");
+ close_paragraph ();
+ }
+
if (output_stream != stdout)
fclose (output_stream);
@@ -2225,11 +1405,17 @@ finished:
if (validating)
validate_file (tag_table);
- if (splitting && (!errors_printed || force))
+ /* If we need to output the table of contents, do it now. */
+ if (contents_filename || shortcontents_filename)
+ toc_update ();
+
+ if (splitting && !html && (!errors_printed || force))
split_file (real_output_filename, 0);
- else if (errors_printed && !force
+ else if (errors_printed
+ && !force
&& strcmp (real_output_filename, "-") != 0
- && strcmp (real_output_filename, "/dev/null") != 0)
+ && FILENAME_CMP (real_output_filename, NULL_DEVICE) != 0
+ && FILENAME_CMP (real_output_filename, ALSO_NULL_DEVICE) != 0)
{ /* If there were errors, and no --force, remove the output. */
fprintf (stderr, _("%s: Removing output file `%s' due to errors; use --force to preserve.\n"),
progname, real_output_filename);
@@ -2247,7 +1433,7 @@ free_and_clear (pointer)
if (*pointer)
{
free (*pointer);
- *pointer = (char *) NULL;
+ *pointer = NULL;
}
}
@@ -2259,6 +1445,8 @@ init_internals ()
free_and_clear (&command);
free_and_clear (&input_filename);
free_node_references ();
+ free_node_node_references ();
+ toc_free ();
init_insertion_stack ();
init_brace_stack ();
current_node = NULL; /* sometimes already freed */
@@ -2267,171 +1455,140 @@ init_internals ()
in_detailmenu = 0;
top_node_seen = 0;
non_top_node_seen = 0;
+ node_number = -1;
}
void
init_paragraph ()
{
free_and_clear (&output_paragraph);
- output_paragraph = (unsigned char *)xmalloc (paragraph_buffer_len);
+ output_paragraph = xmalloc (paragraph_buffer_len);
output_paragraph[0] = 0;
output_paragraph_offset = 0;
output_column = 0;
paragraph_is_open = 0;
current_indent = 0;
+ meta_char_pos = 0;
}
+
+/* This is called from `reader_loop' when we are at the * beginning a
+ menu line. */
-/* Okay, we are ready to start the conversion. Call the reader on
- some text, and fill the text as it is output. Handle commands by
- remembering things like open braces and the current file position on a
- stack, and when the corresponding close brace is found, you can call
- the function with the proper arguments. */
-void
-reader_loop ()
+static void
+handle_menu_entry ()
{
- int character;
- int done = 0;
- int dash_count = 0;
+ char *tem;
+
+ /* Ugh, glean_node_from_menu wants to read the * itself. */
+ input_text_offset--;
+
+ /* Find node name in menu entry and save it in references list for
+ later validation. Use followed_reference type for detailmenu
+ references since we don't want to use them for default node pointers. */
+ tem = glean_node_from_menu (1, in_detailmenu
+ ? followed_reference : menu_reference);
- while (!done)
- {
- if (input_text_offset >= size_of_input_text)
- break;
+ if (html && tem)
+ { /* Start a menu item with the cleaned-up line. Put an anchor
+ around the start text (before `:' or the node name). */
+ char *string;
- character = curchar ();
+ discard_until ("* ");
- if (!in_fixed_width_font &&
- (character == '\'' || character == '`') &&
- input_text[input_text_offset + 1] == character)
- {
- input_text_offset++;
- character = '"';
- }
+ /* The line number was already incremented in reader_loop when we
+ saw the newline, and discard_until has now incremented again. */
+ line_number--;
- if (character == '-')
- {
- dash_count++;
- if (dash_count == 2 && !in_fixed_width_font)
- {
- input_text_offset++;
- continue;
- }
- }
- else
+ if (had_menu_commentary)
{
- dash_count = 0;
+ add_word ("<ul>\n");
+ had_menu_commentary = 0;
+ in_paragraph = 0;
}
-
- /* If this is a whitespace character, then check to see if the line
- is blank. If so, advance to the carriage return. */
- if (whitespace (character))
+ else if (!in_paragraph && !paragraph_is_open)
{
- register int i = input_text_offset + 1;
-
- while (i < size_of_input_text && whitespace (input_text[i]))
- i++;
-
- if (i == size_of_input_text || input_text[i] == '\n')
- {
- if (i == size_of_input_text)
- i--;
-
- input_text_offset = i;
- character = curchar ();
- }
+ add_word ("<p>\n");
+ in_paragraph = 1;
}
-
- if (character == '\n')
+
+ if (in_paragraph)
{
- line_number++;
-
- /* Check for a menu entry here, since the "escape sequence"
- that begins menu entries is "\n* ". */
- if (in_menu && input_text_offset + 1 < size_of_input_text)
- {
- char *glean_node_from_menu (), *tem;
-
- /* Note that the value of TEM is discarded, since it is
- gauranteed to be NULL when glean_node_from_menu () is
- called with a Nonzero argument. */
- if (!in_detailmenu)
- tem = glean_node_from_menu (1);
- }
+ add_word ("</p>");
+ in_paragraph = 0;
}
- switch (character)
- {
- case COMMAND_PREFIX:
- read_command ();
- break;
-
- case '{':
- /* Special case. I'm not supposed to see this character by itself.
- If I do, it means there is a syntax error in the input text.
- Report the error here, but remember this brace on the stack so
- you can ignore its partner. */
+ add_word ("<li><a href=\"");
+ string = expansion (tem, 0);
+ add_anchor_name (string, 1);
+ add_word ("\">");
+ free (string);
- line_error (_("Misplaced %c"), '{');
- remember_brace (misplaced_brace);
+ /* The menu item may use macros, so expand them now. */
+ only_macro_expansion++;
+ get_until_in_line (1, ":", &string);
+ only_macro_expansion--;
+ execute_string ("%s", string); /* get escaping done */
+ free (string);
- /* Don't advance input_text_offset since this happens in
- remember_brace ().
- input_text_offset++;
- */
- break;
+ add_word ("</a>");
- case '}':
- pop_and_call_brace ();
- input_text_offset++;
- break;
-
- default:
- add_char (character);
- input_text_offset++;
+ if (looking_at ("::"))
+ discard_until (":");
+ else
+ { /* discard the node name */
+ get_until_in_line (0, ".", &string);
+ free (string);
}
+ input_text_offset++; /* discard the second colon or the period */
+ add_word (": ");
+ }
+ else if (tem)
+ { /* For Info output, we can just use the input and the main case in
+ reader_loop where we output what comes in. Just move off the *
+ so the next time through reader_loop we don't end up back here. */
+ add_char ('*');
+ input_text_offset += 2; /* undo the pointer back-up above. */
}
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
- maybe_write_itext (input_text, input_text_offset);
-#endif /* HAVE_MACROS */
-}
-/* Find the command corresponding to STRING. If the command
- is found, return a pointer to the data structure. Otherwise
- return (-1). */
-COMMAND *
+ if (tem)
+ free (tem);
+}
+
+/* Find the command corresponding to STRING. If the command is found,
+ return a pointer to the data structure. Otherwise return -1. */
+static COMMAND *
get_command_entry (string)
char *string;
{
- register int i;
+ int i;
for (i = 0; command_table[i].name; i++)
if (strcmp (command_table[i].name, string) == 0)
- return (&command_table[i]);
+ return &command_table[i];
/* This command is not in our predefined command table. Perhaps
it is a user defined command. */
for (i = 0; i < user_command_array_len; i++)
if (user_command_array[i] &&
(strcmp (user_command_array[i]->name, string) == 0))
- return (user_command_array[i]);
+ return user_command_array[i];
/* We never heard of this command. */
- return ((COMMAND *) -1);
+ return (COMMAND *) -1;
}
-
+
/* input_text_offset is right at the command prefix character.
- Read the next token to determine what to do. */
-void
+ Read the next token to determine what to do. Return zero
+ if there's no known command or macro after the prefix character. */
+static int
read_command ()
{
COMMAND *entry;
+ int old_text_offset = input_text_offset++;
- input_text_offset++;
free_and_clear (&command);
command = read_token ();
-#if defined (HAVE_MACROS)
/* Check to see if this command is a macro. If so, execute it here. */
{
MACRO_DEF *def;
@@ -2450,41 +1607,227 @@ read_command ()
if (!(def->flags & ME_RECURSE))
def->inhibited = 0;
- return;
+ return 1;
}
}
-#endif /* HAVE_MACROS */
+
+ if (only_macro_expansion)
+ {
+ /* Back up to the place where we were called, so the
+ caller will have a chance to process this non-macro. */
+ input_text_offset = old_text_offset;
+ return 0;
+ }
+
+ /* Perform alias expansion */
+ command = alias_expand (command);
+
+ if (enclosure_command (command))
+ {
+ remember_brace (enclosure_expand);
+ enclosure_expand (START, output_paragraph_offset, 0);
+ return 0;
+ }
entry = get_command_entry (command);
if (entry == (COMMAND *)-1)
{
line_error (_("Unknown command `%s'"), command);
- return;
+ return 0;
}
- if (entry->argument_in_braces)
+ if (entry->argument_in_braces == BRACE_ARGS)
remember_brace (entry->proc);
+ else if (entry->argument_in_braces == MAYBE_BRACE_ARGS)
+ {
+ if (curchar () == '{')
+ remember_brace (entry->proc);
+ else
+ { /* No braces, so arg is next char. */
+ int ch;
+ int saved_offset = output_paragraph_offset;
+ (*(entry->proc)) (START, output_paragraph_offset, 0);
+
+ /* Possibilities left for the next character: @ (error), }
+ (error), whitespace (skip) anything else (normal char). */
+ skip_whitespace ();
+ ch = curchar ();
+ if (ch == '@')
+ {
+ line_error (_("Use braces to give a command as an argument to @%s"),
+ entry->name);
+ return 0;
+ }
+ else if (ch == '}')
+ {
+ /* Our caller will give the error message, because this }
+ won't match anything. */
+ return 0;
+ }
+ add_char (ch);
+ input_text_offset++;
+ (*(entry->proc)) (END, saved_offset, output_paragraph_offset);
+ return 1;
+ }
+ }
+
+ /* Get here if we have BRACE_ARGS, NO_BRACE_ARGS, or MAYBE_BRACE_ARGS
+ with braces. */
(*(entry->proc)) (START, output_paragraph_offset, 0);
+ return 1;
}
-/* Return the string which invokes PROC; a pointer to a function. */
-char *
-find_proc_name (proc)
- COMMAND_FUNCTION *proc;
+/* Okay, we are ready to start the conversion. Call the reader on
+ some text, and fill the text as it is output. Handle commands by
+ remembering things like open braces and the current file position on a
+ stack, and when the corresponding close brace is found, you can call
+ the function with the proper arguments. Although the filling isn't
+ necessary for HTML, it should do no harm. */
+void
+reader_loop ()
{
- register int i;
+ int character;
+ int done = 0;
+ int dash_count = 0;
- for (i = 0; command_table[i].name; i++)
- if (proc == command_table[i].proc)
- return command_table[i].name;
- return _("NO_NAME!");
-}
+ while (!done)
+ {
+ if (input_text_offset >= input_text_length)
+ break;
+
+ character = curchar ();
+
+ /* If only_macro_expansion, only handle macros and leave
+ everything else intact. */
+ if (!only_macro_expansion && !in_fixed_width_font
+ && (character == '\'' || character == '`')
+ && input_text[input_text_offset + 1] == character)
+ {
+ input_text_offset++;
+ character = '"'; /* html fixxme */
+ }
+
+ /* Convert --- to --. */
+ if (!only_macro_expansion && character == '-')
+ {
+ dash_count++;
+ if (dash_count == 2 && !in_fixed_width_font)
+ {
+ input_text_offset++;
+ continue;
+ }
+ }
+ else if (dash_count > 0)
+ dash_count = 0;
+
+ /* If this is a whitespace character, then check to see if the line
+ is blank. If so, advance to the carriage return. */
+ if (!only_macro_expansion && whitespace (character))
+ {
+ int i = input_text_offset + 1;
+
+ while (i < input_text_length && whitespace (input_text[i]))
+ i++;
+
+ if (i == input_text_length || input_text[i] == '\n')
+ {
+ if (i == input_text_length)
+ i--;
+
+ input_text_offset = i;
+ character = curchar ();
+ }
+ }
+
+ if (character == '\n')
+ line_number++;
+
+ switch (character)
+ {
+ case '*': /* perhaps we are at a menu */
+ /* We used to check for this in the \n case but an @c in a
+ menu swallows its newline, so check here instead. */
+ if (!only_macro_expansion && in_menu
+ && input_text_offset + 1 < input_text_length
+ && input_text[input_text_offset-1] == '\n')
+ handle_menu_entry ();
+ else
+ { /* Duplicate code from below, but not worth twisting the
+ fallthroughs to get down there. */
+ add_char (character);
+ input_text_offset++;
+ }
+ break;
+
+ /* Escapes for HTML unless we're outputting raw HTML. Do
+ this always, even if SGML rules don't require it since
+ that's easier and safer for non-conforming browsers. */
+ case '&':
+ if (html && escape_html)
+ add_word ("&amp;");
+ else
+ add_char (character);
+ input_text_offset++;
+ break;
+
+ case '<':
+ if (html && escape_html)
+ add_word ("&lt;");
+ else
+ add_char (character);
+ input_text_offset++;
+ break;
+
+ case '>':
+ if (html && escape_html)
+ add_word ("&gt;");
+ else
+ add_char (character);
+ input_text_offset++;
+ break;
+ case COMMAND_PREFIX: /* @ */
+ if (read_command () || !only_macro_expansion)
+ break;
+
+ /* FALLTHROUGH (usually) */
+ case '{':
+ /* Special case. We're not supposed to see this character by itself.
+ If we do, it means there is a syntax error in the input text.
+ Report the error here, but remember this brace on the stack so
+ we can ignore its partner. */
+ if (!only_macro_expansion)
+ {
+ line_error (_("Misplaced %c"), '{');
+ remember_brace (misplaced_brace);
+ /* remember_brace advances input_text_offset. */
+ break;
+ }
+
+ /* FALLTHROUGH (usually) */
+ case '}':
+ if (!only_macro_expansion)
+ {
+ pop_and_call_brace ();
+ input_text_offset++;
+ break;
+ }
+
+ /* FALLTHROUGH (usually) */
+ default:
+ add_char (character);
+ input_text_offset++;
+ }
+ }
+ if (macro_expansion_output_stream && !only_macro_expansion)
+ maybe_write_itext (input_text, input_text_offset);
+}
+
void
init_brace_stack ()
{
- brace_stack = (BRACE_ELEMENT *) NULL;
+ brace_stack = NULL;
}
void
@@ -2505,9 +1848,10 @@ remember_brace_1 (proc, position)
COMMAND_FUNCTION *proc;
int position;
{
- BRACE_ELEMENT *new = (BRACE_ELEMENT *) xmalloc (sizeof (BRACE_ELEMENT));
+ BRACE_ELEMENT *new = xmalloc (sizeof (BRACE_ELEMENT));
new->next = brace_stack;
new->proc = proc;
+ new->command = xstrdup (command);
new->pos = position;
new->line = line_number;
new->in_fixed_width_font = in_fixed_width_font;
@@ -2519,24 +1863,29 @@ remember_brace_1 (proc, position)
void
pop_and_call_brace ()
{
- BRACE_ELEMENT *temp;
- COMMAND_FUNCTION *proc;
- int pos;
-
- if (brace_stack == (BRACE_ELEMENT *) NULL)
+ if (brace_stack == NULL)
{
line_error (_("Unmatched }"));
return;
}
- pos = brace_stack->pos;
- proc = brace_stack->proc;
- in_fixed_width_font = brace_stack->in_fixed_width_font;
- temp = brace_stack->next;
- free (brace_stack);
- brace_stack = temp;
+ {
+ BRACE_ELEMENT *temp;
+
+ int pos = brace_stack->pos;
+ COMMAND_FUNCTION *proc = brace_stack->proc;
+ in_fixed_width_font = brace_stack->in_fixed_width_font;
+
+ /* Reset current command, so the proc can know who it is. This is
+ used in cm_accent. */
+ command = brace_stack->command;
- (*proc) (END, pos, output_paragraph_offset);
+ temp = brace_stack->next;
+ free (brace_stack);
+ brace_stack = temp;
+
+ (*proc) (END, pos, output_paragraph_offset);
+ }
}
/* Shift all of the markers in `brace_stack' by AMOUNT. */
@@ -2544,7 +1893,7 @@ void
adjust_braces_following (here, amount)
int here, amount;
{
- register BRACE_ELEMENT *stack = brace_stack;
+ BRACE_ELEMENT *stack = brace_stack;
while (stack)
{
@@ -2554,6 +1903,21 @@ adjust_braces_following (here, amount)
}
}
+/* Return the string which invokes PROC; a pointer to a function.
+ Always returns the first function in the command table if more than
+ one matches PROC. */
+static char *
+find_proc_name (proc)
+ COMMAND_FUNCTION *proc;
+{
+ int i;
+
+ for (i = 0; command_table[i].name; i++)
+ if (proc == command_table[i].proc)
+ return command_table[i].name;
+ return _("NO_NAME!");
+}
+
/* You call discard_braces () when you shouldn't have any braces on the stack.
I used to think that this happens for commands that don't take arguments
in braces, but that was wrong because of things like @code{foo @@}. So now
@@ -2618,9 +1982,9 @@ get_char_len (character)
else
len = 1;
}
- return (len);
+ return len;
}
-
+
void
#if defined (VA_FPRINTF) && __STDC__
add_word_args (char *format, ...)
@@ -2630,7 +1994,7 @@ add_word_args (format, va_alist)
va_dcl
#endif
{
- char buffer[1000];
+ char buffer[2000]; /* xx no fixed limits */
#ifdef VA_FPRINTF
va_list ap;
#endif
@@ -2639,7 +2003,7 @@ add_word_args (format, va_alist)
#ifdef VA_SPRINTF
VA_SPRINTF (buffer, format, ap);
#else
- sprintf (temp_string, format, a1, a2, a3, a4, a5, a6, a7, a8);
+ sprintf (buffer, format, a1, a2, a3, a4, a5, a6, a7, a8);
#endif /* not VA_SPRINTF */
va_end (ap);
add_word (buffer);
@@ -2654,24 +2018,6 @@ add_word (string)
add_char (*string++);
}
-/* Nonzero if the last character inserted has the syntax class of NEWLINE. */
-int last_char_was_newline = 1;
-
-/* The actual last inserted character. Note that this may be something
- other than NEWLINE even if last_char_was_newline is 1. */
-int last_inserted_character = 0;
-
-/* Nonzero means that a newline character has already been
- inserted, so close_paragraph () should insert one less. */
-int line_already_broken = 0;
-
-/* When nonzero we have finished an insertion (see `end_insertion') and we
- want to ignore false continued paragraph closings. */
-int insertion_paragraph_closed = 0;
-
-/* Nonzero means attempt to make all of the lines have fill_column width. */
-int do_justification = 0;
-
/* Add the character to the current paragraph. If filling_enabled is
nonzero, then do filling as well. */
void
@@ -2679,8 +2025,10 @@ add_char (character)
int character;
{
/* If we are avoiding outputting headers, and we are currently
- in a menu, then simply return. */
- if (no_headers && (in_menu || in_detailmenu))
+ in a menu, then simply return. But if we're only expanding macros,
+ then we're being called from glean_node_from_menu to try to
+ remember a menu reference, and we need that so we can do defaulting. */
+ if (no_headers && !only_macro_expansion && (in_menu || in_detailmenu))
return;
/* If we are adding a character now, then we don't have to
@@ -2696,15 +2044,23 @@ add_char (character)
}
}
- if (non_splitting_words && member (character, " \t\n"))
- character = ' ' | 0x80;
+ if (non_splitting_words && strchr (" \t\n", character))
+ {
+ if (html)
+ { /* Seems cleaner to use &nbsp; than an 8-bit char. */
+ add_word ("&nbsp");
+ character = ';';
+ }
+ else
+ character = META (' '); /* unmeta-d in flush_output */
+ }
insertion_paragraph_closed = 0;
switch (character)
{
case '\n':
- if (!filling_enabled)
+ if (!filling_enabled && ! (html && (in_menu || in_detailmenu)))
{
insert ('\n');
@@ -2721,30 +2077,33 @@ add_char (character)
indent (output_column = current_indent);
break;
}
- else /* CHARACTER is newline, and filling is enabled. */
+ else if (end_of_sentence_p ())
+ /* CHARACTER is newline, and filling is enabled. */
{
- if (end_of_sentence_p ())
- {
- insert (' ');
- output_column++;
- last_inserted_character = character;
- }
+ insert (' ');
+ output_column++;
+ last_inserted_character = character;
}
if (last_char_was_newline)
{
+ if (html)
+ last_char_was_newline++;
close_paragraph ();
pending_indent = 0;
}
else
{
last_char_was_newline = 1;
- insert (' ');
+ if (html)
+ insert ('\n');
+ else
+ insert (' ');
output_column++;
}
break;
- default:
+ default: /* not at newline */
{
int len = get_char_len (character);
int suppress_insert = 0;
@@ -2761,18 +2120,29 @@ add_char (character)
if (!paragraph_is_open)
{
start_paragraph ();
-
- /* If the paragraph is supposed to be indented a certain way,
- then discard all of the pending whitespace. Otherwise, we
- let the whitespace stay. */
+ /* If the paragraph is supposed to be indented a certain
+ way, then discard all of the pending whitespace.
+ Otherwise, we let the whitespace stay. */
if (!paragraph_start_indent)
indent (pending_indent);
pending_indent = 0;
+
+ /* This horrible kludge of checking for a < prevents <p>
+ from being inserted when we already have html markup
+ starting a paragraph, as with <ul> and <h1> and the like. */
+ if (html && escape_html && character != '<'
+ && (!in_fixed_width_font || in_menu || in_detailmenu))
+ {
+ insert_string ("<p>");
+ in_paragraph = 1;
+ adjust_braces_following (0, 3); /* adjust for <p> */
+ }
}
- if ((output_column += len) > fill_column)
+ output_column += len;
+ if (output_column > fill_column)
{
- if (filling_enabled)
+ if (filling_enabled && !html)
{
int temp = output_paragraph_offset;
while (--temp > 0 && output_paragraph[temp] != '\n')
@@ -2785,7 +2155,15 @@ add_char (character)
while (temp && whitespace (output_paragraph[temp - 1]))
temp--;
- output_paragraph[temp++] = '\n';
+ /* If we went back all the way to the newline of the
+ preceding line, it probably means that the word we
+ are adding is itself wider than the space that the
+ indentation and the fill_column let us use. In
+ that case, do NOT insert another newline, since it
+ won't help. Just indent to current_indent and
+ leave it alone, since that's the most we can do. */
+ if (temp && output_paragraph[temp - 1] != '\n')
+ output_paragraph[temp++] = '\n';
/* We have correctly broken the line where we want
to. What we don't want is spaces following where
@@ -2817,11 +2195,11 @@ add_char (character)
}
/* Filled, but now indent if that is right. */
- if (indented_fill && current_indent)
+ if (indented_fill && current_indent > 0)
{
int buffer_len = ((output_paragraph_offset - temp)
+ current_indent);
- char *temp_buffer = (char *)xmalloc (buffer_len);
+ char *temp_buffer = xmalloc (buffer_len);
int indentation = 0;
/* We have to shift any markers that are in
@@ -2832,7 +2210,7 @@ add_char (character)
indentation != current_indent)
temp_buffer[indentation++] = ' ';
- strncpy ((char *) &temp_buffer[current_indent],
+ memcpy ((char *) &temp_buffer[current_indent],
(char *) &output_paragraph[temp],
buffer_len - current_indent);
@@ -2844,7 +2222,7 @@ add_char (character)
(paragraph_buffer_len += buffer_len));
output_paragraph = tt;
}
- strncpy ((char *) &output_paragraph[temp],
+ memcpy ((char *) &output_paragraph[temp],
temp_buffer, buffer_len);
output_paragraph_offset += current_indent;
free (temp_buffer);
@@ -2871,11 +2249,27 @@ add_char (character)
}
}
+/* Add a character and store its position in meta_char_pos. */
+void
+add_meta_char (character)
+ int character;
+{
+ meta_char_pos = output_paragraph_offset;
+ add_char (character);
+}
+
/* Insert CHARACTER into `output_paragraph'. */
void
insert (character)
int character;
{
+ /* This is sad, but it seems desirable to not force any particular
+ order on the front matter commands. This way, the document can do
+ @settitle, @documentlanguage, etc, in any order and with any
+ omissions, and we'll still output the html <head> `just in time'. */
+ if (!executing_string && html && !html_output_head_p)
+ html_output_head ();
+
output_paragraph[output_paragraph_offset++] = character;
if (output_paragraph_offset == paragraph_buffer_len)
{
@@ -2895,7 +2289,7 @@ insert_string (string)
/* Sentences might have these characters after the period (or whatever). */
-#define post_sentence(c) ((c) == ')' || (c) == '\'' || (c) == '"' \
+#define POST_SENTENCE(c) ((c) == ')' || (c) == '\'' || (c) == '"' \
|| (c) == ']')
/* Return true if at an end-of-sentence character, possibly followed by
@@ -2904,9 +2298,19 @@ static int
end_of_sentence_p ()
{
int loc = output_paragraph_offset - 1;
- while (loc > 0 && post_sentence (output_paragraph[loc]))
+
+ /* If nothing has been output, don't check output_paragraph[-1]. */
+ if (loc < 0)
+ return 0;
+
+ /* A post-sentence character that is at meta_char_pos is not really
+ a post-sentence character; it was produced by a markup such as
+ @samp. We don't want the period inside @samp to be treated as a
+ sentence ender. */
+ while (loc > 0
+ && loc != meta_char_pos && POST_SENTENCE (output_paragraph[loc]))
loc--;
- return sentence_ender (output_paragraph[loc]);
+ return loc != meta_char_pos && sentence_ender (output_paragraph[loc]);
}
@@ -2959,16 +2363,19 @@ uninhibit_output_flushing ()
void
flush_output ()
{
- register int i;
+ int i;
if (!output_paragraph_offset || flushing_ignored)
return;
for (i = 0; i < output_paragraph_offset; i++)
{
- /* If we turned on the 8th bit for a space
- inside @w, turn it back off for output. */
- if (output_paragraph[i] & meta_character_bit)
+ /* If we turned on the 8th bit for a space inside @w, turn it
+ back off for output. This might be problematic, since the
+ 0x80 character may be used in 8-bit character sets. Sigh.
+ In any case, don't do this for HTML, since the nbsp character
+ is valid input and must be passed along to the browser. */
+ if (!html && (output_paragraph[i] & meta_character_bit))
{
int temp = UNMETA (output_paragraph[i]);
if (temp == ' ')
@@ -2980,6 +2387,7 @@ flush_output ()
output_position += output_paragraph_offset;
output_paragraph_offset = 0;
+ meta_char_pos = 0;
}
/* How to close a paragraph controlling the number of lines between
@@ -2990,6 +2398,16 @@ flush_output ()
1 creates a single blank line between paragraphs. */
int paragraph_spacing = DEFAULT_PARAGRAPH_SPACING;
+static void
+close_paragraph_with_lines (lines)
+ int lines;
+{
+ int old_spacing = paragraph_spacing;
+ paragraph_spacing = lines;
+ close_paragraph ();
+ paragraph_spacing = old_spacing;
+}
+
/* Close the current paragraph, leaving no blank lines between them. */
void
close_single_paragraph ()
@@ -3033,28 +2451,18 @@ close_insertion_paragraph ()
insertion_paragraph_closed = 1;
}
-void
-close_paragraph_with_lines (lines)
- int lines;
-{
- int old_spacing = paragraph_spacing;
- paragraph_spacing = lines;
- close_paragraph ();
- paragraph_spacing = old_spacing;
-}
-
/* Close the currently open paragraph. */
void
close_paragraph ()
{
- register int i;
+ int i;
/* The insertion paragraph is no longer closed. */
insertion_paragraph_closed = 0;
if (paragraph_is_open && !must_start_paragraph)
{
- register int tindex, c;
+ int tindex, c;
tindex = output_paragraph_offset;
@@ -3083,7 +2491,13 @@ close_paragraph ()
if (!force_flush_right)
{
for (i = 0; i < (paragraph_spacing - line_already_broken); i++)
- insert ('\n');
+ {
+ insert ('\n');
+ /* Don't need anything extra for HTML in usual case of no
+ extra paragraph spacing. */
+ if (html && i > 0)
+ insert_string ("<br>");
+ }
}
/* If we are doing flush right indentation, then do it now
@@ -3096,6 +2510,7 @@ close_paragraph ()
no_indent = 0;
output_column = 0;
}
+
ignore_blank_line ();
}
@@ -3122,7 +2537,7 @@ do_flush_right_indentation ()
if (output_paragraph_offset < fill_column)
{
- register int i;
+ int i;
if (fill_column >= paragraph_buffer_len)
output_paragraph =
@@ -3130,7 +2545,7 @@ do_flush_right_indentation ()
(paragraph_buffer_len += fill_column));
temp_len = strlen ((char *)output_paragraph);
- temp = (char *)xmalloc (temp_len + 1);
+ temp = xmalloc (temp_len + 1);
memcpy (temp, (char *)output_paragraph, temp_len);
for (i = 0; i < fill_column - output_paragraph_offset; i++)
@@ -3139,6 +2554,7 @@ do_flush_right_indentation ()
memcpy ((char *)output_paragraph + i, temp, temp_len);
free (temp);
output_paragraph_offset = fill_column;
+ adjust_braces_following (0, i);
}
}
}
@@ -3195,16 +2611,12 @@ void
indent (amount)
int amount;
{
- register BRACE_ELEMENT *elt = brace_stack;
+ if (html)
+ return;
/* For every START_POS saved within the brace stack which will be affected
by this indentation, bump that start pos forward. */
- while (elt)
- {
- if (elt->pos >= output_paragraph_offset)
- elt->pos += amount;
- elt = elt->next;
- }
+ adjust_braces_following (output_paragraph_offset, amount);
while (--amount >= 0)
insert (' ');
@@ -3219,2492 +2631,62 @@ search_forward (string, from)
{
int len = strlen (string);
- while (from < size_of_input_text)
+ while (from < input_text_length)
{
if (strncmp (input_text + from, string, len) == 0)
- return (from);
+ return from;
from++;
}
- return (-1);
-}
-
-/* Whoops, Unix doesn't have strcasecmp. */
-
-/* Case independent string compare. */
-#if !defined (HAVE_STRCASECMP)
-int
-strcasecmp (string1, string2)
- char *string1, *string2;
-{
- char ch1, ch2;
-
- for (;;)
- {
- ch1 = *string1++;
- ch2 = *string2++;
-
- if (!(ch1 | ch2))
- return (0);
-
- ch1 = coerce_to_upper (ch1);
- ch2 = coerce_to_upper (ch2);
-
- if (ch1 != ch2)
- return (ch1 - ch2);
- }
-}
-#endif /* !HAVE_STRCASECMP */
-
-void
-init_insertion_stack ()
-{
- insertion_stack = (INSERTION_ELT *) NULL;
-}
-
-/* Return the type of the current insertion. */
-enum insertion_type
-current_insertion_type ()
-{
- if (!insertion_level)
- return (bad_type);
- else
- return (insertion_stack->insertion);
-}
-
-/* Return a pointer to the string which is the function to wrap around
- items. */
-char *
-current_item_function ()
-{
- register int level, done;
- register INSERTION_ELT *elt;
-
- level = insertion_level;
- elt = insertion_stack;
- done = 0;
-
- /* Skip down through the stack until we find a non-conditional insertion. */
- while (!done && (elt != NULL))
- {
- switch (elt->insertion)
- {
- case ifinfo:
- case ifnothtml:
- case ifnottex:
- case ifset:
- case ifclear:
- case cartouche:
- elt = elt->next;
- level--;
- break;
-
- default:
- done = 1;
- }
- }
-
- if (!level)
- return ((char *) NULL);
- else
- return (elt->item_function);
-}
-
-char *
-get_item_function ()
-{
- char *item_function;
- get_rest_of_line (&item_function);
- backup_input_pointer ();
- return (item_function);
-}
-
- /* Push the state of the current insertion on the stack. */
-void
-push_insertion (type, item_function)
- enum insertion_type type;
- char *item_function;
-{
- INSERTION_ELT *new = (INSERTION_ELT *) xmalloc (sizeof (INSERTION_ELT));
-
- new->item_function = item_function;
- new->filling_enabled = filling_enabled;
- new->indented_fill = indented_fill;
- new->insertion = type;
- new->line_number = line_number;
- new->filename = xstrdup (input_filename);
- new->inhibited = inhibit_paragraph_indentation;
- new->in_fixed_width_font = in_fixed_width_font;
- new->next = insertion_stack;
- insertion_stack = new;
- insertion_level++;
-}
-
- /* Pop the value on top of the insertion stack into the
- global variables. */
-void
-pop_insertion ()
-{
- INSERTION_ELT *temp = insertion_stack;
-
- if (temp == (INSERTION_ELT *) NULL)
- return;
-
- in_fixed_width_font = temp->in_fixed_width_font;
- inhibit_paragraph_indentation = temp->inhibited;
- filling_enabled = temp->filling_enabled;
- indented_fill = temp->indented_fill;
- free_and_clear (&(temp->item_function));
- free_and_clear (&(temp->filename));
- insertion_stack = insertion_stack->next;
- free (temp);
- insertion_level--;
-}
-
- /* Return a pointer to the print name of this
- enumerated type. */
-char *
-insertion_type_pname (type)
- enum insertion_type type;
-{
- if ((int) type < (int) bad_type)
- return (insertion_type_names[(int) type]);
- else
- return (_("Broken-Type in insertion_type_pname"));
-}
-
-/* Return the insertion_type associated with NAME.
- If the type is not one of the known ones, return BAD_TYPE. */
-enum insertion_type
-find_type_from_name (name)
- char *name;
-{
- int index = 0;
- while (index < (int) bad_type)
- {
- if (strcmp (name, insertion_type_names[index]) == 0)
- return (enum insertion_type) index;
- index++;
- }
- return (bad_type);
-}
-
-int
-defun_insertion (type)
- enum insertion_type type;
-{
- return
- ((type == deffn)
- || (type == defun)
- || (type == defmac)
- || (type == defspec)
- || (type == defvr)
- || (type == defvar)
- || (type == defopt)
- || (type == deftypefn)
- || (type == deftypefun)
- || (type == deftypevr)
- || (type == deftypevar)
- || (type == defcv)
- || (type == defivar)
- || (type == defop)
- || (type == defmethod)
- || (type == deftypemethod)
- || (type == deftp));
-}
-
-/* MAX_NS is the maximum nesting level for enumerations. I picked 100
- which seemed reasonable. This doesn't control the number of items,
- just the number of nested lists. */
-#define max_stack_depth 100
-#define ENUM_DIGITS 1
-#define ENUM_ALPHA 2
-typedef struct {
- int enumtype;
- int enumval;
-} DIGIT_ALPHA;
-
-DIGIT_ALPHA enumstack[max_stack_depth];
-int enumstack_offset = 0;
-int current_enumval = 1;
-int current_enumtype = ENUM_DIGITS;
-char *enumeration_arg = (char *)NULL;
-
-void
-start_enumerating (at, type)
- int at, type;
-{
- if ((enumstack_offset + 1) == max_stack_depth)
- {
- line_error (_("Enumeration stack overflow"));
- return;
- }
- enumstack[enumstack_offset].enumtype = current_enumtype;
- enumstack[enumstack_offset].enumval = current_enumval;
- enumstack_offset++;
- current_enumval = at;
- current_enumtype = type;
-}
-
-void
-stop_enumerating ()
-{
- --enumstack_offset;
- if (enumstack_offset < 0)
- enumstack_offset = 0;
-
- current_enumval = enumstack[enumstack_offset].enumval;
- current_enumtype = enumstack[enumstack_offset].enumtype;
-}
-
-/* Place a letter or digits into the output stream. */
-void
-enumerate_item ()
-{
- char temp[10];
-
- if (current_enumtype == ENUM_ALPHA)
- {
- if (current_enumval == ('z' + 1) || current_enumval == ('Z' + 1))
- {
- current_enumval = ((current_enumval - 1) == 'z' ? 'a' : 'A');
- warning (_("lettering overflow, restarting at %c"), current_enumval);
- }
- sprintf (temp, "%c. ", current_enumval);
- }
- else
- sprintf (temp, "%d. ", current_enumval);
-
- indent (output_column += (current_indent - strlen (temp)));
- add_word (temp);
- current_enumval++;
-}
-
-/* This is where the work for all the "insertion" style
- commands is done. A huge switch statement handles the
- various setups, and generic code is on both sides. */
-void
-begin_insertion (type)
- enum insertion_type type;
-{
- int no_discard = 0;
-
- if (defun_insertion (type))
- {
- push_insertion (type, xstrdup (""));
- no_discard++;
- }
- else
- push_insertion (type, get_item_function ());
-
- switch (type)
- {
- case menu:
- if (!no_headers)
- close_paragraph ();
-
- filling_enabled = no_indent = 0;
- inhibit_paragraph_indentation = 1;
-
- if (!no_headers)
- add_word (_("* Menu:\n"));
-
- in_menu++;
- no_discard++;
- break;
-
- case detailmenu:
- if (!in_menu)
- {
- if (!no_headers)
- close_paragraph ();
-
- filling_enabled = no_indent = 0;
- inhibit_paragraph_indentation = 1;
-
- no_discard++;
- }
-
- in_detailmenu++;
- break;
-
- case direntry:
- close_single_paragraph ();
- filling_enabled = no_indent = 0;
- inhibit_paragraph_indentation = 1;
- insert_string ("START-INFO-DIR-ENTRY\n");
- break;
-
- /* I think @quotation is meant to do filling.
- If you don't want filling, then use @display. */
- case quotation:
- close_single_paragraph ();
- last_char_was_newline = no_indent = 0;
- indented_fill = filling_enabled = 1;
- inhibit_paragraph_indentation = 1;
- current_indent += default_indentation_increment;
- break;
-
- case display:
- case example:
- case smallexample:
- case lisp:
- case smalllisp:
- /* Just like @example, but no indentation. */
- case format:
- close_single_paragraph ();
- inhibit_paragraph_indentation = 1;
- in_fixed_width_font++;
- filling_enabled = 0;
- last_char_was_newline = 0;
- if (type != format)
- current_indent += default_indentation_increment;
- break;
-
- case multitable:
- do_multitable ();
- break;
-
- case table:
- case ftable:
- case vtable:
- case itemize:
- close_single_paragraph ();
- current_indent += default_indentation_increment;
- filling_enabled = indented_fill = 1;
-#if defined (INDENT_PARAGRAPHS_IN_TABLE)
- inhibit_paragraph_indentation = 0;
-#else
- inhibit_paragraph_indentation = 1;
-#endif /* !INDENT_PARAGRAPHS_IN_TABLE */
-
- /* Make things work for losers who forget the itemize syntax. */
- if (allow_lax_format && (type == itemize))
- {
- if (!(*insertion_stack->item_function))
- {
- free (insertion_stack->item_function);
- insertion_stack->item_function = xstrdup ("@bullet");
- insertion_stack->item_function[0] = COMMAND_PREFIX;
- }
- }
-
- if (!*insertion_stack->item_function)
- {
- line_error (_("%s requires an argument: the formatter for %citem"),
- insertion_type_pname (type), COMMAND_PREFIX);
- }
- break;
-
- case enumerate:
- close_single_paragraph ();
- no_indent = 0;
-#if defined (INDENT_PARAGRAPHS_IN_TABLE)
- inhibit_paragraph_indentation = 0;
-#else
- inhibit_paragraph_indentation = 1;
-#endif /* !INDENT_PARAGRAPHS_IN_TABLE */
-
- current_indent += default_indentation_increment;
- filling_enabled = indented_fill = 1;
-
- if (isdigit (*enumeration_arg))
- start_enumerating (atoi (enumeration_arg), ENUM_DIGITS);
- else
- start_enumerating (*enumeration_arg, ENUM_ALPHA);
- break;
-
- /* Does nothing special in makeinfo. */
- case group:
- /* Only close the paragraph if we are not inside of an @example. */
- if (!insertion_stack->next ||
- insertion_stack->next->insertion != example)
- close_single_paragraph ();
- break;
-
- /* Insertions that are no-ops in info, but do something in TeX. */
- case ifinfo:
- case ifnothtml:
- case ifnottex:
- case ifset:
- case ifclear:
- case cartouche:
- if (in_menu)
- no_discard++;
- break;
-
- case deffn:
- case defun:
- case defmac:
- case defspec:
- case defvr:
- case defvar:
- case defopt:
- case deftypefn:
- case deftypefun:
- case deftypevr:
- case deftypevar:
- case defcv:
- case defivar:
- case defop:
- case defmethod:
- case deftypemethod:
- case deftp:
- inhibit_paragraph_indentation = 1;
- filling_enabled = indented_fill = 1;
- current_indent += default_indentation_increment;
- no_indent = 0;
- break;
-
- case flushleft:
- close_single_paragraph ();
- inhibit_paragraph_indentation = 1;
- filling_enabled = indented_fill = no_indent = 0;
- break;
-
- case flushright:
- close_single_paragraph ();
- filling_enabled = indented_fill = no_indent = 0;
- inhibit_paragraph_indentation = 1;
- force_flush_right++;
- break;
- }
-
- if (!no_discard)
- discard_until ("\n");
-}
-
-/* Try to end the insertion with the specified TYPE. With a value of
- `bad_type', TYPE gets translated to match the value currently on top
- of the stack. Otherwise, if TYPE doesn't match the top of the
- insertion stack, give error. */
-void
-end_insertion (type)
- enum insertion_type type;
-{
- enum insertion_type temp_type;
-
- if (!insertion_level)
- return;
-
- temp_type = current_insertion_type ();
-
- if (type == bad_type)
- type = temp_type;
-
- if (type != temp_type)
- {
- line_error
- (_("`%cend' expected `%s', but saw `%s'"), COMMAND_PREFIX,
- insertion_type_pname (temp_type), insertion_type_pname (type));
- return;
- }
-
- pop_insertion ();
-
- switch (type)
- {
- /* Insertions which have no effect on paragraph formatting. */
- case ifnothtml:
- case ifnottex:
- case ifinfo:
- case ifset:
- case ifclear:
- break;
-
- case direntry:
- insert_string ("END-INFO-DIR-ENTRY\n\n");
- close_insertion_paragraph ();
- break;
-
- case detailmenu:
- in_detailmenu--; /* No longer hacking menus. */
- if (!in_menu)
- {
- if (!no_headers)
- close_insertion_paragraph ();
- }
- break;
-
- case menu:
- in_menu--; /* No longer hacking menus. */
- if (!no_headers)
- close_insertion_paragraph ();
- break;
-
- case multitable:
- end_multitable ();
- break;
-
- case enumerate:
- stop_enumerating ();
- close_insertion_paragraph ();
- current_indent -= default_indentation_increment;
- break;
-
- case flushleft:
- case group:
- case cartouche:
- close_insertion_paragraph ();
- break;
-
- case format:
- case display:
- case example:
- case smallexample:
- case lisp:
- case smalllisp:
- case quotation:
- /* @format is the only fixed_width insertion without a change
- in indentation. */
- if (type != format)
- current_indent -= default_indentation_increment;
-
- /* The ending of one of these insertions always marks the
- start of a new paragraph. */
- close_insertion_paragraph ();
- break;
-
- case table:
- case ftable:
- case vtable:
- case itemize:
- current_indent -= default_indentation_increment;
- break;
-
- case flushright:
- force_flush_right--;
- close_insertion_paragraph ();
- break;
-
- /* Handle the @defun style insertions with a default clause. */
- default:
- current_indent -= default_indentation_increment;
- close_insertion_paragraph ();
- break;
- }
-}
-
-/* Insertions cannot cross certain boundaries, such as node beginnings. In
- code that creates such boundaries, you should call `discard_insertions'
- before doing anything else. It prints the errors for you, and cleans up
- the insertion stack. With nonzero SPECIALS_OK, allows unmatched
- ifinfo, ifset, ifclear, otherwise not. */
-void
-discard_insertions (specials_ok)
- int specials_ok;
-{
- int real_line_number = line_number;
- while (insertion_stack)
- {
- if (specials_ok && (insertion_stack->insertion == ifinfo
- || insertion_stack->insertion == ifset
- || insertion_stack->insertion == ifclear))
- break;
- else
- {
- char *offender = insertion_type_pname (insertion_stack->insertion);
- char *current_filename = input_filename;
-
- input_filename = insertion_stack->filename;
- line_number = insertion_stack->line_number;
- line_error (_("No matching `%cend %s'"), COMMAND_PREFIX, offender);
- input_filename = current_filename;
- pop_insertion ();
- }
- }
- line_number = real_line_number;
+ return -1;
}
-/* The Texinfo commands. */
-
-/* Commands which insert their own names. */
-void
-insert_self (arg)
- int arg;
-{
- if (arg == START)
- add_word (command);
-}
-
-void
-insert_space (arg)
- int arg;
-{
- if (arg == START)
- add_char (' ');
-}
-
-/* Force a line break in the output. */
-void
-cm_asterisk ()
-{
- close_single_paragraph ();
- cm_noindent ();
-}
-
-/* Insert ellipsis. */
-void
-cm_dots (arg)
- int arg;
-{
- if (arg == START)
- add_word ("...");
-}
-
-/* Insert ellipsis for sentence end. */
-void
-cm_enddots (arg)
- int arg;
-{
- if (arg == START)
- add_word ("....");
-}
-
-void
-cm_bullet (arg)
- int arg;
-{
- if (arg == START)
- add_char ('*');
-}
-
-void
-cm_minus (arg)
- int arg;
-{
- if (arg == START)
- add_char ('-');
-}
-
-/* Insert "TeX". */
-void
-cm_TeX (arg)
- int arg;
-{
- if (arg == START)
- add_word ("TeX");
-}
-
-/* Copyright symbol. */
-void
-cm_copyright (arg)
- int arg;
-{
- if (arg == START)
- add_word ("(C)");
-}
-
-/* Accent commands that take explicit arguments. */
-void
-cm_accent (arg)
- int arg;
-{
- if (arg == START)
- {
- if (strcmp (command, "dotaccent") == 0) /* overdot */
- add_char ('.');
- else if (strcmp (command, "H") == 0) /* Hungarian umlaut */
- add_word ("''");
- else if (strcmp (command, "ringaccent") == 0)
- add_char ('*');
- else if (strcmp (command, "tieaccent") == 0)
- add_char ('[');
- else if (strcmp (command, "u") == 0) /* breve */
- add_char ('(');
- else if (strcmp (command, "v") == 0) /* hacek/check */
- add_char ('<');
- }
- else if (arg == END)
- {
- if (strcmp (command, "ubaraccent") == 0) /* underbar */
- add_char ('_');
- else if (strcmp (command, "udotaccent") == 0) /* underdot */
- add_word ("-.");
- else if (strcmp (command, ",") == 0) /* cedilla */
- add_word (",");
- }
-}
-
-/* Non-English letters/characters that don't insert themselves. */
-void
-cm_special_char (arg)
-{
- if (arg == START)
- {
- if ((*command == 'L' || *command == 'l'
- || *command == 'O' || *command == 'o')
- && command[1] == 0)
- {
- /* Lslash lslash Oslash oslash */
- add_char (*command);
- add_char ('/');
- }
- else if (strcmp (command, "exclamdown") == 0)
- add_char ('!');
- else if (strcmp (command, "pounds") == 0)
- add_char ('#');
- else if (strcmp (command, "questiondown") == 0)
- add_char ('?');
- else
- fprintf (stderr, _("How did @%s end up in cm_special_char?\n"), command);
- }
-}
-
-/* Dotless i or j. */
-void
-cm_dotless (arg, start, end)
- int arg, start, end;
-{
- if (arg == END)
- {
- if (output_paragraph[start] != 'i' && output_paragraph[start] != 'j')
- /* This error message isn't perfect if the argument is multiple
- characters, but it doesn't seem worth getting right. */
- line_error (_("%c%s expects `i' or `j' as argument, not `%c'"),
- COMMAND_PREFIX, command, output_paragraph[start]);
-
- else if (end - start != 1)
- line_error (_("%c%s expects a single character `i' or `j' as argument"),
- COMMAND_PREFIX, command);
-
- /* We've already inserted the `i' or `j', so nothing to do. */
- }
-}
-
-void
-cm_today (arg)
- int arg;
-{
- static char *months [12] =
- { N_("January"), N_("February"), N_("March"), N_("April"), N_("May"),
- N_("June"), N_("July"), N_("August"), N_("September"), N_("October"),
- N_("November"), N_("December") };
- if (arg == START)
- {
- time_t timer = time (0);
- struct tm *ts = localtime (&timer);
- add_word_args ("%d %s %d", ts->tm_mday, _(months[ts->tm_mon]),
- ts->tm_year + 1900);
- }
-}
-
-void
-cm_code (arg)
- int arg;
-{
- extern int printing_index;
-
- if (arg == START)
- {
- in_fixed_width_font++;
-
- if (!printing_index)
- add_char ('`');
- }
- else
- {
- if (!printing_index)
- add_char ('\'');
- }
-}
-
-void
-cm_kbd (arg)
- int arg;
-{
- /* People use @kbd in an example to get the "user input" font.
- We don't want quotes in that case. */
- if (!in_fixed_width_font)
- cm_code (arg);
-}
-
-void
-cm_key (arg)
- int arg;
-{
- add_char (arg == START ? '<' : '>');
-}
-
-/* Convert the character at position into a true control character. */
-void
-cm_ctrl (arg, start, end)
- int arg, start, end;
-{
- /* Should we allow multiple character arguments? I think yes. */
- if (arg == END)
- {
- register int i, character;
-#if defined (NO_MULTIPLE_CTRL)
- if ((end - start) != 1)
- line_error (_("%c%s expects a single character as an argument"),
- COMMAND_PREFIX, command);
- else
-#endif
- for (i = start; i < end; i++)
- {
- character = output_paragraph[i];
-
- if (isletter (character))
- output_paragraph[i] = CTL (coerce_to_upper (character));
- }
- }
-}
-
-/* Handle a command that switches to a non-fixed-width font. */
-void
-not_fixed_width (arg)
- int arg;
-{
- if (arg == START)
- in_fixed_width_font = 0;
-}
-
-/* Small caps and @var in makeinfo just uppercase the text. */
-void
-cm_var_sc (arg, start_pos, end_pos)
- int arg, start_pos, end_pos;
-{
- not_fixed_width (arg);
-
- if (arg == END)
- {
- while (start_pos < end_pos)
- {
- output_paragraph[start_pos] =
- coerce_to_upper (output_paragraph[start_pos]);
- start_pos++;
- }
- }
-}
-
-void
-cm_dfn (arg, position)
- int arg, position;
-{
- add_char ('"');
-}
-
-void
-cm_emph (arg)
- int arg;
-{
- add_char ('*');
-}
-
-void
-cm_strong (arg, position)
- int arg, position;
-{
- cm_emph (arg);
-}
-
-void
-cm_cite (arg, position)
- int arg, position;
-{
- if (arg == START)
- add_word ("`");
- else
- add_word ("'");
-}
-
-/* No highlighting, but argument switches fonts. */
-void
-cm_not_fixed_width (arg, start, end)
- int arg, start, end;
-{
- not_fixed_width (arg);
-}
-
-/* Various commands are no-op's. */
-void
-cm_no_op ()
-{
-}
-
-/* No-op that eats its argument on same line. */
-void
-cm_no_op_line_arg ()
-{
- char *temp;
- get_rest_of_line (&temp);
- free (temp);
-}
-
-/* Prevent the argument from being split across two lines. */
-void
-cm_w (arg, start, end)
- int arg, start, end;
-{
- if (arg == START)
- non_splitting_words++;
- else
- non_splitting_words--;
-}
-
-
-/* Explain that this command is obsolete, thus the user shouldn't
- do anything with it. */
-void
-cm_obsolete (arg, start, end)
- int arg, start, end;
-{
- if (arg == START)
- warning (_("%c%s is obsolete"), COMMAND_PREFIX, command);
-}
-
-/* Insert the text following input_text_offset up to the end of the line
- in a new, separate paragraph. Directly underneath it, insert a
- line of WITH_CHAR, the same length of the inserted text. */
-void
-insert_and_underscore (with_char)
- int with_char;
-{
- register int i, len;
- int old_no_indent, starting_pos, ending_pos;
- char *temp;
-
- close_paragraph ();
- filling_enabled = indented_fill = 0;
- old_no_indent = no_indent;
- no_indent = 1;
-
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- append_to_expansion_output (input_text_offset + 1);
-#endif /* HAVE_MACROS */
-
- get_rest_of_line (&temp);
-
- starting_pos = output_position + output_paragraph_offset;
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- {
- char *temp1 = (char *) xmalloc (2 + strlen (temp));
- sprintf (temp1, "%s\n", temp);
- remember_itext (input_text, input_text_offset);
- me_execute_string (temp1);
- free (temp1);
- }
- else
-#endif /* HAVE_MACROS */
- execute_string ("%s\n", temp);
-
- ending_pos = output_position + output_paragraph_offset;
- free (temp);
-
- len = (ending_pos - starting_pos) - 1;
- for (i = 0; i < len; i++)
- add_char (with_char);
- insert ('\n');
- close_paragraph ();
- filling_enabled = 1;
- no_indent = old_no_indent;
-}
-
-/* Here is a structure which associates sectioning commands with
- an integer, hopefully to reflect the `depth' of the current
- section. */
-struct {
- char *name;
- int level;
-} section_alist[] = {
- { "unnumberedsubsubsec", 5 },
- { "unnumberedsubsec", 4 },
- { "unnumberedsec", 3 },
- { "unnumbered", 2 },
- { "appendixsubsubsec", 5 },
- { "appendixsubsec", 4 },
- { "appendixsec", 3 },
- { "appendixsection", 3 },
- { "appendix", 2 },
- { "subsubsec", 5 },
- { "subsubsection", 5 },
- { "subsection", 4 },
- { "section", 3 },
- { "chapter", 2 },
- { "top", 1 },
-
- { (char *)NULL, 0 }
-};
-
-/* Amount to offset the name of sectioning commands to levels by. */
-int section_alist_offset = 0;
-
-/* Shift the meaning of @section to @chapter. */
-void
-cm_raisesections ()
-{
- discard_until ("\n");
- section_alist_offset--;
-}
-
-/* Shift the meaning of @chapter to @section. */
-void
-cm_lowersections ()
-{
- discard_until ("\n");
- section_alist_offset++;
-}
-
-/* Return an integer which identifies the type section present in TEXT. */
-int
-what_section (text)
- char *text;
-{
- register int i, j;
- char *t;
-
- find_section_command:
- for (j = 0; text[j] && cr_or_whitespace (text[j]); j++);
- if (text[j] != COMMAND_PREFIX)
- return (-1);
-
- text = text + j + 1;
-
- /* We skip @c, @comment, and @?index commands. */
- if ((strncmp (text, "comment", strlen ("comment")) == 0) ||
- (text[0] == 'c' && cr_or_whitespace (text[1])) ||
- (strcmp (text + 1, "index") == 0))
- {
- while (*text++ != '\n');
- goto find_section_command;
- }
-
- /* Handle italicized sectioning commands. */
- if (*text == 'i')
- text++;
-
- for (j = 0; text[j] && !cr_or_whitespace (text[j]); j++);
-
- for (i = 0; (t = section_alist[i].name); i++)
- {
- if (j == strlen (t) && strncmp (t, text, j) == 0)
- {
- int return_val;
-
- return_val = (section_alist[i].level + section_alist_offset);
-
- if (return_val < 0)
- return_val = 0;
- else if (return_val > 5)
- return_val = 5;
- return (return_val);
- }
- }
- return (-1);
-}
-
-/* Set the level of @top to LEVEL. Return the old level of @top. */
-int
-set_top_section_level (level)
- int level;
-{
- register int i, result = -1;
-
- for (i = 0; section_alist[i].name; i++)
- if (strcmp (section_alist[i].name, "top") == 0)
- {
- result = section_alist[i].level;
- section_alist[i].level = level;
- break;
- }
- return (result);
-}
-
-/* Treat this just like @unnumbered. The only difference is
- in node defaulting. */
-void
-cm_top ()
-{
- /* It is an error to have more than one @top. */
- if (top_node_seen)
- {
- TAG_ENTRY *tag = tag_table;
-
- line_error (_("Node with %ctop as a section already exists"),
- COMMAND_PREFIX);
-
- while (tag != (TAG_ENTRY *)NULL)
- {
- if ((tag->flags & IS_TOP))
- {
- int old_line_number = line_number;
- char *old_input_filename = input_filename;
-
- line_number = tag->line_no;
- input_filename = tag->filename;
- line_error (_("Here is the %ctop node"), COMMAND_PREFIX);
- input_filename = old_input_filename;
- line_number = old_line_number;
- return;
- }
- tag = tag->next_ent;
- }
- }
- else
- {
- top_node_seen = 1;
-
- /* It is an error to use @top before you have used @node. */
- if (!tag_table)
- {
- char *top_name;
-
- get_rest_of_line (&top_name);
- free (top_name);
- line_error (_("%ctop used before %cnode, defaulting to %s"),
- COMMAND_PREFIX, COMMAND_PREFIX, top_name);
- execute_string ("@node Top, , (dir), (dir)\n@top %s\n", top_name);
- return;
- }
-
- cm_unnumbered ();
-
- /* The most recently defined node is the top node. */
- tag_table->flags |= IS_TOP;
-
- /* Now set the logical hierarchical level of the Top node. */
- {
- int orig_offset = input_text_offset;
-
- input_text_offset = search_forward (node_search_string, orig_offset);
-
- if (input_text_offset > 0)
- {
- int this_section;
-
- /* We have encountered a non-top node, so mark that one exists. */
- non_top_node_seen = 1;
-
- /* Move to the end of this line, and find out what the
- sectioning command is here. */
- while (input_text[input_text_offset] != '\n')
- input_text_offset++;
-
- if (input_text_offset < size_of_input_text)
- input_text_offset++;
-
- this_section = what_section (input_text + input_text_offset);
-
- /* If we found a sectioning command, then give the top section
- a level of this section - 1. */
- if (this_section != -1)
- set_top_section_level (this_section - 1);
- }
- input_text_offset = orig_offset;
- }
- }
-}
-
-/* Organized by level commands. That is, "*" == chapter, "=" == section. */
-char *scoring_characters = "*=-.";
-
-void
-sectioning_underscore (command)
- char *command;
-{
- char character;
- char *temp;
- int level;
-
- temp = (char *)xmalloc (2 + strlen (command));
- temp[0] = COMMAND_PREFIX;
- strcpy (&temp[1], command);
- level = what_section (temp);
- free (temp);
- level -= 2;
-
- if (level < 0)
- level = 0;
-
- character = scoring_characters[level];
-
- insert_and_underscore (character);
-}
-
-/* The command still works, but prints a warning message in addition. */
-void
-cm_ideprecated (arg, start, end)
- int arg, start, end;
-{
- warning (_("%c%s is obsolete; use %c%s instead"),
- COMMAND_PREFIX, command, COMMAND_PREFIX, command + 1);
- sectioning_underscore (command + 1);
-}
-
-/* The remainder of the text on this line is a chapter heading. */
-void
-cm_chapter ()
-{
- sectioning_underscore ("chapter");
-}
-
-/* The remainder of the text on this line is a section heading. */
-void
-cm_section ()
-{
- sectioning_underscore ("section");
-}
-
-/* The remainder of the text on this line is a subsection heading. */
-void
-cm_subsection ()
-{
- sectioning_underscore ("subsection");
-}
-
-/* The remainder of the text on this line is a subsubsection heading. */
-void
-cm_subsubsection ()
-{
- sectioning_underscore ("subsubsection");
-}
-
-/* The remainder of the text on this line is an unnumbered heading. */
-void
-cm_unnumbered ()
-{
- cm_chapter ();
-}
-
-/* The remainder of the text on this line is an unnumbered section heading. */
-void
-cm_unnumberedsec ()
-{
- cm_section ();
-}
-
-/* The remainder of the text on this line is an unnumbered
- subsection heading. */
-void
-cm_unnumberedsubsec ()
-{
- cm_subsection ();
-}
-
-/* The remainder of the text on this line is an unnumbered
- subsubsection heading. */
-void
-cm_unnumberedsubsubsec ()
-{
- cm_subsubsection ();
-}
-
-/* The remainder of the text on this line is an appendix heading. */
-void
-cm_appendix ()
-{
- cm_chapter ();
-}
-
-/* The remainder of the text on this line is an appendix section heading. */
-void
-cm_appendixsec ()
-{
- cm_section ();
-}
-
-/* The remainder of the text on this line is an appendix subsection heading. */
-void
-cm_appendixsubsec ()
-{
- cm_subsection ();
-}
-
-/* The remainder of the text on this line is an appendix
- subsubsection heading. */
-void
-cm_appendixsubsubsec ()
-{
- cm_subsubsection ();
-}
-
-/* Compatibility functions substitute for chapter, section, etc. */
-void
-cm_majorheading ()
-{
- cm_chapheading ();
-}
-
-void
-cm_chapheading ()
-{
- cm_chapter ();
-}
-
-void
-cm_heading ()
-{
- cm_section ();
-}
-
-void
-cm_subheading ()
-{
- cm_subsection ();
-}
-
-void
-cm_subsubheading ()
-{
- cm_subsubsection ();
-}
-
-/* **************************************************************** */
-/* */
-/* Adding nodes, and making tags */
-/* */
-/* **************************************************************** */
-
-/* Start a new tag table. */
-void
-init_tag_table ()
-{
- while (tag_table != (TAG_ENTRY *) NULL)
- {
- TAG_ENTRY *temp = tag_table;
- free (temp->node);
- free (temp->prev);
- free (temp->next);
- free (temp->up);
- tag_table = tag_table->next_ent;
- free (temp);
- }
-}
-
-void
-write_tag_table ()
-{
- write_tag_table_internal (0); /* Not indirect. */
-}
-
-void
-write_tag_table_indirect ()
-{
- write_tag_table_internal (1);
-}
-
-/* Write out the contents of the existing tag table.
- INDIRECT_P says how to format the output. */
-void
-write_tag_table_internal (indirect_p)
- int indirect_p;
-{
- TAG_ENTRY *node = tag_table;
- int old_indent = no_indent;
-
- no_indent = 1;
- filling_enabled = 0;
- must_start_paragraph = 0;
- close_paragraph ();
-
- if (!indirect_p)
- {
- no_indent = 1;
- insert ('\n');
- }
-
- add_word_args ("\037\nTag Table:\n%s", indirect_p ? "(Indirect)\n" : "");
-
- while (node != (TAG_ENTRY *) NULL)
- {
- execute_string ("Node: %s", node->node);
- add_word_args ("\177%d\n", node->position);
- node = node->next_ent;
- }
-
- add_word ("\037\nEnd Tag Table\n");
- flush_output ();
- no_indent = old_indent;
-}
+/* Cross references. */
+/* Return next comma-delimited argument, but do not cross a close-brace
+ boundary. Clean up whitespace, too. If EXPAND is nonzero, replace
+ the entire brace-delimited argument list with its expansion before
+ looking for the next comma. */
char *
-get_node_token (expand)
- int expand;
+get_xref_token (expand)
+ int expand;
{
char *string;
- get_until_in_line (expand, ",", &string);
-
- if (curchar () == ',')
- input_text_offset++;
-
- canon_white (string);
-
- /* Force all versions of "top" to be "Top". */
- normalize_node_name (string);
-
- return (string);
-}
-
-/* Convert "top" and friends into "Top". */
-void
-normalize_node_name (string)
- char *string;
-{
- if (strcasecmp (string, "Top") == 0)
- strcpy (string, "Top");
-}
-
-/* Look up NAME in the tag table, and return the associated
- tag_entry. If the node is not in the table return NULL. */
-TAG_ENTRY *
-find_node (name)
- char *name;
-{
- TAG_ENTRY *tag = tag_table;
-
- while (tag != (TAG_ENTRY *) NULL)
- {
- if (strcmp (tag->node, name) == 0)
- return (tag);
- tag = tag->next_ent;
- }
- return ((TAG_ENTRY *) NULL);
-}
-
-/* Remember NODE and associates. */
-void
-remember_node (node, prev, next, up, position, line_no, no_warn)
- char *node, *prev, *next, *up;
- int position, line_no, no_warn;
-{
- /* Check for existence of this tag already. */
- if (validating)
- {
- register TAG_ENTRY *tag = find_node (node);
- if (tag)
- {
- line_error (
- _("Node `%s' multiply defined (line %d is first definition at)"),
- node, tag->line_no);
- return;
- }
- }
-
- /* First, make this the current node. */
- current_node = node;
-
- /* Now add it to the list. */
- {
- TAG_ENTRY *new = (TAG_ENTRY *) xmalloc (sizeof (TAG_ENTRY));
- new->node = node;
- new->prev = prev;
- new->next = next;
- new->up = up;
- new->position = position;
- new->line_no = line_no;
- new->filename = node_filename;
- new->touched = 0; /* not yet referenced. */
- new->flags = 0;
- if (no_warn)
- new->flags |= NO_WARN;
- new->next_ent = tag_table;
- tag_table = new;
- }
-}
-
-/* The order is: nodename, nextnode, prevnode, upnode.
- If all of the NEXT, PREV, and UP fields are empty, they are defaulted.
- You must follow a node command which has those fields defaulted
- with a sectioning command (e.g. @chapter) giving the "level" of that node.
- It is an error not to do so.
- The defaults come from the menu in this node's parent. */
-void
-cm_node ()
-{
- char *node, *prev, *next, *up;
- int new_node_pos, defaulting, this_section, no_warn = 0;
- extern int already_outputting_pending_notes;
-
- if (strcmp (command, "nwnode") == 0)
- no_warn = 1;
-
- /* Get rid of unmatched brace arguments from previous commands. */
- discard_braces ();
-
- /* There also might be insertions left lying around that haven't been
- ended yet. Do that also. */
- discard_insertions (1);
-
- if (!already_outputting_pending_notes)
- {
- close_paragraph ();
- output_pending_notes ();
- free_pending_notes ();
- }
-
- filling_enabled = indented_fill = 0;
- new_node_pos = output_position;
- current_footnote_number = 1;
-
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- append_to_expansion_output (input_text_offset + 1);
-#endif /* HAVE_MACROS */
-
- node = get_node_token (1);
- next = get_node_token (0);
- prev = get_node_token (0);
- up = get_node_token (0);
-
- if (verbose_mode)
- printf (_("Formatting node %s...\n"), node);
-
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- remember_itext (input_text, input_text_offset);
-#endif /* HAVE_MACROS */
-
- no_indent = 1;
- if (!no_headers)
- {
- add_word_args ("\037\nFile: %s, Node: ", pretty_output_filename);
-
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- me_execute_string (node);
- else
-#endif /* HAVE_MACROS */
- execute_string ("%s", node);
- filling_enabled = indented_fill = 0;
- }
-
- /* Check for defaulting of this node's next, prev, and up fields. */
- defaulting = (*next == 0 && *prev == 0 && *up == 0);
-
- this_section = what_section (input_text + input_text_offset);
-
- /* If we are defaulting, then look at the immediately following
- sectioning command (error if none) to determine the node's
- level. Find the node that contains the menu mentioning this node
- that is one level up (error if not found). That node is the "Up"
- of this node. Default the "Next" and "Prev" from the menu. */
- if (defaulting)
- {
- NODE_REF *last_ref = (NODE_REF *)NULL;
- NODE_REF *ref = node_references;
-
- if ((this_section < 0) && (strcmp (node, "Top") != 0))
- {
- char *polite_section_name = "top";
- int i;
-
- for (i = 0; section_alist[i].name; i++)
- if (section_alist[i].level == current_section + 1)
- {
- polite_section_name = section_alist[i].name;
- break;
- }
-
- line_error
- (_("Node `%s' requires a sectioning command (e.g. %c%s)"),
- node, COMMAND_PREFIX, polite_section_name);
- }
- else
- {
- if (strcmp (node, "Top") == 0)
- {
- /* Default the NEXT pointer to be the first menu item in
- this node, if there is a menu in this node. We have to
- try very hard to find the menu, as it may be obscured
- by execution_strings which are on the filestack. For
- every member of the filestack which has a FILENAME
- member which is identical to the current INPUT_FILENAME,
- search forward from that offset. */
- int saved_input_text_offset = input_text_offset;
- int saved_size_of_input_text = size_of_input_text;
- char *saved_input_text = input_text;
- FSTACK *next_file = filestack;
-
- int orig_offset, orig_size;
- char *glean_node_from_menu ();
-
- /* No matter what, make this file point back at `(dir)'. */
- free (up); up = xstrdup ("(dir)");
-
- while (1)
- {
- orig_offset = input_text_offset;
- orig_size =
- search_forward (node_search_string, orig_offset);
-
- if (orig_size < 0)
- orig_size = size_of_input_text;
-
- input_text_offset =
- search_forward (menu_search_string, orig_offset);
-
- if (input_text_offset > -1)
- {
- char *nodename_from_menu = (char *)NULL;
-
- input_text_offset =
- search_forward ("\n* ", input_text_offset);
-
- if (input_text_offset != -1)
- nodename_from_menu = glean_node_from_menu (0);
-
- if (nodename_from_menu)
- {
- free (next); next = nodename_from_menu;
- break;
- }
- }
-
- /* We got here, so it hasn't been found yet. Try
- the next file on the filestack if there is one. */
- if (next_file &&
- (strcmp (next_file->filename, input_filename) == 0))
- {
- input_text = next_file->text;
- input_text_offset = next_file->offset;
- size_of_input_text = next_file->size;
- next_file = next_file->next;
- }
- else
- {
- /* No more input files to check. */
- break;
- }
- }
-
- input_text = saved_input_text;
- input_text_offset = saved_input_text_offset;
- size_of_input_text = saved_size_of_input_text;
- }
- }
-
- /* Fix the level of the menu references in the Top node, iff it
- was declared with @top, and no subsequent reference was found. */
- if (top_node_seen && !non_top_node_seen)
- {
- /* Then this is the first non-@top node seen. */
- int level;
-
- level = set_top_section_level (this_section - 1);
- non_top_node_seen = 1;
-
- while (ref)
- {
- if (ref->section == level)
- ref->section = this_section - 1;
- ref = ref->next;
- }
-
- ref = node_references;
- }
-
- while (ref)
- {
- if (ref->section == (this_section - 1) &&
- ref->type == menu_reference &&
- strcmp (ref->node, node) == 0)
- {
- char *containing_node = ref->containing_node;
-
- free (up);
- up = xstrdup (containing_node);
-
- if (last_ref &&
- last_ref->type == menu_reference &&
- (strcmp (last_ref->containing_node,
- containing_node) == 0))
- {
- free (next);
- next = xstrdup (last_ref->node);
- }
-
- while ((ref->section == this_section - 1) &&
- (ref->next) &&
- (ref->next->type != menu_reference))
- ref = ref->next;
-
- if (ref->next && ref->type == menu_reference &&
- (strcmp (ref->next->containing_node,
- containing_node) == 0))
- {
- free (prev);
- prev = xstrdup (ref->next->node);
- }
- else if (!ref->next &&
- strcasecmp (ref->containing_node, "Top") == 0)
- {
- free (prev);
- prev = xstrdup (ref->containing_node);
- }
- break;
- }
- last_ref = ref;
- ref = ref->next;
- }
- }
-
-#if defined (HAVE_MACROS)
- /* Insert the correct args if we are expanding macros, and the node's
- pointers weren't defaulted. */
- if (macro_expansion_output_stream && !executing_string && !defaulting)
- {
- char *temp;
- int op_orig = output_paragraph_offset;
-
- temp = (char *)xmalloc (3 + strlen (next));
- sprintf (temp, ", %s", next);
- me_execute_string (temp);
- free (temp);
-
- temp = (char *)xmalloc (3 + strlen (prev));
- sprintf (temp, ", %s", prev);
- me_execute_string (temp);
- free (temp);
-
- temp = (char *)xmalloc (4 + strlen (up));
- sprintf (temp, ", %s", up);
- me_execute_string (temp);
- free (temp);
-
- output_paragraph_offset = op_orig;
- }
-#endif /* HAVE_MACROS */
-
- if (!no_headers)
- {
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
- me_inhibit_expansion++;
-#endif /* HAVE_MACROS */
-
- if (*next)
- {
- execute_string (", Next: %s", next);
- filling_enabled = indented_fill = 0;
- }
-
- if (*prev)
- {
- execute_string (", Prev: %s", prev);
- filling_enabled = indented_fill = 0;
- }
-
- if (*up)
- {
- execute_string (", Up: %s", up);
- filling_enabled = indented_fill = 0;
- }
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
- me_inhibit_expansion--;
-#endif /* HAVE_MACROS */
- }
-
- close_paragraph ();
- no_indent = 0;
-
- if (!*node)
- {
- line_error ("No node name specified for `%c%s' command",
- COMMAND_PREFIX, command);
- free (node);
- free (next);
- free (prev);
- free (up);
- }
- else
- {
- if (!*next) { free (next); next = (char *)NULL; }
- if (!*prev) { free (prev); prev = (char *)NULL; }
- if (!*up) { free (up); up = (char *)NULL; }
- remember_node (node, prev, next, up, new_node_pos, line_number, no_warn);
- }
-
- /* Change the section only if there was a sectioning command. */
- if (this_section >= 0)
- current_section = this_section;
-
- filling_enabled = 1;
-}
-
-/* Validation of an info file.
- Scan through the list of tag entries touching the Prev, Next, and Up
- elements of each. It is an error not to be able to touch one of them,
- except in the case of external node references, such as "(DIR)".
-
- If the Prev is different from the Up,
- then the Prev node must have a Next pointing at this node.
-
- Every node except Top must have an Up.
- The Up node must contain some sort of reference, other than a Next,
- to this node.
-
- If the Next is different from the Next of the Up,
- then the Next node must have a Prev pointing at this node. */
-void
-validate_file (tag_table)
- TAG_ENTRY *tag_table;
-{
- char *old_input_filename = input_filename;
- TAG_ENTRY *tags = tag_table;
-
- while (tags != (TAG_ENTRY *) NULL)
- {
- register TAG_ENTRY *temp_tag;
-
- input_filename = tags->filename;
- line_number = tags->line_no;
-
- /* If this is a "no warn" node, don't validate it in any way. */
- if (tags->flags & NO_WARN)
- {
- tags = tags->next_ent;
- continue;
- }
-
- /* If this node has a Next, then make sure that the Next exists. */
- if (tags->next)
- {
- validate (tags->next, tags->line_no, "Next");
-
- /* If the Next node exists, and there is no Up, then make
- sure that the Prev of the Next points back. */
- temp_tag = find_node (tags->next);
- if (temp_tag)
- {
- char *prev;
-
- if (temp_tag->flags & NO_WARN)
- {
- /* Do nothing if we aren't supposed to issue warnings
- about this node. */
- }
- else
- {
- prev = temp_tag->prev;
- if (!prev || (strcmp (prev, tags->node) != 0))
- {
- line_error (_("Node `%s''s Next field not pointed back to"),
- tags->node);
- line_number = temp_tag->line_no;
- input_filename = temp_tag->filename;
- line_error
- (_("This node (`%s') is the one with the bad `Prev'"),
- temp_tag->node);
- input_filename = tags->filename;
- line_number = tags->line_no;
- temp_tag->flags |= PREV_ERROR;
- }
- }
- }
- }
-
- /* Validate the Prev field if there is one, and we haven't already
- complained about it in some way. You don't have to have a Prev
- field at this stage. */
- if (!(tags->flags & PREV_ERROR) && tags->prev)
- {
- int valid_p = validate (tags->prev, tags->line_no, "Prev");
-
- if (!valid_p)
- tags->flags |= PREV_ERROR;
- else
- {
- /* If the Prev field is not the same as the Up field,
- then the node pointed to by the Prev field must have
- a Next field which points to this node. */
- if (tags->up && (strcmp (tags->prev, tags->up) != 0))
- {
- temp_tag = find_node (tags->prev);
-
- /* If we aren't supposed to issue warnings about the
- target node, do nothing. */
- if (!temp_tag || (temp_tag->flags & NO_WARN))
- {
- /* Do nothing. */
- }
- else
- {
- if (!temp_tag->next ||
- (strcmp (temp_tag->next, tags->node) != 0))
- {
- line_error
- (_("Node `%s's Prev field not pointed back to"),
- tags->node);
- line_number = temp_tag->line_no;
- input_filename = temp_tag->filename;
- line_error (_("This node (`%s') has the bad Next"),
- temp_tag->node);
- input_filename = tags->filename;
- line_number = tags->line_no;
- temp_tag->flags |= NEXT_ERROR;
- }
- }
- }
- }
- }
-
- if (!tags->up && (strcasecmp (tags->node, _("Top")) != 0))
- line_error (_("Node `%s' missing Up field"), tags->node);
- else if (tags->up)
- {
- int valid_p = validate (tags->up, tags->line_no, "Up");
-
- /* If node X has Up: Y, then warn if Y fails to have a menu item
- or note pointing at X, if Y isn't of the form "(Y)". */
- if (valid_p && *tags->up != '(')
- {
- NODE_REF *nref, *tref, *list;
- NODE_REF *find_node_reference ();
-
- tref = (NODE_REF *) NULL;
- list = node_references;
-
- for (;;)
- {
- if (!(nref = find_node_reference (tags->node, list)))
- break;
-
- if (strcmp (nref->containing_node, tags->up) == 0)
- {
- if (nref->type != menu_reference)
- {
- tref = nref;
- list = nref->next;
- }
- else
- break;
- }
- list = nref->next;
- }
-
- if (!nref)
- {
- temp_tag = find_node (tags->up);
- line_number = temp_tag->line_no;
- input_filename = temp_tag->filename;
- if (!tref)
- line_error (
-_("`%s' has an Up field of `%s', but `%s' has no menu item for `%s'"),
- tags->node, tags->up, tags->up, tags->node);
- line_number = tags->line_no;
- input_filename = tags->filename;
- }
- }
- }
- tags = tags->next_ent;
- }
-
- validate_other_references (node_references);
- /* We have told the user about the references which didn't exist.
- Now tell him about the nodes which aren't referenced. */
-
- tags = tag_table;
- while (tags != (TAG_ENTRY *) NULL)
- {
- /* If this node is a "no warn" node, do nothing. */
- if (tags->flags & NO_WARN)
- {
- tags = tags->next_ent;
- continue;
- }
-
- /* Special hack. If the node in question appears to have
- been referenced more than REFERENCE_WARNING_LIMIT times,
- give a warning. */
- if (tags->touched > reference_warning_limit)
- {
- input_filename = tags->filename;
- line_number = tags->line_no;
- warning (_("node `%s' has been referenced %d times"),
- tags->node, tags->touched);
- }
-
- if (tags->touched == 0)
- {
- input_filename = tags->filename;
- line_number = tags->line_no;
-
- /* Notice that the node "Top" is special, and doesn't have to
- be referenced. */
- if (strcasecmp (tags->node, _("Top")) != 0)
- warning (_("unreferenced node `%s'"), tags->node);
- }
- tags = tags->next_ent;
- }
- input_filename = old_input_filename;
-}
-
-/* Return 1 if tag correctly validated, or 0 if not. */
-int
-validate (tag, line, label)
- char *tag;
- int line;
- char *label;
-{
- TAG_ENTRY *result;
-
- /* If there isn't a tag to verify, or if the tag is in another file,
- then it must be okay. */
- if (!tag || !*tag || *tag == '(')
- return (1);
-
- /* Otherwise, the tag must exist. */
- result = find_node (tag);
-
- if (!result)
- {
- line_number = line;
- line_error (_("%s reference to nonexistent node `%s'"), label, tag);
- return (0);
- }
- result->touched++;
- return (1);
-}
-
-/* Split large output files into a series of smaller files. Each file
- is pointed to in the tag table, which then gets written out as the
- original file. The new files have the same name as the original file
- with a "-num" attached. SIZE is the largest number of bytes to allow
- in any single split file. */
-void
-split_file (filename, size)
- char *filename;
- int size;
-{
- char *root_filename, *root_pathname;
- char *the_file, *filename_part ();
- struct stat fileinfo;
- long file_size;
- char *the_header;
- int header_size;
-
- /* Can only do this to files with tag tables. */
- if (!tag_table)
- return;
-
- if (size == 0)
- size = DEFAULT_SPLIT_SIZE;
-
- if ((stat (filename, &fileinfo) != 0) ||
- (((long) fileinfo.st_size) < SPLIT_SIZE_THRESHOLD))
- return;
- file_size = (long) fileinfo.st_size;
-
- the_file = find_and_load (filename);
- if (!the_file)
- return;
-
- root_filename = filename_part (filename);
- root_pathname = pathname_part (filename);
-
- if (!root_pathname)
- root_pathname = xstrdup ("");
-
- /* Start splitting the file. Walk along the tag table
- outputting sections of the file. When we have written
- all of the nodes in the tag table, make the top-level
- pointer file, which contains indirect pointers and
- tags for the nodes. */
- {
- int which_file = 1;
- TAG_ENTRY *tags = tag_table;
- char *indirect_info = (char *)NULL;
-
- /* Remember the `header' of this file. The first tag in the file is
- the bottom of the header; the top of the file is the start. */
- the_header = (char *)xmalloc (1 + (header_size = tags->position));
- memcpy (the_header, the_file, header_size);
-
- while (tags)
- {
- int file_top, file_bot, limit;
-
- /* Have to include the Control-_. */
- file_top = file_bot = tags->position;
- limit = file_top + size;
-
- /* If the rest of this file is only one node, then
- that is the entire subfile. */
- if (!tags->next_ent)
- {
- int i = tags->position + 1;
- char last_char = the_file[i];
-
- while (i < file_size)
- {
- if ((the_file[i] == '\037') &&
- ((last_char == '\n') ||
- (last_char == '\014')))
- break;
- else
- last_char = the_file[i];
- i++;
- }
- file_bot = i;
- tags = tags->next_ent;
- goto write_region;
- }
-
- /* Otherwise, find the largest number of nodes that can fit in
- this subfile. */
- for (; tags; tags = tags->next_ent)
- {
- if (!tags->next_ent)
- {
- /* This entry is the last node. Search forward for the end
- of this node, and that is the end of this file. */
- int i = tags->position + 1;
- char last_char = the_file[i];
-
- while (i < file_size)
- {
- if ((the_file[i] == '\037') &&
- ((last_char == '\n') ||
- (last_char == '\014')))
- break;
- else
- last_char = the_file[i];
- i++;
- }
- file_bot = i;
-
- if (file_bot < limit)
- {
- tags = tags->next_ent;
- goto write_region;
- }
- else
- {
- /* Here we want to write out everything before the last
- node, and then write the last node out in a file
- by itself. */
- file_bot = tags->position;
- goto write_region;
- }
- }
-
- if (tags->next_ent->position > limit)
- {
- if (tags->position == file_top)
- tags = tags->next_ent;
-
- file_bot = tags->position;
-
- write_region:
- {
- int fd;
- char *split_filename;
-
- split_filename = (char *) xmalloc
- (10 + strlen (root_pathname) + strlen (root_filename));
- sprintf
- (split_filename,
- "%s%s-%d", root_pathname, root_filename, which_file);
-
- fd = open
- (split_filename, O_WRONLY | O_TRUNC | O_CREAT, 0666);
-
- if ((fd < 0) ||
- (write (fd, the_header, header_size) != header_size) ||
- (write (fd, the_file + file_top, file_bot - file_top)
- != (file_bot - file_top)) ||
- ((close (fd)) < 0))
- {
- perror (split_filename);
- if (fd != -1)
- close (fd);
- exit (FATAL);
- }
-
- if (!indirect_info)
- {
- indirect_info = the_file + file_top;
- sprintf (indirect_info, "\037\nIndirect:\n");
- indirect_info += strlen (indirect_info);
- }
-
- sprintf (indirect_info, "%s-%d: %d\n",
- root_filename, which_file, file_top);
-
- free (split_filename);
- indirect_info += strlen (indirect_info);
- which_file++;
- break;
- }
- }
- }
- }
-
- /* We have sucessfully created the subfiles. Now write out the
- original again. We must use `output_stream', or
- write_tag_table_indirect () won't know where to place the output. */
- output_stream = fopen (filename, "w");
- if (!output_stream)
- {
- perror (filename);
- exit (FATAL);
- }
-
- {
- int distance = indirect_info - the_file;
- fwrite (the_file, 1, distance, output_stream);
-
- /* Inhibit newlines. */
- paragraph_is_open = 0;
-
- write_tag_table_indirect ();
- fclose (output_stream);
- free (the_header);
- free (the_file);
- return;
- }
- }
-}
-
-/* The strings here are followed in the message by `reference to...' in
- the `validate' routine. */
-char *
-reftype_type_string (type)
- enum reftype type;
-{
- switch (type)
- {
- case menu_reference:
- return ("Menu");
- case followed_reference:
- return ("Cross");
- default:
- return ("Internal-bad-reference-type");
- }
-}
-
-/* Remember this node name for later validation use. This is used to
- remember menu references while reading the input file. After the
- output file has been written, if validation is on, then we use the
- contents of `node_references' as a list of nodes to validate. */
-void
-remember_node_reference (node, line, type)
- char *node;
- int line;
- enum reftype type;
-{
- NODE_REF *temp = (NODE_REF *) xmalloc (sizeof (NODE_REF));
-
- temp->next = node_references;
- temp->node = xstrdup (node);
- temp->line_no = line;
- temp->section = current_section;
- temp->type = type;
- temp->containing_node = xstrdup (current_node ? current_node : "");
- temp->filename = node_filename;
-
- node_references = temp;
-}
-
-void
-validate_other_references (ref_list)
- register NODE_REF *ref_list;
-{
- char *old_input_filename = input_filename;
-
- while (ref_list != (NODE_REF *) NULL)
- {
- input_filename = ref_list->filename;
- validate (ref_list->node, ref_list->line_no,
- reftype_type_string (ref_list->type));
- ref_list = ref_list->next;
- }
- input_filename = old_input_filename;
-}
-
-/* Find NODE in REF_LIST. */
-NODE_REF *
-find_node_reference (node, ref_list)
- char *node;
- register NODE_REF *ref_list;
-{
- while (ref_list)
- {
- if (strcmp (node, ref_list->node) == 0)
- break;
- ref_list = ref_list->next;
- }
- return (ref_list);
-}
-
-void
-free_node_references ()
-{
- register NODE_REF *list, *temp;
-
- list = node_references;
-
- while (list)
+ if (expand)
{
- temp = list;
- free (list->node);
- free (list->containing_node);
- list = list->next;
- free (temp);
- }
- node_references = (NODE_REF *) NULL;
-}
+ int old_offset = input_text_offset;
+ int old_lineno = line_number;
- /* This function gets called at the start of every line while inside of
- a menu. It checks to see if the line starts with "* ", and if so,
- remembers the node reference that this menu refers to.
- input_text_offset is at the \n just before the line start. */
-#define menu_starter "* "
-char *
-glean_node_from_menu (remember_reference)
- int remember_reference;
-{
- int i, orig_offset = input_text_offset;
- char *nodename;
-
- if (strncmp (&input_text[input_text_offset + 1],
- menu_starter,
- strlen (menu_starter)) != 0)
- return ((char *)NULL);
- else
- input_text_offset += strlen (menu_starter) + 1;
-
- get_until_in_line (0, ":", &nodename);
- if (curchar () == ':')
- input_text_offset++;
- canon_white (nodename);
-
- if (curchar () == ':')
- goto save_node;
-
- free (nodename);
- get_rest_of_line (&nodename);
-
- /* Special hack: If the nodename follows the menu item name,
- then we have to read the rest of the line in order to find
- out what the nodename is. But we still have to read the
- line later, in order to process any formatting commands that
- might be present. So un-count the carriage return that has just
- been counted. */
- line_number--;
-
- isolate_nodename (nodename);
-
-save_node:
- input_text_offset = orig_offset;
- normalize_node_name (nodename);
- i = strlen (nodename);
- if (i && nodename[i - 1] == ':')
- nodename[i - 1] = 0;
-
- if (remember_reference)
- {
- remember_node_reference (nodename, line_number, menu_reference);
- free (nodename);
- return ((char *)NULL);
- }
- else
- return (nodename);
-}
-
-static void
-isolate_nodename (nodename)
- char *nodename;
-{
- register int i, c;
- int paren_seen, paren;
-
- if (!nodename)
- return;
-
- canon_white (nodename);
- paren_seen = paren = i = 0;
-
- if (*nodename == '.' || !*nodename)
- {
- *nodename = 0;
- return;
- }
-
- if (*nodename == '(')
- {
- paren++;
- paren_seen++;
- i++;
- }
-
- for (; (c = nodename[i]); i++)
- {
- if (paren)
+ get_until_in_braces ("}", &string);
+ if (curchar () == '}') /* as opposed to end of text */
+ input_text_offset++;
+ if (input_text_offset > old_offset)
{
- if (c == '(')
- paren++;
- else if (c == ')')
- paren--;
+ int limit = input_text_offset;
- continue;
+ input_text_offset = old_offset;
+ line_number = old_lineno;
+ only_macro_expansion++;
+ replace_with_expansion (input_text_offset, &limit);
+ only_macro_expansion--;
}
-
- /* If the character following the close paren is a space, then this
- node has no more characters associated with it. */
- if (c == '\t' ||
- c == '\n' ||
- c == ',' ||
- ((paren_seen && nodename[i - 1] == ')') &&
- (c == ' ' || c == '.')) ||
- (c == '.' &&
- ((!nodename[i + 1] ||
- (cr_or_whitespace (nodename[i + 1])) ||
- (nodename[i + 1] == ')')))))
- break;
- }
- nodename[i] = 0;
-}
-
-void
-cm_menu ()
-{
- if (current_node == (char *)NULL)
- {
- warning (_("%cmenu seen before first node"), COMMAND_PREFIX);
- warning (_("creating `Top' node"));
- execute_string ("@node Top");
+ free (string);
}
- begin_insertion (menu);
-}
-
-void
-cm_detailmenu ()
-{
- if (current_node == (char *)NULL)
- {
- warning (_("%cmenu seen before first node"), COMMAND_PREFIX);
- warning (_("creating `Top' node"));
- execute_string ("@node Top");
- }
- begin_insertion (detailmenu);
-}
-
-/* **************************************************************** */
-/* */
-/* Cross Reference Hacking */
-/* */
-/* **************************************************************** */
-
-/* Return next comma-delimited argument, but do not cross a close-brace
- boundary. Clean up whitespace, too. */
-char *
-get_xref_token ()
-{
- char *string;
get_until_in_braces (",", &string);
if (curchar () == ',')
input_text_offset++;
fix_whitespace (string);
- return (string);
+ return string;
}
-int px_ref_flag = 0; /* Controls initial output string. */
+/* NOTE: If you wonder why the HTML output is produced with such a
+ peculiar mix of calls to add_word and execute_string, here's the
+ reason. get_xref_token (1) expands all macros in a reference, but
+ any other commands, like @value, @@, etc., are left intact. To
+ expand them, we need to run the arguments through execute_string.
+ However, characters like <, &, > and others cannot be let into
+ execute_string, because they will be escaped. See the mess? */
/* Make a cross reference. */
void
@@ -5712,15 +2694,20 @@ cm_xref (arg)
{
if (arg == START)
{
- char *arg1, *arg2, *arg3, *arg4, *arg5;
-
- arg1 = get_xref_token ();
- arg2 = get_xref_token ();
- arg3 = get_xref_token ();
- arg4 = get_xref_token ();
- arg5 = get_xref_token ();
+ char *arg1 = get_xref_token (1); /* expands all macros in xref */
+ char *arg2 = get_xref_token (0);
+ char *arg3 = get_xref_token (0);
+ char *arg4 = get_xref_token (0);
+ char *arg5 = get_xref_token (0);
+ char *tem;
- add_word_args ("%s", px_ref_flag ? "*note " : "*Note ");
+ if (html)
+ {
+ if (!ref_flag)
+ add_word_args ("%s", px_ref_flag ? _("see ") : _("See "));
+ }
+ else
+ add_word_args ("%s", px_ref_flag ? "*note " : "*Note ");
if (*arg5 || *arg4)
{
@@ -5736,7 +2723,30 @@ cm_xref (arg)
else
node_name = arg2;
- execute_string ("%s: (%s)%s", node_name, arg4, arg1);
+ if (html)
+ {
+ /* html fixxme: revisit this; external node name not
+ much use to us with numbered nodes. */
+ add_word ("<a href=");
+ execute_string ("\"%s.html#", arg4);
+ /* Do not collapse -- to -, etc., in references. */
+ in_fixed_width_font++;
+ tem = expansion (node_name, 0);
+ in_fixed_width_font--;
+ add_escaped_anchor_name (tem);
+ free (tem);
+ add_word ("\">");
+ execute_string ("%s", arg1);
+ add_word ("</a>");
+ }
+ else
+ {
+ execute_string ("%s:", node_name);
+ in_fixed_width_font++;
+ execute_string (" (%s)%s%s", arg4, arg1, px_ref_flag ? "." : "");
+ in_fixed_width_font--;
+ }
+
/* Free all of the arguments found. */
if (arg1) free (arg1);
if (arg2) free (arg2);
@@ -5750,17 +2760,56 @@ cm_xref (arg)
if (*arg3)
{
- if (!*arg2)
- execute_string ("%s: %s", arg3, arg1);
+ if (html)
+ {
+ add_word ("<a href=\"");
+ in_fixed_width_font++;
+ tem = expansion (arg1, 0);
+ in_fixed_width_font--;
+ add_anchor_name (tem, 1);
+ free (tem);
+ add_word ("\">");
+ execute_string ("%s", *arg2 ? arg2 : arg3);
+ add_word ("</a>");
+ }
else
- execute_string ("%s: %s", arg2, arg1);
+ {
+ execute_string ("%s:", *arg2 ? arg2 : arg3);
+ in_fixed_width_font++;
+ execute_string (" %s%s", arg1, px_ref_flag ? "." : "");
+ in_fixed_width_font--;
+ }
}
else
{
- if (*arg2)
- execute_string ("%s: %s", arg2, arg1);
+ if (html)
+ {
+ add_word ("<a href=\"");
+ in_fixed_width_font++;
+ tem = expansion (arg1, 0);
+ in_fixed_width_font--;
+ add_anchor_name (tem, 1);
+ free (tem);
+ add_word ("\">");
+ execute_string ("%s", *arg2 ? arg2 : arg1);
+ add_word ("</a>");
+ }
else
- execute_string ("%s::", arg1);
+ {
+ if (*arg2)
+ {
+ execute_string ("%s:", arg2);
+ in_fixed_width_font++;
+ execute_string (" %s%s", arg1, px_ref_flag ? "." : "");
+ in_fixed_width_font--;
+ }
+ else
+ {
+ in_fixed_width_font++;
+ execute_string ("%s::", arg1);
+ in_fixed_width_font--;
+ }
+ }
}
/* Free all of the arguments found. */
@@ -5771,29 +2820,21 @@ cm_xref (arg)
if (arg5) free (arg5);
}
else
- {
- /* Check to make sure that the next non-whitespace character is either
- a period or a comma. input_text_offset is pointing at the "}" which
- ended the xref or pxref command. */
- int temp = input_text_offset + 1;
+ { /* Check to make sure that the next non-whitespace character is
+ valid to follow an xref (so info readers can find the node
+ names). `input_text_offset' is pointing at the "}" which ended
+ the xref or ref command. */
+ int temp;
- if (output_paragraph[output_paragraph_offset - 2] == ':' &&
- output_paragraph[output_paragraph_offset - 1] == ':')
- return;
- while (temp < size_of_input_text)
+ for (temp = input_text_offset + 1; temp < input_text_length; )
{
if (cr_or_whitespace (input_text[temp]))
temp++;
else
{
- if (input_text[temp] != '.'
- && input_text[temp] != ','
- && input_text[temp] != '\t')
- {
- line_error (
- _("`.' or `,' must follow cross reference, not %c"),
- input_text[temp]);
- }
+ if (input_text[temp] != '.' && input_text[temp] != ',')
+ warning (_("`.' or `,' must follow cross reference, not %c"),
+ input_text[temp]);
break;
}
}
@@ -5810,8 +2851,22 @@ cm_pxref (arg)
cm_xref (arg);
px_ref_flag--;
}
- else
- add_char ('.');
+ /* Note that cm_xref isn't called with arg == END, which disables
+ the code near the end of cm_xref that checks for `.' or `,'
+ after the cross-reference. This is because @pxref{} generates
+ the required character itself, when needed. */
+}
+
+void
+cm_ref (arg)
+ int arg;
+{
+ if (arg == START)
+ {
+ ref_flag++;
+ cm_xref (arg);
+ ref_flag--;
+ }
}
void
@@ -5820,14 +2875,27 @@ cm_inforef (arg)
{
if (arg == START)
{
- char *node = get_xref_token ();
- char *pname = get_xref_token ();
- char *file = get_xref_token ();
+ char *node = get_xref_token (1); /* expands all macros in inforef */
+ char *pname = get_xref_token (0);
+ char *file = get_xref_token (0);
- if (*pname)
- execute_string ("*note %s: (%s)%s", pname, file, node);
+ if (html)
+ {
+ add_word (_("see "));
+ /* html fixxme: revisit this */
+ add_word ("<a href=");
+ execute_string ("\"%s.html\"", file);
+ add_word (">");
+ execute_string ("%s", pname);
+ add_word ("</a>");
+ }
else
- execute_string ("*note (%s)%s::", file, node);
+ {
+ if (*pname)
+ execute_string ("*note %s: (%s)%s", pname, file, node);
+ else
+ execute_string ("*note (%s)%s::", file, node);
+ }
free (node);
free (pname);
@@ -5837,76 +2905,88 @@ cm_inforef (arg)
/* A URL reference. */
void
-cm_uref (arg, start_pos, end_pos)
- int arg, start_pos, end_pos;
+cm_uref (arg)
+ int arg;
{
- if (arg == END)
+ if (arg == START)
{
- char *comma;
- char *arg = (char *) &output_paragraph[start_pos];
-
- output_paragraph[end_pos] = 0;
- output_column -= end_pos - start_pos;
- output_paragraph_offset = start_pos;
-
- arg = xstrdup (arg);
- comma = strchr (arg, ','); /* let's hope for no commas in the url */
- if (comma)
- {
- *comma = 0;
- /* Ignore spaces at beginning of second arg. */
- for (comma++; isspace (*comma); comma++)
- ;
- add_word (comma);
- add_char (' ');
- add_char ('(');
- add_word (arg);
- add_char (')');
- }
- else
- {
- extern int printing_index;
-
- if (!printing_index)
- add_char ('`');
-
- add_word (arg);
-
- if (!printing_index)
- add_char ('\'');
- }
- free (arg);
- }
+ extern int printing_index;
+ char *url = get_xref_token (1); /* expands all macros in uref */
+ char *desc = get_xref_token (0);
+ char *replacement = get_xref_token (0);
+
+ if (html)
+ { /* never need to show the url */
+ add_word ("<a href=");
+ /* don't collapse `--' etc. in the url */
+ in_fixed_width_font++;
+ execute_string ("\"%s\"", url);
+ in_fixed_width_font--;
+ add_word (">");
+ execute_string ("%s", *replacement ? replacement
+ : (*desc ? desc : url));
+ add_word ("</a>");
+ }
+ else if (*replacement) /* do not show the url */
+ execute_string ("%s", replacement);
+ else if (*desc) /* show both text and url */
+ {
+ execute_string ("%s ", desc);
+ in_fixed_width_font++;
+ execute_string ("(%s)", url);
+ in_fixed_width_font--;
+ }
+ else /* no text at all, so have the url to show */
+ {
+ in_fixed_width_font++;
+ execute_string ("%s%s%s",
+ printing_index ? "" : "`",
+ url,
+ printing_index ? "" : "'");
+ in_fixed_width_font--;
+ }
+ if (url)
+ free (url);
+ if (desc)
+ free (desc);
+ if (replacement)
+ free (replacement);
+ }
}
/* An email reference. */
void
-cm_email (arg, start_pos, end_pos)
- int arg, start_pos, end_pos;
+cm_email (arg)
+ int arg;
{
- if (arg == END)
+ if (arg == START)
{
- char *comma;
- char *arg = (char *) &output_paragraph[start_pos];
+ char *addr = get_xref_token (1); /* expands all macros in email */
+ char *name = get_xref_token (0);
- output_paragraph[end_pos] = 0;
- output_column -= end_pos - start_pos;
- output_paragraph_offset = start_pos;
-
- arg = xstrdup (arg);
- comma = strchr (arg, ',');
- if (comma)
+ if (html)
+ {
+ add_word ("<a href=");
+ /* don't collapse `--' etc. in the address */
+ in_fixed_width_font++;
+ execute_string ("\"mailto:%s\"", addr);
+ in_fixed_width_font--;
+ add_word (">");
+ execute_string ("%s", *name ? name : addr);
+ add_word ("</a>");
+ }
+ else
{
- *comma = 0;
- for (comma++; isspace (*comma); comma++)
- ;
- add_word (comma);
- add_char (' ');
+ execute_string ("%s%s", name, *name ? " " : "");
+ in_fixed_width_font++;
+ execute_string ("<%s>", addr);
+ in_fixed_width_font--;
}
- add_char ('<');
- add_word (arg);
- add_char ('>');
- free (arg);
+
+ if (addr)
+ free (addr);
+ if (name)
+ free (name);
}
}
@@ -5916,264 +2996,84 @@ void
cm_image (arg)
int arg;
{
- if (arg == START)
+ char *name_arg, *rest;
+
+ if (arg == END)
+ return;
+
+ name_arg = get_xref_token (1); /* expands all macros in image */
+ /* We don't (yet) care about any other args, but read them so they
+ don't end up in the text. */
+ rest = get_xref_token (0);
+ if (rest)
+ free (rest);
+ rest = get_xref_token (0);
+ if (rest)
+ free (rest);
+
+ if (*name_arg)
{
- char *name_arg = get_xref_token ();
- /* We don't yet care about any other args, but read them so they
- don't end up in the text. */
- char *arg = get_xref_token ();
- if (arg) free (arg);
- arg = get_xref_token ();
- if (arg) free (arg);
-
- if (*name_arg)
- {
- /* Try to open foo.txt. */
+ char *fullname = xmalloc (strlen (name_arg) + 4 + 1);
+
+ if (html)
+ { /* fixxme It would be nice to insert more useful alt text. */
+ sprintf (fullname, "%s.png", name_arg);
+ if (access (fullname, R_OK) != 0)
+ {
+ sprintf (fullname, "%s.jpg", name_arg);
+ if (access (fullname, R_OK) != 0)
+ {
+ line_error (_("No .png or .jpg for `%s'"), name_arg);
+ return;
+ }
+ }
+
+ add_word_args ("<img src=\"%s\" alt=\"%s\">", fullname, fullname);
+ }
+ else
+ { /* Try to open foo.txt. */
FILE *image_file;
- char *name = xmalloc (strlen (name_arg) + 4);
- strcpy (name, name_arg);
- strcat (name, ".txt");
- image_file = fopen (name, "r");
+ strcpy (fullname, name_arg);
+ strcat (fullname, ".txt");
+ image_file = fopen (fullname, "r");
if (image_file)
{
int ch;
int save_inhibit_indentation = inhibit_paragraph_indentation;
int save_filling_enabled = filling_enabled;
-
+
inhibit_paragraph_indentation = 1;
filling_enabled = 0;
last_char_was_newline = 0;
-
+
/* Maybe we need to remove the final newline if the image
file is only one line to allow in-line images. On the
other hand, they could just make the file without a
final newline. */
while ((ch = getc (image_file)) != EOF)
add_char (ch);
-
+
inhibit_paragraph_indentation = save_inhibit_indentation;
filling_enabled = save_filling_enabled;
-
- if (fclose (image_file) != 0) {
- perror (name);
- }
+
+ if (fclose (image_file) != 0)
+ perror (fullname);
}
else
- warning (_("@image file `%s' unreadable: %s"), name,
- strerror (errno));
+ warning (_("@image file `%s' unreadable: %s"), fullname,
+ strerror (errno));
}
- else
- line_error (_("@image missing filename argument"));
- if (name_arg) free (name_arg);
+ free (fullname);
}
-}
-
-/* **************************************************************** */
-/* */
-/* Insertion Command Stubs */
-/* */
-/* **************************************************************** */
-
-void
-cm_quotation ()
-{
- begin_insertion (quotation);
-}
-
-void
-cm_example ()
-{
- begin_insertion (example);
-}
-
-void
-cm_smallexample ()
-{
- begin_insertion (smallexample);
-}
-
-void
-cm_lisp ()
-{
- begin_insertion (lisp);
-}
-
-void
-cm_smalllisp ()
-{
- begin_insertion (smalllisp);
-}
-
-/* @cartouche/@end cartouche draws box with rounded corners in
- TeX output. Right now, just a no-op insertion. */
-void
-cm_cartouche ()
-{
- begin_insertion (cartouche);
-}
-
-void
-cm_format ()
-{
- begin_insertion (format);
-}
-
-void
-cm_display ()
-{
- begin_insertion (display);
-}
-
-void
-cm_direntry ()
-{
- if (no_headers)
- command_name_condition ();
else
- begin_insertion (direntry);
-}
-
-void
-cm_itemize ()
-{
- begin_insertion (itemize);
-}
+ line_error (_("@image missing filename argument"));
-void
-cm_enumerate ()
-{
- do_enumeration (enumerate, "1");
-}
-
-/* Start an enumeration insertion of type TYPE. If the user supplied
- no argument on the line, then use DEFAULT_STRING as the initial string. */
-void
-do_enumeration (type, default_string)
- int type;
- char *default_string;
-{
- get_until_in_line (0, ".", &enumeration_arg);
- canon_white (enumeration_arg);
-
- if (!*enumeration_arg)
- {
- free (enumeration_arg);
- enumeration_arg = xstrdup (default_string);
- }
-
- if (!isdigit (*enumeration_arg) && !isletter (*enumeration_arg))
- {
- warning (_("%s requires letter or digit"), insertion_type_pname (type));
-
- switch (type)
- {
- case enumerate:
- default_string = "1";
- break;
- }
- enumeration_arg = xstrdup (default_string);
- }
- begin_insertion (type);
-}
-
-void
-cm_table ()
-{
- begin_insertion (table);
-}
-
-void
-cm_multitable ()
-{
- begin_insertion (multitable); /* @@ */
-}
-
-void
-cm_ftable ()
-{
- begin_insertion (ftable);
-}
-
-void
-cm_vtable ()
-{
- begin_insertion (vtable);
-}
-
-void
-cm_group ()
-{
- begin_insertion (group);
-}
-
-void
-cm_ifinfo ()
-{
- begin_insertion (ifinfo);
-}
-
-void
-cm_ifnothtml ()
-{
- begin_insertion (ifnothtml);
-}
-
-void
-cm_ifnottex ()
-{
- begin_insertion (ifnottex);
-}
-
-/* Begin an insertion where the lines are not filled or indented. */
-void
-cm_flushleft ()
-{
- begin_insertion (flushleft);
-}
-
-/* Begin an insertion where the lines are not filled, and each line is
- forced to the right-hand side of the page. */
-void
-cm_flushright ()
-{
- begin_insertion (flushright);
-}
-
-/* End existing insertion block. */
-void
-cm_end ()
-{
- char *temp;
- enum insertion_type type;
-
- if (!insertion_level)
- {
- line_error (_("Unmatched `%c%s'"), COMMAND_PREFIX, command);
- return;
- }
-
- get_rest_of_line (&temp);
-
- if (temp[0] == 0)
- line_error (_("`%c%s' needs something after it"), COMMAND_PREFIX, command);
-
- type = find_type_from_name (temp);
-
- if (type == bad_type)
- {
- line_error (_("Bad argument to `%s', `%s', using `%s'"),
- command, temp, insertion_type_pname (current_insertion_type ()));
- }
- end_insertion (type);
- free (temp);
+ if (name_arg)
+ free (name_arg);
}
-/* **************************************************************** */
-/* */
-/* Conditional Handling */
-/* */
-/* **************************************************************** */
+/* Conditionals. */
/* A structure which contains `defined' variables. */
typedef struct defines {
@@ -6183,7 +3083,7 @@ typedef struct defines {
} DEFINE;
/* The linked list of `set' defines. */
-DEFINE *defines = (DEFINE *)NULL;
+DEFINE *defines = NULL;
/* Add NAME to the list of `set' defines. */
void
@@ -6201,7 +3101,7 @@ set (name, value)
return;
}
- temp = (DEFINE *)xmalloc (sizeof (DEFINE));
+ temp = xmalloc (sizeof (DEFINE));
temp->next = defines;
temp->name = xstrdup (name);
temp->value = xstrdup (value);
@@ -6213,9 +3113,9 @@ void
clear (name)
char *name;
{
- register DEFINE *temp, *last;
+ DEFINE *temp, *last;
- last = (DEFINE *)NULL;
+ last = NULL;
temp = defines;
while (temp)
@@ -6242,28 +3142,13 @@ char *
set_p (name)
char *name;
{
- register DEFINE *temp;
+ DEFINE *temp;
for (temp = defines; temp; temp = temp->next)
if (strcmp (temp->name, name) == 0)
- return (temp->value);
+ return temp->value;
- return ((char *)NULL);
-}
-
-/* Conditionally parse based on the current command name. */
-void
-command_name_condition ()
-{
- char *discarder;
-
- discarder = (char *)xmalloc (8 + strlen (command));
-
- sprintf (discarder, "\n%cend %s", COMMAND_PREFIX, command);
- discard_until (discarder);
- discard_until ("\n");
-
- free (discarder);
+ return NULL;
}
/* Create a variable whose name appears as the first word on this line. */
@@ -6310,7 +3195,7 @@ cm_ifeq ()
if (array_len (arglist) > 1)
{
if ((strcasecmp (arglist[0], arglist[1]) == 0) &&
- (arglist[2] != (char *)NULL))
+ (arglist[2]))
execute_string ("%s\n", arglist[2]);
}
@@ -6322,7 +3207,27 @@ void
cm_value (arg, start_pos, end_pos)
int arg, start_pos, end_pos;
{
- if (arg == END)
+ static int value_level = 0, saved_meta_pos = -1;
+
+ /* All the text after @value{ upto the matching } will eventually
+ disappear from output_paragraph, when this function is called
+ with ARG == END. If the text produced until then sets
+ meta_char_pos, we will need to restore it to the value it had
+ before @value was seen. So we need to save the previous value
+ of meta_char_pos here. */
+ if (arg == START)
+ {
+ /* If we are already inside some outer @value, don't overwrite
+ the value saved in saved_meta_pos. */
+ if (!value_level)
+ saved_meta_pos = meta_char_pos;
+ value_level++;
+ /* While the argument of @value is processed, we need to inhibit
+ textual transformations like "--" into "-", since @set didn't
+ do that when it grabbed the name of the variable. */
+ in_fixed_width_font++;
+ }
+ else
{
char *name = (char *) &output_paragraph[start_pos];
char *value;
@@ -6332,10 +3237,26 @@ cm_value (arg, start_pos, end_pos)
output_column -= end_pos - start_pos;
output_paragraph_offset = start_pos;
+ /* Restore the previous value of meta_char_pos if the stuff
+ inside this @value{} moved it. */
+ if (saved_meta_pos == -1) /* can't happen inside @value{} */
+ abort ();
+ if (value_level == 1
+ && meta_char_pos >= start_pos && meta_char_pos < end_pos)
+ {
+ meta_char_pos = saved_meta_pos;
+ saved_meta_pos = -1;
+ }
+ value_level--;
+ /* No need to decrement in_fixed_width_font, since before
+ we are called with arg == END, the reader loop already
+ popped the brace stack, which restored in_fixed_width_font,
+ among other things. */
+
if (value)
execute_string ("%s", value);
else
- add_word_args (_("{No Value For \"%s\"}"), name);
+ add_word_args (_("{No value for `%s'}"), name);
free (name);
}
@@ -6348,8 +3269,12 @@ handle_variable (action)
{
char *name;
- get_rest_of_line (&name);
- backup_input_pointer ();
+ get_rest_of_line (0, &name);
+ /* If we hit the end of text in get_rest_of_line, backing up
+ input pointer will cause the last character of the last line
+ be pushed back onto the input, which is wrong. */
+ if (input_text_offset < input_text_length)
+ backup_input_pointer ();
handle_variable_internal (action, name);
free (name);
}
@@ -6452,11 +3377,11 @@ handle_variable_internal (action, name)
{
int level = 0, done = 0;
- while (!done && input_text_offset < size_of_input_text)
+ while (!done && input_text_offset < input_text_length)
{
char *freeable_line, *line;
- get_rest_of_line (&freeable_line);
+ get_rest_of_line (0, &freeable_line);
for (line = freeable_line; whitespace (*line); line++);
@@ -6488,7 +3413,7 @@ handle_variable_internal (action, name)
}
free (freeable_line);
}
-
+
if (!done)
{
int save = line_number;
@@ -6497,7 +3422,7 @@ handle_variable_internal (action, name)
condition);
line_number = save;
}
-
+
/* We found the end of a false @ifset/ifclear. If we are
in a menu, back up over the newline that ends the ifset,
since that newline may also begin the next menu entry. */
@@ -6524,7 +3449,7 @@ typedef struct {
int in_use; /* Nonzero means string currently in use. */
} EXECUTION_STRING;
-static EXECUTION_STRING **execution_strings = (EXECUTION_STRING **)NULL;
+static EXECUTION_STRING **execution_strings = NULL;
static int execution_strings_index = 0;
static int execution_strings_slots = 0;
@@ -6532,8 +3457,8 @@ EXECUTION_STRING *
get_execution_string (initial_size)
int initial_size;
{
- register int i = 0;
- EXECUTION_STRING *es = (EXECUTION_STRING *)NULL;
+ int i = 0;
+ EXECUTION_STRING *es = NULL;
if (execution_strings)
{
@@ -6549,29 +3474,64 @@ get_execution_string (initial_size)
{
if (execution_strings_index + 1 >= execution_strings_slots)
{
- execution_strings = (EXECUTION_STRING **)xrealloc
+ execution_strings = xrealloc
(execution_strings,
(execution_strings_slots += 3) * sizeof (EXECUTION_STRING *));
for (; i < execution_strings_slots; i++)
- execution_strings[i] = (EXECUTION_STRING *)NULL;
+ execution_strings[i] = NULL;
}
execution_strings[execution_strings_index] =
- (EXECUTION_STRING *)xmalloc (sizeof (EXECUTION_STRING));
+ xmalloc (sizeof (EXECUTION_STRING));
es = execution_strings[execution_strings_index];
execution_strings_index++;
es->size = 0;
- es->string = (char *)NULL;
+ es->string = NULL;
es->in_use = 0;
}
if (initial_size > es->size)
{
- es->string = (char *) xrealloc (es->string, initial_size);
+ es->string = xrealloc (es->string, initial_size);
es->size = initial_size;
}
- return (es);
+ return es;
+}
+
+/* Given a pointer to TEXT and its desired length NEW_LEN, find TEXT's
+ entry in the execution_strings[] array and change the .STRING and
+ .SIZE members of that entry as appropriate. */
+void
+maybe_update_execution_strings (text, new_len)
+ char **text;
+ unsigned new_len;
+{
+ int i = 0;
+
+ if (execution_strings)
+ {
+ for (i = 0; i < execution_strings_index; i++)
+ if (execution_strings[i] && (execution_strings[i]->in_use == 1) &&
+ execution_strings[i]->string == *text)
+ {
+ /* Don't ever shrink the string storage in execution_strings[]!
+ execute_string assumes that it is always big enough to store
+ every possible execution_string, and will break if that's
+ not true. So we only enlarge the string storage if the
+ current size isn't big enough. */
+ if (execution_strings[i]->size < new_len)
+ {
+ execution_strings[i]->string =
+ *text = xrealloc (*text, new_len + 1);
+ execution_strings[i]->size = new_len + 1;
+ }
+ return;
+ }
+ }
+ /* We should *never* end up here, since if we are inside
+ execute_string, TEXT is always in execution_strings[]. */
+ abort ();
}
/* Execute the string produced by formatting the ARGs with FORMAT. This
@@ -6607,7 +3567,7 @@ execute_string (format, va_alist)
input_text_offset = 0;
input_text = temp_string;
input_filename = xstrdup (input_filename);
- size_of_input_text = strlen (temp_string);
+ input_text_length = strlen (temp_string);
executing_string++;
reader_loop ();
@@ -6619,8 +3579,8 @@ execute_string (format, va_alist)
}
-/* Return what would be output for STR, i.e., expand Texinfo commands.
- If IMPLICIT_CODE is set, expand @code{STR}. */
+/* Return what would be output for STR (in newly-malloced memory), i.e.,
+ expand Texinfo commands. If IMPLICIT_CODE is set, expand @code{STR}. */
char *
expansion (str, implicit_code)
@@ -6633,6 +3593,29 @@ expansion (str, implicit_code)
/* Inhibit any real output. */
int start = output_paragraph_offset;
int saved_paragraph_is_open = paragraph_is_open;
+ int saved_output_column = output_column;
+
+ /* Inhibit indentation and filling, so that extra newlines
+ are not added to the expansion. (This is undesirable if
+ we write the expanded text to macro_expansion_output_stream.) */
+ int saved_filling_enabled = filling_enabled;
+ int saved_indented_fill = indented_fill;
+ int saved_no_indent = no_indent;
+ int saved_escape_html = escape_html;
+ int saved_meta_pos = meta_char_pos;
+ int saved_last_char = last_inserted_character;
+ int saved_last_nl = last_char_was_newline;
+
+ /* If we are called in the middle of processing a command, we need
+ to dup and save the global variable `command' (which holds the
+ name of this command), since the recursive reader loop will free
+ it from under our feet if it finds any macros in STR. */
+ char *saved_command = command ? xstrdup (command) : NULL;
+
+ filling_enabled = 0;
+ indented_fill = 0;
+ no_indent = 1;
+ escape_html = 0;
inhibit_output_flushing ();
paragraph_is_open = 1;
@@ -6644,998 +3627,43 @@ expansion (str, implicit_code)
result = xmalloc (1 + length);
memcpy (result, (char *) (output_paragraph + start), length);
result[length] = 0;
-
+
/* Pretend it never happened. */
+ free_and_clear (&command);
+ command = saved_command;
output_paragraph_offset = start;
paragraph_is_open = saved_paragraph_is_open;
+ output_column = saved_output_column;
+ filling_enabled = saved_filling_enabled;
+ indented_fill = saved_indented_fill;
+ no_indent = saved_no_indent;
+ escape_html = saved_escape_html;
+ meta_char_pos = saved_meta_pos;
+ last_inserted_character = saved_last_char;
+ last_char_was_newline = saved_last_nl;
return result;
}
-
-/* @itemx, @item. */
-
-static int itemx_flag = 0;
-
-void
-cm_itemx ()
-{
- itemx_flag++;
- cm_item ();
- itemx_flag--;
-}
-
-void
-cm_item ()
-{
- char *rest_of_line, *item_func;
-
- /* Can only hack "@item" while inside of an insertion. */
- if (insertion_level)
- {
- INSERTION_ELT *stack = insertion_stack;
- int original_input_text_offset;
-
- skip_whitespace ();
- original_input_text_offset = input_text_offset;
-
- get_rest_of_line (&rest_of_line);
- item_func = current_item_function ();
-
- /* Okay, do the right thing depending on which insertion function
- is active. */
-
- switch_top:
- switch (stack->insertion)
- {
- case multitable:
- multitable_item ();
- /* Ultra special hack. It appears that some people incorrectly
- place text directly after the @item, instead of on a new line
- by itself. This happens to work in TeX, so I make it work
- here. */
- if (*rest_of_line)
- {
- line_number--;
- input_text_offset = original_input_text_offset;
- }
- break;
-
- case ifinfo:
- case ifset:
- case ifclear:
- case cartouche:
- stack = stack->next;
- if (!stack)
- goto no_insertion;
- else
- goto switch_top;
- break;
-
- case menu:
- case quotation:
- case example:
- case smallexample:
- case lisp:
- case format:
- case display:
- case group:
- line_error (_("The `%c%s' command is meaningless within a `@%s' block"),
- COMMAND_PREFIX, command,
- insertion_type_pname (current_insertion_type ()));
- break;
-
- case itemize:
- case enumerate:
- if (itemx_flag)
- {
- line_error (_("%citemx is not meaningful inside of a `%s' block"),
- COMMAND_PREFIX,
- insertion_type_pname (current_insertion_type ()));
- }
- else
- {
- start_paragraph ();
- kill_self_indent (-1);
- filling_enabled = indented_fill = 1;
-
- if (current_insertion_type () == itemize)
- {
- indent (output_column = current_indent - 2);
-
- /* I need some way to determine whether this command
- takes braces or not. I believe the user can type
- either "@bullet" or "@bullet{}". Of course, they
- can also type "o" or "#" or whatever else they want. */
- if (item_func && *item_func)
- {
- if (*item_func == COMMAND_PREFIX)
- if (item_func[strlen (item_func) - 1] != '}')
- execute_string ("%s{}", item_func);
- else
- execute_string ("%s", item_func);
- else
- execute_string ("%s", item_func);
- }
- insert (' ');
- output_column++;
- }
- else
- enumerate_item ();
-
- /* Special hack. This makes `close_paragraph' a no-op until
- `start_paragraph' has been called. */
- must_start_paragraph = 1;
-
- /* Handle text directly after the @item. */
- if (*rest_of_line)
- {
- line_number--;
- input_text_offset = original_input_text_offset;
- }
- }
- break;
-
- case table:
- case ftable:
- case vtable:
- {
- /* We need this to determine if we have two @item's in a row
- (see test just below). */
- static int last_item_output_position = 0;
-
- /* Get rid of extra characters. */
- kill_self_indent (-1);
-
- /* If we have one @item followed directly by another @item,
- we need to insert a blank line. This is not true for
- @itemx, though. */
- if (!itemx_flag && last_item_output_position == output_position)
- insert ('\n');
-
- /* `close_paragraph' almost does what we want. The problem
- is when paragraph_is_open, and last_char_was_newline, and
- the last newline has been turned into a space, because
- filling_enabled. I handle it here. */
- if (last_char_was_newline && filling_enabled && paragraph_is_open)
- insert ('\n');
- close_paragraph ();
-
-#if defined (INDENT_PARAGRAPHS_IN_TABLE)
- /* Indent on a new line, but back up one indentation level. */
- {
- int save = inhibit_paragraph_indentation;
- inhibit_paragraph_indentation = 1;
- /* At this point, inserting any non-whitespace character will
- force the existing indentation to be output. */
- add_char ('i');
- inhibit_paragraph_indentation = save;
- }
-#else /* !INDENT_PARAGRAPHS_IN_TABLE */
- add_char ('i');
-#endif /* !INDENT_PARAGRAPHS_IN_TABLE */
-
- output_paragraph_offset--;
- kill_self_indent (default_indentation_increment + 1);
-
- /* Add item's argument to the line. */
- filling_enabled = 0;
- if (item_func && *item_func)
- execute_string ("%s{%s}", item_func, rest_of_line);
- else
- execute_string ("%s", rest_of_line);
-
- if (current_insertion_type () == ftable)
- execute_string ("%cfindex %s\n", COMMAND_PREFIX, rest_of_line);
- else if (current_insertion_type () == vtable)
- execute_string ("%cvindex %s\n", COMMAND_PREFIX, rest_of_line);
-
- /* Start a new line, and let start_paragraph ()
- do the indenting of it for you. */
- close_single_paragraph ();
- indented_fill = filling_enabled = 1;
- last_item_output_position = output_position;
- }
- }
- free (rest_of_line);
- }
- else
- {
- no_insertion:
- line_error (_("%c%s found outside of an insertion block"),
- COMMAND_PREFIX, command);
- }
-}
-
-/* **************************************************************** */
-/* */
-/* Defun and Friends */
-/* */
-/* **************************************************************** */
-
-#define DEFUN_SELF_DELIMITING(c) \
- (((c) == '(') \
- || ((c) == ')') \
- || ((c) == '[') \
- || ((c) == ']'))
-
-struct token_accumulator
-{
- unsigned int length;
- unsigned int index;
- char **tokens;
-};
-
-void
-initialize_token_accumulator (accumulator)
- struct token_accumulator *accumulator;
-{
- (accumulator->length) = 0;
- (accumulator->index) = 0;
- (accumulator->tokens) = NULL;
-}
-
-void
-accumulate_token (accumulator, token)
- struct token_accumulator *accumulator;
- char *token;
-{
- if ((accumulator->index) >= (accumulator->length))
- {
- (accumulator->length) += 10;
- (accumulator->tokens) = (char **) xrealloc
- (accumulator->tokens, (accumulator->length * sizeof (char *)));
- }
- accumulator->tokens[accumulator->index] = token;
- accumulator->index += 1;
-}
-
-char *
-copy_substring (start, end)
- char *start;
- char *end;
-{
- char *result, *scan, *scan_result;
-
- result = (char *) xmalloc ((end - start) + 1);
- scan_result = result;
- scan = start;
-
- while (scan < end)
- *scan_result++ = *scan++;
-
- *scan_result = 0;
- return (result);
-}
-/* Given `string' pointing at an open brace, skip forward and return a
- pointer to just past the matching close brace. */
-int
-scan_group_in_string (string_pointer)
- char **string_pointer;
-{
- register int c;
- register char *scan_string;
- register unsigned int level = 1;
-
- scan_string = (*string_pointer) + 1;
-
- while (1)
- {
- if (level == 0)
- {
- (*string_pointer) = scan_string;
- return (1);
- }
- c = (*scan_string++);
- if (c == 0)
- {
- /* Tweak line_number to compensate for fact that
- we gobbled the whole line before coming here. */
- line_number -= 1;
- line_error (_("Missing `}' in %cdef arg"), COMMAND_PREFIX);
- line_number += 1;
- (*string_pointer) = (scan_string - 1);
- return (0);
- }
- if (c == '{')
- level += 1;
- if (c == '}')
- level -= 1;
- }
-}
-/* Return a list of tokens from the contents of `string'.
- Commands and brace-delimited groups count as single tokens.
- Contiguous whitespace characters are converted to a token
- consisting of a single space. */
-char **
-args_from_string (string)
- char *string;
-{
- struct token_accumulator accumulator;
- register char *scan_string = string;
- char *token_start, *token_end;
-
- initialize_token_accumulator (&accumulator);
-
- while ((*scan_string) != 0)
- {
- /* Replace arbitrary whitespace by a single space. */
- if (whitespace (*scan_string))
- {
- scan_string += 1;
- while (whitespace (*scan_string))
- scan_string += 1;
- accumulate_token ((&accumulator), (xstrdup (" ")));
- continue;
- }
-
- /* Commands count as single tokens. */
- if ((*scan_string) == COMMAND_PREFIX)
- {
- token_start = scan_string;
- scan_string += 1;
- if (self_delimiting (*scan_string))
- scan_string += 1;
- else
- {
- register int c;
- while (1)
- {
- c = *scan_string++;
-
- if ((c == 0) || (c == '{') || (whitespace (c)))
- {
- scan_string -= 1;
- break;
- }
- }
-
- if (*scan_string == '{')
- {
- char *s = scan_string;
- (void) scan_group_in_string (&s);
- scan_string = s;
- }
- }
- token_end = scan_string;
- }
-
- /* Parentheses and brackets are self-delimiting. */
- else if (DEFUN_SELF_DELIMITING (*scan_string))
- {
- token_start = scan_string;
- scan_string += 1;
- token_end = scan_string;
- }
-
- /* Open brace introduces a group that is a single token. */
- else if (*scan_string == '{')
- {
- char *s = scan_string;
- int balanced = scan_group_in_string (&s);
-
- token_start = scan_string + 1;
- scan_string = s;
- token_end = balanced ? (scan_string - 1) : scan_string;
- }
-
- /* Otherwise a token is delimited by whitespace, parentheses,
- brackets, or braces. A token is also ended by a command. */
- else
- {
- token_start = scan_string;
-
- while (1)
- {
- register int c;
-
- c = *scan_string++;
-
- /* Do not back up if we're looking at a }; since the only
- valid }'s are those matched with {'s, we want to give
- an error. If we back up, we go into an infinite loop. */
- if (!c || whitespace (c) || DEFUN_SELF_DELIMITING (c)
- || c == '{')
- {
- scan_string--;
- break;
- }
-
- /* If we encounter a command embedded within a token,
- then end the token. */
- if (c == COMMAND_PREFIX)
- {
- scan_string--;
- break;
- }
- }
- token_end = scan_string;
- }
-
- accumulate_token
- (&accumulator, copy_substring (token_start, token_end));
- }
- accumulate_token (&accumulator, NULL);
- return (accumulator.tokens);
-}
-
-void
-process_defun_args (defun_args, auto_var_p)
- char **defun_args;
- int auto_var_p;
-{
- int pending_space = 0;
-
- while (1)
- {
- char *defun_arg = *defun_args++;
-
- if (defun_arg == NULL)
- break;
-
- if (defun_arg[0] == ' ')
- {
- pending_space = 1;
- continue;
- }
-
- if (pending_space)
- {
- add_char (' ');
- pending_space = 0;
- }
-
- if (DEFUN_SELF_DELIMITING (defun_arg[0]))
- add_char (defun_arg[0]);
- else if (defun_arg[0] == '&')
- add_word (defun_arg);
- else if (defun_arg[0] == COMMAND_PREFIX)
- execute_string ("%s", defun_arg);
- else if (auto_var_p)
- execute_string ("%cvar{%s}", COMMAND_PREFIX, defun_arg);
- else
- add_word (defun_arg);
- }
-}
+/* Return text (info) expansion of STR no matter what the current output
+ format is. */
char *
-next_nonwhite_defun_arg (arg_pointer)
- char ***arg_pointer;
-{
- char **scan = (*arg_pointer);
- char *arg = (*scan++);
-
- if ((arg != 0) && (*arg == ' '))
- arg = *scan++;
-
- if (arg == 0)
- scan -= 1;
-
- *arg_pointer = scan;
-
- return ((arg == 0) ? "" : arg);
-}
-
-/* Make the defun type insertion.
- TYPE says which insertion this is.
- X_P, if nonzero, says not to start a new insertion. */
-void
-defun_internal (type, x_p)
- enum insertion_type type;
- int x_p;
+text_expansion (str)
+ char *str;
{
- enum insertion_type base_type;
- char **defun_args, **scan_args;
- char *category, *defined_name, *type_name, *type_name2;
-
- {
- char *line;
- get_rest_of_line (&line);
- defun_args = (args_from_string (line));
- free (line);
- }
-
- scan_args = defun_args;
-
- switch (type)
- {
- case defun:
- category = _("Function");
- base_type = deffn;
- break;
- case defmac:
- category = _("Macro");
- base_type = deffn;
- break;
- case defspec:
- category = _("Special Form");
- base_type = deffn;
- break;
- case defvar:
- category = _("Variable");
- base_type = defvr;
- break;
- case defopt:
- category = _("User Option");
- base_type = defvr;
- break;
- case deftypefun:
- category = _("Function");
- base_type = deftypefn;
- break;
- case deftypevar:
- category = _("Variable");
- base_type = deftypevr;
- break;
- case defivar:
- category = _("Instance Variable");
- base_type = defcv;
- break;
- case defmethod:
- category = _("Method");
- base_type = defop;
- break;
- case deftypemethod:
- category = _("Method");
- base_type = deftypemethod;
- break;
- default:
- category = next_nonwhite_defun_arg (&scan_args);
- base_type = type;
- break;
- }
-
- if ((base_type == deftypefn)
- || (base_type == deftypevr)
- || (base_type == defcv)
- || (base_type == defop)
- || (base_type == deftypemethod))
- type_name = next_nonwhite_defun_arg (&scan_args);
-
- if (base_type == deftypemethod)
- type_name2 = next_nonwhite_defun_arg (&scan_args);
-
- defined_name = next_nonwhite_defun_arg (&scan_args);
-
- /* This hack exists solely for the purposes of formatting the texinfo
- manual. I couldn't think of a better way. The token might be
- a simple @@ followed immediately by more text. If this is the case,
- then the next defun arg is part of this one, and we should concatenate
- them. */
- if (*scan_args && **scan_args && !whitespace (**scan_args) &&
- (strcmp (defined_name, "@@") == 0))
- {
- char *tem = (char *)xmalloc (3 + strlen (scan_args[0]));
-
- sprintf (tem, "@@%s", scan_args[0]);
-
- free (scan_args[0]);
- scan_args[0] = tem;
- scan_args++;
- defined_name = tem;
- }
-
- if (!x_p)
- begin_insertion (type);
-
- /* Write the definition header line.
- This should start at the normal indentation. */
- current_indent -= default_indentation_increment;
- start_paragraph ();
-
- switch (base_type)
- {
- case deffn:
- case defvr:
- case deftp:
- execute_string (" -- %s: %s", category, defined_name);
- break;
- case deftypefn:
- case deftypevr:
- execute_string (" -- %s: %s %s", category, type_name, defined_name);
- break;
- case defcv:
- execute_string (" -- %s of %s: %s", category, type_name, defined_name);
- break;
- case defop:
- execute_string (" -- %s on %s: %s", category, type_name, defined_name);
- break;
- case deftypemethod:
- execute_string (" -- %s on %s: %s %s", category, type_name, type_name2,
- defined_name);
- break;
- }
- current_indent += default_indentation_increment;
-
- /* Now process the function arguments, if any.
- If these carry onto the next line, they should be indented by two
- increments to distinguish them from the body of the definition,
- which is indented by one increment. */
- current_indent += default_indentation_increment;
-
- switch (base_type)
- {
- case deffn:
- case defop:
- process_defun_args (scan_args, 1);
- break;
-
- /* Through Makeinfo 1.67 we processed remaining args only for deftp,
- deftypefn, and deftypemethod. But the libc manual, for example,
- needs to say:
- @deftypevar {char *} tzname[2]
- And simply allowing the extra text seems far simpler than trying
- to invent yet more defn commands. In any case, we should either
- output it or give an error, not silently ignore it. */
- default:
- process_defun_args (scan_args, 0);
- break;
- }
- current_indent -= default_indentation_increment;
- close_single_paragraph ();
-
- /* Make an entry in the appropriate index. */
- switch (base_type)
- {
- case deffn:
- case deftypefn:
- execute_string ("%cfindex %s\n", COMMAND_PREFIX, defined_name);
- break;
- case defvr:
- case deftypevr:
- case defcv:
- execute_string ("%cvindex %s\n", COMMAND_PREFIX, defined_name);
- break;
- case defop:
- case deftypemethod:
- execute_string ("%cfindex %s on %s\n",
- COMMAND_PREFIX, defined_name, type_name);
- break;
- case deftp:
- execute_string ("%ctindex %s\n", COMMAND_PREFIX, defined_name);
- break;
- }
-
- /* Deallocate the token list. */
- scan_args = defun_args;
- while (1)
- {
- char * arg = (*scan_args++);
- if (arg == NULL)
- break;
- free (arg);
- }
- free (defun_args);
+ char *ret;
+ int save_html = html;
+
+ html = 0;
+ ret = expansion (str, 0);
+ html = save_html;
+
+ return ret;
}
-/* Add an entry for a function, macro, special form, variable, or option.
- If the name of the calling command ends in `x', then this is an extra
- entry included in the body of an insertion of the same type. */
-void
-cm_defun ()
-{
- int x_p;
- enum insertion_type type;
- char *temp = xstrdup (command);
-
- x_p = (command[strlen (command) - 1] == 'x');
-
- if (x_p)
- temp[strlen (temp) - 1] = 0;
-
- type = find_type_from_name (temp);
- free (temp);
-
- /* If we are adding to an already existing insertion, then make sure
- that we are already in an insertion of type TYPE. */
- if (x_p &&
- (!insertion_level || insertion_stack->insertion != type))
- {
- line_error (_("Must be in a `%s' insertion in order to use `%s'x"),
- command, command);
- discard_until ("\n");
- return;
- }
-
- defun_internal (type, x_p);
-}
-/* **************************************************************** */
-/* */
-/* Other Random Commands */
-/* */
-/* **************************************************************** */
-
-/* This says to inhibit the indentation of the next paragraph, but
- not of following paragraphs. */
-void
-cm_noindent ()
-{
- if (!inhibit_paragraph_indentation)
- inhibit_paragraph_indentation = -1;
-}
-
-/* I don't know exactly what to do with this. Should I allow
- someone to switch filenames in the middle of output? Since the
- file could be partially written, this doesn't seem to make sense.
- Another option: ignore it, since they don't *really* want to
- switch files. Finally, complain, or at least warn. */
-void
-cm_setfilename ()
-{
- char *filename;
- get_rest_of_line (&filename);
- /* warning ("`@%s %s' encountered and ignored", command, filename); */
- free (filename);
-}
-
-void
-cm_ignore_line ()
-{
- discard_until ("\n");
-}
-
-/* @br can be immediately followed by `{}', so we have to read those here.
- It should simply close the paragraph. */
-void
-cm_br ()
-{
- if (looking_at ("{}"))
- input_text_offset += 2;
-
- if (curchar () == '\n')
- {
- input_text_offset++;
- line_number++;
- }
-
- close_paragraph ();
-}
-
- /* Insert the number of blank lines passed as argument. */
-void
-cm_sp ()
-{
- int lines;
- char *line;
-
- get_rest_of_line (&line);
-
- if (sscanf (line, "%d", &lines) != 1)
- {
- line_error (_("%csp requires a positive numeric argument"), COMMAND_PREFIX);
- }
- else
- {
- if (lines < 0)
- lines = 0;
-
- while (lines--)
- add_char ('\n');
- }
- free (line);
-}
-
-/* @dircategory LINE outputs INFO-DIR-SECTION LINE,
- but not if --no-headers. */
-
-void
-cm_dircategory ()
-{
- char *line;
-
- get_rest_of_line (&line);;
-
- if (!no_headers)
- {
- insert_string ("INFO-DIR-SECTION ");
- insert_string (line);
- insert ('\n');
- }
-
- free (line);
-}
-
-/* Start a new line with just this text on it.
- Then center the line of text.
- This always ends the current paragraph. */
-void
-cm_center ()
-{
- register int i, start, length;
- int fudge_factor = 1;
- unsigned char *line;
-
- close_paragraph ();
- filling_enabled = indented_fill = 0;
- cm_noindent ();
- start = output_paragraph_offset;
- inhibit_output_flushing ();
- get_rest_of_line ((char **)&line);
- execute_string ("%s", (char *)line);
- free (line);
- uninhibit_output_flushing ();
-
- i = output_paragraph_offset - 1;
- while (i > (start - 1) && output_paragraph[i] == '\n')
- i--;
-
- output_paragraph_offset = ++i;
- length = output_paragraph_offset - start;
-
- if (length < (fill_column - fudge_factor))
- {
- line = (unsigned char *)xmalloc (1 + length);
- memcpy (line, (char *)(output_paragraph + start), length);
-
- i = (fill_column - fudge_factor - length) / 2;
- output_paragraph_offset = start;
-
- while (i--)
- insert (' ');
-
- for (i = 0; i < length; i++)
- insert (line[i]);
-
- free (line);
- }
-
- insert ('\n');
- close_paragraph ();
- filling_enabled = 1;
-}
-
-/* Show what an expression returns. */
-void
-cm_result (arg)
- int arg;
-{
- if (arg == END)
- add_word ("=>");
-}
-
-/* What an expression expands to. */
-void
-cm_expansion (arg)
- int arg;
-{
- if (arg == END)
- add_word ("==>");
-}
-
-/* Indicates two expressions are equivalent. */
-void
-cm_equiv (arg)
- int arg;
-{
- if (arg == END)
- add_word ("==");
-}
-
-/* What an expression may print. */
-void
-cm_print (arg)
- int arg;
-{
- if (arg == END)
- add_word ("-|");
-}
-
-/* An error signaled. */
-void
-cm_error (arg)
- int arg;
-{
- if (arg == END)
- add_word ("error-->");
-}
-
-/* The location of point in an example of a buffer. */
-void
-cm_point (arg)
- int arg;
-{
- if (arg == END)
- add_word ("-!-");
-}
-
-/* Start a new line with just this text on it.
- The text is outdented one level if possible. */
-void
-cm_exdent ()
-{
- char *line;
- int i = current_indent;
-
- if (current_indent)
- current_indent -= default_indentation_increment;
-
- get_rest_of_line (&line);
- close_single_paragraph ();
- execute_string ("%s", line);
- current_indent = i;
- free (line);
- close_single_paragraph ();
-}
-
-
-/* Remember this file, and move onto the next. */
-void
-cm_include ()
-{
- char *filename;
-
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- me_append_before_this_command ();
-#endif /* HAVE_MACROS */
-
- close_paragraph ();
- get_rest_of_line (&filename);
-
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- remember_itext (input_text, input_text_offset);
-#endif /* HAVE_MACROS */
-
- pushfile ();
-
- /* In verbose mode we print info about including another file. */
- if (verbose_mode)
- {
- register int i = 0;
- register FSTACK *stack = filestack;
-
- for (i = 0, stack = filestack; stack; stack = stack->next, i++);
-
- i *= 2;
-
- printf ("%*s", i, "");
- printf ("%c%s %s\n", COMMAND_PREFIX, command, filename);
- fflush (stdout);
- }
-
- if (!find_and_load (filename))
- {
- extern int errno;
-
- popfile ();
- line_number--;
-
- /* Cannot "@include foo", in line 5 of "/wh/bar". */
- line_error ("%c%s %s: %s", COMMAND_PREFIX, command, filename,
- strerror (errno));
-
- free (filename);
- return;
- }
- else
- {
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- remember_itext (input_text, input_text_offset);
-#endif /* HAVE_MACROS */
- reader_loop ();
- }
- free (filename);
- popfile ();
-}
-
-/* The other side of a malformed expression. */
-void
-misplaced_brace ()
-{
- line_error (_("Misplaced %c"), '}');
-}
-
-/* Signals end of processing. Easy to make this happen. */
-void
-cm_bye ()
-{
- input_text_offset = size_of_input_text;
-}
-
/* Set the paragraph indentation variable to the value specified in STRING.
Values can be:
`asis': Don't change existing indentation.
@@ -7654,1929 +3682,12 @@ set_paragraph_indent (string)
else
{
if (sscanf (string, "%d", &paragraph_start_indent) != 1)
- return (-1);
+ return -1;
else
{
if (paragraph_start_indent == 0)
paragraph_start_indent = -1;
}
}
- return (0);
-}
-
-void
-cm_paragraphindent ()
-{
- char *arg;
-
- get_rest_of_line (&arg);
- if (set_paragraph_indent (arg) != 0)
- line_error (_("Bad argument to %c%s"), COMMAND_PREFIX, command);
-
- free (arg);
-}
-
-/* **************************************************************** */
-/* */
-/* Indexing Stuff */
-/* */
-/* **************************************************************** */
-
-
-/* An index element... */
-typedef struct index_elt
-{
- struct index_elt *next;
- char *entry; /* The index entry itself. */
- char *node; /* The node from whence it came. */
- int code; /* Nonzero means add `@code{...}' when
- printing this element. */
- int defining_line; /* Line number where this entry was written. */
- char *defining_file; /* Source file for defining_line. */
-} INDEX_ELT;
-
-/* A list of short-names for each index.
-
- There are two indices into the the_indices array.
-
- * read_index is the index that points to the list of index
- entries that we will find if we ask for the list of entries for
- this name.
-
- * write_index is the index that points to the list of index entries
- that we will add new entries to.
-
- Initially, read_index and write index are the same, but the
- @syncodeindex and @synindex commands can change the list we add
- entries to.
-
- For example, after the commands
-
- @cindex foo
- @defindex ii
- @synindex cp ii
- @cindex bar
-
- the cp index will contain the entry `foo', and the new ii
- index will contain the entry `bar'. This is consistent with the
- way texinfo.tex handles the same situation.
-
- In addition, for each index, it is remembered whether that index is
- a code index or not. Code indices have @code{} inserted around the
- first word when they are printed with printindex. */
-typedef struct
-{
- char *name;
- int read_index; /* index entries for `name' */
- int write_index; /* store index entries here, @synindex can change it */
- int code;
-} INDEX_ALIST;
-
-INDEX_ALIST **name_index_alist = (INDEX_ALIST **) NULL;
-
-/* An array of pointers. Each one is for a different index. The
- "synindex" command changes which array slot is pointed to by a
- given "index". */
-INDEX_ELT **the_indices = (INDEX_ELT **) NULL;
-
-/* The number of defined indices. */
-int defined_indices = 0;
-
-void
-init_indices ()
-{
- int i;
-
- /* Create the default data structures. */
-
- /* Initialize data space. */
- if (!the_indices)
- {
- the_indices = (INDEX_ELT **) xmalloc ((1 + defined_indices) *
- sizeof (INDEX_ELT *));
- the_indices[defined_indices] = (INDEX_ELT *) NULL;
-
- name_index_alist = (INDEX_ALIST **) xmalloc ((1 + defined_indices) *
- sizeof (INDEX_ALIST *));
- name_index_alist[defined_indices] = (INDEX_ALIST *) NULL;
- }
-
- /* If there were existing indices, get rid of them now. */
- for (i = 0; i < defined_indices; i++)
- {
- undefindex (name_index_alist[i]->name);
- if (name_index_alist[i])
- { /* Suppose we're called with two input files, and the first
- does a @synindex pg cp. Then, when we get here to start
- the second file, the "pg" element won't get freed by
- undefindex (because it's pointing to "cp"). So free it
- here; otherwise, when we try to define the pg index again
- just below, it will still point to cp. */
- free (name_index_alist[i]->name);
- free (name_index_alist[i]);
- name_index_alist[i] = (INDEX_ALIST *) NULL;
- }
- }
-
- /* Add the default indices. */
- top_defindex ("cp", 0); /* cp is the only non-code index. */
- top_defindex ("fn", 1);
- top_defindex ("ky", 1);
- top_defindex ("pg", 1);
- top_defindex ("tp", 1);
- top_defindex ("vr", 1);
-}
-
-/* Find which element in the known list of indices has this name.
- Returns -1 if NAME isn't found. */
-int
-find_index_offset (name)
- char *name;
-{
- register int i;
- for (i = 0; i < defined_indices; i++)
- if (name_index_alist[i] &&
- strcmp (name, name_index_alist[i]->name) == 0)
- return (i);
- return (-1);
-}
-
-/* Return a pointer to the entry of (name . index) for this name.
- Return NULL if the index doesn't exist. */
-INDEX_ALIST *
-find_index (name)
- char *name;
-{
- int offset = find_index_offset (name);
- if (offset > -1)
- return (name_index_alist[offset]);
- else
- return ((INDEX_ALIST *) NULL);
-}
-
-/* Given an index name, return the offset in the_indices of this index,
- or -1 if there is no such index. */
-int
-translate_index (name)
- char *name;
-{
- INDEX_ALIST *which = find_index (name);
-
- if (which)
- return (which->read_index);
- else
- return (-1);
-}
-
-/* Return the index list which belongs to NAME. */
-INDEX_ELT *
-index_list (name)
- char *name;
-{
- int which = translate_index (name);
- if (which < 0)
- return ((INDEX_ELT *) -1);
- else
- return (the_indices[which]);
-}
-
-/* Please release me, let me go... */
-void
-free_index (index)
- INDEX_ELT *index;
-{
- INDEX_ELT *temp;
-
- while ((temp = index) != (INDEX_ELT *) NULL)
- {
- free (temp->entry);
- /* Do not free the node, because we already freed the tag table,
- which freed all the node names. */
- /* free (temp->node); */
- index = index->next;
- free (temp);
- }
-}
-
-/* Flush an index by name. This will delete the list of entries that
- would be written by a @printindex command for this index. */
-void
-undefindex (name)
- char *name;
-{
- int i;
- int which = find_index_offset (name);
-
- /* The index might have already been freed if this was the target of
- an @synindex. */
- if (which < 0 || !name_index_alist[which])
- return;
-
- i = name_index_alist[which]->read_index;
-
- free_index (the_indices[i]);
- the_indices[i] = (INDEX_ELT *) NULL;
-
- free (name_index_alist[which]->name);
- free (name_index_alist[which]);
- name_index_alist[which] = (INDEX_ALIST *) NULL;
-}
-
-/* Define an index known as NAME. We assign the slot number.
- CODE if Nonzero says to make this a code index. */
-void
-defindex (name, code)
- char *name;
- int code;
-{
- register int i, slot;
-
- /* If it already exists, flush it. */
- undefindex (name);
-
- /* Try to find an empty slot. */
- slot = -1;
- for (i = 0; i < defined_indices; i++)
- if (!name_index_alist[i])
- {
- slot = i;
- break;
- }
-
- if (slot < 0)
- {
- /* No such luck. Make space for another index. */
- slot = defined_indices;
- defined_indices++;
-
- name_index_alist = (INDEX_ALIST **)
- xrealloc ((char *)name_index_alist,
- (1 + defined_indices) * sizeof (INDEX_ALIST *));
- the_indices = (INDEX_ELT **)
- xrealloc ((char *)the_indices,
- (1 + defined_indices) * sizeof (INDEX_ELT *));
- }
-
- /* We have a slot. Start assigning. */
- name_index_alist[slot] = (INDEX_ALIST *) xmalloc (sizeof (INDEX_ALIST));
- name_index_alist[slot]->name = xstrdup (name);
- name_index_alist[slot]->read_index = slot;
- name_index_alist[slot]->write_index = slot;
- name_index_alist[slot]->code = code;
-
- the_indices[slot] = (INDEX_ELT *) NULL;
-}
-
-/* Add the arguments to the current index command to the index NAME. */
-void
-index_add_arg (name)
- char *name;
-{
- int which;
- char *index_entry;
- INDEX_ALIST *tem;
-
- tem = find_index (name);
-
- which = tem ? tem->write_index : -1;
-
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- append_to_expansion_output (input_text_offset + 1);
-#endif /* HAVE_MACROS */
-
- get_rest_of_line (&index_entry);
- ignore_blank_line ();
-
-#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream && !executing_string)
- {
- int op_orig;
-
- remember_itext (input_text, input_text_offset);
- op_orig = output_paragraph_offset;
- me_execute_string (index_entry);
- me_execute_string ("\n");
- output_paragraph_offset = op_orig;
- }
-#endif /* HAVE_MACROS */
-
- if (which < 0)
- {
- line_error (_("Unknown index `%s'"), name);
- free (index_entry);
- }
- else
- {
- INDEX_ELT *new = (INDEX_ELT *) xmalloc (sizeof (INDEX_ELT));
- new->next = the_indices[which];
- new->entry = index_entry;
- new->node = current_node;
- new->code = tem->code;
- new->defining_line = line_number - 1;
- new->defining_file = input_filename;
- the_indices[which] = new;
- }
-}
-
-#define INDEX_COMMAND_SUFFIX "index"
-
-/* The function which user defined index commands call. */
-void
-gen_index ()
-{
- char *name = xstrdup (command);
- if (strlen (name) >= strlen ("index"))
- name[strlen (name) - strlen ("index")] = 0;
- index_add_arg (name);
- free (name);
-}
-
-void
-top_defindex (name, code)
- char *name;
- int code;
-{
- char *temp;
-
- temp = (char *) xmalloc (1 + strlen (name) + strlen ("index"));
- sprintf (temp, "%sindex", name);
- define_user_command (temp, gen_index, 0);
- defindex (name, code);
- free (temp);
-}
-
-/* Define a new index command. Arg is name of index. */
-void
-cm_defindex ()
-{
- gen_defindex (0);
-}
-
-void
-cm_defcodeindex ()
-{
- gen_defindex (1);
-}
-
-void
-gen_defindex (code)
- int code;
-{
- char *name;
- get_rest_of_line (&name);
-
- if (find_index (name))
- {
- line_error (_("Index `%s' already exists"), name);
- free (name);
- return;
- }
- else
- {
- char *temp = (char *) alloca (1 + strlen (name) + strlen ("index"));
- sprintf (temp, "%sindex", name);
- define_user_command (temp, gen_index, 0);
- defindex (name, code);
- free (name);
- }
-}
-
-/* Expects 2 args, on the same line. Both are index abbreviations.
- Make the first one be a synonym for the second one, i.e. make the
- first one have the same index as the second one. */
-void
-cm_synindex ()
-{
- int source, target;
- char *abbrev1, *abbrev2;
-
- skip_whitespace ();
- get_until_in_line (0, " ", &abbrev1);
- target = find_index_offset (abbrev1);
- skip_whitespace ();
- get_until_in_line (0, " ", &abbrev2);
- source = find_index_offset (abbrev2);
- if (source < 0 || target < 0)
- {
- line_error (_("Unknown index `%s' and/or `%s' in @synindex"),
- abbrev1, abbrev2);
- }
- else
- {
- name_index_alist[target]->write_index
- = name_index_alist[source]->write_index;
- }
-
- free (abbrev1);
- free (abbrev2);
-}
-
-void
-cm_pindex () /* Pinhead index. */
-{
- index_add_arg ("pg");
-}
-
-void
-cm_vindex () /* Variable index. */
-{
- index_add_arg ("vr");
-}
-
-void
-cm_kindex () /* Key index. */
-{
- index_add_arg ("ky");
-}
-
-void
-cm_cindex () /* Concept index. */
-{
- index_add_arg ("cp");
-}
-
-void
-cm_findex () /* Function index. */
-{
- index_add_arg ("fn");
-}
-
-void
-cm_tindex () /* Data Type index. */
-{
- index_add_arg ("tp");
-}
-
-/* Sorting the index. */
-int
-index_element_compare (element1, element2)
- INDEX_ELT **element1, **element2;
-{
- return (strcasecmp ((*element1)->entry, (*element2)->entry));
-}
-
-/* Force all index entries to be unique. */
-void
-make_index_entries_unique (array, count)
- INDEX_ELT **array;
- int count;
-{
- register int i, j;
- INDEX_ELT **copy;
- int counter = 1;
-
- copy = (INDEX_ELT **)xmalloc ((1 + count) * sizeof (INDEX_ELT *));
-
- for (i = 0, j = 0; i < count; i++)
- {
- if ((i == (count - 1)) ||
- (array[i]->node != array[i + 1]->node) ||
- (strcmp (array[i]->entry, array[i + 1]->entry) != 0))
- copy[j++] = array[i];
- else
- {
- free (array[i]->entry);
- free (array[i]);
- }
- }
- copy[j] = (INDEX_ELT *)NULL;
-
- /* Now COPY contains only unique entries. Duplicated entries in the
- original array have been freed. Replace the current array with
- the copy, fixing the NEXT pointers. */
- for (i = 0; copy[i] != (INDEX_ELT *)NULL; i++)
- {
-
- copy[i]->next = copy[i + 1];
-
- /* Fix entry names which are the same. They point to different nodes,
- so we make the entry name unique. */
- if ((copy[i + 1] != (INDEX_ELT *)NULL) &&
- (strcmp (copy[i]->entry, copy[i + 1]->entry) == 0))
- {
- char *new_entry_name;
-
- new_entry_name = (char *)xmalloc (10 + strlen (copy[i]->entry));
- sprintf (new_entry_name, "%s <%d>", copy[i]->entry, counter);
- free (copy[i]->entry);
- copy[i]->entry = new_entry_name;
- counter++;
- }
- else
- counter = 1;
-
- array[i] = copy[i];
- }
- array[i] = (INDEX_ELT *)NULL;
-
- /* Free the storage used only by COPY. */
- free (copy);
-}
-
-/* Sort the index passed in INDEX, returning an array of
- pointers to elements. The array is terminated with a NULL
- pointer. We call qsort because it's supposed to be fast.
- I think this looks bad. */
-INDEX_ELT **
-sort_index (index)
- INDEX_ELT *index;
-{
- INDEX_ELT **array;
- INDEX_ELT *temp = index;
- int count = 0;
- int save_line_number = line_number;
- char *save_input_filename = input_filename;
-
- while (temp != (INDEX_ELT *) NULL)
- {
- count++;
- temp = temp->next;
- }
-
- /* We have the length. Make an array. */
-
- array = (INDEX_ELT **) xmalloc ((count + 1) * sizeof (INDEX_ELT *));
- count = 0;
- temp = index;
-
- while (temp != (INDEX_ELT *) NULL)
- {
- array[count++] = temp;
-
- /* Set line number and input filename to the source line for this
- index entry, as this expansion finds any errors. */
- line_number = array[count - 1]->defining_line;
- input_filename = array[count - 1]->defining_file;
-
- /* If this particular entry should be printed as a "code" index,
- then wrap the entry with "@code{...}". */
- array[count - 1]->entry = expansion (temp->entry, index->code);
-
- temp = temp->next;
- }
- array[count] = (INDEX_ELT *) NULL; /* terminate the array. */
- line_number = save_line_number;
- input_filename = save_input_filename;
-
- /* Sort the array. */
- qsort (array, count, sizeof (INDEX_ELT *), index_element_compare);
- make_index_entries_unique (array, count);
- return (array);
-}
-
-/* Nonzero means that we are in the middle of printing an index. */
-int printing_index = 0;
-
-/* Takes one arg, a short name of an index to print.
- Outputs a menu of the sorted elements of the index. */
-void
-cm_printindex ()
-{
- int item;
- INDEX_ELT *index;
- INDEX_ELT **array;
- char *index_name;
- unsigned line_length;
- char *line;
- int saved_inhibit_paragraph_indentation = inhibit_paragraph_indentation;
- int saved_filling_enabled = filling_enabled;
-
- close_paragraph ();
- get_rest_of_line (&index_name);
-
- index = index_list (index_name);
- if (index == (INDEX_ELT *)-1)
- {
- line_error (_("Unknown index `%s' in @printindex"), index_name);
- free (index_name);
- return;
- }
- else
- free (index_name);
-
- /* Do this before sorting, so execute_string in index_element_compare
- will give the same results as when we actually print. */
- printing_index = 1;
- filling_enabled = 0;
- inhibit_paragraph_indentation = 1;
- array = sort_index (index);
-
- close_paragraph ();
- add_word (_("* Menu:\n\n"));
-
-#if defined (HAVE_MACROS)
- me_inhibit_expansion++;
-#endif /* HAVE_MACROS */
-
- /* This will probably be enough. */
- line_length = 100;
- line = xmalloc (line_length);
-
- for (item = 0; (index = array[item]); item++)
- {
- /* A pathological document might have an index entry outside of any
- node. Don't crash. Perhaps should warn. */
- char *index_node = index->node ? index->node : "(none)";
- unsigned new_length = strlen (index->entry);
-
- if (new_length < 37) /* minimum length used below */
- new_length = 37;
- new_length += strlen (index_node) + 7; /* * : .\n\0 */
-
- if (new_length > line_length)
- {
- line_length = new_length;
- line = xrealloc (line, line_length);
- }
-
- /* Print the entry, nicely formatted. We've already expanded any
- commands, including any implicit @code. Thus, can't call
- execute_string, since @@ has turned into @. */
- sprintf (line, "* %-37s %s.\n", index->entry, index_node);
- line[2 + strlen (index->entry)] = ':';
- insert_string (line);
-
- /* Previous `output_paragraph' from growing to the size of the
- whole index. */
- flush_output ();
- }
-
- free (line);
-
-#if defined (HAVE_MACROS)
- me_inhibit_expansion--;
-#endif /* HAVE_MACROS */
-
- printing_index = 0;
- free (array);
- close_single_paragraph ();
- filling_enabled = saved_filling_enabled;
- inhibit_paragraph_indentation = saved_inhibit_paragraph_indentation;
-}
-
-/* User-defined commands, which happens only from user-defined indexes. */
-
-void
-define_user_command (name, proc, needs_braces_p)
- char *name;
- COMMAND_FUNCTION *proc;
- int needs_braces_p;
-{
- int slot = user_command_array_len;
- user_command_array_len++;
-
- if (!user_command_array)
- user_command_array = (COMMAND **) xmalloc (1 * sizeof (COMMAND *));
-
- user_command_array = (COMMAND **) xrealloc (user_command_array,
- (1 + user_command_array_len) *
- sizeof (COMMAND *));
-
- user_command_array[slot] = (COMMAND *) xmalloc (sizeof (COMMAND));
- user_command_array[slot]->name = xstrdup (name);
- user_command_array[slot]->proc = proc;
- user_command_array[slot]->argument_in_braces = needs_braces_p;
-}
-
-/* Some support for footnotes. */
-
-/* Footnotes are a new construct in Info. We don't know the best method
- of implementing them for sure, so we present two possiblities.
-
- SeparateNode:
- Make them look like followed references, with the reference
- destinations in a makeinfo manufactured node or,
-
- EndNode:
- Make them appear at the bottom of the node that they originally
- appeared in. */
-#define SeparateNode 0
-#define EndNode 1
-
-int footnote_style = EndNode;
-int first_footnote_this_node = 1;
-int footnote_count = 0;
-
-/* Set the footnote style based on he style identifier in STRING. */
-int
-set_footnote_style (string)
- char *string;
-{
- if ((strcasecmp (string, "separate") == 0) ||
- (strcasecmp (string, "MN") == 0))
- footnote_style = SeparateNode;
- else if ((strcasecmp (string, "end") == 0) ||
- (strcasecmp (string, "EN") == 0))
- footnote_style = EndNode;
- else
- return (-1);
-
- return (0);
-}
-
-void
-cm_footnotestyle ()
-{
- char *arg;
-
- get_rest_of_line (&arg);
-
- /* If set on command line, do not change the footnote style. */
- if (!footnote_style_preset && set_footnote_style (arg) != 0)
- line_error ("Bad argument to %c%s", COMMAND_PREFIX, command);
-
- free (arg);
-}
-
-typedef struct fn
-{
- struct fn *next;
- char *marker;
- char *note;
-} FN;
-
-FN *pending_notes = (FN *) NULL;
-
-/* A method for remembering footnotes. Note that this list gets output
- at the end of the current node. */
-void
-remember_note (marker, note)
- char *marker, *note;
-{
- FN *temp = (FN *) xmalloc (sizeof (FN));
-
- temp->marker = xstrdup (marker);
- temp->note = xstrdup (note);
- temp->next = pending_notes;
- pending_notes = temp;
- footnote_count++;
-}
-
-/* How to get rid of existing footnotes. */
-void
-free_pending_notes ()
-{
- FN *temp;
-
- while ((temp = pending_notes) != (FN *) NULL)
- {
- free (temp->marker);
- free (temp->note);
- pending_notes = pending_notes->next;
- free (temp);
- }
- first_footnote_this_node = 1;
- footnote_count = 0;
-}
-
-/* What to do when you see a @footnote construct. */
-
- /* Handle a "footnote".
- footnote *{this is a footnote}
- where "*" is the (optional) marker character for this note. */
-void
-cm_footnote ()
-{
- char *marker;
- char *note;
-
- get_until ("{", &marker);
- canon_white (marker);
-
- if (macro_expansion_output_stream && !executing_string)
- append_to_expansion_output (input_text_offset + 1); /* include the { */
-
- /* Read the argument in braces. */
- if (curchar () != '{')
- {
- line_error (_("`%c%s' needs an argument `{...}', not just `%s'"),
- COMMAND_PREFIX, command, marker);
- free (marker);
- return;
- }
- else
- {
- int len;
- int braces = 1;
- int loc = ++input_text_offset;
-
- while (braces)
- {
- if (loc == size_of_input_text)
- {
- line_error (_("No closing brace for footnote `%s'"), marker);
- return;
- }
-
- if (input_text[loc] == '{')
- braces++;
- else if (input_text[loc] == '}')
- braces--;
- else if (input_text[loc] == '\n')
- line_number++;
-
- loc++;
- }
-
- len = (loc - input_text_offset) - 1;
- note = (char *)xmalloc (len + 1);
- strncpy (note, &input_text[input_text_offset], len);
- note[len] = 0;
- input_text_offset = loc;
- }
-
- /* Must write the macro-expanded argument to the macro expansion
- output stream. This is like the case in index_add_arg. */
- if (macro_expansion_output_stream && !executing_string)
- {
- int op_orig;
-
- remember_itext (input_text, input_text_offset);
- op_orig = output_paragraph_offset;
- me_execute_string (note);
- /* Calling me_execute_string on a lone } provokes an error, since
- as far as the reader knows there is no matching {. We wrote
- the { above in the call to append_to_expansion_output. */
- write_region_to_macro_output ("}", 0, 1);
- output_paragraph_offset = op_orig;
- }
-
- if (!current_node || !*current_node)
- {
- line_error (_("Footnote defined without parent node"));
- free (marker);
- free (note);
- return;
- }
-
- if (!*marker)
- {
- free (marker);
-
- if (number_footnotes)
- {
- marker = (char *)xmalloc (10);
- sprintf (marker, "%d", current_footnote_number);
- current_footnote_number++;
- }
- else
- marker = xstrdup ("*");
- }
-
- remember_note (marker, note);
-
- /* Your method should at least insert MARKER. */
- switch (footnote_style)
- {
- case SeparateNode:
- add_word_args ("(%s)", marker);
- if (first_footnote_this_node)
- {
- char *temp_string;
-
- temp_string = (char *)
- xmalloc ((strlen (current_node)) + (strlen (_("-Footnotes"))) + 1);
-
- add_word_args (" (*note %s-Footnotes::)", current_node);
- strcpy (temp_string, current_node);
- strcat (temp_string, "-Footnotes");
- remember_node_reference (temp_string, line_number, followed_reference);
- free (temp_string);
- first_footnote_this_node = 0;
- }
- break;
-
- case EndNode:
- add_word_args ("(%s)", marker);
- break;
-
- default:
- break;
- }
- free (marker);
- free (note);
-}
-
-/* Nonzero means that we are currently in the process of outputting
- footnotes. */
-int already_outputting_pending_notes = 0;
-
-/* Output the footnotes. We are at the end of the current node. */
-void
-output_pending_notes ()
-{
- FN *footnote = pending_notes;
-
- if (!pending_notes)
- return;
-
- switch (footnote_style)
- {
- case SeparateNode:
- {
- char *old_current_node = current_node;
- char *old_command = xstrdup (command);
-
- already_outputting_pending_notes++;
- execute_string ("%cnode %s-Footnotes,,,%s\n",
- COMMAND_PREFIX, current_node, current_node);
- already_outputting_pending_notes--;
- current_node = old_current_node;
- free (command);
- command = old_command;
- }
- break;
-
- case EndNode:
- close_paragraph ();
- in_fixed_width_font++;
- execute_string (_("---------- Footnotes ----------\n\n"));
- in_fixed_width_font--;
- break;
- }
-
- /* Handle the footnotes in reverse order. */
- {
- FN **array = (FN **) xmalloc ((footnote_count + 1) * sizeof (FN *));
-
- array[footnote_count] = (FN *) NULL;
-
- while (--footnote_count > -1)
- {
- array[footnote_count] = footnote;
- footnote = footnote->next;
- }
-
- filling_enabled = 1;
- indented_fill = 1;
-
- while ((footnote = array[++footnote_count]))
- {
- execute_string ("(%s) %s", footnote->marker, footnote->note);
- close_paragraph ();
- }
- close_paragraph ();
- free (array);
- }
-}
-
-/* **************************************************************** */
-/* */
-/* User definable Macros (text substitution) */
-/* */
-/* **************************************************************** */
-
-#if defined (HAVE_MACROS)
-
-/* Array of macros and definitions. */
-MACRO_DEF **macro_list = (MACRO_DEF **)NULL;
-
-int macro_list_len = 0; /* Number of elements. */
-int macro_list_size = 0; /* Number of slots in total. */
-
-/* Return the macro definition of NAME or NULL if NAME is not defined. */
-MACRO_DEF *
-find_macro (name)
- char *name;
-{
- register int i;
- register MACRO_DEF *def;
-
- def = (MACRO_DEF *)NULL;
- for (i = 0; macro_list && (def = macro_list[i]); i++)
- {
- if ((!def->inhibited) && (strcmp (def->name, name) == 0))
- break;
- }
- return (def);
-}
-
-/* Add the macro NAME with ARGLIST and BODY to the list of defined macros.
- SOURCE_FILE is the name of the file where this definition can be found,
- and SOURCE_LINENO is the line number within that file. If a macro already
- exists with NAME, then a warning is produced, and that previous
- definition is overwritten. */
-void
-add_macro (name, arglist, body, source_file, source_lineno, flags)
- char *name;
- char **arglist;
- char *body;
- char *source_file;
- int source_lineno, flags;
-{
- register MACRO_DEF *def;
-
- def = find_macro (name);
-
- if (!def)
- {
- if (macro_list_len + 2 >= macro_list_size)
- macro_list = (MACRO_DEF **)xrealloc
- (macro_list, ((macro_list_size += 10) * sizeof (MACRO_DEF *)));
-
- macro_list[macro_list_len] = (MACRO_DEF *)xmalloc (sizeof (MACRO_DEF));
- macro_list[macro_list_len + 1] = (MACRO_DEF *)NULL;
-
- def = macro_list[macro_list_len];
- macro_list_len += 1;
- def->name = name;
- }
- else
- {
- char *temp_filename = input_filename;
- int temp_line = line_number;
-
- warning (_("macro `%s' previously defined"), name);
-
- input_filename = def->source_file;
- line_number = def->source_lineno;
- warning (_("here is the previous definition of `%s'"), name);
-
- input_filename = temp_filename;
- line_number = temp_line;
-
- if (def->arglist)
- {
- register int i;
-
- for (i = 0; def->arglist[i]; i++)
- free (def->arglist[i]);
-
- free (def->arglist);
- }
- free (def->source_file);
- free (def->body);
- }
-
- def->source_file = xstrdup (source_file);
- def->source_lineno = source_lineno;
- def->body = body;
- def->arglist = arglist;
- def->inhibited = 0;
- def->flags = flags;
-}
-
-/* Delete the macro with name NAME. The macro is deleted from the list,
- but it is also returned. If there was no macro defined, NULL is
- returned. */
-MACRO_DEF *
-delete_macro (name)
- char *name;
-{
- register int i;
- register MACRO_DEF *def;
-
- def = (MACRO_DEF *)NULL;
-
- for (i = 0; macro_list && (def = macro_list[i]); i++)
- if (strcmp (def->name, name) == 0)
- {
- memmove (macro_list + i, macro_list + i + 1,
- ((macro_list_len + 1) - i) * sizeof (MACRO_DEF *));
- macro_list_len--;
- break;
- }
- return (def);
-}
-
-/* Return the arglist on the current line. This can behave in two different
- ways, depending on the variable BRACES_REQUIRED_FOR_MACRO_ARGS. */
-int braces_required_for_macro_args = 0;
-
-char **
-get_macro_args (def)
- MACRO_DEF *def;
-{
- register int i;
- char *word;
-
- /* Quickly check to see if this macro has been invoked with any arguments.
- If not, then don't skip any of the following whitespace. */
- for (i = input_text_offset; i < size_of_input_text; i++)
- if (!cr_or_whitespace (input_text[i]))
- break;
-
- if (input_text[i] != '{')
- {
- if (braces_required_for_macro_args)
- {
- return ((char **)NULL);
- }
- else
- {
- /* Braces are not required to fill out the macro arguments. If
- this macro takes one argument, it is considered to be the
- remainder of the line, sans whitespace. */
- if (def->arglist && def->arglist[0] && !def->arglist[1])
- {
- char **arglist;
-
- get_rest_of_line (&word);
- if (input_text[input_text_offset - 1] == '\n')
- {
- input_text_offset--;
- line_number--;
- }
- /* canon_white (word); */
- arglist = (char **)xmalloc (2 * sizeof (char *));
- arglist[0] = word;
- arglist[1] = (char *)NULL;
- return (arglist);
- }
- else
- {
- /* The macro either took no arguments, or took more than
- one argument. In that case, it must be invoked with
- arguments surrounded by braces. */
- return ((char **)NULL);
- }
- }
- }
- return (get_brace_args (def->flags & ME_QUOTE_ARG));
-}
-
-/* Substitute actual parameters for named parameters in body.
- The named parameters which appear in BODY must by surrounded
- reverse slashes, as in \foo\. */
-char *
-apply (named, actuals, body)
- char **named, **actuals, *body;
-{
- register int i;
- int new_body_index, new_body_size;
- char *new_body, *text;
- int length_of_actuals;
-
- length_of_actuals = array_len (actuals);
- new_body_size = strlen (body);
- new_body = (char *)xmalloc (1 + new_body_size);
-
- /* Copy chars from BODY into NEW_BODY. */
- i = 0; new_body_index = 0;
-
- while (1)
- {
- if (!body[i])
- break;
-
- if (body[i] != '\\')
- new_body[new_body_index++] = body[i++];
- else
- {
- /* Snarf parameter name, check against named parameters. */
- char *param;
- int param_start, which, len;
-
- param_start = ++i;
- while ((body[i]) && (body[i] != '\\'))
- i++;
-
- len = i - param_start;
- param = (char *)xmalloc (1 + len);
- memcpy (param, body + param_start, len);
- param[len] = 0;
-
- if (body[i]) /* move past \ */
- i++;
-
- /* Now check against named parameters. */
- for (which = 0; named && named[which]; which++)
- if (strcmp (named[which], param) == 0)
- break;
-
- if (named && named[which])
- {
- if (which < length_of_actuals)
- text = actuals[which];
- else
- text = (char *)NULL;
-
- if (!text)
- text = "";
-
- len = strlen (text);
- }
- else
- { /* not a parameter, restore \'s */
- i = body[i] ? (i - 1) : i;
- len++;
- text = xmalloc (1 + len);
- sprintf (text, "\\%s", param);
- }
-
- if ((2 + strlen (param)) < len)
- {
- new_body_size += len + 1;
- new_body = xrealloc (new_body, new_body_size);
- }
-
- free (param);
-
- strcpy (new_body + new_body_index, text);
- new_body_index += len;
-
- if (!named || !named[which])
- free (text);
- }
- }
- new_body[new_body_index] = 0;
- return (new_body);
-}
-
-/* Execute the macro passed in DEF, a pointer to a MACRO_DEF. */
-void
-execute_macro (def)
- MACRO_DEF *def;
-{
- char **arglist;
- int num_args;
- char *execution_string = (char *)NULL;
-
- if (macro_expansion_output_stream && !executing_string && !me_inhibit_expansion)
- me_append_before_this_command ();
-
- /* Find out how many arguments this macro definition takes. */
- num_args = array_len (def->arglist);
-
- /* Gather the arguments present on the line if there are any. */
- arglist = get_macro_args (def);
-
- if (num_args < array_len (arglist))
- {
- free_array (arglist);
- line_error (_("Macro `%s' called with too many args"), def->name);
- return;
- }
-
- if (def->body)
- execution_string = apply (def->arglist, arglist, def->body);
-
- free_array (arglist);
-
- if (def->body)
- {
- if (macro_expansion_output_stream && !executing_string && !me_inhibit_expansion)
- {
- remember_itext (input_text, input_text_offset);
- me_execute_string (execution_string);
- }
- else
- execute_string ("%s", execution_string);
-
- free (execution_string);
- }
-}
-
-/* Read and remember the definition of a macro. */
-void
-cm_macro ()
-{
- register int i;
- char *name, **arglist, *body, *line;
- int body_size, body_index;
- int depth = 1;
- int defining_line = line_number;
- int flags = 0;
-
- arglist = (char **)NULL;
- body = (char *)NULL;
- body_size = 0;
- body_index = 0;
-
- if (macro_expansion_output_stream && !executing_string)
- me_append_before_this_command ();
-
- skip_whitespace ();
-
- /* Get the name of the macro. This is the set of characters which are
- not whitespace and are not `{' immediately following the @macro. */
- {
- int start = input_text_offset;
- int len;
-
- for (i = start;
- (i < size_of_input_text) &&
- (input_text[i] != '{') &&
- (!cr_or_whitespace (input_text[i]));
- i++);
-
- len = i - start;
- name = (char *)xmalloc (1 + len);
- strncpy (name, input_text + start, len);
- name[len] = 0;
- input_text_offset = i;
- }
-
- skip_whitespace ();
-
- /* It is not required that the definition of a macro includes an arglist.
- If not, don't try to get the named parameters, just use a null list. */
- if (curchar () == '{')
- {
- int arglist_index = 0, arglist_size = 0;
- int gathering_words = 1;
- char *word = (char *)NULL;
- int character;
-
- /* Read the words inside of the braces which determine the arglist.
- These words will be replaced within the body of the macro at
- execution time. */
-
- input_text_offset++;
- skip_whitespace_and_newlines ();
-
- while (gathering_words)
- {
- int len;
-
- for (i = input_text_offset;
- (character = input_text[i]);
- i++)
- {
- switch (character)
- {
- case '\n':
- line_number++;
- case ' ':
- case '\t':
- case ',':
- case '}':
- /* Found the end of the current arglist word. Save it. */
- len = i - input_text_offset;
- word = (char *)xmalloc (1 + len);
- strncpy (word, input_text + input_text_offset, len);
- word[len] = 0;
- input_text_offset = i;
-
- /* Advance to the comma or close-brace that signified
- the end of the argument. */
- while ((character = curchar ())
- && character != ','
- && character != '}')
- {
- input_text_offset++;
- if (character == '\n')
- line_number++;
- }
-
- /* Add the word to our list of words. */
- if ((arglist_index + 2) >= arglist_size)
- arglist = (char **)xrealloc
- (arglist, (arglist_size += 10) * sizeof (char *));
-
- arglist[arglist_index++] = word;
- arglist[arglist_index] = (char *)NULL;
- break;
- }
-
- if (character == '}')
- {
- input_text_offset++;
- gathering_words = 0;
- break;
- }
-
- if (character == ',')
- {
- input_text_offset++;
- skip_whitespace_and_newlines ();
- i = input_text_offset - 1;
- }
- }
- }
- }
-
- /* Read the text carefully until we find an "@end macro" which
- matches this one. The text in between is the body of the macro. */
- skip_whitespace_and_newlines ();
-
- while (depth)
- {
- if ((input_text_offset + 9) > size_of_input_text)
- {
- int temp_line = line_number;
- line_number = defining_line;
- line_error (_("%cend macro not found"), COMMAND_PREFIX);
- line_number = temp_line;
- return;
- }
-
- get_rest_of_line (&line);
-
- /* Handle commands only meaningful within a macro. */
- if ((*line == COMMAND_PREFIX) && (depth == 1) &&
- (strncmp (line + 1, "allow-recursion", 15) == 0) &&
- (line[16] == 0 || whitespace (line[16])))
- {
- for (i = 16; whitespace (line[i]); i++);
- strcpy (line, line + i);
- flags |= ME_RECURSE;
- if (!*line)
- {
- free (line);
- continue;
- }
- }
-
- if ((*line == COMMAND_PREFIX) && (depth == 1) &&
- (strncmp (line + 1, "quote-arg", 9) == 0) &&
- (line[10] == 0 || whitespace (line[10])))
- {
- for (i = 10; whitespace (line[i]); i++);
- strcpy (line, line + i);
-
- if (arglist && arglist[0] && !arglist[1])
- {
- flags |= ME_QUOTE_ARG;
- if (!*line)
- {
- free (line);
- continue;
- }
- }
- else
- {
- line_error (_("%cquote-arg only useful when the macro takes a single argument"),
- COMMAND_PREFIX);
- }
- }
-
- if ((*line == COMMAND_PREFIX) &&
- (strncmp (line + 1, "macro ", 6) == 0))
- depth++;
-
- if ((*line == COMMAND_PREFIX) &&
- (strncmp (line + 1, "end macro", 9) == 0))
- depth--;
-
- if (depth)
- {
- if ((body_index + strlen (line) + 3) >= body_size)
- body = (char *)xrealloc
- (body, body_size += 3 + strlen (line));
- strcpy (body + body_index, line);
- body_index += strlen (line);
- body[body_index++] = '\n';
- body[body_index] = 0;
- }
- free (line);
- }
-
- /* If it was an empty macro like
- @macro foo
- @end macro
- create an empty body. (Otherwise, the macro is not expanded.) */
- if (!body)
- {
- body = (char *)malloc(1);
- *body = 0;
- }
-
- /* We now have the name, the arglist, and the body. However, BODY
- includes the final newline which preceded the `@end macro' text.
- Delete it. */
- if (body && strlen (body))
- body[strlen (body) - 1] = 0;
-
- add_macro (name, arglist, body, input_filename, defining_line, flags);
-
- if (macro_expansion_output_stream && !executing_string)
- remember_itext (input_text, input_text_offset);
-}
-
-void
-cm_unmacro ()
-{
- register int i;
- char *line, *name;
- MACRO_DEF *def;
-
- if (macro_expansion_output_stream && !executing_string)
- me_append_before_this_command ();
-
- get_rest_of_line (&line);
-
- for (i = 0; line[i] && !whitespace (line[i]); i++);
- name = (char *)xmalloc (i + 1);
- strncpy (name, line, i);
- name[i] = 0;
-
- def = delete_macro (name);
-
- if (def)
- {
- free (def->source_file);
- free (def->name);
- free (def->body);
-
- if (def->arglist)
- {
- register int i;
-
- for (i = 0; def->arglist[i]; i++)
- free (def->arglist[i]);
-
- free (def->arglist);
- }
-
- free (def);
- }
-
- free (line);
- free (name);
-
- if (macro_expansion_output_stream && !executing_string)
- remember_itext (input_text, input_text_offset);
-}
-
-/* How to output sections of the input file verbatim. */
-
-/* Set the value of POINTER's offset to OFFSET. */
-ITEXT *
-remember_itext (pointer, offset)
- char *pointer;
- int offset;
-{
- register int i;
- ITEXT *itext = (ITEXT *)NULL;
-
- /* If we have no info, initialize a blank list. */
- if (!itext_info)
- {
- itext_info = (ITEXT **)xmalloc ((itext_size = 10) * sizeof (ITEXT *));
- for (i = 0; i < itext_size; i++)
- itext_info[i] = (ITEXT *)NULL;
- }
-
- /* If the pointer is already present in the list, then set the offset. */
- for (i = 0; i < itext_size; i++)
- if ((itext_info[i] != (ITEXT *)NULL) &&
- (itext_info[i]->pointer == pointer))
- {
- itext = itext_info[i];
- itext_info[i]->offset = offset;
- break;
- }
-
- if (i == itext_size)
- {
- /* Find a blank slot (or create a new one), and remember the
- pointer and offset. */
- for (i = 0; i < itext_size; i++)
- if (itext_info[i] == (ITEXT *)NULL)
- break;
-
- /* If not found, then add some slots. */
- if (i == itext_size)
- {
- register int j;
-
- itext_info = (ITEXT **)xrealloc
- (itext_info, (itext_size += 10) * sizeof (ITEXT *));
-
- for (j = i; j < itext_size; j++)
- itext_info[j] = (ITEXT *)NULL;
- }
-
- /* Now add the pointer and the offset. */
- itext_info[i] = (ITEXT *)xmalloc (sizeof (ITEXT));
- itext_info[i]->pointer = pointer;
- itext_info[i]->offset = offset;
- itext = itext_info[i];
- }
- return (itext);
-}
-
-/* Forget the input text associated with POINTER. */
-void
-forget_itext (pointer)
- char *pointer;
-{
- register int i;
-
- for (i = 0; i < itext_size; i++)
- if (itext_info[i] && (itext_info[i]->pointer == pointer))
- {
- free (itext_info[i]);
- itext_info[i] = (ITEXT *)NULL;
- break;
- }
-}
-
-/* Append the text which appeared in input_text from the last offset to
- the character just before the command that we are currently executing. */
-void
-me_append_before_this_command ()
-{
- register int i;
-
- for (i = input_text_offset; i && (input_text[i] != COMMAND_PREFIX); i--);
- maybe_write_itext (input_text, i);
-}
-
-/* Similar to execute_string (), but only takes a single string argument,
- and remembers the input text location, etc. */
-void
-me_execute_string (execution_string)
- char *execution_string;
-{
- pushfile ();
- input_text_offset = 0;
- input_text = execution_string;
- input_filename = xstrdup (input_filename);
- size_of_input_text = strlen (execution_string);
-
- remember_itext (execution_string, 0);
-
- me_executing_string++;
- reader_loop ();
- popfile ();
- me_executing_string--;
-}
-
-/* Append the text which appears in input_text from the last offset to
- the current OFFSET. */
-void
-append_to_expansion_output (offset)
- int offset;
-{
- register int i;
- ITEXT *itext = (ITEXT *)NULL;
-
- for (i = 0; i < itext_size; i++)
- if (itext_info[i] && itext_info[i]->pointer == input_text)
- {
- itext = itext_info[i];
- break;
- }
-
- if (!itext)
- return;
-
- if (offset > itext->offset)
- {
- write_region_to_macro_output
- (input_text, itext->offset, offset);
- remember_itext (input_text, offset);
- }
-}
-
-/* Only write this input text iff it appears in our itext list. */
-void
-maybe_write_itext (pointer, offset)
- char *pointer;
- int offset;
-{
- register int i;
- ITEXT *itext = (ITEXT *)NULL;
-
- for (i = 0; i < itext_size; i++)
- if (itext_info[i] && (itext_info[i]->pointer == pointer))
- {
- itext = itext_info[i];
- break;
- }
-
- if (itext && (itext->offset < offset))
- {
- write_region_to_macro_output (itext->pointer, itext->offset, offset);
- remember_itext (pointer, offset);
- }
-}
-
-void
-write_region_to_macro_output (string, start, end)
- char *string;
- int start, end;
-{
- if (macro_expansion_output_stream)
- fwrite (string + start, 1, end - start, macro_expansion_output_stream);
-}
-
-#endif /* HAVE_MACROS */
-
-/* Return the length of the array in ARRAY. */
-int
-array_len (array)
- char **array;
-{
- register int i = 0;
-
- if (array)
- for (i = 0; array[i] != (char *)NULL; i++);
-
- return (i);
-}
-
-void
-free_array (array)
- char **array;
-{
- if (array)
- {
- register int i;
-
- for (i = 0; array[i] != (char *)NULL; i++)
- free (array[i]);
-
- free (array);
- }
-}
-
-/* Function is used even when we don't have macros. Although, I have
- to admit, it is unlikely that you would have a use for it if you
- aren't using macros. */
-char **
-get_brace_args (quote_single)
- int quote_single;
-{
- char **arglist, *word;
- int arglist_index, arglist_size;
- int character, escape_seen, start;
- int depth = 1;
-
- /* There is an arglist in braces here, so gather the args inside of it. */
- skip_whitespace_and_newlines ();
- input_text_offset++;
- arglist = (char **)NULL;
- arglist_index = arglist_size = 0;
-
- get_arg:
- skip_whitespace_and_newlines ();
- start = input_text_offset;
- escape_seen = 0;
-
- while ((character = curchar ()))
- {
- if (character == '\\')
- {
- input_text_offset += 2;
- escape_seen = 1;
- }
- else if (character == '{')
- {
- depth++;
- input_text_offset++;
- }
- else if ((character == ',' && !quote_single) ||
- ((character == '}') && depth == 1))
- {
- int len = input_text_offset - start;
-
- if (len || (character != '}'))
- {
- word = (char *)xmalloc (1 + len);
- strncpy (word, input_text + start, len);
- word[len] = 0;
-
- /* Clean up escaped characters. */
- if (escape_seen)
- {
- register int i;
-
- for (i = 0; word[i]; i++)
- if (word[i] == '\\')
- memmove (word + i, word + i + 1,
- 1 + strlen (word + i + 1));
- }
-
- if (arglist_index + 2 >= arglist_size)
- arglist = (char **)xrealloc
- (arglist, (arglist_size += 10) * sizeof (char *));
-
- arglist[arglist_index++] = word;
- arglist[arglist_index] = (char *)NULL;
- }
-
- input_text_offset++;
- if (character == '}')
- break;
- else
- goto get_arg;
- }
- else if (character == '}')
- {
- depth--;
- input_text_offset++;
- }
- else
- {
- input_text_offset++;
- if (character == '\n') line_number++;
- }
- }
- return (arglist);
-}
-
-/* **************************************************************** */
-/* */
-/* Looking For Include Files */
-/* */
-/* **************************************************************** */
-
-/* Given a string containing units of information separated by colons,
- return the next one pointed to by INDEX, or NULL if there are no more.
- Advance INDEX to the character after the colon. */
-char *
-extract_colon_unit (string, index)
- char *string;
- int *index;
-{
- int i, start;
-
- i = *index;
-
- if (!string || (i >= strlen (string)))
- return ((char *)NULL);
-
- /* Each call to this routine leaves the index pointing at a colon if
- there is more to the path. If I is > 0, then increment past the
- `:'. If I is 0, then the path has a leading colon. Trailing colons
- are handled OK by the `else' part of the if statement; an empty
- string is returned in that case. */
- if (i && string[i] == ':')
- i++;
-
- start = i;
-
- while (string[i] && string[i] != ':') i++;
-
- *index = i;
-
- if (i == start)
- {
- if (string[i])
- (*index)++;
-
- /* Return "" in the case of a trailing `:'. */
- return (xstrdup (""));
- }
- else
- {
- char *value;
-
- value = (char *)xmalloc (1 + (i - start));
- strncpy (value, &string[start], (i - start));
- value [i - start] = 0;
-
- return (value);
- }
-}
-
-/* Return the full pathname for FILENAME by searching along PATH.
- When found, return the stat () info for FILENAME in FINFO.
- If PATH is NULL, only the current directory is searched.
- If the file could not be found, return a NULL pointer. */
-char *
-get_file_info_in_path (filename, path, finfo)
- char *filename, *path;
- struct stat *finfo;
-{
- char *dir;
- int result, index = 0;
-
- if (path == (char *)NULL)
- path = ".";
-
- /* Handle absolute pathnames. "./foo", "/foo", "../foo". */
- if (*filename == '/' ||
- (*filename == '.' &&
- (filename[1] == '/' ||
- (filename[1] == '.' && filename[2] == '/')))
-#ifdef WIN32
- /* Handle names that look like "d:/foo/bar" */
- || (isalpha (*filename) && filename [1] == ':'
- && (filename [2] == '/' || filename [2] == '\\'))
-#endif
- )
- {
- if (stat (filename, finfo) == 0)
- return (xstrdup (filename));
- else
- return ((char *)NULL);
- }
-
- while ((dir = extract_colon_unit (path, &index)))
- {
- char *fullpath;
-
- if (!*dir)
- {
- free (dir);
- dir = xstrdup (".");
- }
-
- fullpath = (char *)xmalloc (2 + strlen (dir) + strlen (filename));
- sprintf (fullpath, "%s/%s", dir, filename);
- free (dir);
-
- result = stat (fullpath, finfo);
-
- if (result == 0)
- return (fullpath);
- else
- free (fullpath);
- }
- return NULL;
+ return 0;
}
diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h
index 258c7c9c833..b1c7b608065 100644
--- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h
+++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h
@@ -1,7 +1,7 @@
-/* makeinfo.h -- Declarations for Makeinfo.
- $Id: makeinfo.h,v 1.2 1999/01/11 16:38:13 espie Exp $
+/* makeinfo.h -- declarations for Makeinfo.
+ $Id: makeinfo.h,v 1.3 2000/02/09 02:18:42 espie Exp $
- Copyright (C) 1996, 97 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,68 +19,44 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-/* Why, oh why, did I ever listen to rms when he said:
- "Don't make lots of small files, just make one big one!" I've
- regretted it ever since with this program, and with readline.
- bfox@ai.mit.edu Thu Jul 11 07:54:32 1996 */
-
-#if !defined (MAKEINFO_H)
+#ifndef MAKEINFO_H
#define MAKEINFO_H
-#if defined (COMPILING_MAKEINFO)
-# define DECLARE(type, var, init) type var = init
+#ifdef COMPILING_MAKEINFO
+# define DECLARE(type,var,init) type var = init
#else
-# define DECLARE(type, var, init) extern type var
+# define DECLARE(type,var,init) extern type var
#endif
-enum insertion_type
-{
- cartouche, defcv, deffn, defivar, defmac, defmethod,
- defop, defopt, defspec, deftp, deftypefn, deftypefun,
- deftypemethod, deftypevar, deftypevr, defun, defvar,
- defvr, detailmenu, direntry, display, enumerate, example,
- flushleft, flushright, format, ftable, group, ifclear,
- ifinfo, ifnothtml, ifnottex, ifset, itemize, lisp, menu,
- multitable, quotation, smallexample, smalllisp, table, vtable,
- bad_type
-};
+/* Hardcoded per GNU standards, not dependent on argv[0]. */
+DECLARE (char *, progname, "makeinfo");
-DECLARE (int, insertion_level, 0);
-
-#if defined (COMPILING_MAKEINFO)
-char *insertion_type_names[] =
+enum reftype
{
- "cartouche", "defcv", "deffn", "defivar", "defmac", "defmethod",
- "defop", "defopt", "defspec", "deftp", "deftypefn", "deftypefun",
- "deftypemethod", "deftypevar", "deftypevr", "defun", "defvar",
- "defvr", "detailmenu", "direntry", "display", "enumerate", "example",
- "flushleft", "flushright", "format", "ftable", "group", "ifclear",
- "ifinfo", "ifnothtml", "ifnottex", "ifset", "itemize", "lisp", "menu",
- "multitable", "quotation", "smallexample", "smalllisp", "table", "vtable",
- "bad_type"
+ menu_reference, followed_reference
};
-#endif
-typedef struct istack_elt
-{
- struct istack_elt *next;
- char *item_function;
- char *filename;
- int line_number;
- int filling_enabled;
- int indented_fill;
- enum insertion_type insertion;
- int inhibited;
- int in_fixed_width_font;
-} INSERTION_ELT;
-
-DECLARE (INSERTION_ELT *, insertion_stack, (INSERTION_ELT *)NULL);
+extern char *get_xref_token ();
+
+/* Nonzero means a string is in execution, as opposed to a file. */
+DECLARE (int, executing_string, 0);
+
+/* Nonzero means to inhibit writing macro expansions to the output
+ stream, because it has already been written. */
+DECLARE (int, me_inhibit_expansion, 0);
+extern char *expansion (), *text_expansion ();
+
/* Current output stream. */
-DECLARE (FILE *, output_stream, (FILE *)NULL);
+DECLARE (FILE *, output_stream, NULL);
+
+DECLARE (char *, pretty_output_filename, NULL);
+
+/* Current output file name. */
+DECLARE (char *, current_output_filename, NULL);
/* Output paragraph buffer. */
-DECLARE (unsigned char *, output_paragraph, (unsigned char *)NULL);
+DECLARE (unsigned char *, output_paragraph, NULL);
/* Offset into OUTPUT_PARAGRAPH. */
DECLARE (int, output_paragraph_offset, 0);
@@ -88,46 +64,132 @@ DECLARE (int, output_paragraph_offset, 0);
/* The output paragraph "cursor" horizontal position. */
DECLARE (int, output_column, 0);
-/* Non-zero means output_paragraph contains text. */
+/* Position in the output file. */
+DECLARE (int, output_position, 0);
+
+/* The offset into OUTPUT_PARAGRAPH where we have a meta character
+ produced by a markup such as @code or @dfn. */
+DECLARE (int, meta_char_pos, -1);
+
+/* Nonzero means output_paragraph contains text. */
DECLARE (int, paragraph_is_open, 0);
+/* Nonzero means that `start_paragraph' MUST be called before we pay
+ any attention to `close_paragraph' calls. */
+DECLARE (int, must_start_paragraph, 0);
+
+/* Nonzero means that we have seen "@top" once already. */
+DECLARE (int, top_node_seen, 0);
+
+/* Nonzero means that we have seen a non-"@top" node already. */
+DECLARE (int, non_top_node_seen, 0);
+
+/* Nonzero indicates that indentation is temporarily turned off. */
+DECLARE (int, no_indent, 1);
+
+/* Nonzero indicates that filling a line also indents the new line. */
+DECLARE (int, indented_fill, 0);
+
+/* Nonzero means forcing output text to be flushright. */
+DECLARE (int, force_flush_right, 0);
+
/* The amount of indentation to apply at the start of each line. */
DECLARE (int, current_indent, 0);
-/* nonzero if we are currently processing a multitable command */
-DECLARE (int, multitable_active, 0);
-
/* The column at which long lines are broken. */
DECLARE (int, fill_column, 72);
+/* Nonzero means that words are not to be split, even in long lines. This
+ gets changed for cm_w (). */
+DECLARE (int, non_splitting_words, 0);
+
+/* Amount by which @example indentation increases/decreases. */
+DECLARE (int, default_indentation_increment, 5);
+
+/* Nonzero means that we are currently hacking the insides of an
+ insertion which would use a fixed width font. */
+DECLARE (int, in_fixed_width_font, 0);
+
+/* Nonzero if we are currently processing a multitable command */
+DECLARE (int, multitable_active, 0);
+
+/* Nonzero means that we're generating HTML. */
+DECLARE (int, html, 0);
+
+/* Nonzero means escape characters in HTML output. */
+DECLARE (int, escape_html, 1);
+extern char *escape_string (); /* do HTML escapes */
+
+/* Nonzero means that the use of paragraph_start_indent is inhibited.
+ @example uses this to line up the left columns of the example text.
+ A negative value for this variable is incremented each time it is used.
+ @noindent uses this to inhibit indentation for a single paragraph. */
+DECLARE (int, inhibit_paragraph_indentation, 0);
+
+/* Nonzero indicates that filling will take place on long lines. */
+DECLARE (int, filling_enabled, 1);
+
+/* The current node's node name. */
+DECLARE (char *, current_node, NULL);
+
+/* Command name in the process of being hacked. */
+DECLARE (char *, command, NULL);
+
+/* Nonzero if the last character inserted has the syntax class of NEWLINE. */
+DECLARE (int, last_char_was_newline, 1);
+
/* The current input file state. */
DECLARE (char *, input_filename, (char *)NULL);
DECLARE (char *, input_text, (char *)NULL);
-DECLARE (int, size_of_input_text, 0);
+DECLARE (int, input_text_length, 0);
DECLARE (int, input_text_offset, 0);
DECLARE (int, line_number, 0);
-
#define curchar() input_text[input_text_offset]
-/* **************************************************************** */
-/* */
-/* Global Defines */
-/* */
-/* **************************************************************** */
-
-/* Error levels */
-#define NO_ERROR 0
-#define SYNTAX 2
-#define FATAL 4
-
+
+/* A colon separated list of directories to search for files included
+ with @include. This can be controlled with the `-I' option to makeinfo. */
+DECLARE (char *, include_files_path, NULL);
+
+/* The filename of the current input file. This is never freed. */
+DECLARE (char *, node_filename, NULL);
+
+/* Nonzero means do not output "Node: Foo" for node separations, that
+ is, generate plain text. (--no-headers) */
+DECLARE (int, no_headers, 0);
+
+/* Nonzero means that we process @html and @rawhtml even when not
+ generating HTML. (--ifhtml) */
+DECLARE (int, process_html, 0);
+
+/* Nonzero means that we process @ifinfo even when generating HTML.
+ (--ifinfo) */
+DECLARE (int, process_info, 1);
+
+/* Nonzero means that we process @tex and @iftex. (--iftex) */
+DECLARE (int, process_tex, 0);
+
+/* Maximum number of references to a single node before complaining.
+ (--reference-limit) */
+DECLARE (int, reference_warning_limit, 1000);
+
+/* Default is to check node references. (--no-validate) */
+DECLARE (int, validating, 1);
+
+/* Nonzero means print information about what is going on. (--verbose) */
+DECLARE (int, verbose_mode, 0);
+
+/* Nonzero means prefix each @chapter, ... with a number like 1. (--number-sections) */
+DECLARE (int, number_sections, 0);
+
+/* Nonzero means expand node names and references while validating.
+ This will avoid errors when the Texinfo document uses features
+ like @@ and @value inconsistently in node names, but will slow
+ the program by about 80%. You HAVE been warned. */
+DECLARE (int, expensive_validation, 0);
+
/* C's standard macros don't check to make sure that the characters being
changed are within range. So I have to check explicitly. */
-/* GNU Library doesn't have toupper(). Until GNU gets this fixed, I will
- have to do it. */
-#ifndef toupper
-#define toupper(c) ((c) - 32)
-#endif
-
#define coerce_to_upper(c) ((islower(c) ? toupper(c) : (c)))
#define coerce_to_lower(c) ((isupper(c) ? tolower(c) : (c)))
@@ -138,9 +200,9 @@ DECLARE (int, line_number, 0);
#define META(c) ((c) | (meta_character_bit))
#define UNMETA(c) ((c) & (~meta_character_bit))
-#define whitespace(c) (((c) == '\t') || ((c) == ' '))
-#define sentence_ender(c) ((c) == '.' || (c) == '?' || (c) == '!')
-#define cr_or_whitespace(c) (((c) == '\t') || ((c) == ' ') || ((c) == '\n'))
+#define whitespace(c) ((c) == '\t' || (c) == ' ')
+#define sentence_ender(c) ((c) == '.' || (c) == '?' || (c) == '!')
+#define cr_or_whitespace(c) (whitespace(c) || (c) == '\r' || (c) == '\n')
#ifndef isletter
#define isletter(c) (((c) >= 'A' && (c) <= 'Z') || ((c) >= 'a' && (c) <= 'z'))
@@ -158,33 +220,30 @@ DECLARE (int, line_number, 0);
#define digit_value(c) ((c) - '0')
#endif
-#define member(c, s) (strchr (s, c) != NULL)
+#define HTML_SAFE "$-_.+!*'()"
+#define URL_SAFE_CHAR(ch) (isalnum (ch) || strchr (HTML_SAFE, ch))
#define COMMAND_PREFIX '@'
/* Stuff for splitting large files. */
#define SPLIT_SIZE_THRESHOLD 70000 /* What's good enough for Stallman... */
#define DEFAULT_SPLIT_SIZE 50000 /* Is probably good enough for me. */
-
DECLARE (int, splitting, 1); /* Defaults to true for now. */
-typedef void COMMAND_FUNCTION (); /* So I can say COMMAND_FUNCTION *foo; */
-
-#define command_char(c) ((!whitespace(c)) && \
- ((c) != '\n') && \
- ((c) != '{') && \
- ((c) != '}') && \
- ((c) != '='))
+#define command_char(c) (!cr_or_whitespace(c) \
+ && (c) != '{' \
+ && (c) != '}' \
+ && (c) != '=')
#define skip_whitespace() \
- while ((input_text_offset != size_of_input_text) && \
+ while ((input_text_offset != input_text_length) && \
whitespace (curchar())) \
input_text_offset++
#define skip_whitespace_and_newlines() \
do { \
- while ((input_text_offset != size_of_input_text) && \
- (whitespace (curchar ()) || (curchar () == '\n'))) \
+ while (input_text_offset != input_text_length \
+ && cr_or_whitespace (curchar ())) \
{ \
if (curchar () == '\n') \
line_number++; \
@@ -192,4 +251,10 @@ typedef void COMMAND_FUNCTION (); /* So I can say COMMAND_FUNCTION *foo; */
} \
} while (0)
-#endif /* !MAKEINFO_H */
+/* Return nonzero if STRING is the text at input_text + input_text_offset,
+ else zero. */
+#define looking_at(string) \
+ (strncmp (input_text + input_text_offset, string, strlen (string)) == 0)
+
+
+#endif /* not MAKEINFO_H */
diff --git a/gnu/usr.bin/texinfo/makeinfo/multi.c b/gnu/usr.bin/texinfo/makeinfo/multi.c
index ff6358cb6d3..7302b3ec587 100644
--- a/gnu/usr.bin/texinfo/makeinfo/multi.c
+++ b/gnu/usr.bin/texinfo/makeinfo/multi.c
@@ -1,7 +1,7 @@
/* multi.c -- multitable stuff for makeinfo.
- $Id: multi.c,v 1.2 1999/01/11 16:38:13 espie Exp $
+ $Id: multi.c,v 1.3 2000/02/09 02:18:42 espie Exp $
- Copyright (C) 1996, 97 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "system.h"
+#include "insertion.h"
#include "makeinfo.h"
#define MAXCOLS 100 /* remove this limit later @@ */
@@ -51,6 +52,7 @@ struct env
{
unsigned char *output_paragraph;
int output_paragraph_offset;
+ int meta_char_pos;
int output_column;
int paragraph_is_open;
int current_indent;
@@ -66,20 +68,33 @@ static int last_column;
/* flags indicating whether horizontal and vertical separators need
to be drawn, separating rows and columns in the current multitable. */
static int hsep, vsep;
+
+/* whether this is the first row. */
+static int first_row;
+
+static void output_multitable_row ();
-/* Output a row. Have to keep `output_position' up-to-date for each
- character we output, or the tags table will be off, leading to
- chopped-off output files and undefined nodes (because they're in the
- wrong file, etc.). Perhaps it would be better to accumulate this
- value somewhere and add it once at the end of the table, or return it
- as the value, but this seems simplest. */
+/* Output a row. Calls insert, but also flushes the buffered output
+ when we see a newline, since in multitable every line is a separate
+ paragraph. */
static void
out_char (ch)
int ch;
{
- extern int output_position;
- putc (ch, output_stream);
- output_position++;
+ if (html)
+ add_char (ch);
+ else
+ {
+ int env = select_output_environment (0);
+ insert (ch);
+ if (ch == '\n')
+ {
+ uninhibit_output_flushing ();
+ flush_output ();
+ inhibit_output_flushing ();
+ }
+ select_output_environment (env);
+ }
}
@@ -88,6 +103,12 @@ draw_horizontal_separator ()
{
int i, j, s;
+ if (html)
+ {
+ add_word ("<hr>");
+ return;
+ }
+
for (s = 0; s < envs[0].current_indent; s++)
out_char (' ');
if (vsep)
@@ -101,34 +122,48 @@ draw_horizontal_separator ()
out_char ('\n');
}
+
+/* multitable strategy:
+ for each item {
+ for each column in an item {
+ initialize a new paragraph
+ do ordinary formatting into the new paragraph
+ save the paragraph away
+ repeat if there are more paragraphs in the column
+ }
+ dump out the saved paragraphs and free the storage
+ }
+
+ For HTML we construct a simple HTML 3.2 table with <br>s inserted
+ to help non-tables browsers. `@item' inserts a <tr> and `@tab'
+ inserts <td>; we also try to close <tr>. The only real
+ alternative is to rely on the info formatting engine and present
+ preformatted text. */
+
void
do_multitable ()
{
int ncolumns;
- /*
- * multitable strategy:
- * for each item {
- * for each column in an item {
- * initialize a new paragraph
- * do ordinary formatting into the new paragraph
- * save the paragraph away
- * repeat if there are more paragraphs in the column
- * }
- * dump out the saved paragraphs and free the storage
- * }
- */
-
if (multitable_active)
{
line_error ("Multitables cannot be nested");
return;
}
+ close_single_paragraph ();
+
/* scan the current item function to get the field widths
and number of columns, and set up the output environment list
accordingly. */
ncolumns = setup_multitable_parameters ();
+ first_row = 1;
+
+ /* <p> for non-tables browsers. @multitable implicitly ends the
+ current paragraph, so this is ok. */
+ if (html)
+ add_word ("<p><table>");
+
if (hsep)
draw_horizontal_separator ();
@@ -141,6 +176,53 @@ do_multitable ()
++multitable_active;
}
+/* Called to handle a {...} template on the @multitable line.
+ We're at the { and our first job is to find the matching }; as a side
+ effect, we change *PARAMS to point to after it. Our other job is to
+ expand the template text and return the width of that string. */
+static unsigned
+find_template_width (params)
+ char **params;
+{
+ char *template, *xtemplate;
+ unsigned len;
+ char *start = *params;
+ int brace_level = 0;
+
+ /* The first character should be a {. */
+ if (!params || !*params || **params != '{')
+ {
+ line_error ("find_template width internal error: passed %s",
+ params ? *params : "null");
+ return 0;
+ }
+
+ do
+ {
+ if (**params == '{' && (*params)[-1] != '@')
+ brace_level++;
+ else if (**params == '}' && (*params)[-1] != '@')
+ brace_level--;
+ else if (**params == 0)
+ {
+ line_error (_("Missing } in @multitable template"));
+ return 0;
+ }
+ (*params)++;
+ }
+ while (brace_level > 0);
+
+ template = substring (start + 1, *params - 1); /* omit braces */
+ xtemplate = expansion (template, 0);
+ len = strlen (xtemplate);
+
+ free (template);
+ free (xtemplate);
+
+ return len;
+}
+
+
/* Read the parameters for a multitable from the current command
line, save the parameters away, and return the
number of columns. */
@@ -150,7 +232,7 @@ setup_multitable_parameters ()
char *params = insertion_stack->item_function;
int nchars;
float columnfrac;
- char command[200]; /* naughty, should be no fixed limits */
+ char command[200]; /* xx no fixed limits */
int i = 1;
/* We implement @hsep and @vsep even though TeX doesn't.
@@ -176,12 +258,12 @@ setup_multitable_parameters ()
for ( ; i <= MAXCOLS; i++) {
if (sscanf (params, "%f", &columnfrac) < 1)
goto done;
- /* Unfortunately, can't use %n since some m68k-hp-bsd libc
+ /* Unfortunately, can't use %n since m68k-hp-bsd libc (at least)
doesn't support it. So skip whitespace (preceding the
number) and then non-whitespace (the number). */
while (*params && (*params == ' ' || *params == '\t'))
params++;
- /* Hmm, but what what @columnfractions 3foo. Well, I suppose
+ /* Hmm, but what about @columnfractions 3foo. Well, I suppose
it's invalid input anyway. */
while (*params && *params != ' ' && *params != '\t'
&& *params != '\n' && *params != '@')
@@ -192,15 +274,11 @@ setup_multitable_parameters ()
}
} else if (*params == '{') {
- char *start = params;
- while ((*params != '}' || params[-1] == '@') && *params) {
- params++;
- }
+ unsigned template_width = find_template_width (&params);
+
/* This gives us two spaces between columns. Seems reasonable.
- Really should expand the text, though, so a template of
- `@code{foo}' has a width of five, not ten. Also have to match
- braces, then. How to take into account current_indent here? */
- setup_output_environment (i++, params++ - start);
+ How to take into account current_indent here? */
+ setup_output_environment (i++, template_width + 2);
} else {
warning (_("ignoring stray text `%s' after @multitable"), params);
@@ -252,6 +330,7 @@ select_output_environment (n)
/* stash current env info from global vars into the old environment */
e->output_paragraph = output_paragraph;
e->output_paragraph_offset = output_paragraph_offset;
+ e->meta_char_pos = meta_char_pos;
e->output_column = output_column;
e->paragraph_is_open = paragraph_is_open;
e->current_indent = current_indent;
@@ -262,6 +341,7 @@ select_output_environment (n)
e = &envs[current_env_no];
output_paragraph = e->output_paragraph;
output_paragraph_offset = e->output_paragraph_offset;
+ meta_char_pos = e->meta_char_pos;
output_column = e->output_column;
paragraph_is_open = e->paragraph_is_open;
current_indent = e->current_indent;
@@ -281,8 +361,6 @@ nselect_next_environment ()
}
-static void output_multitable_row ();
-
/* do anything needed at the beginning of processing a
multitable column. */
void
@@ -300,10 +378,20 @@ int
multitable_item ()
{
if (!multitable_active) {
- /* impossible, I think. */
- error (_("multitable item not in active multitable"));
- exit (1);
+ line_error ("multitable_item internal error: no active multitable");
+ xexit (1);
}
+
+ if (html)
+ {
+ if (!first_row)
+ add_word ("<br></tr>"); /* <br> for non-tables browsers. */
+ add_word ("<tr align=\"left\"><td>");
+ first_row = 0;
+ return;
+ }
+ first_row = 0;
+
if (current_env_no > 0) {
output_multitable_row ();
}
@@ -311,7 +399,7 @@ multitable_item ()
select_output_environment (1);
if (!output_paragraph) {
line_error (_("Cannot select column #%d in multitable"), current_env_no);
- exit (FATAL);
+ exit (1);
}
init_column ();
@@ -322,11 +410,11 @@ multitable_item ()
static void
output_multitable_row ()
{
- int i, j, s, remaining;
-
/* offset in the output paragraph of the next char needing
to be output for that column. */
int offset[MAXCOLS];
+ int i, j, s, remaining;
+ int had_newline = 0;
for (i = 0; i <= last_column; i++)
offset[i] = 0;
@@ -340,9 +428,12 @@ output_multitable_row ()
/* remove trailing whitespace from each column */
for (i = 1; i <= last_column; i++) {
- while (cr_or_whitespace (CHAR_AT (envs[i].output_paragraph_offset - 1))) {
- envs[i].output_paragraph_offset--;
- }
+ if (envs[i].output_paragraph_offset)
+ while (cr_or_whitespace (CHAR_AT (envs[i].output_paragraph_offset - 1)))
+ envs[i].output_paragraph_offset--;
+
+ if (i == current_env_no)
+ output_paragraph_offset = envs[i].output_paragraph_offset;
}
/* read the current line from each column, outputting them all
@@ -367,7 +458,7 @@ output_multitable_row ()
out_char ('|');
for (i = 1; i <= last_column; i++) {
- for (s = 0; i < envs[i].current_indent; s++)
+ for (s = 0; s < envs[i].current_indent; s++)
out_char (' ');
for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) {
if (CHAR_AT (j) == '\n')
@@ -375,13 +466,22 @@ output_multitable_row ()
out_char (CHAR_AT (j));
}
offset[i] += j + 1; /* skip last text plus skip the newline */
- for (; j <= envs[i].fill_column; j++)
- out_char (' ');
+
+ /* Do not output trailing blanks if we're in the last column and
+ there will be no trailing |. */
+ if (i < last_column && !vsep)
+ for (; j <= envs[i].fill_column; j++)
+ out_char (' ');
if (vsep)
out_char ('|'); /* draw column separator */
}
out_char ('\n'); /* end of line */
+ had_newline = 1;
}
+
+ /* If completely blank item, get blank line despite no other output. */
+ if (!had_newline)
+ out_char ('\n'); /* end of line */
if (hsep)
draw_horizontal_separator ();
@@ -403,7 +503,11 @@ cm_tab ()
if (!multitable_active)
error (_("ignoring @tab outside of multitable"));
- nselect_next_environment ();
+ if (html)
+ add_word ("<td>");
+ else
+ nselect_next_environment ();
+
init_column ();
}
@@ -412,17 +516,19 @@ cm_tab ()
void
end_multitable ()
{
- output_multitable_row ();
+ if (!html)
+ output_multitable_row ();
/* Multitables cannot be nested. Otherwise, we'd have to save the
previous output environment number on a stack somewhere, and then
restore to that environment. */
select_output_environment (0);
- close_paragraph ();
- insert ('\n'); /* we swallow newlines, so insert one of our own */
-
multitable_active = 0;
uninhibit_output_flushing ();
+ close_insertion_paragraph ();
+
+ if (html)
+ add_word ("<br></tr></table>\n");
#if 0
printf (_("** Multicolumn output from last row:\n"));
diff --git a/gnu/usr.bin/texinfo/mkinstalldirs b/gnu/usr.bin/texinfo/mkinstalldirs
index 4428e6fb42d..3f3c00c6a10 100644
--- a/gnu/usr.bin/texinfo/mkinstalldirs
+++ b/gnu/usr.bin/texinfo/mkinstalldirs
@@ -4,7 +4,7 @@
# Created: 1993-05-16
# Public domain
-# $Id: mkinstalldirs,v 1.2 1999/01/11 16:38:01 espie Exp $
+# $Id: mkinstalldirs,v 1.3 2000/02/09 02:18:36 espie Exp $
errstatus=0
diff --git a/gnu/usr.bin/texinfo/po/ChangeLog b/gnu/usr.bin/texinfo/po/ChangeLog
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/gnu/usr.bin/texinfo/po/ChangeLog
+++ /dev/null
diff --git a/gnu/usr.bin/texinfo/po/Makefile.in.in b/gnu/usr.bin/texinfo/po/Makefile.in.in
index 2b1d523a4c6..e80911e25a3 100644
--- a/gnu/usr.bin/texinfo/po/Makefile.in.in
+++ b/gnu/usr.bin/texinfo/po/Makefile.in.in
@@ -46,7 +46,7 @@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
SOURCES = cat-id-tbl.c
POFILES = @POFILES@
GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
+DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
POTFILES = \
@@ -85,9 +85,10 @@ all-no:
$(srcdir)/$(PACKAGE).pot: $(POTFILES)
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ \
- --files-from=$(srcdir)/POTFILES.in
- rm -f $(srcdir)/$(PACKAGE).pot
- mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
+ --files-from=$(srcdir)/POTFILES.in \
+ && test ! -f $(PACKAGE).po \
+ || ( rm -f $(srcdir)/$(PACKAGE).pot \
+ && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
$(srcdir)/stamp-cat-id: $(PACKAGE).pot
@@ -109,17 +110,17 @@ install-exec:
install-data: install-data-@USE_NLS@
install-data-no: all
install-data-yes: all
- $(MKINSTALLDIRS) $(datadir)
+ ${MKINSTALLDIRS} $(DESTDIR)$(datadir);
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
case "$$cat" in \
- *.gmo) destdir=$(gnulocaledir);; \
- *) destdir=$(localedir);; \
+ *.gmo) destdir=$(DESTDIR)$(gnulocaledir);; \
+ *) destdir=$(DESTDIR)$(localedir);; \
esac; \
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
dir=$$destdir/$$lang/LC_MESSAGES; \
- $(MKINSTALLDIRS) $$dir; \
+ $(MKINSTALLDIRS) $$dir; \
if test -r $$cat; then \
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
@@ -143,9 +144,9 @@ install-data-yes: all
fi; \
done
if test "$(PACKAGE)" = "gettext"; then \
- $(MKINSTALLDIRS) $(gettextsrcdir); \
+ $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
- $(gettextsrcdir)/Makefile.in.in; \
+ $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
else \
: ; \
fi
@@ -158,12 +159,11 @@ uninstall:
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
- rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
- rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
- rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
done
- rm -f $(gettextsrcdir)/po-Makefile.in.in
check: all
diff --git a/gnu/usr.bin/texinfo/po/cat-id-tbl.c b/gnu/usr.bin/texinfo/po/cat-id-tbl.c
index 5639d50704a..b4c31351087 100644
--- a/gnu/usr.bin/texinfo/po/cat-id-tbl.c
+++ b/gnu/usr.bin/texinfo/po/cat-id-tbl.c
@@ -58,408 +58,552 @@ Go to the next matching index item from the last `\\[index-search]' command", 38
{"\
\n\
* Menu: Nodes whoses indices contain \"%s\":\n", 48},
- {"Try --help for more information.", 49},
+ {"Try --help for more information.\n", 49},
{"\
Copyright (C) %s Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n", 50},
- {"no entries found\n", 51},
- {"There is no menu in this node.", 52},
- {"There is no menu item \"%s\" in this node.", 53},
- {"Unable to find the node referenced by \"%s\".", 54},
+ {"no index entries found for `%s'\n", 51},
{"\
-Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n\
+Usage: %s [OPTION]... [MENU-ITEM...]\n\
\n\
Read documentation in Info format.\n\
-For more complete documentation on how to use Info, run `info info \
-options'.\n\
\n\
Options:\n\
---directory DIR add DIR to INFOPATH.\n\
---dribble FILENAME remember user keystrokes in FILENAME.\n\
---file FILENAME specify Info file to visit.\n\
---node NODENAME specify nodes in first visited Info file.\n\
---output FILENAME output selected nodes to FILENAME.\n\
---restore FILENAME read initial keystrokes from FILENAME.\n\
---subnodes recursively output menu items.\n\
---help display this help and exit.\n\
---version display version information and exit.\n\
+ --apropos=SUBJECT look up SUBJECT in all indices of all manuals.\n\
+ --directory=DIR add DIR to INFOPATH.\n\
+ --dribble=FILENAME remember user keystrokes in FILENAME.\n\
+ --file=FILENAME specify Info file to visit.\n\
+ --help display this help and exit.\n\
+ --index-search=STRING go to node pointed by index entry STRING.\n\
+ --node=NODENAME specify nodes in first visited Info file.\n\
+ --output=FILENAME output selected nodes to FILENAME.\n\
+ --restore=FILENAME read initial keystrokes from FILENAME.\n\
+ --show-options, --usage go to command-line options node.\n\
+ --subnodes recursively output menu items.\n\
+%s --vi-keys use vi-like and less-like key bindings.\n\
+ --version display version information and exit.\n\
\n\
-The first argument, if present, is the name of the Info file to read.\n\
+The first non-option argument, if present, is the menu entry to start from;\n\
+it is searched for in all `dir' files along INFOPATH.\n\
+If it is not present, info merges all `dir' files and shows the result.\n\
Any remaining arguments are treated as the names of menu\n\
-items in the initial node visited. For example, `info emacs buffers'\n\
-moves to the node `buffers' in the info file `emacs'.\n\
+items relative to the initial node visited.\n\
\n\
-Email bug reports to bug-texinfo@gnu.org.", 55},
- {"Basic Commands in Info Windows", 56},
+Examples:\n\
+ info show top-level dir menu\n\
+ info emacs start at emacs node from top-level dir\n\
+ info emacs buffers start at buffers node within emacs manual\n\
+ info --show-options emacs start at node with emacs' command line options\n\
+ info -f ./foo.info show file ./foo.info, not searching dir\n\
+\n\
+Email bug reports to bug-texinfo@gnu.org,\n\
+general questions and discussion to help-texinfo@gnu.org.\n", 52},
+ {"Cannot find node `%s'.", 53},
+ {"Cannot find node `(%s)%s'.", 54},
+ {"Cannot find a window!", 55},
+ {"Point doesn't appear within this window's node!", 56},
+ {"Cannot delete the last window.", 57},
+ {"No menu in this node.", 58},
+ {"No footnotes in this node.", 59},
+ {"No cross references in this node.", 60},
+ {"No `%s' pointer for this node.", 61},
+ {"Unknown Info command `%c'; try `?' for help.", 62},
+ {"Terminal type `%s' is not smart enough to run Info.", 63},
+ {"You are already at the last page of this node.", 64},
+ {"You are already at the first page of this node.", 65},
+ {"Only one window.", 66},
+ {"Resulting window would be too small.", 67},
+ {"Not enough room for a help window, please delete a window.", 68},
+ {"Basic Commands in Info Windows\n", 69},
+ {"******************************\n", 70},
+ {" %-10s Quit this help.\n", 71},
+ {" %-10s Quit Info altogether.\n", 72},
+ {" %-10s Invoke the Info tutorial.\n", 73},
+ {"Moving within a node:\n", 74},
+ {"---------------------\n", 75},
+ {" %-10s Scroll forward a page.\n", 76},
+ {" %-10s Scroll backward a page.\n", 77},
+ {" %-10s Go to the beginning of this node.\n", 78},
+ {" %-10s Go to the end of this node.\n", 79},
+ {" %-10s Scroll forward 1 line.\n", 80},
+ {" %-10s Scroll backward 1 line.\n", 81},
+ {"Selecting other nodes:\n", 82},
+ {"----------------------\n", 83},
+ {" %-10s Move to the `next' node of this node.\n", 84},
+ {" %-10s Move to the `previous' node of this node.\n", 85},
+ {" %-10s Move `up' from this node.\n", 86},
+ {" %-10s Pick menu item specified by name.\n", 87},
+ {" Picking a menu item causes another node to be selected.\n", 88},
+ {" %-10s Follow a cross reference. Reads name of reference.\n", 89},
+ {" %-10s Move to the last node seen in this window.\n", 90},
+ {" %-10s Skip to next hypertext link within this node.\n", 91},
+ {" %-10s Follow the hypertext link under cursor.\n", 92},
+ {" %-10s Move to the `directory' node. Equivalent to `g (DIR)'.\n", 93},
+ {" %-10s Move to the Top node. Equivalent to `g Top'.\n", 94},
+ {"Other commands:\n", 95},
+ {"---------------\n", 96},
+ {" %-10s Pick first ... ninth item in node's menu.\n", 97},
+ {" %-10s Pick last item in node's menu.\n", 98},
+ {"\
+ %-10s Search for a specified string in the index entries of this Info\n", 99},
+ {"\
+ file, and select the node referenced by the first entry \
+found.\n", 100},
+ {" %-10s Move to node specified by name.\n", 101},
+ {"\
+ You may include a filename as well, as in (FILENAME)NODENAME.\n", 102},
+ {"\
+ %-10s Search forward through this Info file for a specified string,\n", 103},
+ {"\
+ and select the node in which the next occurrence is found.\n", 104},
+ {" %-10s Search backward in this Info file for a specified string,\n", 105},
+ {"The current search path is:\n", 106},
+ {"\
+Commands available in Info windows:\n\
+\n", 107},
+ {"\
+Commands available in the echo area:\n\
+\n", 108},
{"\
The following commands can only be invoked via M-x:\n\
-\n", 57},
- {"--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n", 58},
- {"Display help message", 59},
- {"Visit Info node `(info)Help'", 60},
- {"Print documentation for KEY", 61},
- {"Describe key: %s", 62},
- {"ESC %s is undefined.", 63},
- {"%s is undefined.", 64},
- {"%s is defined to %s.", 65},
- {"Where is command: ", 66},
- {"`%s' is not on any keys", 67},
- {"%s can only be invoked via %s.", 68},
- {"%s can be invoked via %s.", 69},
- {"There is no function named `%s'", 70},
- {"Read the name of an Info command and describe it", 71},
- {"Describe command: ", 72},
- {"Read a command name in the echo area and execute it", 73},
- {"Cannot execute an `echo-area' command here.", 74},
- {"Set the height of the displayed window", 75},
- {"Set screen height to (%d): ", 76},
+\n", 109},
+ {"--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n", 110},
+ {"Display help message", 111},
+ {"Visit Info node `(info)Help'", 112},
+ {"Print documentation for KEY", 113},
+ {"Describe key: %s", 114},
+ {"ESC %s is undefined.", 115},
+ {"%s is undefined.", 116},
+ {"%s is defined to %s.", 117},
+ {"Show what to type to execute a given command", 118},
+ {"Where is command: ", 119},
+ {"`%s' is not on any keys", 120},
+ {"%s can only be invoked via %s.", 121},
+ {"%s can be invoked via %s.", 122},
+ {"There is no function named `%s'", 123},
+ {"Read the name of an Info command and describe it", 124},
+ {"Describe command: ", 125},
+ {"Read a command name in the echo area and execute it", 126},
+ {"Cannot execute an `echo-area' command here.", 127},
+ {"Set the height of the displayed window", 128},
+ {"Set screen height to (%d): ", 129},
{"\
Source files groveled to make this file include:\n\
-\n", 77},
- {"Couldn't manipulate the file %s.\n", 78},
+\n", 130},
+ {"Couldn't manipulate the file %s.\n", 131},
{"\
\n\
* Menu:\n\
(File)Node Lines Size Containing File\n\
- ---------- ----- ---- ---------------", 79},
+ ---------- ----- ---- ---------------", 132},
{"\
Here is the menu of nodes you have recently visited.\n\
-Select one from this menu, or use `\\[history-node]' in another window.\n", 80},
- {"Make a window containing a menu of all of the currently visited nodes", 81},
- {"Select a node which has been previously visited in a visible window", 82},
- {"Select visited node: ", 83},
- {"The reference disappeared! (%s).", 84},
+Select one from this menu, or use `\\[history-node]' in another window.\n", 133},
+ {"Make a window containing a menu of all of the currently visited nodes", 134},
+ {"Select a node which has been previously visited in a visible window", 135},
+ {"Select visited node: ", 136},
+ {"The reference disappeared! (%s).", 137},
+ {"\
+Welcome to Info version %s. Type \\[get-help-window] for help, \\[menu-item] \
+for menu item.", 138},
+ {"Move down to the next line", 139},
+ {"Move up to the previous line", 140},
+ {"Move to the end of the line", 141},
+ {"Move to the start of the line", 142},
+ {"Next", 143},
+ {"Following Next node...", 144},
+ {"Selecting first menu item...", 145},
+ {"Selecting Next node...", 146},
+ {"Moving Up %d time(s), then Next.", 147},
+ {"No more nodes within this document.", 148},
+ {"No `Prev' for this node.", 149},
+ {"Moving Prev in this window.", 150},
+ {"No `Prev' or `Up' for this node within this document.", 151},
+ {"Moving Up in this window.", 152},
+ {"Moving to `Prev's last menu item.", 153},
+ {"Move forwards or down through node structure", 154},
+ {"Move backwards or up through node structure", 155},
+ {"Scroll forward in this window", 156},
+ {"Scroll forward in this window and set default window size", 157},
+ {"Scroll backward in this window", 158},
+ {"Scroll backward in this window and set default window size", 159},
+ {"Move to the start of this node", 160},
+ {"Move to the end of this node", 161},
+ {"Scroll down by lines", 162},
+ {"Scroll up by lines", 163},
+ {"Scroll down by half screen size", 164},
+ {"Scroll up by half screen size", 165},
+ {"Select the next window", 166},
+ {"Select the previous window", 167},
+ {"Split the current window", 168},
+ {"Delete the current window", 169},
+ {"Cannot delete a permanent window", 170},
+ {"Delete all other windows", 171},
+ {"Scroll the other window", 172},
+ {"Scroll the other window backward", 173},
+ {"Grow (or shrink) this window", 174},
+ {"Divide the available screen space among the visible windows", 175},
+ {"Toggle the state of line wrapping in the current window", 176},
+ {"Select the Next node", 177},
+ {"Select the Prev node", 178},
+ {"Select the Up node", 179},
+ {"Select the last node in this file", 180},
+ {"This window has no additional nodes", 181},
+ {"Select the first node in this file", 182},
+ {"Select the last item in this node's menu", 183},
+ {"Select this menu item", 184},
+ {"There aren't %d items in this menu.", 185},
+ {"Menu item (%s): ", 186},
+ {"Menu item: ", 187},
+ {"Follow xref (%s): ", 188},
+ {"Follow xref: ", 189},
+ {"Read a menu item and select its node", 190},
+ {"Read a footnote or cross reference and select its node", 191},
+ {"Move to the start of this node's menu", 192},
+ {"Visit as many menu items at once as possible", 193},
+ {"Read a node name and select it", 194},
+ {"Goto node: ", 195},
+ {"No menu in node `%s'.", 196},
+ {"No menu item `%s' in node `%s'.", 197},
+ {"Unable to find node referenced by `%s' in `%s'.", 198},
+ {"Read a list of menus starting from dir and follow them", 199},
+ {"Follow menus: ", 200},
+ {"Find the node describing program invocation", 201},
+ {"Find Invocation node of [%s]: ", 202},
+ {"Read a manpage reference and select it", 203},
+ {"Get Manpage: ", 204},
+ {"Select the node `Top' in this file", 205},
+ {"Select the node `(dir)'", 206},
+ {"Kill node (%s): ", 207},
+ {"Cannot kill node `%s'", 208},
+ {"Cannot kill the last node", 209},
+ {"Select the most recently selected node", 210},
+ {"Kill this node", 211},
+ {"Read the name of a file and select it", 212},
+ {"Find file: ", 213},
+ {"Cannot find `%s'.", 214},
+ {"Could not create output file `%s'.", 215},
+ {"Done.", 216},
+ {"Writing node %s...", 217},
+ {"Pipe the contents of this node through INFO_PRINT_COMMAND", 218},
+ {"Cannot open pipe to `%s'.", 219},
+ {"Printing node %s...", 220},
+ {"Searching subfile %s ...", 221},
+ {"Read a string and search for it case-sensitively", 222},
+ {"Read a string and search for it", 223},
+ {"Read a string and search backward for it", 224},
+ {"%s%sfor string [%s]: ", 225},
+ {"Search backward", 226},
+ {"Search", 227},
+ {" case-sensitively ", 228},
+ {" ", 229},
+ {"Search failed.", 230},
+ {"Repeat last search in the same direction", 231},
+ {"No previous search string", 232},
+ {"Repeat last search in the reverse direction", 233},
+ {"Search interactively for a string as you type it", 234},
+ {"I-search backward: ", 235},
+ {"I-search: ", 236},
+ {"Failing ", 237},
+ {"Move to the previous cross reference", 238},
+ {"Move to the next cross reference", 239},
+ {"Select reference or menu item appearing on this line", 240},
+ {"Cancel current operation", 241},
+ {"Quit", 242},
+ {"Move the cursor to a specific line of the window", 243},
+ {"Redraw the display", 244},
+ {"Quit using Info", 245},
+ {"Unknown command (%s).", 246},
+ {"\"\" is invalid", 247},
+ {"\"%s\" is invalid", 248},
+ {"Add this digit to the current numeric argument", 249},
+ {"Start (or multiply by 4) the current numeric argument", 250},
+ {"Internally used by \\[universal-argument]", 251},
+ {"readline: Out of virtual memory!\n", 252},
+ {"When \"On\", footnotes appear and disappear automatically", 253},
+ {"When \"On\", creating or deleting a window resizes other windows", 254},
+ {"When \"On\", flash the screen instead of ringing the bell", 255},
+ {"When \"On\", errors cause the bell to ring", 256},
+ {"When \"On\", Info garbage collects files which had to be uncompressed", 257},
+ {"When \"On\", the portion of the matched search string is highlighted", 258},
+ {"Controls what happens when scrolling is requested at the end of a node", 259},
+ {"The number lines to scroll when the cursor moves out of the window", 260},
+ {"When \"On\", Info accepts and displays ISO Latin characters", 261},
+ {"Explain the use of a variable", 262},
+ {"Describe variable: ", 263},
+ {"Set the value of an Info variable", 264},
+ {"Set variable: ", 265},
+ {"Set %s to value (%d): ", 266},
+ {"Set %s to value (%s): ", 267},
+ {"--*** Tags out of Date ***", 268},
+ {"-----Info: (), lines ----, ", 269},
+ {"-%s---Info: %s, %d lines --%s--", 270},
+ {"-%s%s-Info: (%s)%s, %d lines --%s--", 271},
+ {" Subfile: %s", 272},
+ {"%s: option `%s' is ambiguous\n", 273},
+ {"%s: option `--%s' doesn't allow an argument\n", 274},
+ {"%s: option `%c%s' doesn't allow an argument\n", 275},
+ {"%s: option `%s' requires an argument\n", 276},
+ {"%s: unrecognized option `--%s'\n", 277},
+ {"%s: unrecognized option `%c%s'\n", 278},
+ {"%s: illegal option -- %c\n", 279},
+ {"%s: invalid option -- %c\n", 280},
+ {"%s: option requires an argument -- %c\n", 281},
+ {"%s: option `-W %s' is ambiguous\n", 282},
+ {"%s: option `-W %s' doesn't allow an argument\n", 283},
+ {"January", 284},
+ {"February", 285},
+ {"March", 286},
+ {"April", 287},
+ {"May", 288},
+ {"June", 289},
+ {"July", 290},
+ {"August", 291},
+ {"September", 292},
+ {"October", 293},
+ {"November", 294},
+ {"December", 295},
+ {"unlikely character %c in @var", 296},
+ {"@sc argument all uppercase, thus no effect", 297},
+ {"%c%s is obsolete", 298},
+ {"@sp requires a positive numeric argument, not `%s'", 299},
+ {"Bad argument to %c%s", 300},
+ {"asis", 301},
+ {"none", 302},
+ {"Missing `}' in @def arg", 303},
+ {"Function", 304},
+ {"Macro", 305},
+ {"Special Form", 306},
+ {"Variable", 307},
+ {"User Option", 308},
+ {"Instance Variable", 309},
+ {"Method", 310},
+ {"of", 311},
+ {"on", 312},
+ {"Must be in `%s' insertion to use `%sx'", 313},
+ {"%s: getwd: %s, %s\n", 314},
+ {"`%c%s' needs an argument `{...}', not just `%s'", 315},
+ {"No closing brace for footnote `%s'", 316},
+ {"Footnote defined without parent node", 317},
+ {"Footnotes", 318},
+ {"Untitled", 319},
+ {"Unknown index `%s'", 320},
+ {"Index `%s' already exists", 321},
+ {"Unknown index `%s' and/or `%s' in @synindex", 322},
+ {"Unknown index `%s' in @printindex", 323},
+ {"Entry for index `%s' outside of any node", 324},
+ {"(outside of any node)", 325},
+ {"Broken-Type in insertion_type_pname", 326},
+ {"Enumeration stack overflow", 327},
+ {"lettering overflow, restarting at %c", 328},
+ {"%s requires an argument: the formatter for %citem", 329},
+ {"`@end' expected `%s', but saw `%s'", 330},
+ {"No matching `%cend %s'", 331},
+ {"%s requires letter or digit", 332},
+ {"@menu seen before first @node, creating `Top' node", 333},
{"\
-Welcome to Info version %s. \"\\[get-help-window]\" for help, \
-\"\\[menu-item]\" for menu item.", 85},
- {"Move down to the next line", 86},
- {"Move up to the previous line", 87},
- {"Move to the end of the line", 88},
- {"Move to the start of the line", 89},
- {" times", 90},
- {"%d times", 91},
- {"No \"Next\" pointer for this node.", 92},
- {"Following \"Next\" node...", 93},
- {"Next", 94},
- {"Selecting first menu item...", 95},
- {"Selecting \"Next\" node...", 96},
- {"Up", 97},
- {"No more nodes.", 98},
- {"No \"Prev\" for this node.", 99},
- {"Moving \"Prev\" in this window.", 100},
- {"Prev", 101},
- {"No \"Prev\" or \"Up\" for this node.", 102},
- {"Moving \"Up\" in this window.", 103},
- {"Moving to \"Prev\"'s last menu item.", 104},
- {"Move forwards or down through node structure", 105},
- {"Move backwards or up through node structure", 106},
- {"Scroll forward in this window", 107},
- {"Scroll backward in this window", 108},
- {"Move to the start of this node", 109},
- {"Move to the end of this node", 110},
- {"Select the next window", 111},
- {"Select the previous window", 112},
- {"Split the current window", 113},
- {"Delete the current window", 114},
- {"Cannot delete a permanent window", 115},
- {"Delete all other windows", 116},
- {"Scroll the other window", 117},
- {"Grow (or shrink) this window", 118},
- {"Divide the available screen space among the visible windows", 119},
- {"Toggle the state of line wrapping in the current window", 120},
- {"Select the `Next' node", 121},
- {"Select the `Prev' node", 122},
- {"Select the `Up' node", 123},
- {"Select the last node in this file", 124},
- {"This window has no additional nodes", 125},
- {"Select the first node in this file", 126},
- {"Select the last item in this node's menu", 127},
- {"Select this menu item", 128},
- {"There aren't %d items in this menu.", 129},
- {"Menu item (%s): ", 130},
- {"Menu item: ", 131},
- {"Follow xref (%s): ", 132},
- {"Follow xref: ", 133},
- {"Read a menu item and select its node", 134},
- {"Read a footnote or cross reference and select its node", 135},
- {"Move to the start of this node's menu", 136},
- {"Visit as many menu items at once as possible", 137},
- {"Read a node name and select it", 138},
- {"Goto Node: ", 139},
- {"Read a manpage reference and select it", 140},
- {"Get Manpage: ", 141},
- {"Select the node `Top' in this file", 142},
- {"Top", 143},
- {"Select the node `(dir)'", 144},
- {"Kill node (%s): ", 145},
- {"Cannot kill node `%s'", 146},
- {"Cannot kill the last node", 147},
- {"Select the most recently selected node", 148},
- {"Kill this node", 149},
- {"Read the name of a file and select it", 150},
- {"Find file: ", 151},
- {"Cannot find \"%s\".", 152},
- {"Could not create output file \"%s\".", 153},
- {"Done.", 154},
- {"Writing node \"(%s)%s\"...", 155},
- {"Writing node \"%s\"...", 156},
- {"Pipe the contents of this node through INFO_PRINT_COMMAND", 157},
- {"Cannot open pipe to \"%s\".", 158},
- {"Printing node \"(%s)%s\"...", 159},
- {"Printing node \"%s\"...", 160},
- {"Searching subfile \"%s\"...", 161},
- {"Read a string and search for it", 162},
- {"%s for string [%s]: ", 163},
- {"Search backward", 164},
- {"Search", 165},
- {"Search failed.", 166},
- {"Search interactively for a string as you type it", 167},
- {"I-search backward: ", 168},
- {"I-search: ", 169},
- {"Failing ", 170},
- {"No cross references in this node.", 171},
- {"Move to the previous cross reference", 172},
- {"Move to the next cross reference", 173},
- {"Select reference or menu item appearing on this line", 174},
- {"Cancel current operation", 175},
- {"Quit", 176},
- {"Move to the cursor to a specific line of the window", 177},
- {"Redraw the display", 178},
- {"Quit using Info", 179},
- {"Unknown command (%s).", 180},
- {"\"\" is invalid", 181},
- {"\"%s\" is invalid", 182},
- {"Add this digit to the current numeric argument", 183},
- {"Start (or multiply by 4) the current numeric argument", 184},
- {"Internally used by \\[universal-argument]", 185},
- {"readline: Out of virtual memory!\n", 186},
- {"When \"On\", footnotes appear and disappear automatically", 187},
- {"When \"On\", creating or deleting a window resizes other windows", 188},
- {"When \"On\", flash the screen instead of ringing the bell", 189},
- {"When \"On\", errors cause the bell to ring", 190},
- {"When \"On\", Info garbage collects files which had to be uncompressed", 191},
- {"When \"On\", the portion of the matched search string is highlighted", 192},
- {"Controls what happens when scrolling is requested at the end of a node", 193},
- {"The number lines to scroll when the cursor moves out of the window", 194},
- {"When \"On\", Info accepts and displays ISO Latin characters", 195},
- {"Explain the use of a variable", 196},
- {"Describe variable: ", 197},
- {"Set the value of an Info variable", 198},
- {"Set variable: ", 199},
- {"Set %s to value (%d): ", 200},
- {"Set %s to value (%s): ", 201},
- {"--*** Tags out of Date ***", 202},
- {"-----Info: (), lines ----, ", 203},
- {"-%s---Info: %s, %d lines --%s--", 204},
- {"-%s%s-Info: (%s)%s, %d lines --%s--", 205},
- {" Subfile: %s", 206},
- {"%s: option `%s' is ambiguous\n", 207},
- {"%s: option `--%s' doesn't allow an argument\n", 208},
- {"%s: option `%c%s' doesn't allow an argument\n", 209},
- {"%s: option `%s' requires an argument\n", 210},
- {"%s: unrecognized option `--%s'\n", 211},
- {"%s: unrecognized option `%c%s'\n", 212},
- {"%s: illegal option -- %c\n", 213},
- {"%s: invalid option -- %c\n", 214},
- {"%s: option requires an argument -- %c\n", 215},
- {"%s: option `-W %s' is ambiguous\n", 216},
- {"%s: option `-W %s' doesn't allow an argument\n", 217},
- {"%s:%d: warning: ", 218},
- {"Too many errors! Gave up.\n", 219},
- {"%s: %s arg must be numeric, not `%s'.\n", 220},
- {"Couldn't open macro expansion output `%s'", 221},
- {"Cannot specify more than one macro expansion output", 222},
- {"%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n", 223},
- {"%s: --footnote-style arg must be `separate' or `end', not `%s'.\n", 224},
- {"%s: missing file argument.\n", 225},
- {"Try `%s --help' for more information.\n", 226},
+perhaps your @top node should be wrapped in @ifnottex rather than @ifinfo?", 334},
+ {"@detailmenu seen before first node, creating `Top' node", 335},
+ {"Unmatched `%c%s'", 336},
+ {"`%c%s' needs something after it", 337},
+ {"Bad argument to `%s', `%s', using `%s'", 338},
+ {"@%s not meaningful inside `@%s' block", 339},
+ {"@itemx not meaningful inside `%s' block", 340},
+ {"%c%s found outside of an insertion block", 341},
+ {"%s is not a valid ISO 639 language code", 342},
+ {"%c%s expects `i' or `j' as argument, not `%c'", 343},
+ {"%c%s expects a single character `i' or `j' as argument", 344},
+ {"macro `%s' previously defined", 345},
+ {"here is the previous definition of `%s'", 346},
+ {"\\ in macro expansion followed by `%s' instead of \\ or parameter name", 347},
+ {"Macro `%s' called on line %d with too many args", 348},
+ {"%cend macro not found", 349},
+ {"@quote-arg only useful for single-argument macros", 350},
+ {"mismatched @end %s with @%s", 351},
+ {"%s:%d: warning: ", 352},
+ {"Too many errors! Gave up.\n", 353},
+ {"Misplaced %c", 354},
+ {"Try `%s --help' for more information.\n", 355},
{"\
Usage: %s [OPTION]... TEXINFO-FILE...\n\
\n\
-Translate Texinfo source documentation to a format suitable for reading\n\
-with GNU Info.\n\
+Translate Texinfo source documentation to various other formats:\n\
+Info files suitable for reading online with Emacs or standalone GNU Info\n\
+(by default); plain text (with --no-headers); or HTML (with --html).\n\
\n\
Options:\n\
--D VAR define a variable, as with @set.\n\
--E MACRO-OFILE process macros only, output texinfo source.\n\
--I DIR append DIR to the @include directory search path.\n\
--P DIR prepend DIR to the @include directory search path.\n\
--U VAR undefine a variable, as with @clear.\n\
---error-limit NUM quit after NUM errors (default %d).\n\
---fill-column NUM break lines at NUM characters (default %d).\n\
---footnote-style STYLE output footnotes according to STYLE:\n\
- `separate' to place footnotes in their own node,\n\
- `end' to place the footnotes at the end of\n\
- the node in which they are defined (the default).\n\
---force preserve output even if errors.\n\
---help display this help and exit.\n\
---no-validate suppress node cross-reference validation.\n\
---no-warn suppress warnings (but not errors).\n\
---no-split suppress splitting of large files.\n\
---no-headers suppress node separators and Node: Foo headers.\n\
---output FILE, -o FILE output to FILE, and ignore any @setfilename.\n\
---paragraph-indent VAL indent paragraphs with VAL spaces (default %d).\n\
- if VAL is `none', do not indent; if VAL is `asis',\n\
- preserve any existing indentation.\n\
---reference-limit NUM complain about at most NUM references (default %d).\n\
---verbose report about what is being done.\n\
---version display version information and exit.\n\
-\n\
-Email bug reports to bug-texinfo@gnu.org.\n", 227},
- {"%s: getwd: %s, %s\n", 228},
- {"Expected `%s'", 229},
- {"No `%s' found in `%s'", 230},
- {"%s: Skipping macro expansion to stdout as Info output is going there.\n", 231},
- {"Making %s file `%s' from `%s'.\n", 232},
- {"This is Info file %s, produced by Makeinfo version %d.%d", 233},
- {" from the input file %s.\n", 234},
+ --commands-in-node-names allow @ commands in node names.\n\
+ -D VAR define a variable, as with @set.\n\
+ -E, --macro-expand FILE output macro-expanded source to FILE.\n\
+ --error-limit=NUM quit after NUM errors (default %d).\n\
+ --fill-column=NUM break Info lines at NUM characters (default %d).\n\
+ --footnote-style=STYLE output footnotes according to STYLE:\n\
+ `separate' to place footnotes in their own \
+node,\n\
+ `end' to place the footnotes at the end of the\n\
+ node in which they are defined (the default).\n\
+ --force preserve output even if errors.\n\
+ --help display this help and exit.\n\
+ --html output HTML rather than Info format;\n\
+ -I DIR append DIR to the @include search path.\n\
+ --ifhtml process @ifhtml and @html text even when not\n\
+ generating HTML.\n\
+ --ifinfo process @ifinfo text even when generating HTML.\n\
+ --iftex process @iftex and @tex text.\n\
+ implies --no-split.\n", 356},
{"\
-%s: Removing macro output file `%s' due to errors; use --force to preserve.\n", 235},
- {"%s: Removing output file `%s' due to errors; use --force to preserve.\n", 236},
- {"Misplaced %c", 237},
- {"Unknown command `%s'", 238},
- {"NO_NAME!", 239},
- {"%c%s expected `{...}'", 240},
- {"Unmatched }", 241},
- {"%c%s missing close brace", 242},
- {"Broken-Type in insertion_type_pname", 243},
- {"Enumeration stack overflow", 244},
- {"lettering overflow, restarting at %c", 245},
- {"* Menu:\n", 246},
- {"%s requires an argument: the formatter for %citem", 247},
- {"`%cend' expected `%s', but saw `%s'", 248},
- {"No matching `%cend %s'", 249},
- {"How did @%s end up in cm_special_char?\n", 250},
- {"%c%s expects `i' or `j' as argument, not `%c'", 251},
- {"%c%s expects a single character `i' or `j' as argument", 252},
- {"January", 253},
- {"February", 254},
- {"March", 255},
- {"April", 256},
- {"May", 257},
- {"June", 258},
- {"July", 259},
- {"August", 260},
- {"September", 261},
- {"October", 262},
- {"November", 263},
- {"December", 264},
- {"%c%s expects a single character as an argument", 265},
- {"%c%s is obsolete", 266},
- {"Node with %ctop as a section already exists", 267},
- {"Here is the %ctop node", 268},
- {"%ctop used before %cnode, defaulting to %s", 269},
- {"%c%s is obsolete; use %c%s instead", 270},
- {"Node `%s' multiply defined (line %d is first definition at)", 271},
- {"Formatting node %s...\n", 272},
- {"Node `%s' requires a sectioning command (e.g. %c%s)", 273},
- {"Node `%s''s Next field not pointed back to", 274},
- {"This node (`%s') is the one with the bad `Prev'", 275},
- {"Node `%s's Prev field not pointed back to", 276},
- {"This node (`%s') has the bad Next", 277},
- {"Node `%s' missing Up field", 278},
- {"`%s' has an Up field of `%s', but `%s' has no menu item for `%s'", 279},
- {"node `%s' has been referenced %d times", 280},
- {"unreferenced node `%s'", 281},
- {"%s reference to nonexistent node `%s'", 282},
- {"%cmenu seen before first node", 283},
- {"creating `Top' node", 284},
- {"`.' or `,' must follow cross reference, not %c", 285},
- {"@image file `%s' unreadable: %s", 286},
- {"@image missing filename argument", 287},
- {"%s requires letter or digit", 288},
- {"Unmatched `%c%s'", 289},
- {"`%c%s' needs something after it", 290},
- {"Bad argument to `%s', `%s', using `%s'", 291},
- {"{No Value For \"%s\"}", 292},
- {"%c%s requires a name", 293},
- {"Reached eof before matching @end %s", 294},
- {"The `%c%s' command is meaningless within a `@%s' block", 295},
- {"%citemx is not meaningful inside of a `%s' block", 296},
- {"%c%s found outside of an insertion block", 297},
- {"Missing `}' in %cdef arg", 298},
- {"Function", 299},
- {"Macro", 300},
- {"Special Form", 301},
- {"Variable", 302},
- {"User Option", 303},
- {"Instance Variable", 304},
- {"Method", 305},
- {"Must be in a `%s' insertion in order to use `%s'x", 306},
- {"%csp requires a positive numeric argument", 307},
- {"asis", 308},
- {"none", 309},
- {"Bad argument to %c%s", 310},
- {"Unknown index `%s'", 311},
- {"Index `%s' already exists", 312},
- {"Unknown index `%s' and/or `%s' in @synindex", 313},
- {"Unknown index `%s' in @printindex", 314},
+ --no-headers suppress Info node separators and Node: lines \
+and\n\
+ write to standard output without --output.\n\
+ --no-ifhtml do not process @ifhtml and @html text.\n\
+ --no-ifinfo do not process @ifinfo text.\n\
+ --no-iftex do not process @iftex and @tex text.\n\
+ --no-split suppress splitting of large Info output files or\n\
+ generation of one HTML file per node.\n\
+ --no-validate suppress node cross-reference validation.\n\
+ --no-warn suppress warnings (but not errors).\n\
+ --number-sections include chapter, section, etc. numbers in \
+output.\n\
+ -o, --output=FILE output to FILE, ignoring any @setfilename.\n\
+ -P DIR prepend DIR to the @include search path.\n\
+ --paragraph-indent=VAL indent Info paragraphs by VAL spaces (default \
+%d).\n\
+ if VAL is `none', do not indent;\n\
+ if VAL is `asis', preserve existing \
+indentation.\n\
+ --reference-limit=NUM warn about at most NUM references (default %d).\n\
+ -U VAR undefine a variable, as with @clear.\n\
+ -v, --verbose explain what is being done.\n\
+ --version display version information and exit.\n", 357},
{"\
-* Menu:\n\
-\n", 315},
- {"`%c%s' needs an argument `{...}', not just `%s'", 316},
- {"No closing brace for footnote `%s'", 317},
- {"Footnote defined without parent node", 318},
- {"-Footnotes", 319},
+\n\
+The defaults for the @if... conditionals depend on the output format:\n\
+if generating HTML, --ifhtml is on and the others are off;\n\
+if generating Info or plain text, --ifinfo is on and the others are off.\n\
+\n\
+Examples:\n\
+ makeinfo foo.texi write Info to foo's @setfilename\n\
+ makeinfo --html foo.texi write HTML to foo's @setfilename\n\
+ makeinfo --no-headers -o - foo.texi write plain text to standard output\n\
+ makeinfo --number-sections foo.texi write Info with numbered sections\n\
+ makeinfo --no-split foo.texi write one Info file however big\n\
+\n\
+Email bug reports to bug-texinfo@gnu.org,\n\
+general questions and discussion to help-texinfo@gnu.org.", 358},
+ {"%s: %s arg must be numeric, not `%s'.\n", 359},
+ {"Couldn't open macro expansion output `%s'", 360},
+ {"Cannot specify more than one macro expansion output", 361},
+ {"%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n", 362},
+ {"%s: --footnote-style arg must be `separate' or `end', not `%s'.\n", 363},
+ {"%s: missing file argument.\n", 364},
+ {"Expected `%s'", 365},
+ {"No `%s' found in `%s'", 366},
+ {"%s: Skipping macro expansion to stdout as Info output is going there.\n", 367},
+ {"Making %s file `%s' from `%s'.\n", 368},
+ {"This is %s, produced by makeinfo version %s from %s.\n", 369},
{"\
----------- Footnotes ----------\n\
-\n", 320},
- {"macro `%s' previously defined", 321},
- {"here is the previous definition of `%s'", 322},
- {"Macro `%s' called with too many args", 323},
- {"%cend macro not found", 324},
- {"%cquote-arg only useful when the macro takes a single argument", 325},
- {"ignoring stray text `%s' after @multitable", 326},
- {"Too many columns in multitable item (max %d)", 327},
- {"multitable item not in active multitable", 328},
- {"Cannot select column #%d in multitable", 329},
- {"ignoring @tab outside of multitable", 330},
- {"** Multicolumn output from last row:\n", 331},
- {"* column #%d: output = %s\n", 332},
- {"virtual memory exhausted", 333},
- {"%s: warning: ", 334},
- {" for %s", 335},
- {"\tTry `%s --help' for a complete list of options.\n", 336},
+%s: Removing macro output file `%s' due to errors; use --force to preserve.\n", 370},
+ {"%s: Removing output file `%s' due to errors; use --force to preserve.\n", 371},
+ {"Unknown command `%s'", 372},
+ {"Use braces to give a command as an argument to @%s", 373},
+ {"%c%s expected `{...}'", 374},
+ {"Unmatched }", 375},
+ {"NO_NAME!", 376},
+ {"%c%s missing close brace", 377},
+ {"see ", 378},
+ {"See ", 379},
+ {"`.' or `,' must follow cross reference, not %c", 380},
+ {"No .png or .jpg for `%s'", 381},
+ {"@image file `%s' unreadable: %s", 382},
+ {"@image missing filename argument", 383},
+ {"{No value for `%s'}", 384},
+ {"%c%s requires a name", 385},
+ {"Reached eof before matching @end %s", 386},
+ {"Missing } in @multitable template", 387},
+ {"ignoring stray text `%s' after @multitable", 388},
+ {"Too many columns in multitable item (max %d)", 389},
+ {"Cannot select column #%d in multitable", 390},
+ {"ignoring @tab outside of multitable", 391},
+ {"** Multicolumn output from last row:\n", 392},
+ {"* column #%d: output = %s\n", 393},
+ {"Node `%s' previously defined at line %d", 394},
+ {"Formatting node %s...\n", 395},
+ {"Node `%s' requires a sectioning command (e.g. %c%s)", 396},
+ {"No node name specified for `%c%s' command", 397},
+ {"Node:", 398},
+ {"Next:", 399},
+ {"Previous:", 400},
+ {"Up:", 401},
+ {"%s reference to nonexistent node `%s'", 402},
+ {"Menu", 403},
+ {"Cross", 404},
+ {"Next field of node `%s' not pointed to", 405},
+ {"This node (%s) has the bad Prev", 406},
+ {"Prev", 407},
+ {"Prev field of node `%s' not pointed to", 408},
+ {"This node (%s) has the bad Next", 409},
+ {"`%s' has no Up field", 410},
+ {"Up", 411},
+ {"Node `%s' lacks menu item for `%s' despite being its Up target", 412},
+ {"node `%s' has been referenced %d times", 413},
+ {"unreferenced node `%s'", 414},
+ {"Appendix %c ", 415},
+ {"Internal error (search_sectioning) \"%s\"!", 416},
+ {"%c%s is obsolete; use %c%s instead", 417},
+ {"Node with %ctop as a section already exists", 418},
+ {"Here is the %ctop node", 419},
+ {"%ctop used before %cnode, defaulting to %s", 420},
+ {"Table of Contents", 421},
+ {"Short Contents", 422},
+ {"%s: TOC should be here, but it was not found", 423},
+ {"%s: warning: ", 424},
+ {"virtual memory exhausted", 425},
+ {" for %s", 426},
+ {"\tTry `%s --help' for a complete list of options.\n", 427},
{"\
Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
\n\
-Install INFO-FILE in the Info directory file DIR-FILE.\n\
+Install or delete dir entries from INFO-FILE in the Info directory file\n\
+DIR-FILE.\n\
\n\
Options:\n\
---delete Delete existing entries in INFO-FILE;\n\
- don't insert any new entries.\n\
---dir-file=NAME Specify file name of Info directory file.\n\
- This is equivalent to using the DIR-FILE argument.\n\
---entry=TEXT Insert TEXT as an Info directory entry.\n\
- TEXT should have the form of an Info menu item line\n\
- plus zero or more extra lines starting with whitespace.\n\
- If you specify more than one entry, they are all added.\n\
- If you don't specify any entries, they are determined\n\
- from information in the Info file itself.\n\
---help Display this help and exit.\n\
---info-file=FILE Specify Info file to install in the directory.\n\
- This is equivalent to using the INFO-FILE argument.\n\
---info-dir=DIR Same as --dir-file=DIR/dir.\n\
---item=TEXT Same as --entry TEXT.\n\
- An Info directory entry is actually a menu item.\n\
---quiet Suppress warnings.\n\
---remove Same as --delete.\n\
---section=SEC Put this file's entries in section SEC of the directory.\n\
- If you specify more than one section, all the entries\n\
- are added in each of the sections.\n\
- If you don't specify any sections, they are determined\n\
- from information in the Info file itself.\n\
---version Display version information and exit.\n\
+ --delete delete existing entries for INFO-FILE from DIR-FILE;\n\
+ don't insert any new entries.\n\
+ --dir-file=NAME specify file name of Info directory file.\n\
+ This is equivalent to using the DIR-FILE argument.\n\
+ --entry=TEXT insert TEXT as an Info directory entry.\n\
+ TEXT should have the form of an Info menu item line\n\
+ plus zero or more extra lines starting with \
+whitespace.\n\
+ If you specify more than one entry, they are all \
+added.\n\
+ If you don't specify any entries, they are determined\n\
+ from information in the Info file itself.\n\
+ --help display this help and exit.\n\
+ --info-file=FILE specify Info file to install in the directory.\n\
+ This is equivalent to using the INFO-FILE argument.\n\
+ --info-dir=DIR same as --dir-file=DIR/dir.\n\
+ --item=TEXT same as --entry TEXT.\n\
+ An Info directory entry is actually a menu item.\n\
+ --quiet suppress warnings.\n\
+ --remove same as --delete.\n\
+ --section=SEC put this file's entries in section SEC of the directory.\n\
+ If you specify more than one section, all the entries\n\
+ are added in each of the sections.\n\
+ If you don't specify any sections, they are determined\n\
+ from information in the Info file itself.\n\
+ --version display version information and exit.\n\
\n\
-Email bug reports to bug-texinfo@gnu.org.\n", 337},
+Email bug reports to bug-texinfo@gnu.org,\n\
+general questions and discussion to help-texinfo@gnu.org.\n", 428},
{"\
This is the file .../info/dir, which contains the\n\
topmost node of the Info hierarchy, called (dir)Top.\n\
The first time you invoke Info you start off looking at this node.\n\
\n\
-File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
+%s\tThis is the top of the INFO tree\n\
\n\
This (the Directory node) gives a menu of major topics.\n\
Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n\
@@ -469,37 +613,39 @@ File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
In Emacs, you can click mouse button 2 on a menu item or cross reference\n\
to select it.\n\
\n\
-* Menu:\n", 338},
- {"%s: could not read (%s) and could not create (%s)\n", 339},
- {"%s: Specify the Info directory only once.\n", 340},
- {"%s: Specify the Info file only once.\n", 341},
- {"excess command line argument `%s'", 342},
- {"No input file specified; try --help for more information.", 343},
- {"No dir file specified; try --help for more information.", 344},
- {"START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY", 345},
- {"END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY", 346},
- {"no info dir entry in `%s'", 347},
- {"menu item `%s' already exists, for file `%s'", 348},
- {"no entries found for `%s'; nothing deleted", 349},
- {"keep temporary files around after processing", 350},
- {"do not keep temporary files around after processing (default)", 351},
- {"send output to FILE", 352},
- {"display version information and exit", 353},
- {"display this help and exit", 354},
- {"Usage: %s [OPTION]... FILE...\n", 355},
- {"Generate a sorted index for each TeX output FILE.\n", 356},
- {"Usually FILE... is `foo.??' for a document `foo.texi'.\n", 357},
+* Menu:\n", 429},
+ {"%s: could not read (%s) and could not create (%s)\n", 430},
+ {"%s: empty file", 431},
+ {"START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY", 432},
+ {"END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY", 433},
+ {"%s: Specify the Info directory only once.\n", 434},
+ {"%s: Specify the Info file only once.\n", 435},
+ {"excess command line argument `%s'", 436},
+ {"No input file specified; try --help for more information.", 437},
+ {"No dir file specified; try --help for more information.", 438},
+ {"no info dir entry in `%s'", 439},
+ {"menu item `%s' already exists, for file `%s'", 440},
+ {"no entries found for `%s'; nothing deleted", 441},
+ {"display this help and exit", 442},
+ {"keep temporary files around after processing", 443},
+ {"do not keep temporary files around after processing (default)", 444},
+ {"send output to FILE", 445},
+ {"display version information and exit", 446},
+ {"Usage: %s [OPTION]... FILE...\n", 447},
+ {"Generate a sorted index for each TeX output FILE.\n", 448},
+ {"Usually FILE... is specified as `foo.%c%c' for a document `foo.texi'.\n", 449},
{"\
\n\
-Options:\n", 358},
+Options:\n", 450},
{"\
\n\
-Email bug reports to bug-texinfo@gnu.org.", 359},
- {"%s: not a texinfo index file", 360},
- {"failure reopening %s", 361},
- {"entry %s follows an entry with a secondary name", 362},
- {"%s; for file `%s'.\n", 363},
- {"Virtual memory exhausted in %s ()! Needed %d bytes.", 364},
+Email bug reports to bug-texinfo@gnu.org,\n\
+general questions and discussion to help-texinfo@gnu.org.\n", 451},
+ {"%s: not a texinfo index file", 452},
+ {"failure reopening %s", 453},
+ {"No page number in %s", 454},
+ {"entry %s follows an entry with a secondary name", 455},
+ {"%s; for file `%s'.\n", 456},
};
-int _msg_tbl_length = 364;
+int _msg_tbl_length = 456;
diff --git a/gnu/usr.bin/texinfo/util/Makefile.am b/gnu/usr.bin/texinfo/util/Makefile.am
index c4e691329bb..90003d13bcd 100644
--- a/gnu/usr.bin/texinfo/util/Makefile.am
+++ b/gnu/usr.bin/texinfo/util/Makefile.am
@@ -1,5 +1,5 @@
## Makefile.am for texinfo/util.
-## $Id: Makefile.am,v 1.2 1999/01/11 16:38:15 espie Exp $
+## $Id: Makefile.am,v 1.3 2000/02/09 02:18:42 espie Exp $
## Run automake in .. to produce Makefile.in from this.
bin_PROGRAMS = install-info texindex
@@ -9,5 +9,7 @@ localedir = $(datadir)/locale
INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
LDADD = ../lib/libtxi.a @INTLLIBS@
-EXTRA_DIST = README deref.c fixfonts gen-dir-node tex3patch texi2dvi \
- update-info
+# Most of these are just for fun. The only one that's really supported
+# is texi2dvi.
+EXTRA_DIST = README deref.c fix-info-dir fixfonts fixref.gawk gen-dir-node \
+ outline.gawk prepinfo.awk tex3patch texi-docstring-magic.el texi2dvi
diff --git a/gnu/usr.bin/texinfo/util/gen-dir-node b/gnu/usr.bin/texinfo/util/gen-dir-node
index 9d7c92b9bed..457ccc9cf44 100644
--- a/gnu/usr.bin/texinfo/util/gen-dir-node
+++ b/gnu/usr.bin/texinfo/util/gen-dir-node
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: gen-dir-node,v 1.2 1999/01/11 16:38:15 espie Exp $
+# $Id: gen-dir-node,v 1.3 2000/02/09 02:18:42 espie Exp $
# Generate the top-level Info node, given a directory of Info files
# and (optionally) a skeleton file. The output will be suitable for a
# top-level dir file. The skeleton file contains info topic names in the
@@ -33,6 +33,8 @@ skip=
if [ $# -gt 2 ] ; then
echo usage: $0 info-directory [ skeleton-file ] 1>&2
exit 1
+elif [ -z "${INFODIR}" ] ; then
+ INFODIR="%%DEFAULT_INFO_DIR%%"
else
true
fi
@@ -49,18 +51,20 @@ echo "This version was generated on `date`"
echo "by `whoami`@`hostname` for `(cd ${INFODIR}; pwd)`"
cat << moobler
-
+\$Id: gen-dir-node,v 1.3 2000/02/09 02:18:42 espie Exp $
This is the file .../info/dir, which contains the topmost node of the
Info hierarchy. The first time you invoke Info you start off
looking at that node, which is (dir)Top.

File: dir Node: Top This is the top of the INFO tree
+
This (the Directory node) gives a menu of major topics.
- Typing "d" returns here, "q" exits, "?" lists all INFO commands, "h"
- gives a primer for first-timers, "mTexinfo<Return>" visits Texinfo topic,
- etc.
- Or click mouse button 2 on a menu item or cross reference to select it.
- --- PLEASE ADD DOCUMENTATION TO THIS TREE. (See INFO topic first.) ---
+ Typing "q" exits, "?" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs topic, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
* Menu: The list of major topics begins on the next line.
@@ -75,7 +79,7 @@ moobler
### then generate entries for those in the same way, putting the info for
### those at the end....
-infofiles=`(cd ${INFODIR}; ls | egrep -v '\-|^dir$|^dir\.info$|^dir\.orig$')`
+infofiles=`(cd ${INFODIR}; /bin/ls | grep -v '\-[0-9]*$' | egrep -v '^dir$|^dir\.info$|^dir\.orig$')`
# echoing gets clobbered by backquotes; we do it the hard way...
lines=`wc $SKELETON | awk '{print $1}'`
@@ -139,14 +143,12 @@ while [ $lines -ge $line ] ; do
if [ ! -z "${entry}" ] ; then
echo "${entry}"
else
- echo "* ${infoname}: (${fname})."
+ echo "* ${infoname}: (${infoname})."
fi
fi
# remove the name from the directory listing
- infofiles=`echo ${infofiles} | sed -e "s/ ${fname} / /" \
- -e "s/^${fname} //" \
- -e "s/ ${fname}$//"`
+ infofiles=`echo "" ${infofiles} "" | sed -e "s/ ${fname} / /" -e "s/ / /g"`
fi
@@ -159,23 +161,53 @@ done
if [ -z "${infofiles}" ] ; then
exit 0
-else
+elif [ $lines -gt 0 ]; then
echo
fi
+# Sort remaining files by INFO-DIR-SECTION.
+prevsect=
+filesectdata=`(cd ${INFODIR}; fgrep INFO-DIR-SECTION /dev/null ${infofiles} | \
+ fgrep -v 'INFO-DIR-SECTION Miscellaneous' | \
+ sort -t: -k2 -k1 | tr ' ' '_')`
+for sectdata in ${filesectdata}; do
+ file=`echo ${sectdata} | cut -d: -f1`
+ section=`sed -n -e 's/^INFO-DIR-SECTION //p' ${INFODIR}/${file}`
+ infofiles=`echo "" ${infofiles} "" | sed -e "s/ ${file} / /" -e "s/ / /g"`
+
+ if [ "${prevsect}" != "${section}" ] ; then
+ if [ ! -z "${prevsect}" ] ; then
+ echo ""
+ fi
+ echo "${section}"
+ prevsect="${section}"
+ fi
+
+ infoname=`echo $file | sed 's/\.info$//'`
+ entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/${file}`
+ if [ ! -z "${entry}" ] ; then
+ echo "${entry}"
+ elif [ ! -d "${INFODIR}/${file}" ] ; then
+ echo "* ${infoname}: (${infoname})."
+ fi
+done
+
+# Process miscellaneous files.
for file in ${infofiles}; do
- case $file in
- *.gz) zcat=zcat; file=`echo $file|sed 's/\.gz$//'`; gz=.gz;;
- *) zcat=cat; gz=;;
- esac
+ if [ ! -z "${prevsect}" ] ; then
+ echo ""
+ echo "Miscellaneous"
+ prevsect=""
+ fi
+
infoname=`echo $file | sed 's/\.info$//'`
- entry=`$zcat ${INFODIR}/${file}$gz \
- |sed -e '1,/START-INFO-DIR-ENTRY/d' \
- -e '/END-INFO-DIR-ENTRY/,$d'`
+ entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/${file}`
if [ ! -z "${entry}" ] ; then
echo "${entry}"
- else
- echo "* ${infoname}: (${file})."
+ elif [ ! -d "${INFODIR}/${file}" ] ; then
+ echo "* ${infoname}: (${infoname})."
fi
done
diff --git a/gnu/usr.bin/texinfo/util/install-info.c b/gnu/usr.bin/texinfo/util/install-info.c
index 9106ee7c698..915784bcf3f 100644
--- a/gnu/usr.bin/texinfo/util/install-info.c
+++ b/gnu/usr.bin/texinfo/util/install-info.c
@@ -1,7 +1,7 @@
/* install-info -- create Info directory entry(ies) for an Info file.
- $Id: install-info.c,v 1.5 1999/01/11 16:38:15 espie Exp $
+ $Id: install-info.c,v 1.6 2000/02/09 02:18:42 espie Exp $
- Copyright (C) 1996, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,18 +20,11 @@
#include "system.h"
#include <getopt.h>
-#ifdef HAVE_LIBZ
-#include <zlib.h>
-#endif
-
-/* Name this program was invoked with. */
-char *progname;
+static char *progname = "install-info";
-char *readfile ();
struct line_data *findlines ();
-void fatal ();
void insert_entry_here ();
-int compare_section_names ();
+int compare_section_names (), compare_entries_text ();
struct spec_entry;
@@ -73,6 +66,13 @@ struct spec_entry
{
struct spec_entry *next;
char *text;
+ int text_len;
+ /* A pointer to the list of sections to which this entry should be
+ added. */
+ struct spec_section *entry_sections;
+ /* A pointer to a section that is beyond the end of the chain whose
+ head is pointed to by entry_sections. */
+ struct spec_section *entry_sections_tail;
};
@@ -110,6 +110,59 @@ struct menu_section
int end_line;
};
+/* This table defines all the long-named options, says whether they
+ use an argument, and maps them into equivalent single-letter options. */
+
+struct option longopts[] =
+{
+ { "delete", no_argument, NULL, 'r' },
+ { "dir-file", required_argument, NULL, 'd' },
+ { "entry", required_argument, NULL, 'e' },
+ { "help", no_argument, NULL, 'h' },
+ { "info-dir", required_argument, NULL, 'D' },
+ { "info-file", required_argument, NULL, 'i' },
+ { "item", required_argument, NULL, 'e' },
+ { "quiet", no_argument, NULL, 'q' },
+ { "remove", no_argument, NULL, 'r' },
+ { "section", required_argument, NULL, 's' },
+ { "version", no_argument, NULL, 'V' },
+ { 0 }
+};
+
+/* Error message functions. */
+
+/* Print error message. S1 is printf control string, S2 and S3 args for it. */
+
+/* VARARGS1 */
+void
+error (s1, s2, s3)
+ char *s1, *s2, *s3;
+{
+ fprintf (stderr, "%s: ", progname);
+ fprintf (stderr, s1, s2, s3);
+ putc ('\n', stderr);
+}
+
+/* VARARGS1 */
+void
+warning (s1, s2, s3)
+ char *s1, *s2, *s3;
+{
+ fprintf (stderr, _("%s: warning: "), progname);
+ fprintf (stderr, s1, s2, s3);
+ putc ('\n', stderr);
+}
+
+/* Print error message and exit. */
+
+void
+fatal (s1, s2, s3)
+ char *s1, *s2, *s3;
+{
+ error (s1, s2, s3);
+ xexit (1);
+}
+
/* Memory allocation and string operations. */
/* Like malloc but get fatal error if memory is exhausted. */
@@ -169,40 +222,6 @@ copy_string (string, size)
copy[size] = 0;
return copy;
}
-
-/* Error message functions. */
-
-/* Print error message. S1 is printf control string, S2 and S3 args for it. */
-
-/* VARARGS1 */
-void
-error (s1, s2, s3)
- char *s1, *s2, *s3;
-{
- fprintf (stderr, "%s: ", progname);
- fprintf (stderr, s1, s2, s3);
- putc ('\n', stderr);
-}
-
-/* VARARGS1 */
-void
-warning (s1, s2, s3)
- char *s1, *s2, *s3;
-{
- fprintf (stderr, _("%s: warning: "), progname);
- fprintf (stderr, s1, s2, s3);
- putc ('\n', stderr);
-}
-
-/* Print error message and exit. */
-
-void
-fatal (s1, s2, s3)
- char *s1, *s2, *s3;
-{
- error (s1, s2, s3);
- exit (1);
-}
/* Print fatal error message based on errno, with file name NAME. */
@@ -275,13 +294,93 @@ extract_menu_file_name (item_text)
return copy_string (item_text, p - item_text);
}
+
+
+
+/* Return FNAME with any [.info][.gz] suffix removed. */
+
+static char *
+strip_info_suffix (fname)
+ char *fname;
+{
+ char *ret = xstrdup (fname);
+ unsigned len = strlen (ret);
+
+ if (len > 3 && FILENAME_CMP (ret + len - 3, ".gz") == 0)
+ {
+ len -= 3;
+ ret[len] = 0;
+ }
+
+ if (len > 5 && FILENAME_CMP (ret + len - 5, ".info") == 0)
+ {
+ len -= 5;
+ ret[len] = 0;
+ }
+ else if (len > 4 && FILENAME_CMP (ret + len - 4, ".inf") == 0)
+ {
+ len -= 4;
+ ret[len] = 0;
+ }
+#ifdef __MSDOS__
+ else if (len > 4 && (FILENAME_CMP (ret + len - 4, ".inz") == 0
+ || FILENAME_CMP (ret + len - 4, ".igz") == 0))
+ {
+ len -= 4;
+ ret[len] = 0;
+ }
+#endif /* __MSDOS__ */
+
+ return ret;
+}
+
+
+/* Return true if ITEM matches NAME and is followed by TERM_CHAR. ITEM
+ can also be followed by `.gz', `.info.gz', or `.info' (and then
+ TERM_CHAR) and still match. */
+
+static int
+menu_item_equal (item, term_char, name)
+ char *item;
+ char term_char;
+ char *name;
+{
+ unsigned name_len = strlen (name);
+ /* First, ITEM must actually match NAME (usually it won't). */
+ int ret = strncasecmp (item, name, name_len) == 0;
+ if (ret)
+ {
+ /* Then, `foobar' doesn't match `foo', so be sure we've got all of
+ ITEM. The various suffixes should never actually appear in the
+ dir file, but sometimes people put them in. */
+ static char *suffixes[]
+ = { "", ".info.gz", ".info", ".inf", ".gz",
+#ifdef __MSDOS__
+ ".inz", ".igz",
+#endif
+ NULL };
+ unsigned i;
+ ret = 0;
+ for (i = 0; !ret && suffixes[i]; i++)
+ {
+ char *suffix = suffixes[i];
+ unsigned suffix_len = strlen (suffix);
+ ret = strncasecmp (item + name_len, suffix, suffix_len) == 0
+ && item[name_len + suffix_len] == term_char;
+ }
+ }
+
+ return ret;
+}
+
+
void
suggest_asking_for_help ()
{
fprintf (stderr, _("\tTry `%s --help' for a complete list of options.\n"),
progname);
- exit (1);
+ xexit (1);
}
void
@@ -289,35 +388,37 @@ print_help ()
{
printf (_("Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
\n\
-Install INFO-FILE in the Info directory file DIR-FILE.\n\
+Install or delete dir entries from INFO-FILE in the Info directory file\n\
+DIR-FILE.\n\
\n\
Options:\n\
---delete Delete existing entries in INFO-FILE;\n\
- don't insert any new entries.\n\
---dir-file=NAME Specify file name of Info directory file.\n\
- This is equivalent to using the DIR-FILE argument.\n\
---entry=TEXT Insert TEXT as an Info directory entry.\n\
- TEXT should have the form of an Info menu item line\n\
- plus zero or more extra lines starting with whitespace.\n\
- If you specify more than one entry, they are all added.\n\
- If you don't specify any entries, they are determined\n\
- from information in the Info file itself.\n\
---help Display this help and exit.\n\
---info-file=FILE Specify Info file to install in the directory.\n\
- This is equivalent to using the INFO-FILE argument.\n\
---info-dir=DIR Same as --dir-file=DIR/dir.\n\
---item=TEXT Same as --entry TEXT.\n\
- An Info directory entry is actually a menu item.\n\
---quiet Suppress warnings.\n\
---remove Same as --delete.\n\
---section=SEC Put this file's entries in section SEC of the directory.\n\
- If you specify more than one section, all the entries\n\
- are added in each of the sections.\n\
- If you don't specify any sections, they are determined\n\
- from information in the Info file itself.\n\
---version Display version information and exit.\n\
+ --delete delete existing entries for INFO-FILE from DIR-FILE;\n\
+ don't insert any new entries.\n\
+ --dir-file=NAME specify file name of Info directory file.\n\
+ This is equivalent to using the DIR-FILE argument.\n\
+ --entry=TEXT insert TEXT as an Info directory entry.\n\
+ TEXT should have the form of an Info menu item line\n\
+ plus zero or more extra lines starting with whitespace.\n\
+ If you specify more than one entry, they are all added.\n\
+ If you don't specify any entries, they are determined\n\
+ from information in the Info file itself.\n\
+ --help display this help and exit.\n\
+ --info-file=FILE specify Info file to install in the directory.\n\
+ This is equivalent to using the INFO-FILE argument.\n\
+ --info-dir=DIR same as --dir-file=DIR/dir.\n\
+ --item=TEXT same as --entry TEXT.\n\
+ An Info directory entry is actually a menu item.\n\
+ --quiet suppress warnings.\n\
+ --remove same as --delete.\n\
+ --section=SEC put this file's entries in section SEC of the directory.\n\
+ If you specify more than one section, all the entries\n\
+ are added in each of the sections.\n\
+ If you don't specify any sections, they are determined\n\
+ from information in the Info file itself.\n\
+ --version display version information and exit.\n\
\n\
-Email bug reports to bug-texinfo@gnu.org.\n\
+Email bug reports to bug-texinfo@gnu.org,\n\
+general questions and discussion to help-texinfo@gnu.org.\n\
"), progname);
}
@@ -338,11 +439,11 @@ ensure_dirfile_exists (dirfile)
f = fopen (dirfile, "w");
if (f)
{
- fputs (_("This is the file .../info/dir, which contains the\n\
+ fprintf (f, _("This is the file .../info/dir, which contains the\n\
topmost node of the Info hierarchy, called (dir)Top.\n\
The first time you invoke Info you start off looking at this node.\n\
\n\
-File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
+%s\tThis is the top of the INFO tree\n\
\n\
This (the Directory node) gives a menu of major topics.\n\
Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n\
@@ -353,7 +454,7 @@ File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
to select it.\n\
\n\
* Menu:\n\
-"), f);
+"), "File: dir,\tNode: Top"); /* This part must not be translated. */
if (fclose (f) < 0)
pfatal_with_name (dirfile);
}
@@ -363,49 +464,635 @@ File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
fprintf (stderr,
_("%s: could not read (%s) and could not create (%s)\n"),
dirfile, readerr, strerror (errno));
- exit (1);
+ xexit (1);
}
}
else
close (desc); /* It already existed, so fine. */
}
-/* This table defines all the long-named options, says whether they
- use an argument, and maps them into equivalent single-letter options. */
+/* Open FILENAME and return the resulting stream pointer. If it doesn't
+ exist, try FILENAME.gz. If that doesn't exist either, call
+ CREATE_CALLBACK (with FILENAME as arg) to create it, if that is
+ non-NULL. If still no luck, fatal error.
+
+ If we do open it, return the actual name of the file opened in
+ OPENED_FILENAME and the compress program to use to (de)compress it in
+ COMPRESSION_PROGRAM. The compression program is determined by the
+ magic number, not the filename. */
+
+FILE *
+open_possibly_compressed_file (filename, create_callback,
+ opened_filename, compression_program, is_pipe)
+ char *filename;
+ void (*create_callback) ();
+ char **opened_filename;
+ char **compression_program;
+ int *is_pipe;
+{
+ char *local_opened_filename, *local_compression_program;
+ int nread;
+ char data[4];
+ FILE *f;
+
+ /* We let them pass NULL if they don't want this info, but it's easier
+ to always determine it. */
+ if (!opened_filename)
+ opened_filename = &local_opened_filename;
+
+ *opened_filename = filename;
+ f = fopen (*opened_filename, FOPEN_RBIN);
+ if (!f)
+ {
+ *opened_filename = concat (filename, ".gz", "");
+ f = fopen (*opened_filename, FOPEN_RBIN);
+#ifdef __MSDOS__
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".igz", "");
+ f = fopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".inz", "");
+ f = fopen (*opened_filename, FOPEN_RBIN);
+ }
+#endif
+ if (!f)
+ {
+ if (create_callback)
+ { /* That didn't work either. Create the file if we can. */
+ (*create_callback) (filename);
+
+ /* And try opening it again. */
+ free (*opened_filename);
+ *opened_filename = filename;
+ f = fopen (*opened_filename, FOPEN_RBIN);
+ if (!f)
+ pfatal_with_name (filename);
+ }
+ else
+ pfatal_with_name (filename);
+ }
+ }
-struct option longopts[] =
+ /* Read first few bytes of file rather than relying on the filename.
+ If the file is shorter than this it can't be usable anyway. */
+ nread = fread (data, sizeof (data), 1, f);
+ if (nread != 1)
+ {
+ /* Empty files don't set errno, so we get something like
+ "install-info: No error for foo", which is confusing. */
+ if (nread == 0)
+ fatal (_("%s: empty file"), *opened_filename);
+ pfatal_with_name (*opened_filename);
+ }
+
+ if (!compression_program)
+ compression_program = &local_compression_program;
+
+ if (data[0] == '\x1f' && data[1] == '\x8b')
+#if STRIP_DOT_EXE
+ /* An explicit .exe yields a better diagnostics from popen below
+ if they don't have gzip installed. */
+ *compression_program = "gzip.exe";
+#else
+ *compression_program = "gzip";
+#endif
+ else
+ *compression_program = NULL;
+
+ if (*compression_program)
+ { /* It's compressed, so fclose the file and then open a pipe. */
+ char *command = concat (*compression_program," -cd <", *opened_filename);
+ if (fclose (f) < 0)
+ pfatal_with_name (*opened_filename);
+ f = popen (command, "r");
+ if (f)
+ *is_pipe = 1;
+ else
+ pfatal_with_name (command);
+ }
+ else
+ { /* It's a plain file, seek back over the magic bytes. */
+ if (fseek (f, 0, 0) < 0)
+ pfatal_with_name (*opened_filename);
+#if O_BINARY
+ /* Since this is a text file, and we opened it in binary mode,
+ switch back to text mode. */
+ f = freopen (*opened_filename, "r", f);
+#endif
+ *is_pipe = 0;
+ }
+
+ return f;
+}
+
+/* Read all of file FILENAME into memory and return the address of the
+ data. Store the size of the data into SIZEP. If need be, uncompress
+ (i.e., try FILENAME.gz et al. if FILENAME does not exist) and store
+ the actual file name that was opened into OPENED_FILENAME (if it is
+ non-NULL), and the companion compression program (if any, else NULL)
+ into COMPRESSION_PROGRAM (if that is non-NULL). If trouble, do
+ a fatal error. */
+
+char *
+readfile (filename, sizep, create_callback,
+ opened_filename, compression_program)
+ char *filename;
+ int *sizep;
+ void (*create_callback) ();
+ char **opened_filename;
+ char **compression_program;
{
- { "delete", no_argument, NULL, 'r' },
- { "dir-file", required_argument, NULL, 'd' },
- { "entry", required_argument, NULL, 'e' },
- { "help", no_argument, NULL, 'h' },
- { "info-dir", required_argument, NULL, 'D' },
- { "info-file", required_argument, NULL, 'i' },
- { "item", required_argument, NULL, 'e' },
- { "quiet", no_argument, NULL, 'q' },
- { "remove", no_argument, NULL, 'r' },
- { "section", required_argument, NULL, 's' },
- { "version", no_argument, NULL, 'V' },
- { 0 }
-};
+ char *real_name;
+ FILE *f;
+ int pipe_p;
+ int filled = 0;
+ int data_size = 8192;
+ char *data = xmalloc (data_size);
+
+ /* If they passed the space for the file name to return, use it. */
+ f = open_possibly_compressed_file (filename, create_callback,
+ opened_filename ? opened_filename
+ : &real_name,
+ compression_program, &pipe_p);
+
+ for (;;)
+ {
+ int nread = fread (data + filled, 1, data_size - filled, f);
+ if (nread < 0)
+ pfatal_with_name (real_name);
+ if (nread == 0)
+ break;
+
+ filled += nread;
+ if (filled == data_size)
+ {
+ data_size += 65536;
+ data = xrealloc (data, data_size);
+ }
+ }
+
+ /* We'll end up wasting space if we're not passing the filename back
+ and it is not just FILENAME, but so what. */
+ /* We need to close the stream, since on some systems the pipe created
+ by popen is simulated by a temporary file which only gets removed
+ inside pclose. */
+ if (pipe_p)
+ pclose (f);
+ else
+ fclose (f);
+
+ *sizep = filled;
+ return data;
+}
+
+/* Output the old dir file, interpolating the new sections
+ and/or new entries where appropriate. If COMPRESSION_PROGRAM is not
+ null, pipe to it to create DIRFILE. Thus if we read dir.gz on input,
+ we'll write dir.gz on output. */
+
+static void
+output_dirfile (dirfile, dir_nlines, dir_lines,
+ n_entries_to_add, entries_to_add, input_sections,
+ compression_program)
+ char *dirfile;
+ int dir_nlines;
+ struct line_data *dir_lines;
+ int n_entries_to_add;
+ struct spec_entry *entries_to_add;
+ struct spec_section *input_sections;
+ char *compression_program;
+{
+ int i;
+ FILE *output;
+
+ if (compression_program)
+ {
+ char *command = concat (compression_program, ">", dirfile);
+ output = popen (command, "w");
+ }
+ else
+ output = fopen (dirfile, "w");
+
+ if (!output)
+ {
+ perror (dirfile);
+ xexit (1);
+ }
+
+ for (i = 0; i <= dir_nlines; i++)
+ {
+ int j;
+
+ /* If we decided to output some new entries before this line,
+ output them now. */
+ if (dir_lines[i].add_entries_before)
+ for (j = 0; j < n_entries_to_add; j++)
+ {
+ struct spec_entry *this = dir_lines[i].add_entries_before[j];
+ if (this == 0)
+ break;
+ fputs (this->text, output);
+ }
+ /* If we decided to add some sections here
+ because there are no such sections in the file,
+ output them now. */
+ if (dir_lines[i].add_sections_before)
+ {
+ struct spec_section *spec;
+ struct spec_section **sections;
+ int n_sections = 0;
+ struct spec_entry *entry;
+ struct spec_entry **entries;
+ int n_entries = 0;
+
+ /* Count the sections and allocate a vector for all of them. */
+ for (spec = input_sections; spec; spec = spec->next)
+ n_sections++;
+ sections = ((struct spec_section **)
+ xmalloc (n_sections * sizeof (struct spec_section *)));
+
+ /* Fill the vector SECTIONS with pointers to all the sections,
+ and sort them. */
+ j = 0;
+ for (spec = input_sections; spec; spec = spec->next)
+ sections[j++] = spec;
+ qsort (sections, n_sections, sizeof (struct spec_section *),
+ compare_section_names);
+
+ /* Count the entries and allocate a vector for all of them. */
+ for (entry = entries_to_add; entry; entry = entry->next)
+ n_entries++;
+ entries = ((struct spec_entry **)
+ xmalloc (n_entries * sizeof (struct spec_entry *)));
+
+ /* Fill the vector ENTRIES with pointers to all the sections,
+ and sort them. */
+ j = 0;
+ for (entry = entries_to_add; entry; entry = entry->next)
+ entries[j++] = entry;
+ qsort (entries, n_entries, sizeof (struct spec_entry *),
+ compare_entries_text);
+
+ /* Generate the new sections in alphabetical order. In each
+ new section, output all of the entries that belong to that
+ section, in alphabetical order. */
+ for (j = 0; j < n_sections; j++)
+ {
+ spec = sections[j];
+ if (spec->missing)
+ {
+ int k;
+
+ putc ('\n', output);
+ fputs (spec->name, output);
+ putc ('\n', output);
+ for (k = 0; k < n_entries; k++)
+ {
+ struct spec_section *spec1;
+ /* Did they at all want this entry to be put into
+ this section? */
+ entry = entries[k];
+ for (spec1 = entry->entry_sections;
+ spec1 && spec1 != entry->entry_sections_tail;
+ spec1 = spec1->next)
+ {
+ if (!strcmp (spec1->name, spec->name))
+ break;
+ }
+ if (spec1 && spec1 != entry->entry_sections_tail)
+ fputs (entry->text, output);
+ }
+ }
+ }
+
+ free (entries);
+ free (sections);
+ }
+ /* Output the original dir lines unless marked for deletion. */
+ if (i < dir_nlines && !dir_lines[i].delete)
+ {
+ fwrite (dir_lines[i].start, 1, dir_lines[i].size, output);
+ putc ('\n', output);
+ }
+ }
+
+ /* Some systems, such as MS-DOS, simulate pipes with temporary files.
+ On those systems, the compressor actually gets run inside pclose,
+ so we must call pclose. */
+ if (compression_program)
+ pclose (output);
+ else
+ fclose (output);
+}
+/* Parse the input to find the section names and the entry names it
+ specifies. Return the number of entries to add from this file. */
+int
+parse_input (lines, nlines, sections, entries)
+ const struct line_data *lines;
+ int nlines;
+ struct spec_section **sections;
+ struct spec_entry **entries;
+{
+ int n_entries = 0;
+ int prefix_length = strlen ("INFO-DIR-SECTION ");
+ struct spec_section *head = *sections, *tail = NULL;
+ int reset_tail = 0;
+ char *start_of_this_entry = 0;
+ int ignore_sections = *sections != 0;
+ int ignore_entries = *entries != 0;
+
+ int i;
+
+ if (ignore_sections && ignore_entries)
+ return 0;
+
+ /* Loop here processing lines from the input file. Each
+ INFO-DIR-SECTION entry is added to the SECTIONS linked list.
+ Each START-INFO-DIR-ENTRY block is added to the ENTRIES linked
+ list, and all its entries inherit the chain of SECTION entries
+ defined by the last group of INFO-DIR-SECTION entries we have
+ seen until that point. */
+ for (i = 0; i < nlines; i++)
+ {
+ if (!ignore_sections
+ && !strncmp ("INFO-DIR-SECTION ", lines[i].start, prefix_length))
+ {
+ struct spec_section *next
+ = (struct spec_section *) xmalloc (sizeof (struct spec_section));
+ next->name = copy_string (lines[i].start + prefix_length,
+ lines[i].size - prefix_length);
+ next->next = *sections;
+ next->missing = 1;
+ if (reset_tail)
+ {
+ tail = *sections;
+ reset_tail = 0;
+ }
+ *sections = next;
+ head = *sections;
+ }
+ /* If entries were specified explicitly with command options,
+ ignore the entries in the input file. */
+ else if (!ignore_entries)
+ {
+ if (!strncmp ("START-INFO-DIR-ENTRY", lines[i].start, lines[i].size)
+ && sizeof ("START-INFO-DIR-ENTRY") - 1 == lines[i].size)
+ {
+ if (!*sections)
+ {
+ /* We found an entry, but didn't yet see any sections
+ specified. Default to section "Miscellaneous". */
+ *sections = (struct spec_section *)
+ xmalloc (sizeof (struct spec_section));
+ (*sections)->name = "Miscellaneous";
+ (*sections)->next = 0;
+ (*sections)->missing = 1;
+ head = *sections;
+ }
+ /* Next time we see INFO-DIR-SECTION, we will reset the
+ tail pointer. */
+ reset_tail = 1;
+
+ if (start_of_this_entry != 0)
+ fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
+ start_of_this_entry = lines[i + 1].start;
+ }
+ else if (start_of_this_entry)
+ {
+ if ((!strncmp ("* ", lines[i].start, 2)
+ && lines[i].start > start_of_this_entry)
+ || (!strncmp ("END-INFO-DIR-ENTRY",
+ lines[i].start, lines[i].size)
+ && sizeof ("END-INFO-DIR-ENTRY") - 1 == lines[i].size))
+ {
+ /* We found an end of this entry. Allocate another
+ entry, fill its data, and add it to the linked
+ list. */
+ struct spec_entry *next
+ = (struct spec_entry *) xmalloc (sizeof (struct spec_entry));
+ next->text
+ = copy_string (start_of_this_entry,
+ lines[i].start - start_of_this_entry);
+ next->text_len = lines[i].start - start_of_this_entry;
+ next->entry_sections = head;
+ next->entry_sections_tail = tail;
+ next->next = *entries;
+ *entries = next;
+ n_entries++;
+ if (!strncmp ("END-INFO-DIR-ENTRY",
+ lines[i].start, lines[i].size)
+ && sizeof ("END-INFO-DIR-ENTRY") - 1 == lines[i].size)
+ start_of_this_entry = 0;
+ else
+ start_of_this_entry = lines[i].start;
+ }
+ else if (!strncmp ("END-INFO-DIR-ENTRY",
+ lines[i].start, lines[i].size)
+ && sizeof ("END-INFO-DIR-ENTRY") - 1 == lines[i].size)
+ fatal (_("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"));
+ }
+ }
+ }
+ if (start_of_this_entry != 0)
+ fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
+
+ /* If we ignored the INFO-DIR-ENTRY directives, we need now go back
+ and plug the names of all the sections we found into every
+ element of the ENTRIES list. */
+ if (ignore_entries && *entries)
+ {
+ struct spec_entry *entry;
+
+ for (entry = *entries; entry; entry = entry->next)
+ {
+ entry->entry_sections = head;
+ entry->entry_sections_tail = tail;
+ }
+ }
+
+ return n_entries;
+}
+
+/* Parse the dir file whose basename is BASE_NAME. Find all the
+ nodes, and their menus, and the sections of their menus. */
+int
+parse_dir_file (lines, nlines, nodes, base_name)
+ struct line_data *lines;
+ int nlines;
+ struct node **nodes;
+ const char *base_name;
+{
+ int node_header_flag = 0;
+ int something_deleted = 0;
+ int i;
+
+ *nodes = 0;
+ for (i = 0; i < nlines; i++)
+ {
+ /* Parse node header lines. */
+ if (node_header_flag)
+ {
+ int j, end;
+ for (j = 0; j < lines[i].size; j++)
+ /* Find the node name and store it in the `struct node'. */
+ if (!strncmp ("Node:", lines[i].start + j, 5))
+ {
+ char *line = lines[i].start;
+ /* Find the start of the node name. */
+ j += 5;
+ while (line[j] == ' ' || line[j] == '\t')
+ j++;
+ /* Find the end of the node name. */
+ end = j;
+ while (line[end] != 0 && line[end] != ',' && line[end] != '\n'
+ && line[end] != '\t')
+ end++;
+ (*nodes)->name = copy_string (line + j, end - j);
+ }
+ node_header_flag = 0;
+ }
+
+ /* Notice the start of a node. */
+ if (*lines[i].start == 037)
+ {
+ struct node *next = (struct node *) xmalloc (sizeof (struct node));
+
+ next->next = *nodes;
+ next->name = NULL;
+ next->start_line = i;
+ next->end_line = 0;
+ next->menu_start = NULL;
+ next->sections = NULL;
+ next->last_section = NULL;
+
+ if (*nodes != 0)
+ (*nodes)->end_line = i;
+ /* Fill in the end of the last menu section
+ of the previous node. */
+ if (*nodes != 0 && (*nodes)->last_section != 0)
+ (*nodes)->last_section->end_line = i;
+
+ *nodes = next;
+
+ /* The following line is the header of this node;
+ parse it. */
+ node_header_flag = 1;
+ }
+
+ /* Notice the lines that start menus. */
+ if (*nodes != 0 && !strncmp ("* Menu:", lines[i].start, 7))
+ (*nodes)->menu_start = lines[i + 1].start;
+
+ /* Notice sections in menus. */
+ if (*nodes != 0
+ && (*nodes)->menu_start != 0
+ && *lines[i].start != '\n'
+ && *lines[i].start != '*'
+ && *lines[i].start != ' '
+ && *lines[i].start != '\t')
+ {
+ /* Add this menu section to the node's list.
+ This list grows in forward order. */
+ struct menu_section *next
+ = (struct menu_section *) xmalloc (sizeof (struct menu_section));
+
+ next->start_line = i + 1;
+ next->next = 0;
+ next->end_line = 0;
+ next->name = copy_string (lines[i].start, lines[i].size);
+ if ((*nodes)->sections)
+ {
+ (*nodes)->last_section->next = next;
+ (*nodes)->last_section->end_line = i;
+ }
+ else
+ (*nodes)->sections = next;
+ (*nodes)->last_section = next;
+ }
+
+ /* Check for an existing entry that should be deleted.
+ Delete all entries which specify this file name. */
+ if (*lines[i].start == '*')
+ {
+ char *q;
+ char *p = lines[i].start;
+
+ p++; /* skip * */
+ while (*p == ' ') p++; /* ignore following spaces */
+ q = p; /* remember this, it's the beginning of the menu item. */
+
+ /* Read menu item. */
+ while (*p != 0 && *p != ':')
+ p++;
+ p++; /* skip : */
+
+ if (*p == ':')
+ { /* XEmacs-style entry, as in * Mew::Messaging. */
+ if (menu_item_equal (q, ':', base_name))
+ {
+ lines[i].delete = 1;
+ something_deleted = 1;
+ }
+ }
+ else
+ { /* Emacs-style entry, as in * Emacs: (emacs). */
+ while (*p == ' ') p++; /* skip spaces after : */
+ if (*p == '(') /* if at parenthesized (FILENAME) */
+ {
+ p++;
+ if (menu_item_equal (p, ')', base_name))
+ {
+ lines[i].delete = 1;
+ something_deleted = 1;
+ }
+ }
+ }
+ }
+
+ /* Treat lines that start with whitespace
+ as continuations; if we are deleting an entry,
+ delete all its continuations as well. */
+ else if (i > 0 && (*lines[i].start == ' ' || *lines[i].start == '\t'))
+ {
+ lines[i].delete = lines[i - 1].delete;
+ }
+ }
+
+ /* Finish the info about the end of the last node. */
+ if (*nodes != 0)
+ {
+ (*nodes)->end_line = nlines;
+ if ((*nodes)->last_section != 0)
+ (*nodes)->last_section->end_line = nlines;
+ }
+
+ return something_deleted;
+}
+
int
main (argc, argv)
int argc;
char **argv;
{
- char *infile = 0, *dirfile = 0;
+ char *opened_dirfilename;
+ char *compression_program;
char *infile_sans_info;
+ char *infile = 0, *dirfile = 0;
unsigned infilelen_sans_info;
- FILE *output;
/* Record the text of the Info file, as a sequence of characters
and as a sequence of lines. */
- char *input_data;
- int input_size;
- struct line_data *input_lines;
- int input_nlines;
+ char *input_data = NULL;
+ int input_size = 0;
+ struct line_data *input_lines = NULL;
+ int input_nlines = 0;
/* Record here the specified section names and directory entries. */
struct spec_section *input_sections = NULL;
@@ -426,12 +1113,8 @@ main (argc, argv)
/* Nonzero means -q was specified. */
int quiet_flag = 0;
- int node_header_flag;
- int prefix_length;
int i;
- progname = argv[0];
-
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
@@ -482,9 +1165,16 @@ main (argc, argv)
{
struct spec_entry *next
= (struct spec_entry *) xmalloc (sizeof (struct spec_entry));
- if (! (*optarg != 0 && optarg[strlen (optarg) - 1] == '\n'))
- optarg = concat (optarg, "\n", "");
+ int olen = strlen (optarg);
+ if (! (*optarg != 0 && optarg[olen - 1] == '\n'))
+ {
+ optarg = concat (optarg, "\n", "");
+ olen++;
+ }
next->text = optarg;
+ next->text_len = olen;
+ next->entry_sections = NULL;
+ next->entry_sections_tail = NULL;
next->next = entries_to_add;
entries_to_add = next;
n_entries_to_add++;
@@ -494,7 +1184,7 @@ main (argc, argv)
case 'h':
case 'H':
print_help ();
- exit (0);
+ xexit (0);
case 'i':
if (infile)
@@ -527,12 +1217,13 @@ main (argc, argv)
case 'V':
printf ("install-info (GNU %s) %s\n", PACKAGE, VERSION);
+ puts ("");
printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
- "1998");
- exit (0);
+ "1999");
+ xexit (0);
default:
suggest_asking_for_help ();
@@ -555,250 +1246,80 @@ For more information about these matters, see the files named COPYING.\n"),
if (!dirfile)
fatal (_("No dir file specified; try --help for more information."));
- /* Read the Info file and parse it into lines. */
-
- input_data = readfile (infile, &input_size);
- input_lines = findlines (input_data, input_size, &input_nlines);
-
- /* Parse the input file to find the section names it specifies. */
-
- if (input_sections == 0)
- {
- prefix_length = strlen ("INFO-DIR-SECTION ");
- for (i = 0; i < input_nlines; i++)
- {
- if (!strncmp ("INFO-DIR-SECTION ", input_lines[i].start,
- prefix_length))
- {
- struct spec_section *next
- = (struct spec_section *) xmalloc (sizeof (struct spec_section));
- next->name = copy_string (input_lines[i].start + prefix_length,
- input_lines[i].size - prefix_length);
- next->next = input_sections;
- next->missing = 1;
- input_sections = next;
- }
- }
- }
-
- /* Default to section "Miscellaneous" if no sections specified. */
- if (input_sections == 0)
+ /* Read the Info file and parse it into lines, unless we're deleting. */
+ if (!delete_flag)
{
- input_sections
- = (struct spec_section *) xmalloc (sizeof (struct spec_section));
- input_sections->name = "Miscellaneous";
- input_sections->next = 0;
- input_sections->missing = 1;
+ input_data = readfile (infile, &input_size, NULL, NULL, NULL);
+ input_lines = findlines (input_data, input_size, &input_nlines);
}
- /* Now find the directory entries specified in the file
- and put them on entries_to_add. But not if entries
- were specified explicitly with command options. */
+ i = parse_input (input_lines, input_nlines,
+ &input_sections, &entries_to_add);
+ if (i > n_entries_to_add)
+ n_entries_to_add = i;
- if (entries_to_add == 0)
+ if (!delete_flag)
{
- char *start_of_this_entry = 0;
- for (i = 0; i < input_nlines; i++)
+ if (entries_to_add == 0)
+ { /* No need to abort here, the original info file may not
+ have the requisite Texinfo commands. This is not
+ something an installer should have to correct (it's a
+ problem for the maintainer), and there's no need to cause
+ subsequent parts of `make install' to fail. */
+ warning (_("no info dir entry in `%s'"), infile);
+ xexit (0);
+ }
+
+ /* If the entries came from the command-line arguments, their
+ entry_sections pointers are not yet set. Walk the chain of
+ the entries and for each entry update entry_sections to point
+ to the head of the list of sections where this entry should
+ be put. Note that all the entries specified on the command
+ line get put into ALL the sections we've got, either from the
+ Info file, or (under --section) from the command line,
+ because in the loop below every entry inherits the entire
+ chain of sections. */
+ if (n_entries_to_add > 0 && entries_to_add->entry_sections == NULL)
{
- if (!strncmp ("START-INFO-DIR-ENTRY", input_lines[i].start,
- input_lines[i].size)
- && sizeof ("START-INFO-DIR-ENTRY") - 1 == input_lines[i].size)
+ struct spec_entry *ep;
+
+ /* If we got no sections, default to "Miscellaneous". */
+ if (input_sections == NULL)
{
- if (start_of_this_entry != 0)
- fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
- start_of_this_entry = input_lines[i + 1].start;
- }
- if (!strncmp ("END-INFO-DIR-ENTRY", input_lines[i].start,
- input_lines[i].size)
- && sizeof ("END-INFO-DIR-ENTRY") - 1 == input_lines[i].size)
- {
- if (start_of_this_entry != 0)
- {
- struct spec_entry *next
- = (struct spec_entry *) xmalloc (sizeof (struct spec_entry));
- next->text = copy_string (start_of_this_entry,
- input_lines[i].start - start_of_this_entry);
- next->next = entries_to_add;
- entries_to_add = next;
- n_entries_to_add++;
- start_of_this_entry = 0;
- }
- else
- fatal (_("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"));
+ input_sections = (struct spec_section *)
+ xmalloc (sizeof (struct spec_section));
+ input_sections->name = "Miscellaneous";
+ input_sections->next = NULL;
+ input_sections->missing = 1;
}
+ for (ep = entries_to_add; ep; ep = ep->next)
+ ep->entry_sections = input_sections;
}
- if (start_of_this_entry != 0)
- fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
}
- if (!delete_flag)
- if (entries_to_add == 0)
- { /* No need to abort here, the original info file may not have
- the requisite Texinfo commands. This is not something an
- installer should have to correct (it's a problem for the
- maintainer), and there's no need to cause subsequent parts of
- `make install' to fail. */
- warning (_("no info dir entry in `%s'"), infile);
- exit (0);
- }
-
/* Now read in the Info dir file. */
- ensure_dirfile_exists (dirfile);
- dir_data = readfile (dirfile, &dir_size);
+ dir_data = readfile (dirfile, &dir_size, ensure_dirfile_exists,
+ &opened_dirfilename, &compression_program);
dir_lines = findlines (dir_data, dir_size, &dir_nlines);
/* We will be comparing the entries in the dir file against the
- current filename, so need to strip off any directory prefix and any
- .info suffix. */
+ current filename, so need to strip off any directory prefix and/or
+ [.info][.gz] suffix. */
{
- unsigned basename_len;
- char *infile_basename = strrchr (infile, '/');
- if (infile_basename)
- infile_basename++;
- else
- infile_basename = infile;
-
- basename_len = strlen (infile_basename);
- infile_sans_info
- = (strlen (infile_basename) > 5
- && strcmp (infile_basename + basename_len - 5, ".info") == 0)
- ? copy_string (infile_basename, basename_len - 5)
- : infile_basename;
-
- infilelen_sans_info = strlen (infile_sans_info);
- }
-
- /* Parse the dir file. Find all the nodes, and their menus,
- and the sections of their menus. */
-
- dir_nodes = 0;
- node_header_flag = 0;
- for (i = 0; i < dir_nlines; i++)
- {
- /* Parse node header lines. */
- if (node_header_flag)
- {
- int j, end;
- for (j = 0; j < dir_lines[i].size; j++)
- /* Find the node name and store it in the `struct node'. */
- if (!strncmp ("Node:", dir_lines[i].start + j, 5))
- {
- char *line = dir_lines[i].start;
- /* Find the start of the node name. */
- j += 5;
- while (line[j] == ' ' || line[j] == '\t')
- j++;
- /* Find the end of the node name. */
- end = j;
- while (line[end] != 0 && line[end] != ',' && line[end] != '\n'
- && line[end] != '\t')
- end++;
- dir_nodes->name = copy_string (line + j, end - j);
- }
- node_header_flag = 0;
- }
-
- /* Notice the start of a node. */
- if (*dir_lines[i].start == 037)
- {
- struct node *next
- = (struct node *) xmalloc (sizeof (struct node));
- next->next = dir_nodes;
- next->name = NULL;
- next->start_line = i;
- next->end_line = 0;
- next->menu_start = NULL;
- next->sections = NULL;
- next->last_section = NULL;
-
- if (dir_nodes != 0)
- dir_nodes->end_line = i;
- /* Fill in the end of the last menu section
- of the previous node. */
- if (dir_nodes != 0 && dir_nodes->last_section != 0)
- dir_nodes->last_section->end_line = i;
-
- dir_nodes = next;
-
- /* The following line is the header of this node;
- parse it. */
- node_header_flag = 1;
- }
-
- /* Notice the lines that start menus. */
- if (dir_nodes != 0
- && !strncmp ("* Menu:", dir_lines[i].start, 7))
- dir_nodes->menu_start = dir_lines[i + 1].start;
+ char *infile_basename = infile + strlen (infile);
- /* Notice sections in menus. */
- if (dir_nodes != 0
- && dir_nodes->menu_start != 0
- && *dir_lines[i].start != '\n'
- && *dir_lines[i].start != '*'
- && *dir_lines[i].start != ' '
- && *dir_lines[i].start != '\t')
- {
- /* Add this menu section to the node's list.
- This list grows in forward order. */
- struct menu_section *next
- = (struct menu_section *) xmalloc (sizeof (struct menu_section));
- next->start_line = i + 1;
- next->next = 0;
- next->end_line = 0;
- next->name = copy_string (dir_lines[i].start, dir_lines[i].size);
- if (dir_nodes->sections)
- {
- dir_nodes->last_section->next = next;
- dir_nodes->last_section->end_line = i;
- }
- else
- dir_nodes->sections = next;
- dir_nodes->last_section = next;
- }
+ if (HAVE_DRIVE (infile))
+ infile += 2; /* get past the drive spec X: */
- /* Check for an existing entry that should be deleted.
- Delete all entries which specify this file name. */
- if (*dir_lines[i].start == '*')
- {
- char *p = dir_lines[i].start;
+ while (infile_basename > infile && !IS_SLASH (infile_basename[-1]))
+ infile_basename--;
- while (*p != 0 && *p != ':')
- p++;
- p++;
- while (*p == ' ') p++;
- if (*p == '(')
- {
- p++;
- if ((dir_lines[i].size
- > (p - dir_lines[i].start + infilelen_sans_info))
- && !strncmp (p, infile_sans_info, infilelen_sans_info)
- && (p[infilelen_sans_info] == ')'
- || !strncmp (p + infilelen_sans_info, ".info)", 6)))
- {
- dir_lines[i].delete = 1;
- something_deleted = 1;
- }
- }
- }
- /* Treat lines that start with whitespace
- as continuations; if we are deleting an entry,
- delete all its continuations as well. */
- else if (i > 0
- && (*dir_lines[i].start == ' '
- || *dir_lines[i].start == '\t'))
- {
- dir_lines[i].delete = dir_lines[i - 1].delete;
- something_deleted = 1;
- }
- }
+ infile_sans_info = strip_info_suffix (infile_basename);
+ infilelen_sans_info = strlen (infile_sans_info);
+ }
- /* Finish the info about the end of the last node. */
- if (dir_nodes != 0)
- {
- dir_nodes->end_line = dir_nlines;
- if (dir_nodes->last_section != 0)
- dir_nodes->last_section->end_line = dir_nlines;
- }
+ something_deleted
+ = parse_dir_file (dir_lines, dir_nlines, &dir_nodes, infile_sans_info);
/* Decide where to add the new entries (unless --delete was used).
Find the menu sections to add them in.
@@ -833,7 +1354,18 @@ For more information about these matters, see the files named COPYING.\n"),
to add it. */
for (entry = entries_to_add; entry; entry = entry->next)
{
- int textlen = strlen (entry->text);
+ /* Did they at all want this entry to be put into
+ this section? */
+ for (spec = entry->entry_sections;
+ spec && spec != entry->entry_sections_tail;
+ spec = spec->next)
+ {
+ if (!strcmp (spec->name, section->name))
+ break;
+ }
+ if (!spec || spec == entry->entry_sections_tail)
+ continue;
+
/* Subtract one because dir_lines is zero-based,
but the `end_line' and `start_line' members are
one-based. */
@@ -845,7 +1377,7 @@ For more information about these matters, see the files named COPYING.\n"),
(which means it is for some other file),
we are in trouble. */
if (dir_lines[i].start[0] == '*'
- && menu_line_equal (entry->text, textlen,
+ && menu_line_equal (entry->text, entry->text_len,
dir_lines[i].start,
dir_lines[i].size)
&& !dir_lines[i].delete)
@@ -853,7 +1385,7 @@ For more information about these matters, see the files named COPYING.\n"),
extract_menu_item_name (entry->text),
extract_menu_file_name (dir_lines[i].start));
if (dir_lines[i].start[0] == '*'
- && menu_line_lessp (entry->text, textlen,
+ && menu_line_lessp (entry->text, entry->text_len,
dir_lines[i].start,
dir_lines[i].size))
add_at_line = i;
@@ -874,162 +1406,10 @@ For more information about these matters, see the files named COPYING.\n"),
if (delete_flag && !something_deleted && !quiet_flag)
warning (_("no entries found for `%s'; nothing deleted"), infile);
- /* Output the old dir file, interpolating the new sections
- and/or new entries where appropriate. */
-
- output = fopen (dirfile, "w");
- if (!output)
- {
- perror (dirfile);
- exit (1);
- }
-
- for (i = 0; i <= dir_nlines; i++)
- {
- int j;
-
- /* If we decided to output some new entries before this line,
- output them now. */
- if (dir_lines[i].add_entries_before)
- for (j = 0; j < n_entries_to_add; j++)
- {
- struct spec_entry *this = dir_lines[i].add_entries_before[j];
- if (this == 0)
- break;
- fputs (this->text, output);
- }
- /* If we decided to add some sections here
- because there are no such sections in the file,
- output them now. */
- if (dir_lines[i].add_sections_before)
- {
- struct spec_section *spec;
- struct spec_section **sections;
- int n_sections = 0;
-
- /* Count the sections and allocate a vector for all of them. */
- for (spec = input_sections; spec; spec = spec->next)
- n_sections++;
- sections = ((struct spec_section **)
- xmalloc (n_sections * sizeof (struct spec_section *)));
-
- /* Fill the vector SECTIONS with pointers to all the sections,
- and sort them. */
- j = 0;
- for (spec = input_sections; spec; spec = spec->next)
- sections[j++] = spec;
- qsort (sections, n_sections, sizeof (struct spec_section *),
- compare_section_names);
-
- /* Generate the new sections in alphabetical order.
- In each new section, output all of our entries. */
- for (j = 0; j < n_sections; j++)
- {
- spec = sections[j];
- if (spec->missing)
- {
- struct spec_entry *entry;
-
- putc ('\n', output);
- fputs (spec->name, output);
- putc ('\n', output);
- for (entry = entries_to_add; entry; entry = entry->next)
- fputs (entry->text, output);
- }
- }
-
- free (sections);
- }
-
- /* Output the original dir lines unless marked for deletion. */
- if (i < dir_nlines && !dir_lines[i].delete)
- {
- fwrite (dir_lines[i].start, 1, dir_lines[i].size, output);
- putc ('\n', output);
- }
- }
-
- fclose (output);
-
- exit (0);
-}
-
-/* Read all of file FILNAME into memory
- and return the address of the data.
- Store the size into SIZEP.
- If there is trouble, do a fatal error. */
-
-char *
-readfile (filename, sizep)
- char *filename;
- int *sizep;
-{
- int desc;
- int data_size = 1024;
- char *data = (char *) xmalloc (data_size);
- int filled = 0;
- int nread = 0;
-#ifdef HAVE_LIBZ
- int isGZ = 0;
- gzFile zdesc;
-#endif
-
- desc = open (filename, O_RDONLY);
- if (desc < 0)
- pfatal_with_name (filename);
-
-#ifdef HAVE_LIBZ
- /* The file should always be two bytes long. */
- if (read (desc, data, 2) != 2)
- pfatal_with_name (filename);
-
- /* Undo that read. */
- lseek (desc, 0, SEEK_SET);
+ output_dirfile (opened_dirfilename, dir_nlines, dir_lines, n_entries_to_add,
+ entries_to_add, input_sections, compression_program);
- /* If we see gzip magic, use gzdopen. */
- if (data[0] == '\x1f' && data[1] == '\x8b')
- {
- isGZ = 1;
- zdesc = gzdopen (desc, "r");
- if (zdesc == NULL) {
- close (desc);
- pfatal_with_name (filename);
- }
- }
-#endif /* HAVE_LIBZ */
-
- while (1)
- {
-#ifdef HAVE_LIBZ
- if (isGZ)
- nread = gzread (zdesc, data + filled, data_size - filled);
- else
-#endif
- nread = read (desc, data + filled, data_size - filled);
-
- if (nread < 0)
- pfatal_with_name (filename);
- if (nread == 0)
- break;
-
- filled += nread;
- if (filled == data_size)
- {
- data_size *= 2;
- data = (char *) xrealloc (data, data_size);
- }
- }
-
- *sizep = filled;
-
-#ifdef HAVE_LIBZ
- if (isGZ)
- gzclose (zdesc);
- else
-#endif
- close(desc);
-
- return data;
+ xexit (0);
}
/* Divide the text at DATA (of SIZE bytes) into lines.
@@ -1042,23 +1422,23 @@ findlines (data, size, nlinesp)
int size;
int *nlinesp;
{
- struct line_data *lines;
- int lines_allocated = 512;
+ int i;
+ int lineflag = 1;
+ int lines_allocated = 511;
int filled = 0;
- int i = 0;
- int lineflag;
-
- lines = (struct line_data *) xmalloc (lines_allocated * sizeof (struct line_data));
+ struct line_data *lines
+ = xmalloc ((lines_allocated + 1) * sizeof (struct line_data));
- lineflag = 1;
for (i = 0; i < size; i++)
{
if (lineflag)
{
if (filled == lines_allocated)
{
- lines_allocated *= 2;
- lines = (struct line_data *) xrealloc (lines, lines_allocated * sizeof (struct line_data));
+ /* try to keep things somewhat page-aligned */
+ lines_allocated = ((lines_allocated + 1) * 2) - 1;
+ lines = xrealloc (lines, (lines_allocated + 1)
+ * sizeof (struct line_data));
}
lines[filled].start = &data[i];
lines[filled].add_entries_before = 0;
@@ -1098,7 +1478,7 @@ menu_line_lessp (line1, len1, line2, len2)
{
int minlen = (len1 < len2 ? len1 : len2);
int i;
-
+
for (i = 0; i < minlen; i++)
{
/* If one item name is a prefix of the other,
@@ -1131,7 +1511,7 @@ menu_line_equal (line1, len1, line2, len2)
{
int minlen = (len1 < len2 ? len1 : len2);
int i;
-
+
for (i = 0; i < minlen; i++)
{
/* If both item names end here, they are equal. */
@@ -1159,6 +1539,31 @@ compare_section_names (sec1, sec2)
return strcmp (name1, name2);
}
+/* This is the comparison function for qsort
+ for a vector of pointers to struct spec_entry.
+ Compare the entries' text. */
+
+int
+compare_entries_text (entry1, entry2)
+ struct spec_entry **entry1, **entry2;
+{
+ char *text1 = (*entry1)->text;
+ char *text2 = (*entry2)->text;
+ char *colon1 = strchr (text1, ':');
+ char *colon2 = strchr (text2, ':');
+ int len1, len2;
+
+ if (!colon1)
+ len1 = strlen (text1);
+ else
+ len1 = colon1 - text1;
+ if (!colon2)
+ len2 = strlen (text2);
+ else
+ len2 = colon2 - text2;
+ return strncmp (text1, text2, len1 <= len2 ? len1 : len2);
+}
+
/* Insert ENTRY into the add_entries_before vector
for line number LINE_NUMBER of the dir file.
DIR_LINES and N_ENTRIES carry information from like-named variables
@@ -1171,7 +1576,7 @@ insert_entry_here (entry, line_number, dir_lines, n_entries)
struct line_data *dir_lines;
int n_entries;
{
- int i;
+ int i, j;
if (dir_lines[line_number].add_entries_before == 0)
{
@@ -1181,12 +1586,26 @@ insert_entry_here (entry, line_number, dir_lines, n_entries)
dir_lines[line_number].add_entries_before[i] = 0;
}
+ /* Find the place where this entry belongs. If there are already
+ several entries to add before LINE_NUMBER, make sure they are in
+ alphabetical order. */
for (i = 0; i < n_entries; i++)
- if (dir_lines[line_number].add_entries_before[i] == 0)
+ if (dir_lines[line_number].add_entries_before[i] == 0
+ || menu_line_lessp (entry->text, strlen (entry->text),
+ dir_lines[line_number].add_entries_before[i]->text,
+ strlen (dir_lines[line_number].add_entries_before[i]->text)))
break;
if (i == n_entries)
abort ();
+ /* If we need to plug ENTRY into the middle of the
+ ADD_ENTRIES_BEFORE array, move the entries which should be output
+ after this one down one notch, before adding a new one. */
+ if (dir_lines[line_number].add_entries_before[i] != 0)
+ for (j = n_entries - 1; j > i; j--)
+ dir_lines[line_number].add_entries_before[j]
+ = dir_lines[line_number].add_entries_before[j - 1];
+
dir_lines[line_number].add_entries_before[i] = entry;
}
diff --git a/gnu/usr.bin/texinfo/util/texi2dvi b/gnu/usr.bin/texinfo/util/texi2dvi
index 6f196887fdf..bd6387b499a 100644
--- a/gnu/usr.bin/texinfo/util/texi2dvi
+++ b/gnu/usr.bin/texinfo/util/texi2dvi
@@ -1,8 +1,8 @@
#! /bin/sh
-# texi2dvi --- smartly produce DVI files from texinfo sources
-# $Id: texi2dvi,v 1.2 1999/01/11 16:38:15 espie Exp $
+# texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources.
+# $Id: texi2dvi,v 1.3 2000/02/09 02:18:42 espie Exp $
#
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,344 +19,550 @@
# program's maintainer or write to: The Free Software Foundation,
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
#
-# Commentary:
-#
-# Author: Noah Friedman <friedman@gnu.org>
+# Original author: Noah Friedman <friedman@gnu.org>.
#
# Please send bug reports, etc. to bug-texinfo@gnu.org.
# If possible, please send a copy of the output of the script called with
# the `--debug' option when making a bug report.
-#
-# In the interest of general portability, some common bourne shell
-# constructs were avoided because they weren't guaranteed to be available
-# in some earlier implementations. I've tried to make this program as
-# portable as possible. Welcome to unix, where the lowest common
-# denominator is rapidly diminishing.
-#
-# Among the more interesting lossages I noticed among Bourne shells:
-# * No shell functions.
-# * No `unset' builtin.
-# * `shift' cannot take a numeric argument, and signals an error if
-# there are no arguments to shift.
-#
-# Code:
-
-# Name by which this script was invoked.
-progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
# This string is expanded by rcs automatically when this file is checked out.
-rcs_revision='$Revision: 1.2 $'
-version=`set - $rcs_revision; echo $2`
-
-# To prevent hairy quoting and escaping later.
-bq='`'
-eq="'"
+rcs_revision='$Revision: 1.3 $'
+rcs_version=`set - $rcs_revision; echo $2`
+program=`echo $0 | sed -e 's!.*/!!'`
+version="texi2dvi (GNU Texinfo 4.0) $rcs_version
-usage="Usage: $0 [OPTION]... FILE...
-Run a Texinfo document through TeX.
+Copyright (C) 1999 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
-Options:
--b, --batch No interaction (\nonstopmode in TeX).
--c, --clean Remove all auxiliary files.
--D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq).
--t, --texinfo CMD Insert CMD after @setfilename before running TeX.
---verbose Report on what is done.
--h, --help Display this help and exit.
--v, --version Display version information and exit.
+usage="Usage: $program [OPTION]... FILE...
-The values of the TEX, TEXINDEX, and MAKEINFO environment variables are
-used to run those commands, if they are set.
+Run each Texinfo or LaTeX FILE through TeX in turn until all
+cross-references are resolved, building all indices. The directory
+containing each FILE is searched for included files. The suffix of FILE
+is used to determine its language (LaTeX or Texinfo).
-Email bug reports to bug-texinfo@gnu.org."
+Makeinfo is used to perform Texinfo macro expansion before running TeX
+when needed.
-# Initialize variables.
+Options:
+ -@ Use @input instead of \input; for preloaded Texinfo.
+ -b, --batch No interaction.
+ -c, --clean Remove all auxiliary files.
+ -D, --debug Turn on shell debugging (set -x).
+ -e, --expand Force macro expansion using makeinfo.
+ -I DIR Search DIR for Texinfo files.
+ -h, --help Display this help and exit successfully.
+ -l, --language=LANG Specify the LANG of FILE: LaTeX or Texinfo.
+ -p, --pdf Use pdftex or pdflatex for processing.
+ -q, --quiet No output unless errors (implies --batch).
+ -s, --silent Same as --quiet.
+ -t, --texinfo=CMD Insert CMD after @setfilename in copy of input file.
+ Multiple values accumulate.
+ -v, --version Display version information and exit successfully.
+ -V, --verbose Report on what is done.
+
+The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO,
+TEX (or PDFTEX), and TEXINDEX environment variables are used to run
+those commands, if they are set.
+
+Email bug reports to <bug-texinfo@gnu.org>,
+general questions and discussion to <help-texinfo@gnu.org>."
+
+# Initialize variables for option overriding and otherwise.
# Don't use `unset' since old bourne shells don't have this command.
# Instead, assign them an empty value.
-# Some of these, like TEX and TEXINDEX, may be inherited from the environment.
-backup_extension=.bak # these files get deleted if all goes well.
-batch=
+escape='\'
+batch=false # eval for batch mode
clean=
debug=
-orig_pwd="`pwd`"
+expand= # t for expansion via makeinfo
+oformat=dvi
+set_language=
+miincludes= # makeinfo include path
textra=
-verbose=false
-makeinfo="${MAKEINFO-makeinfo}"
-texindex="${TEXINDEX-texindex}"
-tex="${TEX-tex}"
+tmpdir=${TMPDIR:-/tmp}/t2d$$ # avoid collisions on 8.3 filesystems.
+txincludes= # TEXINPUTS extensions
+txiprereq=19990129 # minimum texinfo.tex version to have macro expansion
+quiet= # by default let the tools' message be displayed
+verbose=false # echo for verbose mode
+
+orig_pwd=`pwd`
+
+# Systems which define $COMSPEC or $ComSpec use semicolons to separate
+# directories in TEXINPUTS.
+if test -n "$COMSPEC$ComSpec"; then
+ path_sep=";"
+else
+ path_sep=":"
+fi
# Save this so we can construct a new TEXINPUTS path for each file.
TEXINPUTS_orig="$TEXINPUTS"
-export TEXINPUTS
-
+# Unfortunately makeindex does not read TEXINPUTS.
+INDEXSTYLE_orig="$INDEXSTYLE"
+export TEXINPUTS INDEXSTYLE
+
+# Push a token among the arguments that will be used to notice when we
+# ended options/arguments parsing.
+# Use "set dummy ...; shift" rather than 'set - ..." because on
+# Solaris set - turns off set -x (but keeps set -e).
+# Use ${1+"$@"} rather than "$@" because Digital Unix and Ultrix 4.3
+# still expand "$@" to a single argument (the empty string) rather
+# than nothing at all.
+arg_sep="$$--$$"
+set dummy ${1+"$@"} "$arg_sep"; shift
+
+#
# Parse command line arguments.
-# Make sure that all wildcarded options are long enough to be unambiguous.
-# It's a good idea to document the full long option name in each case.
-# Long options which take arguments will need a `*' appended to the
-# canonical name to match the value appended after the `=' character.
-while :; do
- test $# -eq 0 && break
-
+while test x"$1" != x"$arg_sep"; do
+
+ # Handle --option=value by splitting apart and putting back on argv.
case "$1" in
- -b | --batch | --b* ) batch=t; shift ;;
- -c | --clean | --c* ) clean=t; shift ;;
- -D | --debug | --d* ) debug=t; shift ;;
- -h | --help | --h* ) echo "$usage"; exit 0 ;;
- # OK, we should do real option parsing here, but be lazy for now.
- -t | --texinfo | --t*) shift; textra="$textra $1"; shift ;;
- -v | --vers* )
- echo "$progname (GNU Texinfo 3.12) $version"
- echo "Copyright (C) 1998 Free Software Foundation, Inc.
-There is NO warranty. You may redistribute this software
-under the terms of the GNU General Public License.
-For more information about these matters, see the files named COPYING."
- exit 0 ;;
- --verb* ) verbose=echo; shift ;;
- -- ) # Stop option processing
+ --*=*)
+ opt=`echo "$1" | sed -e 's/=.*//'`
+ val=`echo "$1" | sed -e 's/[^=]*=//'`
+ shift
+ set dummy "$opt" "$val" ${1+"$@"}; shift
+ ;;
+ esac
+
+ # This recognizes --quark as --quiet. So what.
+ case "$1" in
+ -@ ) escape=@;;
+ # Silently and without documentation accept -b and --b[atch] as synonyms.
+ -b | --b*) batch=eval;;
+ -q | -s | --q* | --s*) quiet=t; batch=eval;;
+ -c | --c*) clean=t;;
+ -D | --d*) debug=t;;
+ -e | --e*) expand=t;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -I | --I*)
+ shift
+ miincludes="$miincludes -I $1"
+ txincludes="$txincludes$path_sep$1"
+ ;;
+ -l | --l*) shift; set_language=$1;;
+ -p | --p*) oformat=pdf;;
+ -t | --t*) shift; textra="$textra\\
+$1";;
+ -v | --vers*) echo "$version"; exit 0;;
+ -V | --verb*) verbose=echo;;
+ --) # What remains are not options.
shift
- break ;;
- -* )
- case "$1" in
- --*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
- * ) arg="$1" ;;
- esac
- exec 1>&2
- echo "$progname: Unknown or ambiguous option $bq$arg$eq."
- echo "$progname: Try $bq--help$eq for more information."
- exit 1 ;;
- * ) break ;;
+ while test x"$1" != x"$arg_sep"; do
+ set dummy ${1+"$@"} "$1"; shift
+ shift
+ done
+ break;;
+ -*)
+ echo "$0: Unknown or ambiguous option \`$1'." >&2
+ echo "$0: Try \`--help' for more information." >&2
+ exit 1;;
+ *) set dummy ${1+"$@"} "$1"; shift;;
esac
+ shift
done
+# Pop the token
+shift
-# See if there are any command line args left (which will be interpreted as
-# filename arguments).
-if test $# -eq 0; then
- exec 1>&2
- echo "$progname: At least one file name is required as an argument."
- echo "$progname: Try $bq--help$eq for more information."
+# Interpret remaining command line args as filenames.
+if test $# = 0; then
+ echo "$0: Missing file arguments." >&2
+ echo "$0: Try \`--help' for more information." >&2
exit 2
fi
+# Prepare the temporary directory. Remove it at exit, unless debugging.
+if test -z "$debug"; then
+ trap "cd / && rm -rf $tmpdir" 0 1 2 15
+fi
+
+# Create the temporary directory with strict rights
+(umask 077 && mkdir $tmpdir) || exit 1
+
+# Prepare the tools we might need. This may be extra work in some
+# cases, but improves the readibility of the script.
+utildir=$tmpdir/utils
+mkdir $utildir || exit 1
+
+# A sed script that preprocesses Texinfo sources in order to keep the
+# iftex sections only. We want to remove non TeX sections, and
+# comment (with `@c texi2dvi') TeX sections so that makeinfo does not
+# try to parse them. Nevertheless, while commenting TeX sections,
+# don't comment @macro/@end macro so that makeinfo does propagate
+# them. Unfortunately makeinfo --iftex --no-ifhtml --no-ifinfo
+# doesn't work well enough (yet) to use that, so work around with sed.
+comment_iftex_sed=$utildir/comment.sed
+cat <<EOF >$comment_iftex_sed
+/^@tex/,/^@end tex/{
+ s/^/@c texi2dvi/
+}
+/^@iftex/,/^@end iftex/{
+ s/^/@c texi2dvi/
+ /^@c texi2dvi@macro/,/^@c texi2dvi@end macro/{
+ s/^@c texi2dvi//
+ }
+}
+/^@html/,/^@end html/d
+/^@ifhtml/,/^@end ifhtml/d
+/^@ifnottex/,/^@end ifnottex/d
+/^@ifinfo/,/^@end ifinfo/{
+ /^@node/p
+ /^@menu/,/^@end menu/p
+ d
+}
+EOF
+# Uncommenting is simple: Remove any leading `@c texi2dvi'.
+uncomment_iftex_sed=$utildir/uncomment.sed
+cat <<EOF >$uncomment_iftex_sed
+s/^@c texi2dvi//
+EOF
+
+# A shell script that computes the list of xref files.
+# Takes the filename (without extension) of which we look for xref
+# files as argument. The index files must be reported last.
+get_xref_files=$utildir/get_xref.sh
+cat <<\EOF >$get_xref_files
+#! /bin/sh
+
+# Get list of xref files (indexes, tables and lists).
+# Find all files having root filename with a two-letter extension,
+# saves the ones that are really Texinfo-related files. .?o? catches
+# LaTeX tables and lists.
+for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do
+ # If file is empty, skip it.
+ test -s "$this_file" || continue
+ # If the file is not suitable to be an index or xref file, don't
+ # process it. The file can't be if its first character is not a
+ # backslash or single quote.
+ first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file`
+ if test "x$first_character" = "x\\" \
+ || test "x$first_character" = "x'"; then
+ xref_files="$xref_files ./$this_file"
+ fi
+done
+echo "$xref_files"
+EOF
+chmod 500 $get_xref_files
+
+# File descriptor usage:
+# 0 standard input
+# 1 standard output (--verbose messages)
+# 2 standard error
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 5 tools output (turned off by --quiet)
+
+# Tools' output. If quiet, discard, else redirect to the message flow.
+if test "$quiet" = t; then
+ exec 5>/dev/null
+else
+ exec 5>&1
+fi
+
+# Enable tracing
test "$debug" = t && set -x
-# Texify files
+#
+# TeXify files.
+
for command_line_filename in ${1+"$@"}; do
$verbose "Processing $command_line_filename ..."
- # See if file exists. If it doesn't we're in trouble since, even
+ # If the COMMAND_LINE_FILENAME is not absolute (e.g., --debug.tex),
+ # prepend `./' in order to avoid that the tools take it as an option.
+ echo "$command_line_filename" | egrep '^(/|[A-z]:/)' >/dev/null \
+ || command_line_filename="./$command_line_filename"
+
+ # See if the file exists. If it doesn't we're in trouble since, even
# though the user may be able to reenter a valid filename at the tex
# prompt (assuming they're attending the terminal), this script won't
- # be able to find the right index files and so forth.
- if test ! -r "${command_line_filename}"; then
- echo "$0: Could not read ${command_line_filename}." >&2
+ # be able to find the right xref files and so forth.
+ if test ! -r "$command_line_filename"; then
+ echo "$0: Could not read $command_line_filename, skipping." >&2
continue
fi
- # Roughly equivalent to `dirname ...`, but more portable
- directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
- filename_texi="`basename ${command_line_filename}`"
- # Strip off the last extension part (probably .texinfo or .texi)
- filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
-
- # Use same basename since we want to generate aux files with the same
- # basename as the manual. Use extension .texi for the temp file so
- # that TeX will ignore it. Thus, we must use a subdirectory.
- #
- # Output the macro-expanded file to here. The vastly abbreviated
- # temporary directory name is so we don't have collisions on 8.3 or
- # 14-character filesystems.
- tmp_dir=${TMPDIR-/tmp}/txi2d.$$
- filename_tmp=$tmp_dir/$filename_noext.texi
- # Output the file with the user's extra commands to here.
- tmp_dir2=${tmp_dir}.2
- filename_tmp2=$tmp_dir2/$filename_noext.texi
- mkdir $tmp_dir $tmp_dir2
- # Always remove the temporary directories.
- trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15
-
- # If directory and file are the same, then it's probably because there's
- # no pathname component. Set dirname to `.', the current directory.
- if test "z${directory}" = "z${command_line_filename}"; then
- directory=.
- fi
+ # Get the name of the current directory. We want the full path
+ # because in clean mode we are in tmp, in which case a relative
+ # path has no meaning.
+ filename_dir=`echo $command_line_filename | sed 's!/[^/]*$!!;s!^$!.!'`
+ filename_dir=`cd "$filename_dir" >/dev/null && pwd`
+
+ # Strip directory part but leave extension.
+ filename_ext=`basename "$command_line_filename"`
+ # Strip extension.
+ filename_noext=`echo "$filename_ext" | sed 's/\.[^.]*$//'`
+ ext=`echo "$filename_ext" | sed 's/^.*\.//'`
+
+ # _src. Use same basename since we want to generate aux files with
+ # the same basename as the manual. If --expand, then output the
+ # macro-expanded file to here, else copy the original file.
+ tmpdir_src=$tmpdir/src
+ filename_src=$tmpdir_src/$filename_noext.$ext
+
+ # _xtr. The file with the user's extra commands.
+ tmpdir_xtr=$tmpdir/xtr
+ filename_xtr=$tmpdir_xtr/$filename_noext.$ext
+
+ # _bak. Copies of the previous xref files (another round is run if
+ # they differ from the new one).
+ tmpdir_bak=$tmpdir/bak
+
+ # Make all those directories and give up if we can't succeed.
+ mkdir $tmpdir_src $tmpdir_xtr $tmpdir_bak || exit 1
- # Source file might @include additional texinfo sources. Put `.' and
+ # Source file might include additional sources. Put `.' and
# directory where source file(s) reside in TEXINPUTS before anything
- # else. `.' goes first to ensure that any old .aux, .cps, etc. files in
- # ${directory} don't get used in preference to fresher files in `.'.
- TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
+ # else. `.' goes first to ensure that any old .aux, .cps,
+ # etc. files in ${directory} don't get used in preference to fresher
+ # files in `.'. Include orig_pwd in case we are in clean mode, where
+ # we've cd'd to a temp directory.
+ common=".$path_sep$orig_pwd$path_sep$filename_dir$path_sep$txincludes$path_sep"
+ TEXINPUTS="$common$TEXINPUTS_orig"
+ INDEXSTYLE="$common$INDEXSTYLE_orig"
+
+ # If the user explicitly specified the language, use that.
+ # Otherwise, if the first line is \input texinfo, assume it's texinfo.
+ # Otherwise, guess from the file extension.
+ if test -n "$set_language"; then
+ language=$set_language
+ elif sed 1q "$command_line_filename" | fgrep 'input texinfo' >/dev/null; then
+ language=texinfo
+ else
+ language=
+ fi
+
+ # Get the type of the file (latex or texinfo) from the given language
+ # we just guessed, or from the file extension if not set yet.
+ case ${language:-$filename_ext} in
+ [lL]a[tT]e[xX] | *.ltx | *.tex)
+ # Assume a LaTeX file. LaTeX needs bibtex and uses latex for
+ # compilation. No makeinfo.
+ bibtex=${BIBTEX:-bibtex}
+ makeinfo= # no point in running makeinfo on latex source.
+ texindex=${MAKEINDEX:-makeindex}
+ if test $oformat = dvi; then
+ tex=${LATEX:-latex}
+ else
+ tex=${PDFLATEX:-pdflatex}
+ fi
+ ;;
+
+ *)
+ # Assume a Texinfo file. Texinfo files need makeinfo, texindex and tex.
+ bibtex=
+ texindex=${TEXINDEX:-texindex}
+ if test $oformat = dvi; then
+ tex=${TEX:-tex}
+ else
+ tex=${PDFTEX:-pdftex}
+ fi
+ # Unless required by the user, makeinfo expansion is wanted only
+ # if texinfo.tex is too old.
+ if test "$expand" = t; then
+ makeinfo=${MAKEINFO:-makeinfo}
+ else
+ # Check if texinfo.tex performs macro expansion by looking for
+ # its version. The version is a date of the form YEAR-MO-DA.
+ # We don't need to use [0-9] to match the digits since anyway
+ # the comparison with $txiprereq, a number, will fail with non
+ # digits.
+ txiversion_tex=txiversion.tex
+ echo '\input texinfo.tex @bye' >$tmpdir/$txiversion_tex
+ # Run in the tmpdir to avoid leaving files.
+ eval `cd $tmpdir >/dev/null \
+ && $tex $txiversion_tex 2>/dev/null \
+| sed -n 's/^.*\[\(.*\)version \(....\)-\(..\)-\(..\).*$/txiformat=\1 txiversion="\2\3\4"/p'`
+ $verbose "texinfo.tex preloaded as \`$txiformat', version is \`$txiversion' ..."
+ if test "$txiprereq" -le "$txiversion" >/dev/null 2>&1; then
+ makeinfo=
+ else
+ makeinfo=${MAKEINFO:-makeinfo}
+ fi
+ # As long as we had to run TeX, offer the user this convenience
+ if test "$txiformat" = Texinfo; then
+ escape=@
+ fi
+ fi
+ ;;
+ esac
- # Expand macro commands in the original source file using Makeinfo;
- # the macro syntax bfox implemented is impossible to implement in TeX.
+ # Expand macro commands in the original source file using Makeinfo.
# Always use `end' footnote style, since the `separate' style
# generates different output (arguably this is a bug in -E).
# Discard main info output, the user asked to run TeX, not makeinfo.
- # Redirect output to /dev/null to throw away `Making info file...' msg.
- $verbose "Macro-expanding $command_line_filename to $filename_tmp ..."
- $makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \
- $command_line_filename >/dev/null
-
- # But if there were no macros, or makeinfo failed for some reason,
- # just use the original file. (It shouldn't make any difference, but
- # let's be safe.)
- if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
+ if test -n "$makeinfo"; then
+ $verbose "Macro-expanding $command_line_filename to $filename_src ..."
+ sed -f $comment_iftex_sed "$command_line_filename" \
+ | $makeinfo --footnote-style=end -I "$filename_dir" $miincludes \
+ -o /dev/null --macro-expand=- \
+ | sed -f $uncomment_iftex_sed >"$filename_src"
+ filename_input=$filename_src
+ fi
+
+ # If makeinfo failed (or was not even run), use the original file as input.
+ if test $? -ne 0 \
+ || test ! -r "$filename_src"; then
$verbose "Reverting to $command_line_filename ..."
- cp -p $command_line_filename $filename_tmp
+ filename_input=$filename_dir/$filename_ext
fi
- filename_input=$filename_tmp
- dirname_input=$tmp_dir
# Used most commonly for @finalout, @smallbook, etc.
if test -n "$textra"; then
- $verbose "Inserting extra commands: $textra."
+ $verbose "Inserting extra commands: $textra"
sed '/^@setfilename/a\
-'"$textra" $filename_input >$filename_tmp2
- filename_input=$filename_tmp2
- dirname_input=$tmp_dir2
+'"$textra" "$filename_input" >$filename_xtr
+ filename_input=$filename_xtr
fi
# If clean mode was specified, then move to the temporary directory.
if test "$clean" = t; then
- $verbose "cd $dirname_input"
- cd $dirname_input || exit 1
- filename_input=`basename $filename_input`
+ $verbose "cd $tmpdir_src"
+ cd "$tmpdir_src" || exit 1
fi
- while true; do # will break out of loop below
- # "Unset" variables that might have values from previous iterations and
- # which won't be completely reset later.
- definite_index_files=
-
- # Find all files having root filename with a two-letter extension,
- # determine whether they're really index files, and save them. Foo.aux
- # is actually the cross-references file, but we need to keep track of
- # that too.
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files}; do
- # If file is empty, forget it.
- test -s "${this_file}" || continue
-
- # Examine first character of file. If it's not suitable to be an
- # index or xref file, don't process it.
- first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "x${first_character}" = "x\\" \
- || test "x${first_character}" = "x'"; then
- definite_index_files="${definite_index_files} ${this_file}"
+ while :; do # will break out of loop below
+ orig_xref_files=`$get_xref_files "$filename_noext"`
+
+ # Save copies of originals for later comparison.
+ if test -n "$orig_xref_files"; then
+ $verbose "Backing up xref files: `echo $orig_xref_files | sed 's|\./||g'`"
+ cp $orig_xref_files $tmpdir_bak
+ fi
+
+ # Run bibtex on current file.
+ # - If its input (AUX) exists.
+ # - If AUX contains both `\bibdata' and `\bibstyle'.
+ # - If some citations are missing (LOG contains `Citation').
+ # or the LOG complains of a missing .bbl
+ #
+ # We run bibtex first, because I can see reasons for the indexes
+ # to change after bibtex is run, but I see no reason for the
+ # converse.
+ #
+ # Don't try to be too smart. Running bibtex only if the bbl file
+ # exists and is older than the LaTeX file is wrong, since the
+ # document might include files that have changed. Because there
+ # can be several AUX (if there are \include's), but a single LOG,
+ # looking for missing citations in LOG is easier, though we take
+ # the risk to match false messages.
+ if test -n "$bibtex" \
+ && test -r "$filename_noext.aux" \
+ && test -r "$filename_noext.log" \
+ && (grep '^\\bibdata[{]' "$filename_noext.aux" \
+ && grep '^\\bibstyle[{]' "$filename_noext.aux" \
+ && (grep 'Warning:.*Citation.*undefined' "$filename_noext.log" \
+ || grep 'No file .*\.bbl\.' "$filename_noext.log")) \
+ >/dev/null 2>&1; \
+ then
+ $verbose "Running $bibtex $filename_noext ..."
+ if $bibtex "$filename_noext" >&5; then :; else
+ echo "$0: $bibtex exited with bad status, quitting." >&2
+ exit 1
+ fi
+ fi
+
+ # What we'll run texindex on -- exclude non-index files.
+ # Since we know index files are last, it is correct to remove everything
+ # before .aux and .?o?.
+ index_files=`echo "$orig_xref_files" \
+ | sed "s!.*\.aux!!g;
+ s!./$filename_noext\..o.!!g;
+ s/^[ ]*//;s/[ ]*$//"`
+ # Run texindex (or makeindex) on current index files. If they
+ # already exist, and after running TeX a first time the index
+ # files don't change, then there's no reason to run TeX again.
+ # But we won't know that if the index files are out of date or
+ # nonexistent.
+ if test -n "$texindex" && test -n "$index_files"; then
+ $verbose "Running $texindex $index_files ..."
+ if $texindex $index_files 2>&5 1>&2; then :; else
+ echo "$0: $texindex exited with bad status, quitting." >&2
+ exit 1
fi
- done
- orig_index_files="${definite_index_files}"
- orig_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # Now save copies of original index files so we have some means of
- # comparison later.
- $verbose "Backing up current index files: $orig_index_files ..."
- for index_file_to_save in ${orig_index_files}; do
- cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
- done
-
- # Run texindex on current index files. If they already exist, and
- # after running TeX a first time the index files don't change, then
- # there's no reason to run TeX again. But we won't know that if the
- # index files are out of date or nonexistent.
- if test -n "${orig_index_files_sans_aux}"; then
- $verbose "Running $texindex $orig_index_files_sans_aux ..."
- ${texindex} ${orig_index_files_sans_aux}
fi
# Finally, run TeX.
- if test "$batch" = t; then
- tex_mode='\nonstopmode'
- else
- tex_mode=
+ # Prevent $ESCAPE from being interpreted by the shell if it happens
+ # to be `/'.
+ $batch tex_args="\\${escape}nonstopmode\ \\${escape}input"
+ $verbose "Running $cmd ..."
+ cmd="$tex $tex_args $filename_input"
+ if $cmd >&5; then :; else
+ echo "$0: $tex exited with bad status, quitting." >&2
+ echo "$0: see $filename_noext.log for errors." >&2
+ test "$clean" = t \
+ && cp "$filename_noext.log" "$orig_pwd"
+ exit 1
fi
- $verbose "Running $tex $filename_input ..."
- cmd="$tex $tex_mode \\input $filename_input"
- $cmd
-
- # Check if index files changed.
- #
- definite_index_files=
- # Get list of new index files.
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files}; do
- # If file is empty, forget it.
- test -s "${this_file}" || continue
-
- # Examine first character of file. If it's not a backslash or
- # single quote, then it's definitely not an index or xref file.
- # (Will have to check for @ when we switch to Texinfo syntax in
- # all these files...)
- first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "x${first_character}" = "x\\" \
- || test "x${first_character}" = "x'"; then
- definite_index_files="${definite_index_files} ${this_file}"
- fi
- done
- new_index_files="${definite_index_files}"
- new_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # If old and new list don't at least have the same file list, then one
- # file or another has definitely changed.
- $verbose "Original index files =$orig_index_files"
- $verbose "New index files =$new_index_files"
- if test "z${orig_index_files}" != "z${new_index_files}"; then
- index_files_changed_p=t
- else
- # File list is the same. We must compare each file until we find a
- # difference.
- index_files_changed_p=
- for this_file in ${new_index_files}; do
- $verbose "Comparing index file $this_file ..."
- # cmp -s will return nonzero exit status if files differ.
- cmp -s "${this_file}" "${this_file}${backup_extension}"
- if test $? -ne 0; then
- # We only need to keep comparing until we find *one* that
- # differs, because we'll have to run texindex & tex no
- # matter what.
- index_files_changed_p=t
- $verbose "Index file $this_file differed:"
- test $verbose = echo \
- && diff -c "${this_file}${backup_extension}" "${this_file}"
+
+
+ # Decide if looping again is needed.
+ finished=t
+
+ # LaTeX (and the package changebar) report in the LOG file if it
+ # should be rerun. This is needed for files included from
+ # subdirs, since texi2dvi does not try to compare xref files in
+ # subdirs. Performing xref files test is still good since LaTeX
+ # does not report changes in xref files.
+ if fgrep "Rerun to get" "$filename_noext.log" >/dev/null 2>&1; then
+ finished=
+ fi
+
+ # Check if xref files changed.
+ new_xref_files=`$get_xref_files "$filename_noext"`
+ $verbose "Original xref files = `echo $orig_xref_files | sed 's|\./||g'`"
+ $verbose "New xref files = `echo $new_xref_files | sed 's|\./||g'`"
+
+ # If old and new lists don't at least have the same file list,
+ # then one file or another has definitely changed.
+ test "x$orig_xref_files" != "x$new_xref_files" && finished=
+
+ # File list is the same. We must compare each file until we find
+ # a difference.
+ if test -n "$finished"; then
+ for this_file in $new_xref_files; do
+ $verbose "Comparing xref file `echo $this_file | sed 's|\./||g'` ..."
+ # cmp -s returns nonzero exit status if files differ.
+ if cmp -s "$this_file" "$tmpdir_bak/$this_file"; then :; else
+ # We only need to keep comparing until we find one that
+ # differs, because we'll have to run texindex & tex again no
+ # matter how many more there might be.
+ finished=
+ $verbose "xref file `echo $this_file | sed 's|\./||g'` differed ..."
+ test "$debug" = t && diff -c "$tmpdir_bak/$this_file" "$this_file"
break
fi
done
fi
- # If index files have changed since TeX has been run, or if the aux
- # file wasn't present originally, run texindex and TeX again.
- if test "${index_files_changed_p}"; then :; else
- # Nothing changed. We're done with TeX.
- break
- fi
+ # If finished, exit the loop, else rerun the loop.
+ test -n "$finished" && break
done
# If we were in clean mode, compilation was in a tmp directory.
- # Copy the DVI file into the directory where the compilation
+ # Copy the DVI (or PDF) file into the directory where the compilation
# has been done. (The temp dir is about to get removed anyway.)
# We also return to the original directory so that
# - the next file is processed in correct conditions
# - the temporary file can be removed
if test -n "$clean"; then
- $verbose "Copying DVI file from `pwd` to $orig_pwd"
- cp -p $filename_noext.dvi $orig_pwd
+ $verbose "Copying $oformat file from `pwd` to $orig_pwd"
+ cp -p "./$filename_noext.$oformat" "$orig_pwd"
+ cd / # in case $orig_pwd is on a different drive (for DOS)
cd $orig_pwd || exit 1
fi
- # Generate list of files to delete, then call rm once with the entire
- # list. This is significantly faster than multiple executions of rm.
- file_list=
- for file in ${orig_index_files}; do
- file_list="${file_list} ${file}${backup_extension}"
- done
- if test -n "${file_list}"; then
- $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
- rm -f ${file_list}
- rm -rf $tmp_dir $tmp_dir2
+ # Remove temporary files.
+ if test "x$debug" = "x"; then
+ $verbose "Removing $tmpdir_src $tmpdir_xtr $tmpdir_bak ..."
+ cd /
+ rm -rf $tmpdir_src $tmpdir_xtr $tmpdir_bak
fi
done
$verbose "$0 done."
-true # exit successfully.
+exit 0 # exit successfully, not however we ended the loop.
diff --git a/gnu/usr.bin/texinfo/util/texindex.c b/gnu/usr.bin/texinfo/util/texindex.c
index b1017555ee4..6eacd60120a 100644
--- a/gnu/usr.bin/texinfo/util/texindex.c
+++ b/gnu/usr.bin/texinfo/util/texindex.c
@@ -1,7 +1,7 @@
-/* Prepare TeX index dribble output into an actual index.
- $Id: texindex.c,v 1.2 1999/01/11 16:38:15 espie Exp $
+/* Process TeX index dribble output into an actual index.
+ $Id: texindex.c,v 1.3 2000/02/09 02:18:43 espie Exp $
- Copyright (C) 1987, 91, 92, 96, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,6 +20,8 @@
#include "system.h"
#include <getopt.h>
+static char *program_name = "texindex";
+
#if defined (emacs)
# include "../src/config.h"
/* Some s/os.h files redefine these. */
@@ -34,19 +36,8 @@
#define memset(ptr, ignore, count) bzero (ptr, count)
#endif
-
char *mktemp ();
-#if defined (VMS)
-# include <file.h>
-# define TI_NO_ERROR ((1 << 28) | 1)
-# define TI_FATAL_ERROR ((1 << 28) | 4)
-# define unlink delete
-#else /* !VMS */
-# define TI_NO_ERROR 0
-# define TI_FATAL_ERROR 1
-#endif /* !VMS */
-
#if !defined (SEEK_SET)
# define SEEK_SET 0
# define SEEK_CUR 1
@@ -124,11 +115,7 @@ char *text_base;
/* Nonzero means do not delete tempfiles -- for debugging. */
int keep_tempfiles;
-/* The name this program was run with. */
-char *program_name;
-
/* Forward declarations of functions in this file. */
-
void decode_command ();
void sort_in_core ();
void sort_offline ();
@@ -149,9 +136,7 @@ void fatal ();
void error ();
void *xmalloc (), *xrealloc ();
char *concat ();
-char *maketempname ();
void flush_tempfiles ();
-char *tempcopy ();
#define MAX_IN_CORE_SORT 500000
@@ -165,12 +150,6 @@ main (argc, argv)
tempcount = 0;
last_deleted_tempcount = 0;
- program_name = strrchr (argv[0], '/');
- if (program_name != (char *)NULL)
- program_name++;
- else
- program_name = argv[0];
-
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
@@ -201,6 +180,9 @@ main (argc, argv)
decode_command (argc, argv);
+ /* XXX mkstemp not appropriate, as we need to have somewhat predictable
+ * names. But race condition was fixed, see maketempname.
+ */
tempbase = mktemp (concat ("txiXXXXXX", "", ""));
/* Process input files completely, one by one. */
@@ -208,14 +190,26 @@ main (argc, argv)
for (i = 0; i < num_infiles; i++)
{
int desc;
- long ptr;
+ off_t ptr;
char *outfile;
+ struct stat instat;
desc = open (infiles[i], O_RDONLY, 0);
if (desc < 0)
pfatal_with_name (infiles[i]);
+
+ if (stat (infiles[i], &instat))
+ pfatal_with_name (infiles[i]);
+ if (S_ISDIR (instat.st_mode))
+ {
+#ifdef EISDIR
+ errno = EISDIR;
+#endif
+ pfatal_with_name (infiles[i]);
+ }
+
lseek (desc, (off_t) 0, SEEK_END);
- ptr = (long) lseek (desc, (off_t) 0, SEEK_CUR);
+ ptr = (off_t) lseek (desc, (off_t) 0, SEEK_CUR);
close (desc);
@@ -233,8 +227,8 @@ main (argc, argv)
}
flush_tempfiles (tempcount);
- exit (TI_NO_ERROR);
-
+ xexit (0);
+
return 0; /* Avoid bogus warnings. */
}
@@ -249,6 +243,8 @@ typedef struct
} TEXINDEX_OPTION;
TEXINDEX_OPTION texindex_options[] = {
+ { "--help", "-h", (int *)NULL, 0, (char *)NULL,
+ N_("display this help and exit") },
{ "--keep", "-k", &keep_tempfiles, 1, (char *)NULL,
N_("keep temporary files around after processing") },
{ "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL,
@@ -257,8 +253,6 @@ TEXINDEX_OPTION texindex_options[] = {
N_("send output to FILE") },
{ "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL,
N_("display version information and exit") },
- { "--help", "-h", (int *)NULL, 0, (char *)NULL,
- N_("display this help and exit") },
{ (char *)NULL, (char *)NULL, (int *)NULL, 0, (char *)NULL }
};
@@ -272,11 +266,15 @@ usage (result_value)
fprintf (f, _("Usage: %s [OPTION]... FILE...\n"), program_name);
fprintf (f, _("Generate a sorted index for each TeX output FILE.\n"));
/* Avoid trigraph nonsense. */
- fprintf (f, _("Usually FILE... is `foo.??\' for a document `foo.texi'.\n"));
+ fprintf (f,
+_("Usually FILE... is specified as `foo.%c%c\' for a document `foo.texi'.\n"),
+ '?', '?'); /* avoid trigraph in cat-id-tbl.c */
fprintf (f, _("\nOptions:\n"));
for (i = 0; texindex_options[i].long_name; i++)
{
+ putc (' ', f);
+
if (texindex_options[i].short_name)
fprintf (f, "%s, ", texindex_options[i].short_name);
@@ -287,9 +285,12 @@ usage (result_value)
fprintf (f, "\t%s\n", _(texindex_options[i].doc_string));
}
- puts (_("\nEmail bug reports to bug-texinfo@gnu.org."));
+ fputs (_("\n\
+Email bug reports to bug-texinfo@gnu.org,\n\
+general questions and discussion to help-texinfo@gnu.org.\n\
+"), f);
- exit (result_value);
+ xexit (result_value);
}
/* Decode the command line arguments to set the parameter variables
@@ -307,15 +308,14 @@ decode_command (argc, argv)
/* Store default values into parameter variables. */
tempdir = getenv ("TMPDIR");
-#ifdef VMS
if (tempdir == NULL)
- tempdir = "sys$scratch:";
-#else
+ tempdir = getenv ("TEMP");
if (tempdir == NULL)
- tempdir = "/tmp/";
+ tempdir = getenv ("TMP");
+ if (tempdir == NULL)
+ tempdir = DEFAULT_TMPDIR;
else
tempdir = concat (tempdir, "/", "");
-#endif
keep_tempfiles = 0;
@@ -335,12 +335,13 @@ decode_command (argc, argv)
if (strcmp (arg, "--version") == 0)
{
printf ("texindex (GNU %s) %s\n", PACKAGE, VERSION);
- printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
+ puts ("");
+ printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
- "1998");
- exit (0);
+ "1999");
+ xexit (0);
}
else if ((strcmp (arg, "--keep") == 0) ||
(strcmp (arg, "-k") == 0))
@@ -383,13 +384,25 @@ For more information about these matters, see the files named COPYING.\n"),
/* Return a name for a temporary file. */
-char *
+static char *
maketempname (count)
int count;
{
char tempsuffix[10];
- sprintf (tempsuffix, "%d", count);
- return concat (tempdir, tempbase, tempsuffix);
+ char *name;
+ int fd;
+
+ sprintf (tempsuffix, ".%d", count);
+ name = concat (tempdir, tempbase, tempsuffix);
+
+ fd = open (name, O_CREAT|O_EXCL|O_WRONLY, 0666);
+ if (fd == -1)
+ return NULL;
+ else
+ {
+ close(fd);
+ return name;
+ }
}
/* Delete all temporary files up to TO_COUNT. */
@@ -404,36 +417,6 @@ flush_tempfiles (to_count)
unlink (maketempname (++last_deleted_tempcount));
}
-/* Copy the input file open on IDESC into a temporary file
- and return the temporary file name. */
-
-#define BUFSIZE 1024
-
-char *
-tempcopy (idesc)
- int idesc;
-{
- char *outfile = maketempname (++tempcount);
- int odesc;
- char buffer[BUFSIZE];
-
- odesc = open (outfile, O_WRONLY | O_CREAT, 0666);
-
- if (odesc < 0)
- pfatal_with_name (outfile);
-
- while (1)
- {
- int nread = read (idesc, buffer, BUFSIZE);
- write (odesc, buffer, nread);
- if (!nread)
- break;
- }
-
- close (odesc);
-
- return outfile;
-}
/* Compare LINE1 and LINE2 according to the specified set of keyfields. */
@@ -894,7 +877,7 @@ void
sort_offline (infile, nfiles, total, outfile)
char *infile;
int nfiles;
- long total;
+ off_t total;
char *outfile;
{
/* More than enough. */
@@ -924,10 +907,13 @@ sort_offline (infile, nfiles, total, outfile)
for (i = 0; i < ntemps; i++)
{
char *outname = maketempname (++tempcount);
- FILE *ostream = fopen (outname, "w");
+ FILE *ostream;
long tempsize = 0;
- if (!ostream)
+ if (!outname)
+ pfatal_with_name("temporary file");
+ ostream = fopen (outname, "w");
+ if (!outname || !ostream)
pfatal_with_name (outname);
tempfiles[i] = outname;
@@ -972,6 +958,8 @@ fail:
for (i = 0; i < ntemps; i++)
{
char *newtemp = maketempname (++tempcount);
+ if (!newtemp)
+ pfatal_with_name("temp file");
sort_in_core (&tempfiles[i], MAX_IN_CORE_SORT, newtemp);
if (!keep_tempfiles)
unlink (tempfiles[i]);
@@ -993,7 +981,7 @@ fail:
void
sort_in_core (infile, total, outfile)
char *infile;
- long total;
+ off_t total;
char *outfile;
{
char **nextline;
@@ -1251,7 +1239,7 @@ indexify (line, ostream)
pagenumber = find_braced_pos (line, 1, 0, 0);
pagelength = find_braced_end (pagenumber) - pagenumber;
if (pagelength == 0)
- abort ();
+ fatal (_("No page number in %s"), line);
primary = find_braced_pos (line, 2, 0, 0);
primarylength = find_braced_end (primary) - primary;
@@ -1440,6 +1428,8 @@ merge_files (infiles, nfiles, outfile)
if (i + 1 == ntemps)
nf = nfiles - i * MAX_DIRECT_MERGE;
tempfiles[i] = maketempname (++tempcount);
+ if (!tempfiles[i])
+ pfatal_with_name("temp file");
value |= merge_direct (&infiles[i * MAX_DIRECT_MERGE], nf, tempfiles[i]);
}
@@ -1627,7 +1617,7 @@ fatal (format, arg)
char *format, *arg;
{
error (format, arg);
- exit (TI_FATAL_ERROR);
+ xexit (1);
}
/* Print error message. FORMAT is printf control string, ARG is arg for it. */
@@ -1661,7 +1651,7 @@ pfatal_with_name (name)
s = strerror (errno);
printf ("%s: ", program_name);
printf (_("%s; for file `%s'.\n"), s, name);
- exit (TI_FATAL_ERROR);
+ xexit (1);
}
/* Return a newly-allocated string whose contents concatenate those of
@@ -1682,21 +1672,6 @@ concat (s1, s2, s3)
return result;
}
-#if !defined (HAVE_STRERROR)
-extern char *sys_errlist[];
-extern int sys_nerr;
-
-char *
-strerror (num)
- int num;
-{
- if (num >= sys_nerr)
- return ("");
- else
- return (sys_errlist[num]);
-}
-#endif /* !HAVE_STRERROR */
-
#if !defined (HAVE_STRCHR)
char *
strrchr (string, character)
@@ -1712,50 +1687,3 @@ strrchr (string, character)
return ((char *)NULL);
}
#endif /* HAVE_STRCHR */
-
-void
-memory_error (callers_name, bytes_wanted)
- char *callers_name;
- int bytes_wanted;
-{
- char printable_string[80];
-
- sprintf (printable_string,
- _("Virtual memory exhausted in %s ()! Needed %d bytes."),
- callers_name, bytes_wanted);
-
- error (printable_string);
- abort ();
-}
-
-/* Just like malloc, but kills the program in case of fatal error. */
-void *
-xmalloc (nbytes)
- int nbytes;
-{
- void *temp = (void *) malloc (nbytes);
-
- if (nbytes && temp == (void *)NULL)
- memory_error ("xmalloc", nbytes);
-
- return (temp);
-}
-
-/* Like realloc (), but barfs if there isn't enough memory. */
-void *
-xrealloc (pointer, nbytes)
- void *pointer;
- int nbytes;
-{
- void *temp;
-
- if (!pointer)
- temp = (void *)xmalloc (nbytes);
- else
- temp = (void *)realloc (pointer, nbytes);
-
- if (nbytes && !temp)
- memory_error ("xrealloc", nbytes);
-
- return (temp);
-}
diff --git a/gnu/usr.bin/texinfo/util/update-info b/gnu/usr.bin/texinfo/util/update-info
deleted file mode 100644
index d946bceb511..00000000000
--- a/gnu/usr.bin/texinfo/util/update-info
+++ /dev/null
@@ -1,875 +0,0 @@
-#!/bin/sh
-# update-info -- update dir file from all extant info pages.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can either send email to this
-# program's maintainer or write to: The Free Software Foundation,
-# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
-#
-# Author: rhawes@dmapub.dma.org. Please report bugs to him.
-#
-# run this program to install update-info
-# ###SECTION 0### install script
-# These constants set the version numbers for both files:
-PROGRAM_VERSION="1.4"
-PACKAGE_VERSION="4.0"
-
-# ENVIRONMENT
-if test -z "$TMPDIR"; then
- TMPDIR="/usr/tmp"
-fi
-
-TMP_SED="$TMPDIR/uss$$.info"
-TMP_F_ADD_SECTION="$TMPDIR/ufa$$.info"
-TMP_F_DELETE_INVALID="$TMPDIR/ufd$$.info"
-TMP_F_INSERT_MISSING="$TMPDIR/ufi$$.info"
-TMP_FILES="$TMP_SED $TMP_F_ADD_SECTION $TMP_F_DELETE_INVALID\
- $TMP_F_INSERT_MISSING"
-
-trap 'rm -f $TMP_FILES' 0
-
-# file boundaries
-UPDATE_INFO="/^# _file: 'update-info'_/"
-UPDATE_INFO_F="/^# _file: 'update-info.f'_/"
-
-# @F_ADD_SECTION@
-echo 'Item_Num=`expr "$Item_Num" + "1"`
-echo "$1">>"$TMP_SECTIONS"
-if test "$Item_Status"; then
- Item_Status=`echo "${Item_Status}
-X"`
-else
- Item_Status="X"
-fi '>$TMP_F_ADD_SECTION
-
-# @F_INSERT_MISSING@
-echo 'if test -z "$Create_Node"; then
- rm -f ${Info_Node}.old
- cp $Info_Node ${Info_Node}.old
- echo "$BACKUP_MSG"
-fi
-echo "/$MENU_BEGIN/
-+,$ d
-r $TMP_MENU
-w
-q"|ed -s $Info_Node>/dev/null'>$TMP_F_INSERT_MISSING
-
-# @F_DELETE_INVALID@
-echo '
-rm -f ${Info_Node}.old
-cp $Info_Node ${Info_Node}.old
-echo "$BACKUP_MSG"
-echo "/$MENU_BEGIN/
-+,$ d
-w
-q"|ed -s $Info_Node>/dev/null
-sed -f "$TMP_SED" "$TMP_MENU">>"$Info_Node"'>$TMP_F_DELETE_INVALID
-
-cat<<Sed_Script_EOF>$TMP_SED
-s/@UPDATE_INFO_VERSION@/$PROGRAM_VERSION/g
-s/@TEXINFO_VERSION@/$PACKAGE_VERSION/g
-s/@SET_ITEM@/Item_Status=\`echo "\$Item_Status"|sed -e "\${1}s%^.*%\${2}%"\`/
-/@F_ADD_SECTION@/r $TMP_F_ADD_SECTION
-/@F_ADD_SECTION@/d
-/@F_DELETE_INVALID@/r $TMP_F_DELETE_INVALID
-/@F_DELETE_INVALID@/d
-/@F_INSERT_MISSING@/r $TMP_F_INSERT_MISSING
-/@F_INSERT_MISSING@/d
-Sed_Script_EOF
-
-sed -e "1,${UPDATE_INFO}d" -e "$UPDATE_INFO_F,\$d" -f $TMP_SED $0>update-info
-sed -e "1,${UPDATE_INFO_F}d" -f $TMP_SED $0>update-info.f
-chmod +x update-info update-info.f
-echo "installed update-info, and update-info.f into `pwd`"
-rm -f $TMP_FILES
-exit
-
-# _file: 'update-info'_
-#!/bin/sh
-#update-info (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@
-#Copyright (C) 1997 Free Software Foundation, Inc.
-#update-info comes with NO WARRANTY, to the extent permitted by law.
-#You may redistribute copies of update-info
-#under the terms of the GNU General Public License.
-#For more information about these matters, see the files named COPYING."
-#Author: Richard L. Hawes
-
-# ###SECTION 1### Constants
-set -h 2>/dev/null
-# ENVIRONMENT
-if test -z "$TMPDIR"; then
- TMPDIR="/usr/tmp"
-fi
-if test -z "$LINES"; then
- LINES=24
-fi
-if test -z "$COLUMNS"; then
- COLUMNS=80
-fi
-if test -z "$EDITOR"; then
- EDITOR=vi
-fi
-if test -z "$LINENO"; then
- LINENO="0"
-fi
-# constants redefined by update-info.f
-PROMPT1="(y=yes, Y=yes to all, n=no, N=No to all):"
-FUNCTIONS=""
-#
-ARGUMENTS="$*"
-DISPLAY_NUM=`expr "$LINES" - 4`
-CONTROL_D="{Ctrl-D}"
-DIR_SECTION="^INFO-DIR-SECTION"
-ENTRY_END="^END-INFO-DIR-ENTRY"
-ENTRY_START="^START-INFO-DIR-ENTRY"
-MENU_BEGIN='^\*\([ ]\)\{1,\}Menu:'
-MENU_ITEM='^\* ([^ ]).*:([ ])+\('
-SECTION_TITLE="^[A-Za-z0-9]"
-MENU_FILTER1='s/^\*\([ ]\)\{1,\}/* /'
-MENU_FILTER2='s/\([ ]\)\{1,\}$//g'
-TMP_ITEM="${TMPDIR}/ui${$}.info"
-TMP_LIST="${TMPDIR}/ul${$}.info"
-TMP_MENU="${TMPDIR}/um${$}.info"
-TMP_SECTIONS="${TMPDIR}/us${$}.info" # used only in Detect_Missing
-TMP_SED="$TMP_SECTIONS" # used only in Detect_Invalid routines
-TMP_FILE1="${TMPDIR}/ux${$}.info"
-TMP_FILE2="${TMPDIR}/uy${$}.info"
-TMP_COUNT="$TMP_FILE2"
-TMP_FILE_LIST="$TMP_LIST $TMP_MENU $TMP_SECTIONS $TMP_FILE1 $TMP_FILE2\
- $TMP_ITEM"
-TRY_HELP_MSG="Try --help for more information"
-if zcat --version 2>/dev/null>/dev/null; then
- CAT_COMMAND="zcat -f"
-else
- echo "$0:$LINENO: GNU zcat not found">&2
- CAT_COMMAND="cat"
-fi
-
-# ###SECTION 100### main program
-#variables set by options
-Create_Node=""
-Debug=":"
-Interactive=""
-Load_Functions="y"
-Mode=""
-#
-Inserts="0"
-Inserts_Total="0"
-Invalid="0"
-Invalid_Total="0"
-Changed=""
-
-while test "$*"
- do
- case "$1" in
- -c) Create_Node="y";;
- -ci|-ic) Create_Node="y"; Interactive="y";;
- -cif|-cfi|-ifc|-icf|-fci|-fic) Create_Node="y"
- Interactive="y"; Load_Functions="";;
- --debug) set -eux; Debug="set>&2";;
- -d|--delete) Mode="Detect_Invalid";;
- -f) Load_Functions="";;
- -i|--interactive) Interactive="y";;
- -fi|-if) Load_Functions=""; Interactive="y";;
- -id|-di) Mode="Detect_Invalid"; Interactive="y";;
- +i|+d|+f);;
- --version)
-cat<<VersionEOF
-update-info (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@
-Copyright (C) 1997 Free Software Foundation, Inc.
-update-info comes with NO WARRANTY, to the extent permitted by law.
-You may redistribute copies of update-info
-under the terms of the GNU General Public License.
-For more information about these matters, see the files named COPYING.
-Author: Richard L. Hawes
-VersionEOF
- exit;;
-
- --help)
-cat<<HelpEndOfFile
-Usage: update-info [OPTION]... INFO_PATH/INFO_DIR_FILE
-
-It detects and inserts missing menu items into the info node file.
-
-Options:
--c create a new info node
- --debug print debug information to standard error path
--d, --delete delete invalid menu items (ignore missing menu items)
--f do not load functions (file update-info.f)
- --help print this help message and exit
--i, --interactive interactive mode prompts before inserting or removing
- menu items
- --version print current version and exit
-Backup of the info node has a '.old' suffix added. This is a shell script.
-Files: update-info.f -- contains functions (optional).
-Environment Variables: COLUMNS, EDITOR, LINES, TMPDIR
-Email bug reports to bug-texinfo@prep.ai.mit.edu.
-HelpEndOfFile
- exit;;
-
- [-+]*) echo "$0:$LINENO: \"$1\" is not a valid option">&2
- echo "$TRY_HELP_MSG">&2
- exit 2;;
- *) break;;
- esac
- shift
- done
-
-if test "$#" -lt "1"; then
- echo "$0:$LINENO: Too few parameters">&2
- echo "$TRY_HELP_MSG">&2
- exit 2
-elif test "$#" -gt "1"; then
- echo "$0:$LINENO: Too many parameters">&2
- echo "$TRY_HELP_MSG">&2
- exit 2
-fi
-Info_Path="$1"
-Info_Node=`basename "$Info_Path"`
-if echo "$Info_Node"|grep ".*dir$">/dev/null; then
- :
-else
- echo "$0:$LINENO: $Info_Node is not a valid info node name">&2
- exit 2
-fi
-Info_Pathname=`dirname "$Info_Path"`
-cd "$Info_Pathname"||exit
-
-BACKUP_MSG="Backed up $Info_Node to ${Info_Node}.old."
-HANGUP_MSG="Hang up on \"update-info $ARGUMENTS\""
-INSERT_MSG="menu item(s) were inserted (not counting duplicates)."
-INSERT_MSG2="total menu item(s) were inserted into `pwd`/$Info_Node"
-DELETE_MSG="invalid menu item(s) were removed (not counting duplicates)."
-DELETE_MSG2="total invalid menu item(s) were removed from `pwd`/$Info_Node"
-
-if test "$Create_Node"; then
- if test "$Mode"; then
- echo "$0:$LINENO: ERROR: Illogical option combination: -d -c">&2
- echo "$TRY_HELP_MSG">&2
- exit 2
- fi
- if test -f "$Info_Node"; then
- rm -f ${Info_Node}.old
- mv "$Info_Node" "${Info_Node}.old"
- echo "$BACKUP_MSG"
- fi
- echo "Creating new Info Node: `pwd`/$Info_Node"
-cat>$Info_Node<<NodeEndOfFile||exit
-
-This is the file .../info/dir, which contains the topmost node of the
-Info hierarchy. The first time you invoke Info you start off
-looking at that node, which is (dir)Top.
-
-File: dir Node: Top This is the top of the INFO tree
- This (the Directory node) gives a menu of major topics.
- Typing "d" returns here, "q" exits, "?" lists all INFO commands, "h"
- gives a primer for first-timers, "mTexinfo<Return>" visits Texinfo topic,
- etc.
- Or click mouse button 2 on a menu item or cross reference to select it.
- --- PLEASE ADD DOCUMENTATION TO THIS TREE. (See INFO topic first.) ---
-
-* Menu: The list of major topics begins on the next line.
-
-NodeEndOfFile
-else
- if test ! -f "$Info_Node"; then
- echo "$0:$LINENO: $Info_Node is irregular or nonexistant">&2
- exit 2
- elif test ! -r "$Info_Node"; then
- echo "$0:$LINENO: $Info_Node is not readable">&2
- exit 2
- elif test ! -w "$Info_Node"; then
- echo "$0:$LINENO: $Info_Node is not writeable">&2
- exit 2
- fi
-fi
-
-if test "$Load_Functions" -a "$Interactive" -a -z "$Mode"; then
- if FUNCTIONS_VERSION=`( update-info.f )`; then
- if test `echo "$FUNCTIONS_VERSION"\
- |cut -d' ' -f5` = "@UPDATE_INFO_VERSION@"; then
- echo "Loading functions..."
- . update-info.f
- else
- echo "$0:$LINENO: wrong version of update-info.f">&2
- echo "(functions were not loaded)">&2
- fi
- else
- echo "(functions were not loaded)">&2
- fi
-fi
-
-
-trap ' eval "$Debug"; rm -f $TMP_FILE_LIST; exit ' 0
-if test "$Interactive"; then
- if test ! -t "1"; then
- echo "$0:$LINENO: Cannot run in interactive mode "\
- "standard out is redirected">&2
- exit 2
- fi
- trap ' ' 2 3
-else
- trap ' rm -f $TMP_FILE_LIST
- echo "$0:$LINENO: received INT signal. All edits are canceled.">&2
- exit ' 2
- trap ' rm -f $TMP_FILE_LIST
- echo "$0:$LINENO: received QUIT signal. All edits are canceled.">&2
- exit ' 3
-fi
-if test -z "$Mode"; then
- trap '
- if test "$Changed"; then
- {
- echo $HANGUP_MSG
- @F_INSERT_MISSING@
- Inserts_Total=`wc -c<"$TMP_COUNT"`
- echo $Inserts_Total $INSERT_MSG2
- }|mail "$LOGNAME"
- fi
- rm -f $TMP_FILE_LIST
- exit ' 1
-else
- trap '
- if test "$Changed"; then
- {
- echo $HANGUP_MSG
- @F_DELETE_INVALID@
- Invalid_Total=`wc -l<"$TMP_SED"`
- echo $Invalid_Total $DELETE_MSG2
- }|mail $LOGNAME
- fi
- rm -f $TMP_FILE_LIST
- exit ' 1
-fi
-
-sed -e "1,/$MENU_BEGIN/d" -e "$MENU_FILTER1" -e "$MENU_FILTER2"<$Info_Node\
-|tee $TMP_MENU\
-|sed -n -e '/\* /{
-s/).*$//g
-s/\.gz$//
-s/\.info$//
-s/^.*(//p
-}'|sort -u>$TMP_FILE1
-ls -F|sed -e '/\/$/d' -e '/[-.][0-9]/d'\
- -e '/:$/d' -e '/^$/d' -e "/^${Info_Node}~\$/d"\
- -e "/^${Info_Node}\$/d" -e "/^${Info_Node}.old\$/d"\
- -e 's/\.gz$//' -e 's/\.info$//'|sort>$TMP_FILE2
-
-if test -z "$Mode"; then
- #Detect Missing
- comm -13 $TMP_FILE1 $TMP_FILE2>$TMP_LIST
- cat</dev/null>$TMP_COUNT
- #get sections, initialize variables
- sed -n -e "/$SECTION_TITLE/p" "$TMP_MENU">"$TMP_SECTIONS"
- Item_Num=`wc -l<"$TMP_SECTIONS"|tr -d ' '`
- Item_Status=`echo\
- |awk "BEGIN{for(i=1;i<=${Item_Num};i++)printf(\"_\n\")}"`
- Item_Dir="$Item_Num"
- for Info_Name in `cat $TMP_LIST`
- do
- if test -r "$Info_Name"; then
- Info_File="$Info_Name"
- elif test -r "${Info_Name}.info"; then
- Info_File="${Info_Name}.info"
- elif test -r "${Info_Name}.gz"; then
- Info_File="${Info_Name}.gz"
- elif test -r "${Info_Name}.info.gz"; then
- Info_File="${Info_Name}.info.gz"
- else
- echo "$0:$LINENO: can't find info file for ${Info_Name}?">&2
- fi
- #generate menu item
- echo|tr -d '\012'>$TMP_FILE1
- eval $CAT_COMMAND "$Info_File"\
- |sed -n -e "/$DIR_SECTION/w $TMP_FILE1"\
- -e "/$ENTRY_START/,/$ENTRY_END/{
- $MENU_FILTER1
- p
- }"|awk "BEGIN{Mode=0}
- /^$/{if(Mode==1)exit}
- /^([ ])+([^ ])+/{if(Mode==1)print}
- /^[^ ]/{if(Mode==1)exit}
- /${MENU_ITEM}${Info_Name}\)\./{if(Mode==0){Mode++
- print}
- else
- exit}">"$TMP_ITEM"
- if test ! -s "$TMP_ITEM"; then
- echo "* $Info_Name: ($Info_Name).">"$TMP_ITEM"
- fi
- Item_Status=`echo "$Item_Status"|sed -e '1,$s/^./_/'`
- if test -s "$TMP_FILE1"; then
- Item_Section=`sed -e "s/$DIR_SECTION[ ]*//"\
- <$TMP_FILE1`
- else
- Item_Section=`echo "Miscellaneous"`
- fi
- Size=`echo "$Item_Section"|wc -l|tr -d ' '`
- # initialize variables, check for new sections
- Num1=1
- while test "$Num1" -le "$Size"
- do
- Item=`echo "$Item_Section"|sed -n -e "${Num1}p"`
- if Num=`grep -in "^$Item$" "$TMP_SECTIONS"`; then
- Num=`echo "$Num"|sed -e 's/:.*$//g'`
- ##F#Set_Item
- set "$Num" "X"
- @SET_ITEM@
- else
- set "$Item"
- @F_ADD_SECTION@
- fi
- Num1=`expr "$Num1" + "1"`
- done
- if test "$Interactive"; then
- echo "$Item_Section"
- cat "$TMP_ITEM"
- echo "add menu item for $Info_File? "
- while true
- do
- echo "$PROMPT1"|tr -d '\012'
- read Answer
- case $Answer in
- y) break;;
- e)
- if test "$FUNCTIONS"; then
- Select_Sections
- break
- else
- echo "Can't edit. "\
- "Functions are not loaded.">&2
- fi;;
- Y) Interactive=""; break;;
- n) continue 2;;
- N) break 2;;
- *) echo "\"$Answer\" "\
- "is an invalid response">&2;;
- esac
- done
- fi
- if echo "$Item_Status"|grep '^X'>/dev/null; then
- # edit $TMP_MENU
-
- Changed="y"
- (
- trap ' ' 1 2 3
- Tmp_Var=`echo "$Item_Status"|tr -d '\012'`
- Key=`awk -F':' ' FNR==1{ print $1}' $TMP_ITEM`
- # add new sections to 'dir' file
- if test "$Item_Num" -gt "$Item_Dir"; then
- if test "$Item_Dir" -ne "0"; then
- sed -e "1,${Item_Dir}d" -e 'i\
-
-' "$TMP_SECTIONS">>"$TMP_MENU"
- else
- sed -e 'i\
-
-' "$TMP_SECTIONS">>"$TMP_MENU"
- fi
- fi
- # awk determines the insertion points for each section
- awk -F":" "function Insert(Line){
- if(Mode==2){
- Mode=1;if(substr(\"$Tmp_Var\",Item++,1)==\"X\")
- print Line
- }
- }
- BEGIN{Mode=1;Item=1}
- /$SECTION_TITLE/{Insert(FNR-1);if(Mode>=1)Mode=2}
- /${MENU_ITEM}.*\)\./{if(\$1>Item_Name)Insert(FNR-1)}
- /^$/{Insert(FNR-1)}
- END{Insert(FNR)}" Item_Name="$Key" "$TMP_MENU"\
- |sort -nr|sed -e "s%\$% r $TMP_ITEM%"|sed -e '$a\
-w
-' -e '$a\
-q
-'|ed -s "$TMP_MENU"
- echo "$Item_Status"|tr -cd "X">>$TMP_COUNT
- )
-
- Inserts=`expr "$Inserts" + "1"`
- echo "$Info_File installed into section(s):"\
- |tr -d '\012'
- echo "$Item_Status"|awk '/X/{printf(" %d", FNR)}'
- echo
- Item_Dir="$Item_Num"
- else
- echo "$Info_File not installed (no section selected)"
- fi
- done
- # print summary
- trap ' ' 1 2 3
- if test "$Changed"; then
- @F_INSERT_MISSING@
- Inserts_Total=`wc -c<"$TMP_COUNT"|tr -d " "`
- if test "$Inserts" -ne "$Inserts_Total"; then
- echo "$Inserts $INSERT_MSG"
- fi
- echo "$Inserts_Total $INSERT_MSG2"
- fi
-else
- # Detect Invalid
- cat</dev/null>"$TMP_SED"
- comm -23 $TMP_FILE1 $TMP_FILE2>$TMP_LIST
- for Info_Name in `cat $TMP_LIST`
- do
- if test "$Interactive"; then
- # display invalid menu item(s)
- awk "BEGIN{Mode=1}
- /^([ ])+([^ ])+/{if(Mode==2)print}
- /^$/{if(Mode==2)Mode=1}
- /$SECTION_TITLE/{Section=\$0}
- /^[^ ]/{if(Mode==2)Mode=1}
- /${MENU_ITEM}${Info_Name}\)\./{if(Mode==1){Mode++
- print Section
- print}}" $TMP_MENU
- echo "delete menu item for $Info_Name? "
- while true
- do
- echo\
- "(y=yes, n=no, Y=yes to all, N=No to all):"\
- |tr -d '\012'
- read Answer
- case "$Answer" in
- y) break;;
- Y) Interactive=""; break;;
- n) continue 2;;
- N) break 2;;
- *) echo "\"$Answer\" "\
- "is an invalid reponse">&2;;
- esac
- done
- fi
- # remove menu item from $TMP_MENU
- Invalid=`expr "$Invalid" + "1"`
- Changed="y"
- (
- trap ' ' 1 2 3
- echo\
- "invalid menu item for $Info_Name removed from section(s):"\
- |tr -d '\012'
- awk "function Delete(Last){
- printf(\"%d,%dd\n\",First,Last-1)>>\"$TMP_SED\"}
- BEGIN{Mode=1;Section=0}
- /^$/{if(Mode==2){Delete(FNR);Mode=1}}
- /$SECTION_TITLE/{Section++}
- /^[^ ]/{if(Mode==2){Delete(FNR);Mode=1}}
- /${MENU_ITEM}${Info_Name}\)\./{if(Mode==1){
- First=FNR;printf(\" %d\",Section);Mode=2}}
- END{if(Mode==2)Delete(FNR+1)}" $TMP_MENU
- echo
- )
- done
-
- # display a summary
- trap ' ' 1 2 3
- if test "$Changed"; then
- Invalid_Total=`wc -l<"$TMP_SED"|tr -d ' '`
- @F_DELETE_INVALID@
- if test "$Invalid" -ne "$Invalid_Total"; then
- echo "$Invalid $DELETE_MSG"
- fi
- echo "$Invalid_Total $DELETE_MSG2"
- fi
-fi
-if test -z "$Changed"; then
- echo "Nothing to do"
-fi
-rm -f $TMP_FILE_LIST
-eval "$Debug"
-exit 0
-# _file: 'update-info.f'_
-#update-info.f (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@
-#Copyright (C) 1997 Free Software Foundation, Inc.
-#update-info comes with NO WARRANTY, to the extent permitted by law.
-#You may redistribute copies of update-info
-#under the terms of the GNU General Public License.
-#For more information about these matters, see the files named COPYING."
-#Author: Richard L. Hawes
-
-# update-info.f functions for update-info
-
-# ###SECTION 1### functions used to insert missing menu items
-
-Set_Item (){
-# set item status
-@SET_ITEM@
-}
-
-Add_Section (){
-# add a section
-@F_ADD_SECTION@
-}
-
-# ###SECTION 2### functions for menu selection of sections
-
-Print (){
-# print a line without a linefeed
-echo "$*"|tr -d '\012'
-}
-
-Get_Answer (){
-# get an answer to question
-_gs_Valid="$1"
-_gs_Prompt="$2"
-set -f
-Answer=""
-while test -z "$Answer"
- do
- Print "$_gs_Prompt"
- if read Answer; then
- :
- else
- Answer="$CONTROL_D"
- echo
- fi
- if expr "$Answer" : "[$_gs_Valid]$">/dev/null; then
- :
- else
- Print "\"$Answer\" is not a valid response! --">&2
- Answer=""
- fi
- done
-set +f
-}
-
-Do_Previous (){
-# go to previous screen
-if test "$Previous"; then
- Next="$Top_Item"
- Top_Item="$Previous"
- if Previous=`expr "$Top_Item" - "$DISPLAY_NUM"`; then
- if test "$Previous" -le "0"; then
- Previous=""
- fi
- else
- Previous=""
- fi
-elif test "$Next"; then
- Last_Page
-else
- Print "There is no previous page. ">&2
-fi
-}
-
-Do_Next (){
-# process go to next
-if test "$Next"; then
- Previous="$Top_Item"
- Top_Item="$Next"
- Set_Next
-elif test "$Previous"; then
- Top_Item="1"
- Previous=""
- Set_Next
-else
- Print "There is no next page. ">&2
-fi
-}
-
-Do_Add_Section (){
-# process add section command
-echo
-echo "Please enter the name of the new section:"
-if read Answer; then
- Answer=`echo "$Answer"\
- |sed -e 's/^\([ ]\)\{1,\}//g' -e "$MENU_FILTER2"`
- if test "$Answer"; then
- Add_Section "$Answer"
- Last_Page
- clear
- fi
-else
- Answer=""
-fi
-if test -z "$Answer"; then
- clear
- Print "no section added. "
-fi
-}
-
-Do_Edit (){
-# process edit item command
-if test -t "2"; then
- _de_Done=""
- cp "$TMP_ITEM" "$TMP_FILE1"
- while test -z "$_de_Done"
- do
- eval $EDITOR "$TMP_FILE1"
- clear
- _de_Done="t"
- if sed -n -e "$MENU_FILTER1" -e '1p' "$TMP_FILE1"\
- |egrep "${MENU_ITEM}${Info_Name}\)\.">/dev/null; then
- :
- else
- sed -n -e '1p' "$TMP_FILE1"
- echo "Pattern mismatch: `echo\
- "/${MENU_ITEM}${Info_Name}\)\./"\
- |tr -d "\011"`">&2
- echo
- _de_Done=""
- fi
- if sed -n -e '2,$p' "$TMP_FILE1"|grep '^[^ ]'>&2; then
- echo "These lines must have leading spaces">&2
- echo
- _de_Done=""
- fi
- if test -z "$_de_Done"; then
- Get_Answer "yn" "Invalid entry, cancel edits? (y or n):"
- if test "y" = "$Answer"; then
- clear
- Print "Canceling edits -- invalid entry ">&2
- _de_Done="t"
- fi
- else
- sed -e "$MENU_FILTER1" -e "$MENU_FILTER2" -e '/^$/d'\
- <"$TMP_FILE1">"$TMP_ITEM"
- fi
- done
-else
- Print "editor cannot run with error path redirected "
-fi
-}
-
-Do_Number (){
-# process number
-_dn_Num="$1"
-if test "$_dn_Num" -ge 1 -a "$_dn_Num" -le "$Item_Num"; then
- if test `echo "$Item_Status"|sed -n -e "${_dn_Num}p"` = "_"; then
- Set_Item "$_dn_Num" "X"
- else
- Set_Item "$_dn_Num" "_"
- fi
-else
- Print "\"$_dn_Num\" is an invalid section number. ">&2
-fi
-}
-
-Do_Help (){
-# process menu help
-echo
-echo "\
-Enter the following commands seperated
-by spaces and terminated by<ENTER>:
-# : (section number) toggle section
-a : add a new section
-e : edit item -- changes will not be
- accepted if you change the
- '(info_file_name).' or delete
- the key parts: '*' 'Menu Name' ':'
-h : get this help screen
-n : next page
-p : previous page
-q : quit and do not put into menu
-s : save and put into menu"
-Print "Press enter to continue:"
-read junk
-clear
-}
-
-Set_Next (){
-# determine value of Next
-Next=`expr "$DISPLAY_NUM" + "$Top_Item"`
-if test "$Next" -gt "$Item_Num"; then
- Next=""
-fi
-}
-
-Last_Page (){
-# go to last page of menu
-Top_Item=`echo|awk "BEGIN{printf(\"%d\",
-int((${Item_Num}-1)/${DISPLAY_NUM})*${DISPLAY_NUM}+1)}"`
-if test "$Top_Item" -gt "$DISPLAY_NUM"; then
- Previous=`expr "$Top_Item" '-' "$DISPLAY_NUM"`
-else
- Previous=""
-fi
-Set_Next
-}
-
-Select_Sections (){
-# prompt user for which sections
-set -f
-Top_Item="1"
-Previous=""
-Set_Next
-clear
-echo "Default sections are selected."
-Done=""
-while test -z "$Done"
- do
- awk "FNR==1{printf(\"%s\n\", substr(\$0,1,${COLUMNS}))}" $TMP_ITEM
- Tmp_Var=`echo "$Item_Status"|tr -d '\012'`
- awk "BEGIN{Max=$Top_Item+$DISPLAY_NUM}
- FNR>=$Top_Item{if(FNR>=Max)exit
- printf(\"%2d:%s %s\n\",FNR,substr(\"$Tmp_Var\",FNR,1),
- substr(\$0,1,${COLUMNS}-5))}" "$TMP_SECTIONS"
- echo "Enter 1-${Item_Num}, add, edit, help,"
- if test "$Previous" -o "$Next"; then
- Print "next, previous, "
- fi
- Print "quit, save :"
- read Command_List||Command_List="$CONTROL_D"
- Command_List=`echo "$Command_List"\
- |tr '\011' ' '|tr ' ' '\012'|sed -e "/^$/d"`
- clear
- if test -z "$Command_List"; then
- Help="y"
- else
- Help=""
- fi
- while test "$Command_List"
- do
- Command=`echo "$Command_List"|sed -n -e '1p'`
- Command_List=`echo "$Command_List"|sed -e '1d'`
- case "$Command" in
- [0-9]|[0-9][0-9]) Do_Number "$Command";;
- n*) Do_Next;;
- p*) Do_Previous;;
- a*) Do_Add_Section;;
- e*) Do_Edit; break;;
- h*) Help="y";;
- s*) Done="s"; break;;
- q*) Done="q"
- Item_Status=`echo "$Item_Status"|sed -e '1,$s/^./_/'`
- break;;
- *) Print "$Command is not a valid command. ">&2
- Help="y";;
- esac
- done
- if test "$Help"; then
- Do_Help
- fi
- echo
- done
-set +f
-# if new sections added, remove unused ones
-if test "$Item_Num" -gt "$Item_Dir"; then
- Tmp_Var=`echo "$Item_Status"|awk "FNR>$Item_Dir{
- if(\\$0==\"_\")printf(\"%d\n\", FNR)}"`
- if test "$Tmp_Var"; then
- Tmp_Var1=`echo "$Tmp_Var"|sed -e 's/$/d/'`
- sed -e "$Tmp_Var1" "$TMP_SECTIONS">$TMP_FILE1
- cp $TMP_FILE1 "$TMP_SECTIONS"
- Item_Status=`echo "$Item_Status"|sed -e "$Tmp_Var1"`
- Tmp_Var=""
- Tmp_Var1=""
- Item_Num=`wc -l<"$TMP_SECTIONS"|tr -d ' '`
- fi
-fi
-}
-
-# ###SECTION 100### Constants that redefine
-PROMPT1="(y=yes, e=edit, Y=yes to all, n=no, N=No to all):"
-FUNCTIONS="y"
-#
-echo "update-info.f (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@"