Commit 8491377b by Jeff Law

This commit was generated by cvs2svn to compensate for changes in r18765,

which included commits to RCS files with non-trunk default branches.

From-SVN: r18766
parent 7e98cc16
This file records noteworthy changes. This file records noteworthy changes.
3.11 (31 July 1997)
* New commands:
- @uref to make a reference to a url; @url now only indicates such.
- @image to include graphics (epsf for TeX).
- @deftypemethod and @deftypemethodx to document methods in strongly
typed object-oriented languages, such as C++.
- @html for raw HTML.
- @ifnothtml @ifnotinfo @ifnottex for more precise conditionals.
- @kbdinputstyle to control when @kbd uses the slanted typewriter font.
- @email takes second optional argument.
* texinfo.tex reads texinfo.cnf (if present) for site-wide TeX
configuration; for example, A4 paper sizes.
* info:
- arrow keys supported.
- trailing : in INFOPATH appends default path.
- new option --index-search for online help support.
* makeinfo:
- output files removed if errors unless (new option) --force.
- new option -P to prepend to search path.
- macro expansion file can be standard output.
* install-info creates a new dir file if necessary.
* update-info script to create a dir file from all info files.
* Elisp: texnfo-tex.el and detexinfo.el removed from the distribution;
- - texnfo-tex features are now part of standard TeX & Texinfo packages;
- - makeinfo --no-headers does a better job than detexinfo.el.
* Documentation:
- Updates, revisions, corrections in the manual.
- makeinfo.texi removed, as it was a copy of what was in texinfo.texi.
* gettext support in sources, French and German translations included.
* info man page removed; use the Texinfo manual.
* Automake used, other portability fixes.
3.10 (nonexistent)
3.9 (4 October 1996) 3.9 (4 October 1996)
* makeinfo: * makeinfo:
- Give a suppressible (with --no-validate) error for references - Give a suppressible (with --no-validate) error for references
...@@ -91,3 +125,205 @@ This file records noteworthy changes. ...@@ -91,3 +125,205 @@ This file records noteworthy changes.
Just bug fixes, see ChangeLog for full details. Just bug fixes, see ChangeLog for full details.
texinfo-3.0: first release of Texinfo version 2, with many new commands. texinfo-3.0: first release of Texinfo version 2, with many new commands.
Here is the separate NEWS for old releases of Info:
Version 2.11, Sat Apr 1 09:15:21 1995
Changes since 2.7 beta:
Although the basic code remains the same, there are numerous nits
fixed, including some display bugs, and a memory leak. Some changes
that have taken place with larger impact include the way in which the
(dir) node is built; I have added in support for "localdir"
directories among other things. Info files may be stored in
compressed formats, and in their own subdirectories; menu items which
do not explicitly name the node to which they are attached have the
menu item name looked up as an Info file if it is not found within the
current document. This means that the menu item:
* Info:: The Info documentation reader.
in (dir) refers to the info node "(info)Top".
Please see the ChangeLog and documentation for details on other
changes.
Version 2.7 beta, Wed Dec 30 02:02:38 1992
Version 2.6 beta, Tue Dec 22 03:58:07 1992
Version 2.5 beta, Tue Dec 8 14:50:35 1992
Version 2.4 beta, Sat Nov 28 14:34:02 1992
Version 2.3 beta, Fri Nov 27 01:04:13 1992
Version 2.2 beta, Tue Nov 24 09:36:08 1992
Version 2.1 beta, Tue Nov 17 23:29:36 1992
Changes since 2.5 beta:
Note that versions 2.6 and 2.7 Beta were only released to a select group.
* "info-" removed from the front of M-x commands.
* Automatic footnote display. When you enter a node which contains
footnotes, and the variable "automatic-footnotes" is "On", Info pops
up a window containing the footnotes. Likewise, when you leave that
node, the window containing the footnotes goes away.
* Cleaner built in documentation, and documentation functions.
Use:
o `M-x describe-variable' to read a variable's documenation
o `M-x describe-key' to find out what a particular keystroke does.
o `M-x describe-function' to read a function's documentation.
o `M-x where-is' to find out what keys invoke a particular function.
* Info can "tile" the displayed windows (via "M-x tile-windows"). If
the variable "automatic-tiling" is "On", then splitting a window or
deleting a window causes the remaining windows to be retiled.
* You can save every keystroke you type in a "dribble file" by using the
`--dribble FILENAME' option. You can initially read keystrokes from an
alternate input stream with `--restore FILENAME', or by redirecting
input on the command line `info < old-dribble'.
* New behaviour of menu items. If the label is the same as the
target node name, and the node couldn't be found in the current file,
treat the label as a file name. For example, a menu entry in "DIR"
might contain:
* Emacs:: Cool text-editor.
Info would not find the node "(dir)Emacs", so just plain "(emacs)"
would be tried.
* New variable "ISO-Latin" allows you to use European machines with
8-bit character sets.
* Cleanups in echo area reading, and redisplay. Cleanups in handling the
window which shows possible completions.
* Info can now read files that have been compressed. An array in filesys.c
maps extensions to programs that can decompress stdin, and write the results
to stdout. Currently, ".Z"/uncompress, ".z"/gunzip, and ".Y"/unyabba are
supported. The modeline for a compressed file shows "zz" in it.
* There is a new variable "gc-compressed-files" which, if non-zero, says
it is okay to reclaim the file buffer space allocated to a file which
was compressed, if, and only if, that file's contents do not appear in
any history node.
* New file `nodemenu.c' implements a few functions for manipulating
previously visited nodes. `C-x C-b' (list-visited-nodes) produces a
menu of the nodes that could be reached by info-history-node in some
window. `C-x b' (select-visited-node) is similar, but reads one of
the node names with completion.
* Keystroke `M-r' (move_to_screen_line) allows the user to place the cursor at
the start of a specific screen line. Without a numeric argument, place the
cursor on the center line; with an arg, place the cursor on that line.
* Interruptible display implemented. Basic display speedups and hacks.
* The message "*** Tags Out of Date ***" now means what it says.
* Index searching with `,' (info-index-next) has been improved.
* When scrolling with C-v, C-M-v, or M-v, only "Page Only" scrolling
will happen.
* Continous scrolling (along with `]' (info-global-next) and `['
(info-global-prev) works better. `]' and `[' accept numeric
arguments, moving that many nodes in that case.
* `C-x w' (info-toggle-wrap) controls how lines wider than the width
of the screen are displayed. If a line is too long, a `$' is
displayed in the rightmost column of the window.
* There are some new variables for controlling the behaviour of Info
interactively. The current list of variables is as follows:
Variable Name Default Value Description
------------- ------------- -----------
`automatic-footnotes' On When "On", footnotes appear and
disappear automatically.
`automatic-tiling' Off When "On", creating of deleting a
window resizes other windows.
`visible-bell' Off If non-zero, try to use a visible bell.
`errors-ring-bell' On If non-zero, errors cause a ring.
`show-index-match' On If non-zero, the portion of the string
matched is highlighted by changing its
case.
`scroll-behaviour' Continuous One of "Continuous", "Next Only", or
"Page Only". "Page Only" prevents you from
scrolling past the bottom or top of a node.
"Next Only" causes the Next or Prev node to
be selected when you scroll past the bottom
or top of a node. "Continous" moves
linearly through the files hierchichal
structure.
`scroll-step' 0 Controls how scrolling is done for you when
the cursor moves out of the current window.
Non-zero means it is the number of lines
you would like the screen to shift. A
value of 0 means to center the line
containing the cursor in the window.
`gc-compressed-files' Off If non-zero means it is okay to reclaim the
file buffer space allocated to a file which
was compressed, if, and only if, that
file's contents do not appear in the node
list of any window.
`ISO-Latin' Off Non-zero means that you are using an ISO
Latin character set. By default, standard
ASCII characters are assumed.
________________________________________
This release of Info is version 2.5 beta.
Changes since 2.4 beta:
* Index (i) and (,) commands fully implemented.
* "configure" script now shipped with Info.
* New function "set-variable" allows users to set various variables.
* User-settable behaviour on end or beginning of node scrolling. This
supercedes the SPC and DEL changes in 2.3 beta.
________________________________________
This release of Info is version 2.4 beta.
Changes since 2.3 beta:
* info-last-node now means move to the last node of this info file.
* info-history-node means move backwards through this window's node history.
* info-first-node moves to the first node in the Info file. This node is
not necessarily "Top"!
* SPC and DEL can select the Next or Prev node after printing an informative
message when pressed at the end/beg of a node.
----------------------------------------
This release of Info is version 2.3 beta.
Changes since 2.2 beta:
* M-x command lines if NAMED_COMMANDS is #defined. Variable in Makefile.
* Screen height changes made quite robust.
* Interactive function "set-screen-height" implements user height changes.
* Scrolling on some terminals is faster now.
* C-l with numeric arguement is fixed.
----------------------------------------
This release of Info is version 2.2 beta.
Changes since 2.0:
* C-g can now interrupt multi-file searches.
* Incremental search is fully implemented.
* Loading large tag tables is much faster now.
* makedoc.c replaces shell script, speeding incremental builds.
* Scrolling in redisplay is implemented.
* Recursive uses of the echo area made more robust.
* Garbage collection of unreferenced nodes.
Texinfo, Version 3 This is the README file for the GNU Texinfo distribution.
==================
Please email bugs or suggestions to bug-texinfo@prep.ai.mit.edu.
This is the README file for version 3 of the Texinfo distribution.
Files within this distribution have their own version and edition Files within this distribution have their own version and edition
numbers. When you refer to a file, please mention its own number, as numbers. When you refer to a file, please mention its own version, as
well as the version number of the Texinfo distribution. well as the version number of the Texinfo distribution.
PLEASE REPORT BUGS TO: bug-texinfo@prep.ai.mit.edu For instructions on compiling and installing info, makeinfo, texi2dvi,
and texindex, please read the file `INSTALL'. Also:
* The Emacs Lisp files are not compiled or installed by default; to
install them, use `make install' in the `emacs' subdirectory. See
./emacs/README for some considerations.
* The Info tree uses a file `dir' as its root node; the `dir-example'
file in this distribution is included for informative purposes.
Use it or not as you like.
* You can create a file texinfo.cnf to be read by TeX when
processing Texinfo manuals. For example, it might contain the
command @afourpaper. See the `Preparing for TeX' node in
texinfo.texi for more details.
Texinfo is a documentation system that uses a single source file to Texinfo is a documentation system that uses a single source file to
produce both on-line information and printed output. This means that produce both online information and printed output. This means that
instead of writing two different documents, one for the on-line help instead of writing two different documents, one for the online help or
or other on-line information and the other for a typeset manual or other online information and the other for a typeset manual or other
other printed work, you need write only one document. When the work printed work, you need write only one document. When the work is
is revised, you need revise only one document. You can read the revised, you need revise only one document. You can read the online
on-line information, known as an "Info file", with an Info information, known as an "Info file", with an Info documentation-reading
documentation-reading program. By convention, Texinfo source file program. By convention, Texinfo source file names end with a `.texi' or
names end with a `.texi' or `.texinfo' extension. Texinfo is `.texinfo' extension. Texinfo is described in the Texinfo manual (the
described in the Texinfo manual (the file ./texinfo.texi). file ./doc/texinfo.texi).
You can write and format Texinfo files into Info files within GNU Emacs, You can write and format Texinfo files into Info files within GNU Emacs,
and read them using the Emacs Info reader. If you do not have Emacs, and read them using the Emacs Info reader. If you do not have Emacs,
...@@ -26,22 +41,15 @@ them using `info'. Use TeX, which is not included in this package (see ...@@ -26,22 +41,15 @@ them using `info'. Use TeX, which is not included in this package (see
`How to Obtain TeX' in the Texinfo manual for information), to typeset `How to Obtain TeX' in the Texinfo manual for information), to typeset
Texinfo files for printing. Texinfo files for printing.
For instructions on compiling and installing info, makeinfo, texi2dvi,
and texindex, please read the file `INSTALL'. The Emacs Lisp files are
not installed by default; to install them, use `make install' in the
`emacs' subdirectory. The Info tree uses a file `dir' as its root node;
a sample `dir' file is included in the distribution, but not installed
anywhere. Use it or not as you like.
This distribution includes (but is not limited to) the following files: This distribution includes (but is not limited to) the following files:
README This file. README This file.
INTRODUCTION This file tells you how to create INTRODUCTION This file tells you how to create
readable files from the Texinfo source readable files from the Texinfo source
files in this distribution. files in this distribution.
Texinfo source files: Texinfo source files (in ./doc):
texinfo.texi This manual describes Texinfo. It texinfo.texi This manual describes Texinfo. It
tells how to use Texinfo to write tells how to use Texinfo to write
...@@ -61,15 +69,8 @@ Texinfo source files: ...@@ -61,15 +69,8 @@ Texinfo source files:
info-stnd.texi This manual tells you how to use info-stnd.texi This manual tells you how to use
the standalone GNU Info reader that is the standalone GNU Info reader that is
included in this distribution as a C included in this distribution as C
source file, `info.c'. source (./info).
makeinfo.texi This manual tells you how to use
makeinfo. The same information is
contained in a chapter of the Texinfo
manual; it has been extracted here for
your convenience.
Printing related files: Printing related files:
...@@ -78,18 +79,18 @@ Printing related files: ...@@ -78,18 +79,18 @@ Printing related files:
Texinfo file into a DVI file ready for Texinfo file into a DVI file ready for
printing. printing.
texindex.c This file contains the source for util/texindex.c This file contains the source for
the `texindex' program that generates the `texindex' program that generates
sorted indices used by TeX when sorted indices used by TeX when
typesetting a file for printing. typesetting a file for printing.
texi2dvi This is a shell script for util/texi2dvi This is a shell script for
producing an indexed DVI file using producing an indexed DVI file using
TeX and texindex. Must be used if the TeX and texindex. Must be used if the
source document uses Texinfo @macros. source document uses Texinfo @macros.
GNU Emacs related files: GNU Emacs related files (in ./emacs):
texinfmt.el This Emacs Lisp file provides the texinfmt.el This Emacs Lisp file provides the
functions that GNU Emacs uses to functions that GNU Emacs uses to
...@@ -100,19 +101,15 @@ GNU Emacs related files: ...@@ -100,19 +101,15 @@ GNU Emacs related files:
for GNU Emacs. for GNU Emacs.
texnfo-upd.el These files provides commands to texnfo-upd.el These files provides commands to
texnfo-tex.el help you write Texinfo files makeinfo.el help you write Texinfo files
makeinfo.el using GNU Emacs Texinfo mode. using GNU Emacs Texinfo mode.
detexinfo.el This extra utility file contains functions
to remove Texinfo commands from a
Texinfo source file.
info.el These are the standard GNU Emacs info.el These are the standard GNU Emacs
informat.el Info reading and support files, informat.el Info reading and support files,
included here for your convenience. included here for your convenience.
Source files for standalone C programs: Source files for standalone C programs (./lib, ./makeinfo, ./info):
makeinfo.c This file contains the source for makeinfo.c This file contains the source for
the `makeinfo' program that you can the `makeinfo' program that you can
...@@ -128,7 +125,7 @@ Source files for standalone C programs: ...@@ -128,7 +125,7 @@ Source files for standalone C programs:
getopt.h getopt.h
C Installation files: Installation files:
configure This file creates creates a Makefile configure This file creates creates a Makefile
which in turn creates an `info' or which in turn creates an `info' or
...@@ -136,10 +133,14 @@ C Installation files: ...@@ -136,10 +133,14 @@ C Installation files:
distribution. distribution.
configure.in This is a template for creating configure.in This is a template for creating
`configure' using m4 macros. `configure' using Autoconf.
Makefile.in This is a template for `configure' Makefile.in This is a template for `configure'
to use to make a Makefile. to use to make a Makefile. Created by
Automake.
Makefile.am This is a template for Automake
to use to make a Makefile.in.
Other files: Other files:
...@@ -148,10 +149,6 @@ Other files: ...@@ -148,10 +149,6 @@ Other files:
features since the first edition features since the first edition
of Texinfo. of Texinfo.
info.1 This is a `man' page that briefly
describes the standalone `info'
program.
fixfonts This is a shell script to install the fixfonts This is a shell script to install the
`lcircle10' TeX fonts as an alias for `lcircle10' TeX fonts as an alias for
the `circle10' fonts. In some older the `circle10' fonts. In some older
......
If you are interested in working on any of these, If you are interested in working on any of these,
email bug-texinfo@prep.ai.mit.edu. email bug-texinfo@prep.ai.mit.edu.
* Use Automake. * Makeinfo:
- HTML output.
* Use a config header file instead of @DEFS@. - A detexinfo program, like detex or delatex. This command would
* A detexinfo program, like detex or delatex. This command would
strip all the texinfo commands out, and would be used as a filter on strip all the texinfo commands out, and would be used as a filter on
the way to a speller. An option would be to NOT strip comments out. the way to a speller. An option would be to NOT strip comments out.
makeinfo --no-headers come close. makeinfo --no-headers comes close.
- If node name contains an @ command, complain explicitly.
* Change bars. This is difficult or impossible in TeX, - Better ASCII output: convert menus to single table of contents,
unfortunately. To do it right requires device driver support. enumerate chapters and sections, convert cross-refs and indices to
chapter/section references. See:
* The dark corner symbol for the gawk manual. ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/faq201s.zip
* Better i18n support, including support for 8-bit input n* TeX:
characters. Requires fonts, and the DC fonts are not (as of this - Use @ as the escape character, and Texinfo syntax generally, in the
writing) free. table of contents, aux, and index files. Eliminate all the crazy
multiple redefinitions of every Texinfo command in different contexts.
* @exercise/@answer command for, e.g., gawk. - Handle @hsep and @vsep in @multitables.
* @figure. * General:
- Better i18n support, including support for 8-bit input characters,
and 8-bit output in info. Perhaps have to use the ec fonts.
- Support compressed image files, automatic generation of .txt
or .jpg from .eps by Ghostscript.
- Repeat TeX run until cross-references stabilize, not just twice.
(Document this in manual and fix texi2dvi.)
- Handle reference card creation, perhaps by only paying attention to
sectioning and @def... commands.
- Allow : in node names for info files, for names like `class::method'.
- Get Info declared as a MIME Content-Type.
* HTML output in makeinfo. * Language:
- @figure:
@figure [xref-label]
@figureinclude <filename>, [<height>], [<width>]
@figurehsize <dimen>
@figurevsize <dimen>
@caption ... @end caption
<arbitrary Texinfo commands>
@end figure
- @flushboth to combine @flushleft and @flushright, for RFC's.
- @part sectioning command.
- Anchors a la HTML?
- Allow subitems and `see' and `see also' in indices.
- @exercise/@answer command for, e.g., gawk.
- Allow @hsep/@vsep at @item, instead of just in template.
- The dark corner symbol for the gawk manual.
- Change bars. This is difficult or impossible in TeX,
unfortunately. To do it right requires device driver support.
* Include a complete functional summary, a la a reference card, in the manual. * Doc:
- Include a complete functional summary, as in a reference card, in
the manual.
- Improve the manuals for makeinfo, standalone info, etc.
- Page 39, need a new section on doing dedication pages. See gawk.texi
for an example of doing it in both the tex and info versions.
* Use @ as the escape character, and Texinfo syntax generally, in the * Info:
table of contents, aux, and index files. Eliminate all the crazy - Search all nodes of dir file at startup, then can have
redefinitions of every Texinfo command (which lists always seem to be INFO-DIR-SEPARATE-GROUPS and other such.
incomplete). - Better dir file merging.
- Steal interface ideas from Lynx: TAB for navigating to next link
within a page, number links, etc.
- q within help should quit help like C-x 0.
- Full-text search on all available info files.
- Incorporate an X-based viewer, perhaps tkinfo:
http://www.math.ucsb.edu/~boldt/tkinfo/.
- Perhaps process Texinfo files directly instead of converting to Info:
ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/tkman.tar.Z
+ ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/rman.tar.Z
+ Tcl/Tk 8.0 from ftp.smli.com in the /pub/tcl directory.
From: phelps@ecstasy.CS.Berkeley.EDU (Tom Phelps)
* Improve the manuals for makeinfo, standalone info, etc. * Install-info:
- be able to copy the info file to compile-time $(infodir), to
simplify by-hand installation.
...@@ -3,7 +3,7 @@ topmost node of the Info hierarchy. This file is merely made available ...@@ -3,7 +3,7 @@ topmost node of the Info hierarchy. This file is merely made available
for your hacking pleasure, not official or standard in any way. for your hacking pleasure, not official or standard in any way.
If it doesn't make sense to you, or you don't like it, ignore it. If it doesn't make sense to you, or you don't like it, ignore it.
$Id: dir-example,v 1.1 1997/08/21 22:57:52 jason Exp $ $Id: dir,v 1.23 1997/07/25 18:05:32 karl Exp $
 
File: dir Node: Top This is the top of the INFO tree. File: dir Node: Top This is the top of the INFO tree.
...@@ -26,7 +26,7 @@ GNU packages ...@@ -26,7 +26,7 @@ GNU packages
* File utilities: (fileutils). GNU file utilities. * File utilities: (fileutils). GNU file utilities.
* Finding files: (find). Operating on files matching certain criteria. * Finding files: (find). Operating on files matching certain criteria.
* Font utilities: (fontu). Programs for font manipulation. * Font utilities: (fontu). Programs for font manipulation.
* Gawk: (gawk). A text processing and scanning language. * Gawk: (gawk.info). A text scanning and processing language.
* Gzip: (gzip). General (de)compression. * Gzip: (gzip). General (de)compression.
* Identifier DB: (id-utils). Identifier database utilities. * Identifier DB: (id-utils). Identifier database utilities.
* Ispell: (ispell). Interactive spelling corrector. * Ispell: (ispell). Interactive spelling corrector.
...@@ -35,11 +35,12 @@ GNU packages ...@@ -35,11 +35,12 @@ GNU packages
* Ptx: (ptx). Permuted index generator. * Ptx: (ptx). Permuted index generator.
* Shar: (sharutils). Shell archiver, uudecode/uuencode. * Shar: (sharutils). Shell archiver, uudecode/uuencode.
* Shell utilities: (sh-utils). GNU shell utilities. * Shell utilities: (sh-utils). GNU shell utilities.
* Tar: (tar). ``Tape'' archiver. * tar: (tar). Making tape (or disk) archives.
* Text utilities: (textutils). GNU text utilities. * Text utilities: (textutils). GNU text utilities.
* Time: (time). Measuring program resource usage. * Time: (time). Measuring program resource usage.
* UUCP: (uucp). Copying between machines, offline. * UUCP: (uucp). Copying between machines, offline.
* Wdiff: (wdiff). Word-by-word comparison. * Wdiff: (wdiff). Word-by-word comparison.
* Wget: (wget). URL download.
GNU programming tools GNU programming tools
* As: (as). Assembler. * As: (as). Assembler.
...@@ -53,6 +54,7 @@ GNU programming tools ...@@ -53,6 +54,7 @@ GNU programming tools
* Libtool: (libtool). Generic library support script. * Libtool: (libtool). Generic library support script.
* GCC: (gcc). C compiler. * GCC: (gcc). C compiler.
* GDB: (gdb). Source-level debugger for C and C++. * GDB: (gdb). Source-level debugger for C and C++.
* Gettext Utilities: (gettext). GNU gettext utilities.
* Gperf: (gperf). Perfect hash function generator. * Gperf: (gperf). Perfect hash function generator.
* Gprof: (gprof). Profiler. * Gprof: (gprof). Profiler.
* Indent: (indent). Prettyprinter for programs. * Indent: (indent). Prettyprinter for programs.
...@@ -61,11 +63,11 @@ GNU programming tools ...@@ -61,11 +63,11 @@ GNU programming tools
Texinfo documentation system Texinfo documentation system
* Info: (info). Documentation browsing system. * Info: (info). Documentation browsing system.
* Texinfo: (texinfo). The GNU documentation format. * Texinfo: (texinfo). The GNU documentation format.
* info program: (info-stnd). Standalone Info-reading program.
* install-info: (texinfo)Invoking install-info. Updating info/dir entries. * install-info: (texinfo)Invoking install-info. Updating info/dir entries.
* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. * texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. * texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
* info program: (info-stnd). Standalone Info-reading program. * makeinfo: (texinfo)makeinfo preferred. Translate Texinfo source.
* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII.
GNU Emacs Lisp GNU Emacs Lisp
* Elisp: (elisp). GNU Emacs Lisp reference manual. * Elisp: (elisp). GNU Emacs Lisp reference manual.
...@@ -90,17 +92,12 @@ GNU Emacs Lisp ...@@ -90,17 +92,12 @@ GNU Emacs Lisp
* VM: (vm). Mail reader. * VM: (vm). Mail reader.
* W3: (w3). WWW browser. * W3: (w3). WWW browser.
GNU admin GNU programming support
* Autoconf: (autoconf). Automatic generation of package configuration. * Autoconf: (autoconf). Automatic generation of package configuration.
* Automake: (automake). Making Makefile.in's.
* Configure: (configure). Cygnus configure. * Configure: (configure). Cygnus configure.
* Gettext: (gettext). Internationalization.
* Gnats: (gnats). Cygnus bug tracking system. * Gnats: (gnats). Cygnus bug tracking system.
* Maintaining: (maintain). Maintaining GNU software.
* Remsync: (remsync). Remote synchronization of directory trees. * Remsync: (remsync). Remote synchronization of directory trees.
* Send PR: (send-pr). Cygnus bug reporting for Gnats. * Send PR: (send-pr). Cygnus bug reporting for Gnats.
* Source config: (cfg-paper). Some theory on configuring source packages.
* Standards: (standards). GNU coding standards.
GNU libraries GNU libraries
* Annotate: (annotate). High-level GDB to GUI's. * Annotate: (annotate). High-level GDB to GUI's.
...@@ -119,7 +116,10 @@ GNU libraries ...@@ -119,7 +116,10 @@ GNU libraries
GNU programming documentation GNU programming documentation
* GDB internals: (gdbint). Debugger internals. * GDB internals: (gdbint). Debugger internals.
* Ld internals: (ldint). GNU linker 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. * Stabs: (stabs). Symbol table debugging information format.
* Standards: (standards). GNU coding standards.
DOS DOS
* Demacs: (demacs). GNU Emacs for DOS. * Demacs: (demacs). GNU Emacs for DOS.
...@@ -133,6 +133,7 @@ TeX things ...@@ -133,6 +133,7 @@ TeX things
* LaTeX: (latex). LaTeX. * LaTeX: (latex). LaTeX.
* MakeIndex: (makeindex). Index creation for TeX. * MakeIndex: (makeindex). Index creation for TeX.
* Naming fonts: (fontname). Filenames for TeX fonts. * Naming fonts: (fontname). Filenames for TeX fonts.
* TDS: (tds). Standard TeX directory structure.
* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX. * TeXDraw: (texdraw). Drawing PostScript diagrams within TeX.
* Web2c: (web2c). TeX, Metafont, and their companion programs. * Web2c: (web2c). TeX, Metafont, and their companion programs.
...@@ -140,6 +141,7 @@ Other things ...@@ -140,6 +141,7 @@ Other things
* Amd: (amdref). Filesystem automounter. * Amd: (amdref). Filesystem automounter.
* CMUCL: (cmu-user). CMU Common Lisp. * CMUCL: (cmu-user). CMU Common Lisp.
* File headers: (filehdr). Bibliographic information for computer files. * File headers: (filehdr). Bibliographic information for computer files.
* GCP: (gcp). Game club protocol.
* HTML: (snafu). Hypertext Markup Language 2.0 specification. * HTML: (snafu). Hypertext Markup Language 2.0 specification.
* Jargon: (jargon). The jargon file. * Jargon: (jargon). The jargon file.
* Perl: (perl). Practical extraction and report language. * Perl: (perl). Practical extraction and report language.
...@@ -148,12 +150,14 @@ Other things ...@@ -148,12 +150,14 @@ Other things
* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info. * UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info.
Individual utilities Individual utilities
* aclocal: (automake)Invoking aclocal. Generating aclocal.m4.
* aid: (id-utils)aid invocation. Matching strings. * aid: (id-utils)aid invocation. Matching strings.
* ar: (binutils)ar. Create/modify/extract archives. * ar: (binutils)ar. Create/modify/extract archives.
* at-pr: (gnats)at-pr. Bug report timely reminders. * at-pr: (gnats)at-pr. Bug report timely reminders.
* automake: (automake). Making Makefile.in's.
* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's. * autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's.
* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in. * autoscan: (autoconf)Invoking autoscan. Automate initial configure.in.
* awk: (Gawk)Invoking gawk. Text processing and scanning. * awk: (gawk)Invoking gawk. Text processing and scanning.
* basename: (sh-utils)basename invocation. Strip directory and suffix. * basename: (sh-utils)basename invocation. Strip directory and suffix.
* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies. * bibtex: (web2c)BibTeX invocation. Maintaining bibliographies.
* c++filt: (binutils)c++filt. Demangle C++ symbols. * c++filt: (binutils)c++filt. Demangle C++ symbols.
...@@ -170,9 +174,10 @@ Individual utilities ...@@ -170,9 +174,10 @@ Individual utilities
* cut: (textutils)cut invocation. Print selected parts of lines. * cut: (textutils)cut invocation. Print selected parts of lines.
* date: (sh-utils)date invocation. Print/set system date and time. * date: (sh-utils)date invocation. Print/set system date and time.
* dd: (fileutils)dd invocation. Copy and convert a file. * dd: (fileutils)dd invocation. Copy and convert a file.
* df: (fileutils)df invocation. Report filesystems' disk usage. * df: (fileutils)df invocation. Report filesystem disk usage.
* diff3: (diff)Invoking diff3. Three-way diff. * diff3: (diff)Invoking diff3. Three-way diff.
* dir: (fileutils)dir invocation. List directories briefly. * dir: (fileutils)dir invocation. List directories briefly.
* dircolors: (fileutils)dircolors invocation. Color setup for ls.
* dirname: (sh-utils)dirname invocation. Strip non-directory suffix. * dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures). * dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures).
* du: (fileutils)du invocation. Report on disk usage. * du: (fileutils)du invocation. Report on disk usage.
...@@ -188,6 +193,7 @@ Individual utilities ...@@ -188,6 +193,7 @@ Individual utilities
* etags: (emacs)Create Tags Table. Creating a TAGS table. * etags: (emacs)Create Tags Table. Creating a TAGS table.
* expand: (textutils)expand invocation. Convert tabs to spaces. * expand: (textutils)expand invocation. Convert tabs to spaces.
* expr: (sh-utils)expr invocation. Evaluate expressions. * expr: (sh-utils)expr invocation. Evaluate expressions.
* factor: (sh-utils)factor invocation. Print prime factors
* false: (sh-utils)false invocation. Do nothing, unsuccessfully. * false: (sh-utils)false invocation. Do nothing, unsuccessfully.
* fid: (id-utils)fid invocation. Listing a file's identifiers. * fid: (id-utils)fid invocation. Listing a file's identifiers.
* file-pr: (gnats)file-pr. Processing incoming traffic. * file-pr: (gnats)file-pr. Processing incoming traffic.
...@@ -195,6 +201,7 @@ Individual utilities ...@@ -195,6 +201,7 @@ Individual utilities
* fmt: (textutils)fmt invocation. Reformat paragraph text. * fmt: (textutils)fmt invocation. Reformat paragraph text.
* fold: (textutils)fold invocation. Wrap long input lines. * fold: (textutils)fold invocation. Wrap long input lines.
* g++: (gcc)Invoking G++. The GNU C++ compiler. * g++: (gcc)Invoking G++. The GNU C++ compiler.
* gettextize: (gettext)gettextize Invocation. Prepare a package for gettext.
* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets. * gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets.
* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts. * gftopk: (web2c)GFtoPK invocation. Generic to packed fonts.
* gftype: (web2c)GFtype invocation. GF to human-readable text. * gftype: (web2c)GFtype invocation. GF to human-readable text.
...@@ -223,6 +230,7 @@ Individual utilities ...@@ -223,6 +230,7 @@ Individual utilities
* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation. * maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation.
* maketextex: (kpathsea)MakeTeX scripts. TeX source generation. * maketextex: (kpathsea)MakeTeX scripts. TeX source generation.
* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric 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. * mf: (web2c)mf invocation. Creating typeface families.
* mft: (web2c)MFT invocation. Prettyprinting Metafont source. * mft: (web2c)MFT invocation. Prettyprinting Metafont source.
* mkdir: (fileutils)mkdir invocation. Create directories. * mkdir: (fileutils)mkdir invocation. Create directories.
...@@ -231,6 +239,8 @@ Individual utilities ...@@ -231,6 +239,8 @@ Individual utilities
* mknod: (fileutils)mknod invocation. Create special files. * mknod: (fileutils)mknod invocation. Create special files.
* mp: (web2c)mp invocation. Creating technical diagrams. * mp: (web2c)mp invocation. Creating technical diagrams.
* mpto: (web2c)MPto invocation. MetaPost label extraction. * 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. * mv: (fileutils)mv invocation. Rename files.
* newer: (web2c)Newer invocation. Compare modification times. * newer: (web2c)Newer invocation. Compare modification times.
* nice: (sh-utils)nice invocation. Modify scheduling priority. * nice: (sh-utils)nice invocation. Modify scheduling priority.
...@@ -263,6 +273,7 @@ Individual utilities ...@@ -263,6 +273,7 @@ Individual utilities
* rmdir: (fileutils)rmdir invocation. Remove empty directories. * rmdir: (fileutils)rmdir invocation. Remove empty directories.
* sdiff: (diff)Invoking sdiff. Interactively merge files. * sdiff: (diff)Invoking sdiff. Interactively merge files.
* send-pr: (gnats)Invoking send-pr. Submitting bugs. * send-pr: (gnats)Invoking send-pr. Submitting bugs.
* seq: (sh-utils)seq invocation. Print numeric sequences
* shar: (sharutils)shar invocation. Create shell archive. * shar: (sharutils)shar invocation. Create shell archive.
* size: (binutils)size. List object file section sizes. * size: (binutils)size. List object file section sizes.
* sleep: (sh-utils)sleep invocation. Delay for a specified time. * sleep: (sh-utils)sleep invocation. Delay for a specified time.
...@@ -305,5 +316,6 @@ Individual utilities ...@@ -305,5 +316,6 @@ Individual utilities
* who: (sh-utils)who invocation. Print who is logged in. * who: (sh-utils)who invocation. Print who is logged in.
* whoami: (sh-utils)whoami invocation. Print effective user id. * whoami: (sh-utils)whoami invocation. Print effective user id.
* xargs: (find)Invoking xargs. Operating on many files. * 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. * yes: (sh-utils)yes invocation. Print a string indefinitely.
* zcat: (gzip)Overview. Decompression to stdout. * zcat: (gzip)Overview. Decompression to stdout.
# Makefile for Texinfo/emacs. # Makefile.in generated automatically by automake 1.2 from Makefile.am
# Copyright (C) 1995, 96 Free Software Foundation, Inc.
# $Id: Makefile.in,v 1.1 1997/08/21 22:57:56 jason Exp $
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Author: Brian J. Fox (bfox@ai.mit.edu)
#
srcdir = @srcdir@ # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
VPATH = @srcdir@ # This Makefile.in is free software; the Free Software Foundation
SHELL = /bin/sh # gives unlimited permission to copy, distribute and modify it.
RM = rm -f
# Do not byte compile our Elisp files by default.
ELISP_SRCS = info.el makeinfo.el texinfo.el texnfo-upd.el \
texnfo-tex.el texinfmt.el informat.el detexinfo.el
ELISP_OBJS = info.elc makeinfo.elc texinfo.elc texnfo-upd.elc \
texnfo-tex.elc texinfmt.elc informat.elc detexinfo.elc
.SUFFIXES: .el .elc SHELL = /bin/sh
.el.elc: srcdir = @srcdir@
$(srcdir)/elisp-comp $< top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
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
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
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
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
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@
ELCFILES =
# Do not install our Elisp files by default, either.
noinst_LISP = info.el informat.el makeinfo.el \
texinfmt.el texinfo.el texnfo-upd.el
EXTRA_DIST = README elisp-comp new-useful-setqs $(noinst_LISP)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
LISP = $(noinst_LISP)
lispdir = @lispdir@
EMACS = @EMACS@
DIST_COMMON = README Makefile.am Makefile.in elisp-comp
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
default: all
.SUFFIXES:
.SUFFIXES: .el .elc
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus emacs/Makefile
all: Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
sub-all: all cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
.el.elc:
@echo 'WARNING: Warnings can be ignored. :-)'
if test $(EMACS) != no; then \
EMACS=$(EMACS) $(SHELL) $(srcdir)/elisp-comp $<; \
fi
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = emacs
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
info:
dvi: dvi:
check: all
$(MAKE)
installcheck:
install-info: install-info:
install-exec:
@$(NORMAL_INSTALL)
elisp: $(ELISP_OBJS) install-data: install-data-local
.PHONY: elisp @$(NORMAL_INSTALL)
# Nobody likes any of these install targets. Fine. Install it install: install-exec install-data all
# manually, then. @:
install:
@echo Please install the Emacs Lisp files manually.
uninstall: uninstall:
@echo Please uninstall the Emacs Lisp files manually.
# install: $(ELISP_OBJS)
# @(echo "(print (car load-path))" >/tmp/elc.$$$$; \
# lispdir=`emacs -batch -q -l /tmp/elc.$$$$ -nw | grep site-lisp`; \
# rm /tmp/elc.$$$$; \
# if [ "$$lispdir" != "" ]; then \
# lispdir=`echo $$lispdir | sed -e 's/"//g'`; \
# echo "Installing .elc files in $$lispdir."; \
# $(CP) $(ELISP_OBJS) $$lispdir; \
# else \
# echo "To install the elisp files, please copy *.elc to the"; \
# echo "emacs site-lisp directory."; \
# fi)
#
# install: $(ELISP_OBJS)
# for file in $(ELISP_OBJS); do \
# $(INSTALL_DATA) $$file $(lispdir); \
# done
#
# uninstall: $(ELISP_OBJS)
# cd $(lispdir) && rm -f $(ELISP_OBJS)
#
informat.elc: info.elc
makeinfo.elc: texinfo.elc
texinfmt.elc: texinfo.elc
texinfmt.elc: texnfo-upd.elc
Makefile: $(srcdir)/Makefile.in ../config.status
cd .. && sh config.status
realclean distclean: clean
$(RM) Makefile *.log
clean: FORCE
$(RM) *.elc
FORCE:
all: Makefile $(LISP) $(ELCFILES)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
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)
maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-lisp mostlyclean-generic
clean: clean-lisp clean-generic mostlyclean
distclean: distclean-lisp distclean-generic clean
rm -f config.status
maintainer-clean: maintainer-clean-lisp maintainer-clean-generic \
distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: default mostlyclean-lisp distclean-lisp clean-lisp \
maintainer-clean-lisp tags distdir info dvi installcheck install-info \
install-exec install-data install uninstall all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install-data-local:
@echo "WARNING: You must (compile and) install the Emacs Lisp files"
@echo "WARNING: manually. See ./emacs/README for some considerations."
# For some reason these do not get defined.
distclean-lisp:
clean-lisp:
mostlyclean-lisp:
# 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:
;;; info.el --- info package for Emacs. ;;; info.el --- info package for Emacs.
;; Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc. ;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 97 Free Software
;; Foundation, Inc.
;; Maintainer: FSF ;; Maintainer: FSF
;; Keywords: help ;; Keywords: help
...@@ -28,27 +29,39 @@ ...@@ -28,27 +29,39 @@
;;; Code: ;;; Code:
(defgroup info nil
"Info subsystem"
:group 'help
:group 'docs)
(defvar Info-history nil (defvar Info-history nil
"List of info nodes user has visited. "List of info nodes user has visited.
Each element of list is a list (FILENAME NODENAME BUFFERPOS).") Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
(defvar Info-enable-edit nil (defcustom Info-enable-edit nil
"*Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node. "*Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node.
This is convenient if you want to write info files by hand. This is convenient if you want to write info files by hand.
However, we recommend that you not do this. However, we recommend that you not do this.
It is better to write a Texinfo file and generate the Info file from that, It is better to write a Texinfo file and generate the Info file from that,
because that gives you a printed manual as well.") because that gives you a printed manual as well."
:type 'boolean
:group 'info)
(defvar Info-enable-active-nodes nil (defvar Info-enable-active-nodes nil
"Non-nil allows Info to execute Lisp code associated with nodes. "Non-nil allows Info to execute Lisp code associated with nodes.
The Lisp code is executed when the node is selected.") The Lisp code is executed when the node is selected.")
(put 'Info-enable-active-nodes 'risky-local-variable t) (put 'Info-enable-active-nodes 'risky-local-variable t)
(defvar Info-fontify t (defcustom Info-fontify t
"*Non-nil enables highlighting and fonts in Info nodes.") "*Non-nil enables highlighting and fonts in Info nodes."
:type 'boolean
:group 'info)
(defvar Info-fontify-maximum-menu-size 30000 (defcustom Info-fontify-maximum-menu-size 30000
"*Maximum size of menu to fontify if `Info-fontify' is non-nil.") "*Maximum size of menu to fontify if `Info-fontify' is non-nil."
:type 'integer
:group 'info)
(defvar Info-directory-list (defvar Info-directory-list
(let ((path (getenv "INFOPATH")) (let ((path (getenv "INFOPATH"))
...@@ -98,9 +111,11 @@ source tree, the `info' directory in the source tree is used as the last ...@@ -98,9 +111,11 @@ source tree, the `info' directory in the source tree is used as the last
element, in place of the installation Info directory. This is useful element, in place of the installation Info directory. This is useful
when you run a version of Emacs without installing it.") when you run a version of Emacs without installing it.")
(defvar Info-additional-directory-list nil (defcustom Info-additional-directory-list nil
"List of additional directories to search for Info documentation files. "List of additional directories to search for Info documentation files.
These directories are not searched for merging the `dir' file.") These directories are not searched for merging the `dir' file."
:type '(repeat directory)
:group 'info)
(defvar Info-current-file nil (defvar Info-current-file nil
"Info file that Info is now looking at, or nil. "Info file that Info is now looking at, or nil.
...@@ -114,10 +129,13 @@ or nil if current info file is not split into subfiles.") ...@@ -114,10 +129,13 @@ or nil if current info file is not split into subfiles.")
(defvar Info-current-node nil (defvar Info-current-node nil
"Name of node that Info is now looking at, or nil.") "Name of node that Info is now looking at, or nil.")
(defvar Info-tag-table-marker (make-marker) (defvar Info-tag-table-marker nil
"Marker pointing at beginning of current Info file's tag table. "Marker pointing at beginning of current Info file's tag table.
Marker points nowhere if file has no tag table.") Marker points nowhere if file has no tag table.")
(defvar Info-tag-table-buffer nil
"Buffer used for indirect tag tables.")
(defvar Info-current-file-completions nil (defvar Info-current-file-completions nil
"Cached completion list for current Info file.") "Cached completion list for current Info file.")
...@@ -133,16 +151,26 @@ Marker points nowhere if file has no tag table.") ...@@ -133,16 +151,26 @@ Marker points nowhere if file has no tag table.")
(".z" . "gunzip") (".z" . "gunzip")
(".inf" . nil) (".inf" . nil)
("" . nil)) ("" . nil))
'( (".info.Z" . "uncompress") '( (".info.Z". "uncompress")
(".info.Y" . "unyabba") (".info.Y". "unyabba")
(".info.gz" . "gunzip") (".info.gz". "gunzip")
(".info.z" . "gunzip") (".info.z". "gunzip")
(".info" . nil) (".info". nil)
(".Z" . "uncompress") ("-info.Z". "uncompress")
(".Y" . "unyabba") ("-info.Y". "unyabba")
(".gz" . "gunzip") ("-info.gz". "gunzip")
(".z" . "gunzip") ("-info.z". "gunzip")
("" . nil))) ("-info". nil)
("/index.Z". "uncompress")
("/index.Y". "unyabba")
("/index.gz". "gunzip")
("/index.z". "gunzip")
("/index". nil)
(".Z". "uncompress")
(".Y". "unyabba")
(".gz". "gunzip")
(".z". "gunzip")
("". nil)))
"List of file name suffixes and associated decoding commands. "List of file name suffixes and associated decoding commands.
Each entry should be (SUFFIX . STRING); the file is given to Each entry should be (SUFFIX . STRING); the file is given to
the command as standard input. If STRING is nil, no decoding is done. the command as standard input. If STRING is nil, no decoding is done.
...@@ -301,7 +329,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -301,7 +329,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(cons (list Info-current-file Info-current-node (point)) (cons (list Info-current-file Info-current-node (point))
Info-history))) Info-history)))
;; Go into info buffer. ;; Go into info buffer.
(switch-to-buffer "*info*") (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
(buffer-disable-undo (current-buffer)) (buffer-disable-undo (current-buffer))
(or (eq major-mode 'Info-mode) (or (eq major-mode 'Info-mode)
(Info-mode)) (Info-mode))
...@@ -316,7 +344,6 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -316,7 +344,6 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(setq Info-current-file nil (setq Info-current-file nil
Info-current-subfile nil Info-current-subfile nil
Info-current-file-completions nil Info-current-file-completions nil
Info-index-alternatives nil
buffer-file-name nil) buffer-file-name nil)
(erase-buffer) (erase-buffer)
(if (eq filename t) (if (eq filename t)
...@@ -325,12 +352,12 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -325,12 +352,12 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(setq default-directory (file-name-directory filename))) (setq default-directory (file-name-directory filename)))
(set-buffer-modified-p nil) (set-buffer-modified-p nil)
;; See whether file has a tag table. Record the location if yes. ;; See whether file has a tag table. Record the location if yes.
(set-marker Info-tag-table-marker nil)
(goto-char (point-max)) (goto-char (point-max))
(forward-line -8) (forward-line -8)
;; Use string-equal, not equal, to ignore text props. ;; Use string-equal, not equal, to ignore text props.
(or (string-equal nodename "*") (if (not (or (string-equal nodename "*")
(not (search-forward "\^_\nEnd tag table\n" nil t)) (not
(search-forward "\^_\nEnd tag table\n" nil t))))
(let (pos) (let (pos)
;; We have a tag table. Find its beginning. ;; We have a tag table. Find its beginning.
;; Is this an indirect file? ;; Is this an indirect file?
...@@ -341,16 +368,21 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -341,16 +368,21 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(looking-at "(Indirect)\n")) (looking-at "(Indirect)\n"))
;; It is indirect. Copy it to another buffer ;; It is indirect. Copy it to another buffer
;; and record that the tag table is in that buffer. ;; and record that the tag table is in that buffer.
(let ((buf (current-buffer))
(tagbuf
(or Info-tag-table-buffer
(generate-new-buffer " *info tag table*"))))
(setq Info-tag-table-buffer tagbuf)
(save-excursion (save-excursion
(let ((buf (current-buffer))) (set-buffer tagbuf)
(set-buffer (get-buffer-create " *info tag table*"))
(buffer-disable-undo (current-buffer)) (buffer-disable-undo (current-buffer))
(setq case-fold-search t) (setq case-fold-search t)
(erase-buffer) (erase-buffer)
(insert-buffer-substring buf) (insert-buffer-substring buf))
(set-marker Info-tag-table-marker (set-marker Info-tag-table-marker
(match-end 0)))) (match-end 0) tagbuf))
(set-marker Info-tag-table-marker pos)))) (set-marker Info-tag-table-marker pos)))
(set-marker Info-tag-table-marker nil))
(setq Info-current-file (setq Info-current-file
(if (eq filename t) "dir" filename)))) (if (eq filename t) "dir" filename))))
;; Use string-equal, not equal, to ignore text props. ;; Use string-equal, not equal, to ignore text props.
...@@ -365,18 +397,28 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -365,18 +397,28 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
;; read the proper subfile into this buffer. ;; read the proper subfile into this buffer.
(if (marker-position Info-tag-table-marker) (if (marker-position Info-tag-table-marker)
(save-excursion (save-excursion
(set-buffer (marker-buffer Info-tag-table-marker)) (let ((m Info-tag-table-marker)
(goto-char Info-tag-table-marker) found found-mode)
(if (re-search-forward regexp nil t) (save-excursion
(set-buffer (marker-buffer m))
(goto-char m)
(beginning-of-line) ;so re-search will work.
(setq found (re-search-forward regexp nil t))
(if found
(setq guesspos (read (current-buffer))))
(setq found-mode major-mode))
(if found
(progn (progn
(setq guesspos (read (current-buffer))) ;; If this is an indirect file, determine
;; If this is an indirect file, ;; which file really holds this node and
;; determine which file really holds this node ;; read it in.
;; and read it in. (if (not (eq found-mode 'Info-mode))
(if (not (eq (current-buffer) (get-buffer "*info*"))) ;; Note that the current buffer must be
(setq guesspos ;; the *info* buffer on entry to
(Info-read-subfile guesspos)))) ;; Info-read-subfile. Thus the hackery
(error "No such node: %s" nodename)))) ;; above.
(setq guesspos (Info-read-subfile guesspos))))
(error "No such node: %s" nodename)))))
(goto-char (max (point-min) (- guesspos 1000))) (goto-char (max (point-min) (- guesspos 1000)))
;; Now search from our advised position (or from beg of buffer) ;; Now search from our advised position (or from beg of buffer)
;; to find the actual node. ;; to find the actual node.
...@@ -464,7 +506,8 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -464,7 +506,8 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
Info-dir-file-attributes Info-dir-file-attributes
(cons (cons file attrs) (cons (cons file attrs)
Info-dir-file-attributes)))))) Info-dir-file-attributes))))))
(or (cdr dirs) (setq Info-dir-contents-directory (car dirs))) (or (cdr dirs) (setq Info-dir-contents-directory
(file-name-as-directory (car dirs))))
(setq dirs (cdr dirs)))) (setq dirs (cdr dirs))))
(or buffers (or buffers
...@@ -548,12 +591,18 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -548,12 +591,18 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(setq Info-dir-contents (buffer-string))) (setq Info-dir-contents (buffer-string)))
(setq default-directory Info-dir-contents-directory)) (setq default-directory Info-dir-contents-directory))
;; Note that on entry to this function the current-buffer must be the
;; *info* buffer; not the info tags buffer.
(defun Info-read-subfile (nodepos) (defun Info-read-subfile (nodepos)
;; NODEPOS is either a position (in the Info file as a whole,
;; not relative to a subfile) or the name of a subfile.
(let (lastfilepos
lastfilename)
(if (numberp nodepos)
(save-excursion
(set-buffer (marker-buffer Info-tag-table-marker)) (set-buffer (marker-buffer Info-tag-table-marker))
(goto-char (point-min)) (goto-char (point-min))
(search-forward "\n\^_") (search-forward "\n\^_")
(let (lastfilepos
lastfilename)
(forward-line 2) (forward-line 2)
(catch 'foo (catch 'foo
(while (not (looking-at "\^_")) (while (not (looking-at "\^_"))
...@@ -570,8 +619,11 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -570,8 +619,11 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(throw 'foo t)) (throw 'foo t))
(setq lastfilename thisfilename) (setq lastfilename thisfilename)
(setq lastfilepos thisfilepos)) (setq lastfilepos thisfilepos))
(forward-line 1)))) (forward-line 1)))))
(set-buffer (get-buffer "*info*")) (setq lastfilename nodepos)
(setq lastfilepos 0))
;; Assume previous buffer is in Info-mode.
;; (set-buffer (get-buffer "*info*"))
(or (equal Info-current-subfile lastfilename) (or (equal Info-current-subfile lastfilename)
(let ((buffer-read-only nil)) (let ((buffer-read-only nil))
(setq buffer-file-name nil) (setq buffer-file-name nil)
...@@ -582,7 +634,8 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -582,7 +634,8 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(setq Info-current-subfile lastfilename))) (setq Info-current-subfile lastfilename)))
(goto-char (point-min)) (goto-char (point-min))
(search-forward "\n\^_") (search-forward "\n\^_")
(+ (- nodepos lastfilepos) (point)))) (if (numberp nodepos)
(+ (- nodepos lastfilepos) (point)))))
;; Select the info node that point is in. ;; Select the info node that point is in.
(defun Info-select-node () (defun Info-select-node ()
...@@ -618,7 +671,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -618,7 +671,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(defun Info-set-mode-line () (defun Info-set-mode-line ()
(setq mode-line-buffer-identification (setq mode-line-buffer-identification
(concat (concat
"Info: (" " Info: ("
(if Info-current-file (if Info-current-file
(file-name-nondirectory Info-current-file) (file-name-nondirectory Info-current-file)
"") "")
...@@ -667,7 +720,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -667,7 +720,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(defun Info-read-node-name (prompt &optional default) (defun Info-read-node-name (prompt &optional default)
(let* ((completion-ignore-case t) (let* ((completion-ignore-case t)
(completion-table (Info-build-node-completions)) (completion-table (Info-build-node-completions))
(nodename (completing-read prompt 'Info-read-node-name-1))) (nodename (completing-read prompt 'Info-read-node-name-1 nil t)))
(if (equal nodename "") (if (equal nodename "")
(or default (or default
(Info-read-node-name prompt)) (Info-read-node-name prompt))
...@@ -679,10 +732,10 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -679,10 +732,10 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(save-excursion (save-excursion
(save-restriction (save-restriction
(if (marker-buffer Info-tag-table-marker) (if (marker-buffer Info-tag-table-marker)
(progn (let ((marker Info-tag-table-marker))
(set-buffer (marker-buffer Info-tag-table-marker)) (set-buffer (marker-buffer marker))
(widen) (widen)
(goto-char Info-tag-table-marker) (goto-char marker)
(while (re-search-forward "\nNode: \\(.*\\)\177" nil t) (while (re-search-forward "\nNode: \\(.*\\)\177" nil t)
(setq compl (setq compl
(cons (list (buffer-substring (match-beginning 1) (cons (list (buffer-substring (match-beginning 1)
...@@ -727,6 +780,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -727,6 +780,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(onode Info-current-node) (onode Info-current-node)
(ofile Info-current-file) (ofile Info-current-file)
(opoint (point)) (opoint (point))
(ostart (window-start))
(osubfile Info-current-subfile)) (osubfile Info-current-subfile))
(save-excursion (save-excursion
(save-restriction (save-restriction
...@@ -739,6 +793,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -739,6 +793,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(if (not found) ;can only happen in subfile case -- else would have erred (if (not found) ;can only happen in subfile case -- else would have erred
(unwind-protect (unwind-protect
(let ((list ())) (let ((list ()))
(save-excursion
(set-buffer (marker-buffer Info-tag-table-marker)) (set-buffer (marker-buffer Info-tag-table-marker))
(goto-char (point-min)) (goto-char (point-min))
(search-forward "\n\^_\nIndirect:") (search-forward "\n\^_\nIndirect:")
...@@ -753,13 +808,13 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -753,13 +808,13 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(re-search-forward "\\(^.*\\): [0-9]+$") (re-search-forward "\\(^.*\\): [0-9]+$")
(goto-char (+ (match-end 1) 2)) (goto-char (+ (match-end 1) 2))
(setq list (cons (cons (read (current-buffer)) (setq list (cons (cons (read (current-buffer))
(buffer-substring (match-beginning 1) (buffer-substring
(match-end 1))) (match-beginning 1) (match-end 1)))
list)) list))
(goto-char (1+ (match-end 0)))) (goto-char (1+ (match-end 0))))
(setq list (nreverse list) (setq list (nreverse list)
current (car (car list)) current (car (car list))
list (cdr list))) list (cdr list))))
(while list (while list
(message "Searching subfile %s..." (cdr (car list))) (message "Searching subfile %s..." (cdr (car list)))
(Info-read-subfile (car (car list))) (Info-read-subfile (car (car list)))
...@@ -771,9 +826,10 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -771,9 +826,10 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
(message "") (message "")
(signal 'search-failed (list regexp)))) (signal 'search-failed (list regexp))))
(if (not found) (if (not found)
(progn (Info-read-subfile opoint) (progn (Info-read-subfile osubfile)
(goto-char opoint) (goto-char opoint)
(Info-select-node))))) (Info-select-node)
(set-window-start (selected-window) ostart)))))
(widen) (widen)
(goto-char found) (goto-char found)
(Info-select-node) (Info-select-node)
...@@ -800,7 +856,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." ...@@ -800,7 +856,7 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
;; Return the node name in the buffer following point. ;; Return the node name in the buffer following point.
;; ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp ;; ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp
;; saying which chas may appear in the node name. ;; saying which chars may appear in the node name.
(defun Info-following-node-name (&optional allowedchars) (defun Info-following-node-name (&optional allowedchars)
(skip-chars-forward " \t") (skip-chars-forward " \t")
(buffer-substring-no-properties (buffer-substring-no-properties
...@@ -884,9 +940,18 @@ NAME may be an abbreviation of the reference name." ...@@ -884,9 +940,18 @@ NAME may be an abbreviation of the reference name."
;; Record as a completion and perhaps as default. ;; Record as a completion and perhaps as default.
(if (eq default t) (setq default str)) (if (eq default t) (setq default str))
(if (eq alt-default t) (setq alt-default str)) (if (eq alt-default t) (setq alt-default str))
;; Don't add this string if it's a duplicate.
;; We use a loop instead of "(assoc str completions)" because
;; we want to do a case-insensitive compare.
(let ((tail completions)
(tem (downcase str)))
(while (and tail
(not (string-equal tem (downcase (car (car tail))))))
(setq tail (cdr tail)))
(or tail
(setq completions (setq completions
(cons (cons str nil) (cons (cons str nil)
completions)))) completions))))))
;; If no good default was found, try an alternate. ;; If no good default was found, try an alternate.
(or default (or default
(setq default alt-default)) (setq default alt-default))
...@@ -1148,8 +1213,7 @@ N is the digit argument used to invoke this command." ...@@ -1148,8 +1213,7 @@ N is the digit argument used to invoke this command."
(interactive) (interactive)
(if Info-standalone (if Info-standalone
(save-buffers-kill-emacs) (save-buffers-kill-emacs)
(switch-to-buffer (prog1 (other-buffer (current-buffer)) (bury-buffer)))
(bury-buffer (current-buffer))))))
(defun Info-next-menu-item () (defun Info-next-menu-item ()
(interactive) (interactive)
...@@ -1222,9 +1286,15 @@ N is the digit argument used to invoke this command." ...@@ -1222,9 +1286,15 @@ N is the digit argument used to invoke this command."
(defun Info-scroll-up () (defun Info-scroll-up ()
"Scroll one screenful forward in Info, considering all nodes as one sequence. "Scroll one screenful forward in Info, considering all nodes as one sequence.
Once you scroll far enough in a node that its menu appears on the screen, Once you scroll far enough in a node that its menu appears on the screen
the next scroll moves into its first subnode. When you scroll past but after point, the next scroll moves into its first subnode.
the end of a node, that goes to the next node or back up to the parent node."
When you scroll past the end of a node, that goes to the next node; if
this node has no successor, it moves to the parent node's successor,
and so on. If point is inside the menu of a node, it moves to
subnode indicated by the following menu item. (That case won't
normally result from this command, but can happen in other ways.)"
(interactive) (interactive)
(if (or (< (window-start) (point-min)) (if (or (< (window-start) (point-min))
(> (window-start) (point-max))) (> (window-start) (point-max)))
...@@ -1363,7 +1433,7 @@ Give a blank topic name to go to the Index node itself." ...@@ -1363,7 +1433,7 @@ Give a blank topic name to go to the Index node itself."
"Go to the next matching index item from the last `i' command." "Go to the next matching index item from the last `i' command."
(interactive "p") (interactive "p")
(or Info-index-alternatives (or Info-index-alternatives
(error "No previous `i' command in this file")) (error "No previous `i' command"))
(while (< num 0) (while (< num 0)
(setq num (+ num (length Info-index-alternatives)))) (setq num (+ num (length Info-index-alternatives))))
(while (> num 0) (while (> num 0)
...@@ -1446,7 +1516,16 @@ SIG optional fourth argument, controls action on no match ...@@ -1446,7 +1516,16 @@ SIG optional fourth argument, controls action on no match
a string: signal an error, using that string." a string: signal an error, using that string."
(save-excursion (save-excursion
(goto-char pos) (goto-char pos)
(re-search-backward start (max (point-min) (- pos 200)) 'yes) ;; First look for a match for START that goes across POS.
(while (and (not (bobp)) (> (point) (- pos (length start)))
(not (looking-at start)))
(forward-char -1))
;; If we did not find one, search back for START
;; (this finds only matches that end at or before POS).
(or (looking-at start)
(progn
(goto-char pos)
(re-search-backward start (max (point-min) (- pos 200)) 'yes)))
(let (found) (let (found)
(while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes) (while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes)
(not (setq found (and (<= (match-beginning 0) pos) (not (setq found (and (<= (match-beginning 0) pos)
...@@ -1554,6 +1633,92 @@ If no reference to follow, moves to the next node, or up if none." ...@@ -1554,6 +1633,92 @@ If no reference to follow, moves to the next node, or up if none."
(define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node) (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)
) )
(defun Info-check-pointer (item)
;; Non-nil if ITEM is present in this node.
(condition-case nil
(Info-extract-pointer item)
(error nil)))
(easy-menu-define Info-mode-menu Info-mode-map
"Menu for info files."
'("Info"
["Up" Info-up (Info-check-pointer "up")]
["Next" Info-next (Info-check-pointer "next")]
["Previous" Info-prev (Info-check-pointer "prev[ious]*")]
("Menu item" ["You should never see this" report-emacs-bug t])
("Reference" ["You should never see this" report-emacs-bug t])
["Search..." Info-search t]
["Goto node..." Info-goto-node t]
["Last" Info-last Info-history]
["Exit" Info-exit t]))
(defvar Info-menu-last-node nil)
;; Last node the menu was created for.
(defun Info-menu-update ()
;; Update the Info menu for the current node.
(condition-case nil
(if (or (not (eq major-mode 'Info-mode))
(eq Info-current-node Info-menu-last-node))
()
;; Update menu menu.
(let* ((Info-complete-menu-buffer (current-buffer))
(items (nreverse (condition-case nil
(Info-complete-menu-item
"" (lambda (e) t) t)
(error nil))))
entries current
(number 0))
(while (and items (< number 9))
(setq current (car items)
items (cdr items)
number (1+ number))
(setq entries (cons `[,current
(Info-menu ,current)
:keys ,(format "%d" number)]
entries)))
(if items
(setq entries (cons ["Other..." Info-menu t] entries)))
(or entries
(setq entries (list ["No menu" nil nil])))
(easy-menu-change '("Info") "Menu item" (nreverse entries)))
;; Update reference menu. Code stolen from `Info-follow-reference'.
(let ((items nil)
str i entries current
(number 0))
(save-excursion
(goto-char (point-min))
(while (re-search-forward "\\*note[ \n\t]*\\([^:]*\\):" nil t)
(setq str (buffer-substring
(match-beginning 1)
(1- (point))))
(setq i 0)
(while (setq i (string-match "[ \n\t]+" str i))
(setq str (concat (substring str 0 i) " "
(substring str (match-end 0))))
(setq i (1+ i)))
(setq items
(cons str items))))
(while (and items (< number 9))
(setq current (car items)
items (cdr items)
number (1+ number))
(setq entries (cons `[,current
(Info-follow-reference ,current)
t]
entries)))
(if items
(setq entries (cons ["Other..." Info-follow-reference t]
entries)))
(or entries
(setq entries (list ["No references" nil nil])))
(easy-menu-change '("Info") "Reference" (nreverse entries)))
;; Update last seen node.
(setq Info-menu-last-node (current-buffer)))
;; Try to avoid entering infinite beep mode in case of errors.
(error (ding))))
;; Info mode is suitable only for specially formatted data. ;; Info mode is suitable only for specially formatted data.
(put 'info-mode 'mode-class 'special) (put 'info-mode 'mode-class 'special)
...@@ -1604,7 +1769,10 @@ Advanced commands: ...@@ -1604,7 +1769,10 @@ Advanced commands:
(kill-all-local-variables) (kill-all-local-variables)
(setq major-mode 'Info-mode) (setq major-mode 'Info-mode)
(setq mode-name "Info") (setq mode-name "Info")
(setq tab-width 8)
(use-local-map Info-mode-map) (use-local-map Info-mode-map)
(make-local-hook 'activate-menubar-hook)
(add-hook 'activate-menubar-hook 'Info-menu-update nil t)
(set-syntax-table text-mode-syntax-table) (set-syntax-table text-mode-syntax-table)
(setq local-abbrev-table text-mode-abbrev-table) (setq local-abbrev-table text-mode-abbrev-table)
(setq case-fold-search t) (setq case-fold-search t)
...@@ -1613,9 +1781,12 @@ Advanced commands: ...@@ -1613,9 +1781,12 @@ Advanced commands:
(make-local-variable 'Info-current-subfile) (make-local-variable 'Info-current-subfile)
(make-local-variable 'Info-current-node) (make-local-variable 'Info-current-node)
(make-local-variable 'Info-tag-table-marker) (make-local-variable 'Info-tag-table-marker)
(setq Info-tag-table-marker (make-marker))
(make-local-variable 'Info-tag-table-buffer)
(setq Info-tag-table-buffer nil)
(make-local-variable 'Info-history) (make-local-variable 'Info-history)
(make-local-variable 'Info-index-alternatives) (make-local-variable 'Info-index-alternatives)
(if (memq (framep (selected-frame)) '(x pc)) (if (memq (framep (selected-frame)) '(x pc w32))
(progn (progn
(make-face 'info-node) (make-face 'info-node)
(make-face 'info-menu-5) (make-face 'info-menu-5)
...@@ -1752,6 +1923,8 @@ the variable `Info-file-list-for-emacs'." ...@@ -1752,6 +1923,8 @@ the variable `Info-file-list-for-emacs'."
;; Get Info running, and pop to it in another window. ;; Get Info running, and pop to it in another window.
(save-window-excursion (save-window-excursion
(info)) (info))
;; FIXME It would be cool if this could use a buffer other
;; than *info*.
(pop-to-buffer "*info*") (pop-to-buffer "*info*")
(Info-find-node (car (car where)) (Info-find-node (car (car where))
(car (cdr (car where)))) (car (cdr (car where))))
...@@ -1786,12 +1959,14 @@ the variable `Info-file-list-for-emacs'." ...@@ -1786,12 +1959,14 @@ the variable `Info-file-list-for-emacs'."
(t (t
(Info-goto-emacs-command-node command))))) (Info-goto-emacs-command-node command)))))
(defvar Info-title-face-alist (defcustom Info-title-face-alist
'((?* bold underline) '((?* bold underline)
(?= bold-italic underline) (?= bold-italic underline)
(?- italic underline)) (?- italic underline))
"*Alist of face or list of faces to use for pseudo-underlined titles. "*Alist of face or list of faces to use for pseudo-underlined titles.
The alist key is the character the title is underlined with (?*, ?= or ?-).") The alist key is the character the title is underlined with (?*, ?= or ?-)."
:type '(repeat (list character face face))
:group 'info)
(defun Info-fontify-node () (defun Info-fontify-node ()
(save-excursion (save-excursion
...@@ -1841,6 +2016,17 @@ The alist key is the character the title is underlined with (?*, ?= or ?-).") ...@@ -1841,6 +2016,17 @@ The alist key is the character the title is underlined with (?*, ?= or ?-).")
'mouse-face 'highlight)))) 'mouse-face 'highlight))))
(set-buffer-modified-p nil)))) (set-buffer-modified-p nil))))
;; When an Info buffer is killed, make sure the associated tags buffer
;; is killed too.
(defun Info-kill-buffer ()
(and (eq major-mode 'Info-mode)
Info-tag-table-buffer
(kill-buffer Info-tag-table-buffer)))
(add-hook 'kill-buffer-hook 'Info-kill-buffer)
(provide 'info) (provide 'info)
;;; info.el ends here ;;; info.el ends here
...@@ -71,7 +71,8 @@ ...@@ -71,7 +71,8 @@
(delete-region (point) end))) (delete-region (point) end)))
(goto-char (point-max)) (goto-char (point-max))
(insert "\^_\f\nTag table:\n") (insert "\^_\f\nTag table:\n")
(move-marker Info-tag-table-marker (point)) (if (eq major-mode 'info-mode)
(move-marker Info-tag-table-marker (point)))
(setq list (nreverse list)) (setq list (nreverse list))
(while list (while list
(insert "Node: " (car (car list)) ?\177) (insert "Node: " (car (car list)) ?\177)
...@@ -152,6 +153,10 @@ contains just the tag table and a directory of subfiles." ...@@ -152,6 +153,10 @@ contains just the tag table and a directory of subfiles."
(search-forward "\nTag Table:\n") (search-forward "\nTag Table:\n")
(insert "(Indirect)\n"))) (insert "(Indirect)\n")))
(defvar Info-validate-allnodes)
(defvar Info-validate-thisnode)
(defvar Info-validate-lossages)
;;;###autoload ;;;###autoload
(defun Info-validate () (defun Info-validate ()
"Check current buffer for validity as an Info file. "Check current buffer for validity as an Info file.
...@@ -165,11 +170,11 @@ Check that every node pointer points to an existing node." ...@@ -165,11 +170,11 @@ Check that every node pointer points to an existing node."
(error "Don't yet know how to validate indirect info files: \"%s\"" (error "Don't yet know how to validate indirect info files: \"%s\""
(buffer-name (current-buffer)))) (buffer-name (current-buffer))))
(goto-char (point-min)) (goto-char (point-min))
(let ((allnodes '(("*"))) (let ((Info-validate-allnodes '(("*")))
(regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]") (regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]")
(case-fold-search t) (case-fold-search t)
(tags-losing nil) (tags-losing nil)
(lossages ())) (Info-validate-lossages ()))
(while (search-forward "\n\^_" nil t) (while (search-forward "\n\^_" nil t)
(forward-line 1) (forward-line 1)
(let ((beg (point))) (let ((beg (point)))
...@@ -182,11 +187,11 @@ Check that every node pointer points to an existing node." ...@@ -182,11 +187,11 @@ Check that every node pointer points to an existing node."
(goto-char (match-end 1)) (goto-char (match-end 1))
(skip-chars-backward " \t") (skip-chars-backward " \t")
(point)))))) (point))))))
(if (assoc name allnodes) (if (assoc name Info-validate-allnodes)
(setq lossages (setq Info-validate-lossages
(cons (list name "Duplicate node-name" nil) (cons (list name "Duplicate node-name" nil)
lossages)) Info-validate-lossages))
(setq allnodes (setq Info-validate-allnodes
(cons (list name (cons (list name
(progn (progn
(end-of-line) (end-of-line)
...@@ -197,18 +202,18 @@ Check that every node pointer points to an existing node." ...@@ -197,18 +202,18 @@ Check that every node pointer points to an existing node."
(downcase (downcase
(Info-following-node-name))))) (Info-following-node-name)))))
beg) beg)
allnodes))))))) Info-validate-allnodes)))))))
(goto-char (point-min)) (goto-char (point-min))
(while (search-forward "\n\^_" nil t) (while (search-forward "\n\^_" nil t)
(forward-line 1) (forward-line 1)
(let ((beg (point)) (let ((beg (point))
thisnode next) Info-validate-thisnode next)
(forward-line 1) (forward-line 1)
(if (re-search-backward regexp beg t) (if (re-search-backward regexp beg t)
(save-restriction (save-restriction
(search-forward "\n\^_" nil 'move) (search-forward "\n\^_" nil 'move)
(narrow-to-region beg (point)) (narrow-to-region beg (point))
(setq thisnode (downcase (setq Info-validate-thisnode (downcase
(buffer-substring-no-properties (buffer-substring-no-properties
(match-beginning 1) (match-beginning 1)
(progn (progn
...@@ -218,23 +223,24 @@ Check that every node pointer points to an existing node." ...@@ -218,23 +223,24 @@ Check that every node pointer points to an existing node."
(end-of-line) (end-of-line)
(and (search-backward "next:" nil t) (and (search-backward "next:" nil t)
(setq next (Info-validate-node-name "invalid Next")) (setq next (Info-validate-node-name "invalid Next"))
(assoc next allnodes) (assoc next Info-validate-allnodes)
(if (equal (car (cdr (assoc next allnodes))) (if (equal (car (cdr (assoc next Info-validate-allnodes)))
thisnode) Info-validate-thisnode)
;; allow multiple `next' pointers to one node ;; allow multiple `next' pointers to one node
(let ((tem lossages)) (let ((tem Info-validate-lossages))
(while tem (while tem
(if (and (equal (car (cdr (car tem))) (if (and (equal (car (cdr (car tem)))
"should have Previous") "should have Previous")
(equal (car (car tem)) (equal (car (car tem))
next)) next))
(setq lossages (delq (car tem) lossages))) (setq Info-validate-lossages
(delq (car tem) Info-validate-lossages)))
(setq tem (cdr tem)))) (setq tem (cdr tem))))
(setq lossages (setq Info-validate-lossages
(cons (list next (cons (list next
"should have Previous" "should have Previous"
thisnode) Info-validate-thisnode)
lossages)))) Info-validate-lossages))))
(end-of-line) (end-of-line)
(if (re-search-backward "prev[ious]*:" nil t) (if (re-search-backward "prev[ious]*:" nil t)
(Info-validate-node-name "invalid Previous")) (Info-validate-node-name "invalid Previous"))
...@@ -262,29 +268,29 @@ Check that every node pointer points to an existing node." ...@@ -262,29 +268,29 @@ Check that every node pointer points to an existing node."
(point)))) (point))))
(Info-extract-menu-node-name "Bad format cross-reference"))))))) (Info-extract-menu-node-name "Bad format cross-reference")))))))
(setq tags-losing (not (Info-validate-tags-table))) (setq tags-losing (not (Info-validate-tags-table)))
(if (or lossages tags-losing) (if (or Info-validate-lossages tags-losing)
(with-output-to-temp-buffer " *problems in info file*" (with-output-to-temp-buffer " *problems in info file*"
(while lossages (while Info-validate-lossages
(princ "In node \"") (princ "In node \"")
(princ (car (car lossages))) (princ (car (car Info-validate-lossages)))
(princ "\", ") (princ "\", ")
(let ((tem (nth 1 (car lossages)))) (let ((tem (nth 1 (car Info-validate-lossages))))
(cond ((string-match "\n" tem) (cond ((string-match "\n" tem)
(princ (substring tem 0 (match-beginning 0))) (princ (substring tem 0 (match-beginning 0)))
(princ "...")) (princ "..."))
(t (t
(princ tem)))) (princ tem))))
(if (nth 2 (car lossages)) (if (nth 2 (car Info-validate-lossages))
(progn (progn
(princ ": ") (princ ": ")
(let ((tem (nth 2 (car lossages)))) (let ((tem (nth 2 (car Info-validate-lossages))))
(cond ((string-match "\n" tem) (cond ((string-match "\n" tem)
(princ (substring tem 0 (match-beginning 0))) (princ (substring tem 0 (match-beginning 0)))
(princ "...")) (princ "..."))
(t (t
(princ tem)))))) (princ tem))))))
(terpri) (terpri)
(setq lossages (cdr lossages))) (setq Info-validate-lossages (cdr Info-validate-lossages)))
(if tags-losing (princ "\nTags table must be recomputed\n"))) (if tags-losing (princ "\nTags table must be recomputed\n")))
;; Here if info file is valid. ;; Here if info file is valid.
;; If we already made a list of problems, clear it out. ;; If we already made a list of problems, clear it out.
...@@ -313,9 +319,10 @@ Check that every node pointer points to an existing node." ...@@ -313,9 +319,10 @@ Check that every node pointer points to an existing node."
nil nil
(setq name (downcase name)) (setq name (downcase name))
(or (and (> (length name) 0) (= (aref name 0) ?\()) (or (and (> (length name) 0) (= (aref name 0) ?\())
(assoc name allnodes) (assoc name Info-validate-allnodes)
(setq lossages (setq Info-validate-lossages
(cons (list thisnode kind name) lossages)))) (cons (list Info-validate-thisnode kind name)
Info-validate-lossages))))
name) name)
(defun Info-validate-tags-table () (defun Info-validate-tags-table ()
...@@ -327,7 +334,7 @@ Check that every node pointer points to an existing node." ...@@ -327,7 +334,7 @@ Check that every node pointer points to an existing node."
(start (progn (search-backward "\nTag table:\n") (start (progn (search-backward "\nTag table:\n")
(1- (match-end 0)))) (1- (match-end 0))))
tem) tem)
(setq tem allnodes) (setq tem Info-validate-allnodes)
(while tem (while tem
(goto-char start) (goto-char start)
(or (equal (car (car tem)) "*") (or (equal (car (car tem)) "*")
...@@ -342,7 +349,7 @@ Check that every node pointer points to an existing node." ...@@ -342,7 +349,7 @@ Check that every node pointer points to an existing node."
(setq tem (downcase (buffer-substring-no-properties (setq tem (downcase (buffer-substring-no-properties
(match-beginning 1) (match-beginning 1)
(match-end 1)))) (match-end 1))))
(setq tem (assoc tem allnodes)) (setq tem (assoc tem Info-validate-allnodes))
(if (or (not tem) (if (or (not tem)
(< 1000 (progn (< 1000 (progn
(goto-char (match-beginning 2)) (goto-char (match-beginning 2))
...@@ -426,4 +433,6 @@ For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\"" ...@@ -426,4 +433,6 @@ For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\""
(error (message ">> Error: %s" (prin1-to-string err)))))) (error (message ">> Error: %s" (prin1-to-string err))))))
(kill-emacs error)))) (kill-emacs error))))
(provide 'informat)
;;; informat.el ends here ;;; informat.el ends here
...@@ -47,15 +47,24 @@ ...@@ -47,15 +47,24 @@
(require 'compile) (require 'compile)
(defvar makeinfo-run-command "makeinfo" (defgroup makeinfo nil
"Run makeinfo conveniently"
:group 'docs)
(defcustom makeinfo-run-command "makeinfo"
"*Command used to run `makeinfo' subjob. "*Command used to run `makeinfo' subjob.
The name of the file is appended to this string, separated by a space.") The name of the file is appended to this string, separated by a space."
:type 'string
:group 'makeinfo)
(defvar makeinfo-options "--fill-column=70" (defcustom makeinfo-options "--fill-column=70"
"*String containing options for running `makeinfo'. "*String containing options for running `makeinfo'.
Do not include `--footnote-style' or `--paragraph-indent'; Do not include `--footnote-style' or `--paragraph-indent';
the proper way to specify those is with the Texinfo commands the proper way to specify those is with the Texinfo commands
`@footnotestyle` and `@paragraphindent'.") `@footnotestyle` and `@paragraphindent'."
:type 'string
:group 'makeinfo)
(require 'texinfo) (require 'texinfo)
......
;;; texinfmt.el --- format Texinfo files into Info files. ;;; texinfmt.el --- format Texinfo files into Info files.
;; Copyright (C) 1985, 1986, 1988, 1990, 1991, ;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993,
;; 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. ;; 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
;; Author: Robert J. Chassell
;; Date: 10 Sep 1996
;; Maintainer: Robert J. Chassell <bug-texinfo@prep.ai.mit.edu> ;; Maintainer: Robert J. Chassell <bug-texinfo@prep.ai.mit.edu>
;; Keywords: maint, tex, docs ;; Keywords: maint, tex, docs
...@@ -29,7 +27,7 @@ ...@@ -29,7 +27,7 @@
;;; Emacs lisp functions to convert Texinfo files to Info files. ;;; Emacs lisp functions to convert Texinfo files to Info files.
(defvar texinfmt-version "2.35 of 10 September 1996") (defvar texinfmt-version "2.37 of 24 May 1997")
(defun texinfmt-version (&optional here) (defun texinfmt-version (&optional here)
"Show the version of texinfmt.el in the minibuffer. "Show the version of texinfmt.el in the minibuffer.
...@@ -101,7 +99,7 @@ If optional argument HERE is non-nil, insert info at point." ...@@ -101,7 +99,7 @@ If optional argument HERE is non-nil, insert info at point."
(defun texinfo-format-buffer (&optional notagify) (defun texinfo-format-buffer (&optional notagify)
"Process the current buffer as texinfo code, into an Info file. "Process the current buffer as texinfo code, into an Info file.
The Info file output is generated in a buffer visiting the Info file The Info file output is generated in a buffer visiting the Info file
names specified in the @setfilename command. name specified in the @setfilename command.
Non-nil argument (prefix, if interactive) means don't make tag table Non-nil argument (prefix, if interactive) means don't make tag table
and don't split the file if large. You can use Info-tagify and and don't split the file if large. You can use Info-tagify and
...@@ -299,6 +297,33 @@ converted to Info is stored in a temporary buffer." ...@@ -299,6 +297,33 @@ converted to Info is stored in a temporary buffer."
(message "Done."))) (message "Done.")))
;;;###autoload
(defun texi2info (&optional notagify)
"Convert the current buffer (written in Texinfo code) into an Info file.
The Info file output is generated in a buffer visiting the Info file
names specified in the @setfilename command.
This function automatically updates all node pointers and menus, and
creates a master menu. This work is done on a temporary buffer that
is automatically removed when the Info file is created. The original
Texinfo source buffer is not changed.
Non-nil argument (prefix, if interactive) means don't make tag table
and don't split the file if large. You can use Info-tagify and
Info-split to do these manually."
(interactive "P")
(let ((temp-buffer (concat "*--" (buffer-name) "--temporary-buffer*" )))
(message "First updating nodes and menus, then creating Info file.")
;; (sit-for 2)
(copy-to-buffer temp-buffer (point-min) (point-max))
(switch-to-buffer temp-buffer)
(texinfo-master-menu t)
(message "Now creating Info file.")
(sit-for 2)
(texinfo-format-buffer notagify)
(save-buffer)
(kill-buffer temp-buffer)))
;;; Primary internal formatting function for the whole buffer. ;;; Primary internal formatting function for the whole buffer.
...@@ -476,6 +501,7 @@ converted to Info is stored in a temporary buffer." ...@@ -476,6 +501,7 @@ converted to Info is stored in a temporary buffer."
"bullet{\\|" "bullet{\\|"
"cite{\\|" "cite{\\|"
"code{\\|" "code{\\|"
"email{\\|"
"emph{\\|" "emph{\\|"
"equiv{\\|" "equiv{\\|"
"error{\\|" "error{\\|"
...@@ -486,7 +512,6 @@ converted to Info is stored in a temporary buffer." ...@@ -486,7 +512,6 @@ converted to Info is stored in a temporary buffer."
"kbd{\\|" "kbd{\\|"
"key{\\|" "key{\\|"
"lisp{\\|" "lisp{\\|"
"email{\\|"
"minus{\\|" "minus{\\|"
"point{\\|" "point{\\|"
"print{\\|" "print{\\|"
...@@ -1049,12 +1074,10 @@ Leave point after argument." ...@@ -1049,12 +1074,10 @@ Leave point after argument."
(file-name-nondirectory (expand-file-name arg))) (file-name-nondirectory (expand-file-name arg)))
(insert "Info file: " (insert "Info file: "
texinfo-format-filename ", -*-Text-*-\n" texinfo-format-filename ", -*-Text-*-\n"
;; Date string removed so that regression testing is easier.
;; "produced on "
;; (substring (current-time-string) 8 10) " "
;; (substring (current-time-string) 4 7) " "
;; (substring (current-time-string) -4) " "
"produced by `texinfo-format-buffer'\n" "produced by `texinfo-format-buffer'\n"
;; Date string removed so that regression testing is easier.
;; "on "
;; (insert (format-time-string "%e %b %Y")) " "
"from file" "from file"
(if (buffer-file-name input-buffer) (if (buffer-file-name input-buffer)
(concat " `" (concat " `"
...@@ -1714,7 +1737,7 @@ Used by @refill indenting command to avoid indenting within lists, etc.") ...@@ -1714,7 +1737,7 @@ Used by @refill indenting command to avoid indenting within lists, etc.")
;; ;;
;; Using the Emacs Lisp formatter, texinfmt.el, ;; Using the Emacs Lisp formatter, texinfmt.el,
;; the whitespace between columns can be increased by setting ;; the whitespace between columns can be increased by setting
;; `extra-inter-column-width' to a value greater than 0. By default, ;; `texinfo-extra-inter-column-width' to a value greater than 0. By default,
;; there is at least one blank space between columns. ;; there is at least one blank space between columns.
;; ;;
;; The Emacs Lisp formatter, texinfmt.el, ignores the following four ;; The Emacs Lisp formatter, texinfmt.el, ignores the following four
...@@ -1764,12 +1787,11 @@ Used by @refill indenting command to avoid indenting within lists, etc.") ...@@ -1764,12 +1787,11 @@ Used by @refill indenting command to avoid indenting within lists, etc.")
;; Note that @tab, the cell separators, are not treated as independent ;; Note that @tab, the cell separators, are not treated as independent
;; Texinfo commands. ;; Texinfo commands.
(defvar extra-inter-column-width 0 (defvar texinfo-extra-inter-column-width 0
"*Insert NUMBER of additional columns of whitespace between entries of "*Number of extra spaces between entries (columns) in @multitable.")
a multi-column table.")
(defvar multitable-temp-buffer-name "*multitable-temporary-buffer*") (defvar texinfo-multitable-buffer-name "*multitable-temporary-buffer*")
(defvar multitable-temp-rectangle-name "texinfo-multitable-temp-") (defvar texinfo-multitable-rectangle-name "texinfo-multitable-temp-")
;; These commands are defined in texinfo.tex for printed output. ;; These commands are defined in texinfo.tex for printed output.
(put 'multitableparskip 'texinfo-format 'texinfo-discard-line-with-args) (put 'multitableparskip 'texinfo-format 'texinfo-discard-line-with-args)
...@@ -1778,6 +1800,7 @@ a multi-column table.") ...@@ -1778,6 +1800,7 @@ a multi-column table.")
(put 'multitablelinespace 'texinfo-format 'texinfo-discard-line-with-args) (put 'multitablelinespace 'texinfo-format 'texinfo-discard-line-with-args)
(put 'multitable 'texinfo-format 'texinfo-multitable) (put 'multitable 'texinfo-format 'texinfo-multitable)
(defun texinfo-multitable () (defun texinfo-multitable ()
"Produce multi-column tables. "Produce multi-column tables.
...@@ -1806,7 +1829,7 @@ Long lines of text are filled within columns. ...@@ -1806,7 +1829,7 @@ Long lines of text are filled within columns.
Using the Emacs Lisp formatter, texinfmt.el, Using the Emacs Lisp formatter, texinfmt.el,
the whitespace between columns can be increased by setting the whitespace between columns can be increased by setting
`extra-inter-column-width' to a value greater than 0. By default, `texinfo-extra-inter-column-width' to a value greater than 0. By default,
there is at least one blank space between columns. there is at least one blank space between columns.
The Emacs Lisp formatter, texinfmt.el, ignores the following four The Emacs Lisp formatter, texinfmt.el, ignores the following four
...@@ -1895,7 +1918,7 @@ commands that are defined in texinfo.tex for printed output. ...@@ -1895,7 +1918,7 @@ commands that are defined in texinfo.tex for printed output.
;; between column spaces ;; between column spaces
(length texinfo-multitable-width-list) (length texinfo-multitable-width-list)
;; additional between column spaces, if any ;; additional between column spaces, if any
extra-inter-column-width texinfo-extra-inter-column-width
;; sum of spaces for each entry ;; sum of spaces for each entry
(apply '+ texinfo-multitable-width-list)))) (apply '+ texinfo-multitable-width-list))))
(if (> desired-columns fill-column) (if (> desired-columns fill-column)
...@@ -1941,7 +1964,7 @@ This command is executed when texinfmt sees @item inside @multitable." ...@@ -1941,7 +1964,7 @@ This command is executed when texinfmt sees @item inside @multitable."
;; extract-row command deletes the source line in the table. ;; extract-row command deletes the source line in the table.
(unformated-row (texinfo-multitable-extract-row))) (unformated-row (texinfo-multitable-extract-row)))
;; Use a temporary buffer ;; Use a temporary buffer
(set-buffer (get-buffer-create multitable-temp-buffer-name)) (set-buffer (get-buffer-create texinfo-multitable-buffer-name))
(delete-region (point-min) (point-max)) (delete-region (point-min) (point-max))
(insert unformated-row) (insert unformated-row)
(goto-char (point-min)) (goto-char (point-min))
...@@ -1968,7 +1991,7 @@ This command is executed when texinfmt sees @item inside @multitable." ...@@ -1968,7 +1991,7 @@ This command is executed when texinfmt sees @item inside @multitable."
(point))) (point)))
;; Set fill-column *wider* than needed to produce inter-column space ;; Set fill-column *wider* than needed to produce inter-column space
(setq fill-column (+ 1 (setq fill-column (+ 1
extra-inter-column-width texinfo-extra-inter-column-width
(nth table-column table-widths))) (nth table-column table-widths)))
(narrow-to-region start end) (narrow-to-region start end)
;; Remove whitespace before and after entry. ;; Remove whitespace before and after entry.
...@@ -2000,7 +2023,7 @@ This command is executed when texinfmt sees @item inside @multitable." ...@@ -2000,7 +2023,7 @@ This command is executed when texinfmt sees @item inside @multitable."
(if (> needed-whitespace 0) needed-whitespace 1) (if (> needed-whitespace 0) needed-whitespace 1)
? ))) ? )))
;; now, put formatted cell into a rectangle ;; now, put formatted cell into a rectangle
(set (intern (concat multitable-temp-rectangle-name (set (intern (concat texinfo-multitable-rectangle-name
(int-to-string table-column))) (int-to-string table-column)))
(extract-rectangle (point-min) (point))) (extract-rectangle (point-min) (point)))
(delete-region (point-min) (point)) (delete-region (point-min) (point))
...@@ -2023,12 +2046,12 @@ This command is executed when texinfmt sees @item inside @multitable." ...@@ -2023,12 +2046,12 @@ This command is executed when texinfmt sees @item inside @multitable."
(setq here (point)) (setq here (point))
(insert-rectangle (insert-rectangle
(eval (intern (eval (intern
(concat multitable-temp-rectangle-name (concat texinfo-multitable-rectangle-name
(int-to-string column-number))))) (int-to-string column-number)))))
(goto-char here) (goto-char here)
(end-of-line) (end-of-line)
(setq column-number (1+ column-number)))) (setq column-number (1+ column-number))))
(kill-buffer multitable-temp-buffer-name) (kill-buffer texinfo-multitable-buffer-name)
(setq fill-column existing-fill-column))) (setq fill-column existing-fill-column)))
...@@ -2091,10 +2114,21 @@ This command is executed when texinfmt sees @item inside @multitable." ...@@ -2091,10 +2114,21 @@ This command is executed when texinfmt sees @item inside @multitable."
;; The `@today{}' command requires a pair of braces, like `@dots{}'. ;; The `@today{}' command requires a pair of braces, like `@dots{}'.
(defun texinfo-format-today () (defun texinfo-format-today ()
(texinfo-parse-arg-discard) (texinfo-parse-arg-discard)
(insert (format "%s %s %s" (insert (format-time-string "%e %b %Y")))
(substring (current-time-string) 8 10)
(substring (current-time-string) 4 7)
(substring (current-time-string) -4)))) ;;; @timestamp{}
;; Produce `Day Month Year Hour:Min' style of output.
;; eg `1 Jan 1900 13:52'
(put 'timestamp 'texinfo-format 'texinfo-format-timestamp)
;; The `@timestamp{}' command requires a pair of braces, like `@dots{}'.
(defun texinfo-format-timestamp ()
"Insert the current local time and date."
(texinfo-parse-arg-discard)
;; For seconds and time zone, replace format string with "%e %b %Y %T %Z"
(insert (format-time-string "%e %b %Y %R")))
;;; @ignore ;;; @ignore
...@@ -2217,8 +2251,9 @@ This command is executed when texinfmt sees @item inside @multitable." ...@@ -2217,8 +2251,9 @@ This command is executed when texinfmt sees @item inside @multitable."
(put 'email 'texinfo-format 'texinfo-format-key) (put 'email 'texinfo-format 'texinfo-format-key)
(put 'key 'texinfo-format 'texinfo-format-key) (put 'key 'texinfo-format 'texinfo-format-key)
;; I've decided not want to have angle brackets around these -- rms.
(defun texinfo-format-key () (defun texinfo-format-key ()
(insert "<" (texinfo-parse-arg-discard) ">") (insert (texinfo-parse-arg-discard))
(goto-char texinfo-command-start)) (goto-char texinfo-command-start))
(put 'bullet 'texinfo-format 'texinfo-format-bullet) (put 'bullet 'texinfo-format 'texinfo-format-bullet)
...@@ -3706,12 +3741,11 @@ The command `@value{foo}' expands to the value." ...@@ -3706,12 +3741,11 @@ The command `@value{foo}' expands to the value."
;; Act as if clear, i.e. do nothing. ;; Act as if clear, i.e. do nothing.
())))) ()))))
;;; @ifeq ;;; @ifeq
(put 'ifeq 'texinfo-format 'texinfo-format-ifeq) (put 'ifeq 'texinfo-format 'texinfo-format-ifeq)
(defun texinfo-format-ifeq () (defun texinfo-format-ifeq ()
"If ARG1 and ARG2 caselessly string compare to same string, performs COMMAND. "If ARG1 and ARG2 caselessly string compare to same string, perform COMMAND.
Otherwise produces no output. Otherwise produces no output.
Thus: Thus:
......
;;; texinfo.el--major mode for editing Texinfo files. ;;; texinfo.el --- major mode for editing Texinfo files
;; Copyright (C) 1985, '88, '89, '90, '91, ;; Copyright (C) 1985, '88, '89, '90, '91,
;; '92, '93, '96 Free Software Foundation, Inc. ;; '92, '93, '96, '97 Free Software Foundation, Inc.
;; Author: Robert J. Chassell ;; Author: Robert J. Chassell
;; Date: 6 Sep 1996 ;; Date: [Set date below for texinfo-version]
;; Maintainer: bug-texinfo@prep.ai.mit.edu ;; Maintainer: bug-texinfo@prep.ai.mit.edu
;; Keywords: maint, tex, docs ;; Keywords: maint, tex, docs
...@@ -25,6 +25,26 @@ ...@@ -25,6 +25,26 @@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA. ;; Boston, MA 02111-1307, USA.
;;; Code:
(defgroup texinfo nil
"Texinfo Mode"
:group 'docs)
(defvar texinfo-version "2.37 of 24 May 1997")
(defun texinfo-version (&optional here)
"Show the version of texinfo.el in the minibuffer.
If optional argument HERE is non-nil, insert info at point."
(interactive "P")
(let ((version-string
(format "Version of \`texinfo.el\': %s" texinfo-version)))
(if here
(insert version-string)
(if (interactive-p)
(message "%s" version-string)
version-string))))
;;; Autoloads: ;;; Autoloads:
...@@ -261,11 +281,11 @@ chapter." ...@@ -261,11 +281,11 @@ chapter."
;; It didn't seem to be any better, and it's slower--simon. ;; It didn't seem to be any better, and it's slower--simon.
("^\\(@c\\|@comment\\)\\>.*" . font-lock-comment-face) ;comments ("^\\(@c\\|@comment\\)\\>.*" . font-lock-comment-face) ;comments
;; Robert J. Chassell <bob@gnu.ai.mit.edu> says remove this line. ;; Robert J. Chassell <bob@gnu.ai.mit.edu> says remove this line.
;("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t) ;;("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t)
("@\\([a-zA-Z]+\\|[^ \t\n]\\)" 1 font-lock-keyword-face) ;commands ("@\\([a-zA-Z]+\\|[^ \t\n]\\)" 1 font-lock-keyword-face) ;commands
("^\\*\\(.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items ("^\\*\\(.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items
("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face) ("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face)
("@\\(file\\|kbd\\|key\\){\\([^}]+\\)" 2 font-lock-string-face) ("@\\(file\\|kbd\\|key\\|url\\|email\\){\\([^}]+\\)" 2 font-lock-string-face)
("@\\(samp\\|code\\|var\\|math\\){\\([^}]+\\)" ("@\\(samp\\|code\\|var\\|math\\){\\([^}]+\\)"
2 font-lock-variable-name-face) 2 font-lock-variable-name-face)
("@\\(cite\\|xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-reference-face) ("@\\(cite\\|xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-reference-face)
...@@ -321,6 +341,7 @@ chapter." ...@@ -321,6 +341,7 @@ chapter."
(define-key keymap "\C-c\C-t\C-d" 'texinfo-delete-from-print-queue) (define-key keymap "\C-c\C-t\C-d" 'texinfo-delete-from-print-queue)
(define-key keymap "\C-c\C-t\C-q" 'tex-show-print-queue) (define-key keymap "\C-c\C-t\C-q" 'tex-show-print-queue)
(define-key keymap "\C-c\C-t\C-p" 'texinfo-tex-print) (define-key keymap "\C-c\C-t\C-p" 'texinfo-tex-print)
(define-key keymap "\C-c\C-t\C-v" 'texinfo-tex-view)
(define-key keymap "\C-c\C-t\C-i" 'texinfo-texindex) (define-key keymap "\C-c\C-t\C-i" 'texinfo-texindex)
(define-key keymap "\C-c\C-t\C-r" 'texinfo-tex-region) (define-key keymap "\C-c\C-t\C-r" 'texinfo-tex-region)
...@@ -471,9 +492,10 @@ value of texinfo-mode-hook." ...@@ -471,9 +492,10 @@ value of texinfo-mode-hook."
(make-local-variable 'indent-tabs-mode) (make-local-variable 'indent-tabs-mode)
(setq indent-tabs-mode nil) (setq indent-tabs-mode nil)
(make-local-variable 'paragraph-separate) (make-local-variable 'paragraph-separate)
(setq paragraph-separate (concat "^\b\\|^@[a-zA-Z]*[ \n]\\|" paragraph-separate)) (setq paragraph-separate
(concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
(make-local-variable 'paragraph-start) (make-local-variable 'paragraph-start)
(setq paragraph-start (concat "^\b\\|^@[a-zA-Z]*[ \n]\\|" paragraph-start)) (setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))
(make-local-variable 'fill-column) (make-local-variable 'fill-column)
(setq fill-column 72) (setq fill-column 72)
(make-local-variable 'comment-start) (make-local-variable 'comment-start)
...@@ -494,9 +516,13 @@ value of texinfo-mode-hook." ...@@ -494,9 +516,13 @@ value of texinfo-mode-hook."
(make-local-variable 'outline-level) (make-local-variable 'outline-level)
(setq outline-level 'texinfo-outline-level) (setq outline-level 'texinfo-outline-level)
(make-local-variable 'tex-start-of-header) (make-local-variable 'tex-start-of-header)
(setq tex-start-of-header "%**start") (setq tex-start-of-header "%\\*\\*start")
(make-local-variable 'tex-end-of-header) (make-local-variable 'tex-end-of-header)
(setq tex-end-of-header "%**end") (setq tex-end-of-header "%\\*\\*end")
(make-local-variable 'tex-first-line-header-regexp)
(setq tex-first-line-header-regexp "^\\\\input")
(make-local-variable 'tex-trailer)
(setq tex-trailer "@bye\n")
(run-hooks 'text-mode-hook 'texinfo-mode-hook)) (run-hooks 'text-mode-hook 'texinfo-mode-hook))
...@@ -543,10 +569,10 @@ value of texinfo-mode-hook." ...@@ -543,10 +569,10 @@ value of texinfo-mode-hook."
(let ((depth 1) string) (let ((depth 1) string)
(save-excursion (save-excursion
(while (and (> depth 0) (while (and (> depth 0)
(re-search-backward texinfo-environment-regexp nil t) (re-search-backward texinfo-environment-regexp nil t))
(if (looking-at "@end") (if (looking-at "@end")
(setq depth (1+ depth)) (setq depth (1+ depth))
(setq depth (1- depth))))) (setq depth (1- depth))))
(looking-at texinfo-environment-regexp) (looking-at texinfo-environment-regexp)
(if (zerop depth) (if (zerop depth)
(setq string (setq string
...@@ -662,13 +688,12 @@ The default is not to surround any existing words with the braces." ...@@ -662,13 +688,12 @@ The default is not to surround any existing words with the braces."
;;; Texinfo file structure ;;; Texinfo file structure
;; These are defined in texnfo-upd.el. ;; These are defined in texnfo-upd.el. defvars here avoid warnings.
;; texinfo-section-types-regexp (defvar texinfo-section-types-regexp)
;; texinfo-section-level-regexp (defvar texinfo-section-level-regexp)
;; texinfo-subsection-level-regexp (defvar texinfo-subsection-level-regexp)
;; texinfo-subsubsection-level-regexp (defvar texinfo-subsubsection-level-regexp)
;; `texinfo-show-structure' requires texnfo-upd.el
(defun texinfo-show-structure (&optional nodes-too) (defun texinfo-show-structure (&optional nodes-too)
"Show the structure of a Texinfo file. "Show the structure of a Texinfo file.
List the lines in the file that begin with the @-sign commands for List the lines in the file that begin with the @-sign commands for
...@@ -735,20 +760,28 @@ to jump to the corresponding spot in the Texinfo source file." ...@@ -735,20 +760,28 @@ to jump to the corresponding spot in the Texinfo source file."
;;; The tex and print function definitions: ;;; The tex and print function definitions:
(defvar texinfo-texi2dvi-command "texi2dvi" (defcustom texinfo-texi2dvi-command "texi2dvi"
"*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer.") "*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer."
:type 'string
:group 'texinfo)
(defvar texinfo-tex-command "tex" (defcustom texinfo-tex-command "tex"
"*Command used by `texinfo-tex-region' to run TeX on a region.") "*Command used by `texinfo-tex-region' to run TeX on a region."
:type 'string
:group 'texinfo)
(defvar texinfo-texindex-command "texindex" (defcustom texinfo-texindex-command "texindex"
"*Command used by `texinfo-texindex' to sort unsorted index files.") "*Command used by `texinfo-texindex' to sort unsorted index files."
:type 'string
:group 'texinfo)
(defvar texinfo-delete-from-print-queue-command "lprm" (defcustom texinfo-delete-from-print-queue-command "lprm"
"*Command string used to delete a job from the line printer queue. "*Command string used to delete a job from the line printer queue.
Command is used by \\[texinfo-delete-from-print-queue] based on Command is used by \\[texinfo-delete-from-print-queue] based on
number provided by a previous \\[tex-show-print-queue] number provided by a previous \\[tex-show-print-queue]
command.") command."
:type 'string
:group 'texinfo)
(defvar texinfo-tex-trailer "@bye" (defvar texinfo-tex-trailer "@bye"
"String appended after a region sent to TeX by `texinfo-tex-region'.") "String appended after a region sent to TeX by `texinfo-tex-region'.")
...@@ -767,109 +800,16 @@ inclusive. The header must start in the first 100 lines. ...@@ -767,109 +800,16 @@ inclusive. The header must start in the first 100 lines.
The value of `texinfo-tex-trailer' is appended to the temporary file after the region." The value of `texinfo-tex-trailer' is appended to the temporary file after the region."
(interactive "r") (interactive "r")
(require 'tex-mode) (require 'tex-mode)
(if (get-buffer "*tex-shell*") (let ((tex-command texinfo-tex-command)
(tex-kill-job) (tex-trailer "@bye\n"))
(tex-start-shell)) (tex-region beg end)))
(or tex-zap-file (setq tex-zap-file (make-temp-name "#tz")))
(let ((tex-out-file (concat tex-zap-file ".tex"))
(temp-buffer (get-buffer-create " tex-Output-Buffer"))
(zap-directory
(file-name-as-directory (expand-file-name tex-directory))))
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(forward-line 100)
(let ((search-end (point))
(hbeg (point-min)) (hend (point-min))
(default-directory zap-directory))
(goto-char (point-min))
;; Copy first line, the `\input texinfo' line, to temp file
(write-region (point)
(save-excursion (end-of-line) (point))
tex-out-file nil nil)
;; Don't copy first line twice if region includes it.
(forward-line 1)
(if (< beg (point)) (setq beg (point)))
;; Initialize the temp file with either the header or nothing
(if (search-forward tex-start-of-header search-end t)
(progn
(beginning-of-line)
(setq hbeg (point)) ; Mark beginning of header.
(if (search-forward tex-end-of-header nil t)
(progn (beginning-of-line)
(setq hend (point))) ; Mark end of header.
(setq hbeg (point-min))))) ; Else no header.
;; Copy header to temp file.
(write-region (min hbeg beg) hend tex-out-file t nil)
;; Copy region to temp file.
(write-region (max beg hend) end tex-out-file t nil))
;; This is a kludge to insert the tex-trailer into the tex-out-file.
;; We have to create a special buffer in which to insert
;; the tex-trailer first because there is no function with
;; which to append a literal string directly to a file.
(let ((local-tex-trailer texinfo-tex-trailer))
(set-buffer temp-buffer)
(erase-buffer)
;; make sure trailer isn't hidden by a comment
(insert-string "\n")
(if local-tex-trailer (insert-string local-tex-trailer))
(tex-set-buffer-directory temp-buffer zap-directory)
(write-region (point-min) (point-max) tex-out-file t nil))
;;; The following is sufficient in Emacs 19.
;;; (write-region (concat "\n" texinfo-tex-trailer) nil
;;; tex-out-file t nil)
))
(tex-set-buffer-directory "*tex-shell*" zap-directory)
(tex-send-command tex-shell-cd-command zap-directory)
(tex-send-command texinfo-tex-command tex-out-file)
;; alternatively:
;; (send-string "tex-shell" (concat tex-shell-cd-command " "
;; zap-directory "\n"))
;; (send-string "tex-shell" (concat texinfo-tex-command " "
;; tex-out-file "\n"))
(tex-recenter-output-buffer 0)))
(defun texinfo-tex-buffer () (defun texinfo-tex-buffer ()
"Run TeX on visited file, once or twice, to make a correct `.dvi' file." "Run TeX on visited file, once or twice, to make a correct `.dvi' file."
(interactive) (interactive)
;; Make sure TeX shell is running.
(require 'tex-mode) (require 'tex-mode)
(if (get-buffer "*tex-shell*") (let ((tex-command texinfo-texi2dvi-command))
(quit-process (get-process "tex-shell") t) (tex-buffer)))
(tex-start-shell))
(cond ((null buffer-file-name)
(error "Buffer not visiting any file!"))
((buffer-modified-p)
(error "Buffer has been modified since last saved!")))
(setq tex-zap-file buffer-file-name)
(tex-send-command tex-shell-cd-command (file-name-directory tex-zap-file))
(tex-send-command texinfo-texi2dvi-command tex-zap-file)
;; alternatively:
;; (send-string "tex-shell"
;; (concat tex-shell-cd-command
;; " " (file-name-directory tex-zap-file) "\n"))
;; )
;;
;; (send-string "tex-shell"
;; (concat texinfo-texi2dvi-command " " tex-zap-file "\n"))
(tex-recenter-output-buffer 0))
(defun texinfo-texindex () (defun texinfo-texindex ()
"Run `texindex' on unsorted index files. "Run `texindex' on unsorted index files.
...@@ -889,12 +829,14 @@ This runs the shell command defined by `texinfo-texindex-command'." ...@@ -889,12 +829,14 @@ This runs the shell command defined by `texinfo-texindex-command'."
This runs the shell command defined by `tex-dvi-print-command'." This runs the shell command defined by `tex-dvi-print-command'."
(interactive) (interactive)
(require 'tex-mode) (require 'tex-mode)
(tex-send-command tex-dvi-print-command (concat tex-zap-file ".dvi")) (tex-print))
;; alternatively:
;; (send-string "tex-shell" (defun texinfo-tex-view ()
;; (concat tex-dvi-print-command "View `.dvi' file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
;; " " tex-zap-file ".dvi" "\n")) This runs the shell command defined by `tex-dvi-view-command'."
(tex-recenter-output-buffer nil)) (interactive)
(require 'tex-mode)
(tex-view))
(defun texinfo-quit-job () (defun texinfo-quit-job ()
"Quit currently running TeX job, by sending an `x' to it." "Quit currently running TeX job, by sending an `x' to it."
......
;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files ;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files
;; Copyright 1989, 1990, 1991, 1992, 1996 Free Software Foundation, Inc. ;; Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
;; Author: Robert J. Chassell ;; Author: Robert J. Chassell
;; Date: 12 Sep 1996 ;; Maintainer: bug-texinfo@prep.ai.mit.edu
;; Maintainer: Robert J. Chassell <bug-texinfo@prep.ai.mit.edu>
;; Keywords: maint, tex, docs ;; Keywords: maint, tex, docs
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
...@@ -37,16 +36,16 @@ ...@@ -37,16 +36,16 @@
;; * insert or update the menu for a section, ;; * insert or update the menu for a section,
;; * create a master menu for a Texinfo source file. ;; * create a master menu for a Texinfo source file.
;; ;;
;; Passed an argument, the `texinfo-update-node' and ;; With a prefix argument, the `texinfo-update-node' and
;; `texinfo-make-menu' functions do their jobs in the region. ;; `texinfo-make-menu' functions do their jobs in the region.
;; ;;
;; In brief, the functions for creating or updating nodes and menus, are: ;; In brief, the functions for creating or updating nodes and menus, are:
;; ;;
;; texinfo-update-node (&optional region-p) ;; texinfo-update-node (&optional beginning end)
;; texinfo-every-node-update () ;; texinfo-every-node-update ()
;; texinfo-sequential-node-update (&optional region-p) ;; texinfo-sequential-node-update (&optional region-p)
;; ;;
;; texinfo-make-menu (&optional region-p) ;; texinfo-make-menu (&optional beginning end)
;; texinfo-all-menus-update () ;; texinfo-all-menus-update ()
;; texinfo-master-menu () ;; texinfo-master-menu ()
;; ;;
...@@ -81,11 +80,11 @@ ...@@ -81,11 +80,11 @@
;;; The update node functions described in detail ;;; The update node functions described in detail
;; The `texinfo-update-node' function without an argument inserts ;; The `texinfo-update-node' command with no prefix argument inserts
;; the correct next, previous and up pointers for the node in which ;; the correct next, previous and up pointers for the node in which
;; point is located (i.e., for the node preceding point). ;; point is located (i.e., for the node preceding point).
;; With an argument, the `texinfo-update-node' function inserts the ;; With prefix argument, the `texinfo-update-node' function inserts the
;; correct next, previous and up pointers for the nodes inside the ;; correct next, previous and up pointers for the nodes inside the
;; region. ;; region.
...@@ -150,13 +149,16 @@ ...@@ -150,13 +149,16 @@
;;; Code: ;;; Code:
;;; The menu making functions (defvar texinfo-master-menu-header
" --- The Detailed Node Listing ---\n"
"String inserted before lower level entries in Texinfo master menu.
It comes after the chapter-level menu entries.")
(defun texinfo-make-menu (&optional region-p) (defun texinfo-make-menu (&optional beginning end)
"Without any prefix argument, make or update a menu. "Without any prefix argument, make or update a menu.
Make the menu for the section enclosing the node found following point. Make the menu for the section enclosing the node found following point.
Non-nil argument (prefix, if interactive) means make or update menus A prefix argument means make or update menus
for nodes within or part of the marked region. for nodes within or part of the marked region.
Whenever a menu exists, and is being updated, the descriptions that Whenever a menu exists, and is being updated, the descriptions that
...@@ -164,21 +166,20 @@ are associated with node names in the pre-existing menu are ...@@ -164,21 +166,20 @@ are associated with node names in the pre-existing menu are
incorporated into the new menu. Otherwise, the nodes' section titles incorporated into the new menu. Otherwise, the nodes' section titles
are inserted as descriptions." are inserted as descriptions."
(interactive "P") (interactive
(if (not region-p) (if prefix-arg
(list (point) (mark))))
(if (null beginning)
(let ((level (texinfo-hierarchic-level))) (let ((level (texinfo-hierarchic-level)))
(texinfo-make-one-menu level) (texinfo-make-one-menu level)
(message "Done...updated the menu. You may save the buffer.")) (message "Menu updated"))
;; else ;; else
(message "Making or updating menus in %s... " (buffer-name)) (message "Making or updating menus in %s... " (buffer-name))
(let ((beginning (region-beginning))
(region-end (region-end))
(level (progn ; find section type following point
(goto-char (region-beginning))
(texinfo-hierarchic-level))))
(if (= region-end beginning)
(error "Please mark a region!"))
(save-excursion (save-excursion
(goto-char (min beginning end))
;; find section type following point
(let ((level (texinfo-hierarchic-level))
(region-end (max beginning end)))
(save-restriction (save-restriction
(widen) (widen)
...@@ -192,7 +193,7 @@ are inserted as descriptions." ...@@ -192,7 +193,7 @@ are inserted as descriptions."
(while (texinfo-find-lower-level-node level region-end) (while (texinfo-find-lower-level-node level region-end)
(setq level (texinfo-hierarchic-level)) ; new, lower level (setq level (texinfo-hierarchic-level)) ; new, lower level
(texinfo-make-one-menu level)))))) (texinfo-make-one-menu level))))))
(message "Done...updated menus. You may save the buffer."))) (message "Making or updating menus in %s...done" (buffer-name))))
(defun texinfo-make-one-menu (level) (defun texinfo-make-one-menu (level)
"Make a menu of all the appropriate nodes in this section. "Make a menu of all the appropriate nodes in this section.
...@@ -233,9 +234,14 @@ nodes in the buffer before updating the menus." ...@@ -233,9 +234,14 @@ nodes in the buffer before updating the menus."
(goto-char (point-min)) (goto-char (point-min))
(message "Checking for a master menu in %s ... "(buffer-name)) (message "Checking for a master menu in %s ... "(buffer-name))
(save-excursion (save-excursion
(if (re-search-forward texinfo-master-menu-header nil t) (if (search-forward texinfo-master-menu-header nil t)
;; Remove detailed master menu listing
(progn (progn
;; Check if @detailmenu kludge is used;
;; if so, leave point before @detailmenu.
(search-backward "\n@detailmenu"
(save-excursion (forward-line -3) (point))
t)
;; Remove detailed master menu listing
(setq master-menu-p t) (setq master-menu-p t)
(goto-char (match-beginning 0)) (goto-char (match-beginning 0))
(let ((end-of-detailed-menu-descriptions (let ((end-of-detailed-menu-descriptions
...@@ -249,21 +255,11 @@ nodes in the buffer before updating the menus." ...@@ -249,21 +255,11 @@ nodes in the buffer before updating the menus."
(progn (progn
(message "Updating all nodes in %s ... " (buffer-name)) (message "Updating all nodes in %s ... " (buffer-name))
(sleep-for 2) (sleep-for 2)
(push-mark (point-max) t) (texinfo-update-node (point-min) (point-max))))
(goto-char (point-min))
;; Using the mark to pass bounds this way
;; is kludgy, but it's not worth fixing. -- rms.
(let ((mark-active t))
(texinfo-update-node t))))
(message "Updating all menus in %s ... " (buffer-name)) (message "Updating all menus in %s ... " (buffer-name))
(sleep-for 2) (sleep-for 2)
(push-mark (point-max) t) (texinfo-make-menu (point-max) (point-min))
(goto-char (point-min))
;; Using the mark to pass bounds this way
;; is kludgy, but it's not worth fixing. -- rms.
(let ((mark-active t))
(texinfo-make-menu t))
(if master-menu-p (if master-menu-p
(progn (progn
...@@ -438,7 +434,7 @@ old description into the new entry. ...@@ -438,7 +434,7 @@ old description into the new entry.
For this function, the new menu is a list made up of lists of dotted For this function, the new menu is a list made up of lists of dotted
pairs in which the first element of the pair is the node name and the pairs in which the first element of the pair is the node name and the
second element the description. The new menu is changed destructively. second element the description. The new menu is changed destructively.
The old menu is the menu as it appears in the texinfo file." The old menu is the menu as it appears in the Texinfo file."
(let ((new-menu-list-pointer new-menu-list) (let ((new-menu-list-pointer new-menu-list)
(end-of-menu (texinfo-menu-end))) (end-of-menu (texinfo-menu-end)))
...@@ -452,9 +448,9 @@ The old menu is the menu as it appears in the texinfo file." ...@@ -452,9 +448,9 @@ The old menu is the menu as it appears in the texinfo file."
;; ;;
;; Recognize both when looking for the description. ;; Recognize both when looking for the description.
(concat "\\* \\(" ; so only menu entries are found (concat "\\* \\(" ; so only menu entries are found
(car (car new-menu-list)) "::" (regexp-quote (car (car new-menu-list))) "::"
"\\|" "\\|"
".*: " (car (car new-menu-list)) "[.,\t\n]" ".*: " (regexp-quote (car (car new-menu-list))) "[.,\t\n]"
"\\)" "\\)"
) ; so only complete entries are found ) ; so only complete entries are found
end-of-menu end-of-menu
...@@ -525,7 +521,7 @@ Single argument, END-OF-MENU, is position limiting search." ...@@ -525,7 +521,7 @@ Single argument, END-OF-MENU, is position limiting search."
"")) ""))
(defun texinfo-menu-end () (defun texinfo-menu-end ()
"Return position of end of menu. Does not change location of point. "Return position of end of menu, but don't move point.
Signal an error if not end of menu." Signal an error if not end of menu."
(save-excursion (save-excursion
(if (re-search-forward "^@end menu" nil t) (if (re-search-forward "^@end menu" nil t)
...@@ -784,9 +780,14 @@ title of the section containing the menu." ...@@ -784,9 +780,14 @@ title of the section containing the menu."
(or (re-search-forward "^@node" nil t) (or (re-search-forward "^@node" nil t)
(error "Too few nodes for a master menu!")) (error "Too few nodes for a master menu!"))
(point)))) (point))))
(if (re-search-forward texinfo-master-menu-header first-chapter t) (if (search-forward texinfo-master-menu-header first-chapter t)
;; Remove detailed master menu listing
(progn (progn
;; Check if @detailmenu kludge is used;
;; if so, leave point before @detailmenu.
(search-backward "\n@detailmenu"
(save-excursion (forward-line -3) (point))
t)
;; Remove detailed master menu listing
(goto-char (match-beginning 0)) (goto-char (match-beginning 0))
(let ((end-of-detailed-menu-descriptions (let ((end-of-detailed-menu-descriptions
(save-excursion ; beginning of end menu line (save-excursion ; beginning of end menu line
...@@ -800,15 +801,11 @@ title of the section containing the menu." ...@@ -800,15 +801,11 @@ title of the section containing the menu."
(message "Making a master menu in %s ...first updating all nodes... " (message "Making a master menu in %s ...first updating all nodes... "
(buffer-name)) (buffer-name))
(sleep-for 2) (sleep-for 2)
(push-mark (point-max) t) (texinfo-update-node (point-min) (point-max))
(goto-char (point-min))
(texinfo-update-node t)
(message "Updating all menus in %s ... " (buffer-name)) (message "Updating all menus in %s ... " (buffer-name))
(sleep-for 2) (sleep-for 2)
(push-mark (point-max) t) (texinfo-make-menu (point-min) (point-max))))
(goto-char (point-min))
(texinfo-make-menu t)))
(message "Now making the master menu in %s... " (buffer-name)) (message "Now making the master menu in %s... " (buffer-name))
(sleep-for 2) (sleep-for 2)
...@@ -822,9 +819,14 @@ title of the section containing the menu." ...@@ -822,9 +819,14 @@ title of the section containing the menu."
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(if (re-search-forward texinfo-master-menu-header nil t) (if (search-forward texinfo-master-menu-header nil t)
(progn (progn
(goto-char (match-beginning 0)) (goto-char (match-beginning 0))
;; Check if @detailmenu kludge is used;
;; if so, leave point before @detailmenu.
(search-backward "\n@detailmenu"
(save-excursion (forward-line -3) (point))
t)
(insert "\n") (insert "\n")
(delete-blank-lines) (delete-blank-lines)
(goto-char (point-min)))) (goto-char (point-min))))
...@@ -880,7 +882,10 @@ However, there does not need to be a title field." ...@@ -880,7 +882,10 @@ However, there does not need to be a title field."
(point) (point)
(save-excursion (re-search-forward "^@end menu") (point))) (save-excursion (re-search-forward "^@end menu") (point)))
(save-excursion ; leave point at beginning of menu (save-excursion
;; `master-menu-inserted-p' is a kludge to tell
;; whether to insert @end detailmenu (see bleow)
(let (master-menu-inserted-p)
;; Handle top of menu ;; Handle top of menu
(insert "\n@menu\n") (insert "\n@menu\n")
;; Insert chapter menu entries ;; Insert chapter menu entries
...@@ -895,13 +900,16 @@ However, there does not need to be a title field." ...@@ -895,13 +900,16 @@ However, there does not need to be a title field."
;; Only insert detailed master menu if there is one.... ;; Only insert detailed master menu if there is one....
(if (car (car master-menu-list)) (if (car (car master-menu-list))
;; @detailmenu added 5 Sept 1996 at Karl Berry's request to avert a (progn (setq master-menu-inserted-p t)
;; bug in `makeinfo'; all agree this is a bad kluge and should (insert (concat "\n@detailmenu" texinfo-master-menu-header))))
;; eventually be removed. @detailmenu ... @end detailmenu is a noop
;; in `texinfmt.el' See @end detailmenu below ;; @detailmenu added 5 Sept 1996 to `texinfo-master-menu-header'
;; also see `texinfo-all-menus-update' above, `texinfo-master-menu', ;; at Karl Berry's request to avert a bug in `makeinfo';
;; `texinfo-multiple-files-update' ;; all agree this is a bad kludge and should eventually be removed.
(insert texinfo-master-menu-header)) ;; @detailmenu ... @end detailmenu is a noop in `texinfmt.el'.
;; See @end detailmenu below;
;; also see `texinfo-all-menus-update' above, `texinfo-master-menu',
;; `texinfo-multiple-files-update'.
;; Now, insert all the other menus ;; Now, insert all the other menus
...@@ -925,14 +933,12 @@ However, there does not need to be a title field." ...@@ -925,14 +933,12 @@ However, there does not need to be a title field."
(setq master-menu-list (cdr master-menu-list))) (setq master-menu-list (cdr master-menu-list)))
;; Finish menu ;; Finish menu
;; @detailmenu (see note above)
(insert "\n@end detailmenu")
(insert "\n@end menu\n\n")))
(defvar texinfo-master-menu-header ;; @detailmenu (see note above)
"\n@detailmenu\n --- The Detailed Node Listing ---\n" ;; Only insert @end detailmenu if a master menu was inserted.
"String inserted before lower level entries in Texinfo master menu. (if master-menu-inserted-p
It comes after the chapter-level menu entries.") (insert "\n@end detailmenu"))
(insert "\n@end menu\n\n"))))
(defun texinfo-locate-menu-p () (defun texinfo-locate-menu-p ()
"Find the next menu in the texinfo file. "Find the next menu in the texinfo file.
...@@ -1236,15 +1242,14 @@ document; the values are regular expressions.") ...@@ -1236,15 +1242,14 @@ document; the values are regular expressions.")
;;; Updating a node ;;; Updating a node
;;;###autoload ;;;###autoload
(defun texinfo-update-node (&optional region-p) (defun texinfo-update-node (&optional beginning end)
"Without any prefix argument, update the node in which point is located. "Without any prefix argument, update the node in which point is located.
Non-nil argument (prefix, if interactive) means update the nodes in the Interactively, a prefix argument means to operate on the region.
marked region.
The functions for creating or updating nodes and menus, and their The functions for creating or updating nodes and menus, and their
keybindings, are: keybindings, are:
texinfo-update-node (&optional region-p) \\[texinfo-update-node] texinfo-update-node (&optional beginning end) \\[texinfo-update-node]
texinfo-every-node-update () \\[texinfo-every-node-update] texinfo-every-node-update () \\[texinfo-every-node-update]
texinfo-sequential-node-update (&optional region-p) texinfo-sequential-node-update (&optional region-p)
...@@ -1257,41 +1262,35 @@ keybindings, are: ...@@ -1257,41 +1262,35 @@ keybindings, are:
The `texinfo-column-for-description' variable specifies the column to The `texinfo-column-for-description' variable specifies the column to
which menu descriptions are indented. Its default value is 32." which menu descriptions are indented. Its default value is 32."
(interactive "P") (interactive
(if (not region-p) (if prefix-arg
;; update a single node (list (point) (mark))))
(if (null beginning)
;; Update a single node.
(let ((auto-fill-function nil) (auto-fill-hook nil)) (let ((auto-fill-function nil) (auto-fill-hook nil))
(if (not (re-search-backward "^@node" (point-min) t)) (if (not (re-search-backward "^@node" (point-min) t))
(error "Node line not found before this position.")) (error "Node line not found before this position"))
(texinfo-update-the-node) (texinfo-update-the-node)
(message "Done...updated the node. You may save the buffer.")) (message "Done...updated the node. You may save the buffer."))
;; else ;; else
(let ((auto-fill-function nil) (let ((auto-fill-function nil)
(auto-fill-hook nil) (auto-fill-hook nil))
(beginning (region-beginning)) (save-excursion
(end (region-end)))
(if (= end beginning)
(error "Please mark a region!"))
(save-restriction (save-restriction
(narrow-to-region beginning end) (narrow-to-region beginning end)
(goto-char beginning) (goto-char (point-min))
(push-mark (point) t)
(while (re-search-forward "^@node" (point-max) t) (while (re-search-forward "^@node" (point-max) t)
(beginning-of-line) (beginning-of-line)
(texinfo-update-the-node)) (texinfo-update-the-node))
(message "Done...updated nodes in region. You may save the buffer."))))) (goto-char (point-max))
(message "Done...nodes updated in region. You may save the buffer."))))))
;;;###autoload ;;;###autoload
(defun texinfo-every-node-update () (defun texinfo-every-node-update ()
"Update every node in a Texinfo file." "Update every node in a Texinfo file."
(interactive) (interactive)
(save-excursion (save-excursion
(push-mark (point-max) t) (texinfo-update-node (point-min) (point-max))
(goto-char (point-min))
;; Using the mark to pass bounds this way
;; is kludgy, but it's not worth fixing. -- rms.
(let ((mark-active t))
(texinfo-update-node t))
(message "Done...updated every node. You may save the buffer."))) (message "Done...updated every node. You may save the buffer.")))
(defun texinfo-update-the-node () (defun texinfo-update-the-node ()
...@@ -1366,7 +1365,7 @@ line, including the comma. Leaves point at beginning of line." ...@@ -1366,7 +1365,7 @@ line, including the comma. Leaves point at beginning of line."
(defun texinfo-find-pointer (beginning end level direction) (defun texinfo-find-pointer (beginning end level direction)
"Move point to section associated with next, previous, or up pointer. "Move point to section associated with next, previous, or up pointer.
Return type of pointer (either 'normal or 'no-pointer). Return type of pointer (either `normal' or `no-pointer').
The first and second arguments bound the search for a pointer to the The first and second arguments bound the search for a pointer to the
beginning and end, respectively, of the enclosing higher level beginning and end, respectively, of the enclosing higher level
...@@ -1447,7 +1446,7 @@ will be at some level higher in the Texinfo file. The fourth argument ...@@ -1447,7 +1446,7 @@ will be at some level higher in the Texinfo file. The fourth argument
(defun texinfo-pointer-name (kind) (defun texinfo-pointer-name (kind)
"Return the node name preceding the section command. "Return the node name preceding the section command.
The argument is the kind of section, either normal or no-pointer." The argument is the kind of section, either `normal' or `no-pointer'."
(let (name) (let (name)
(cond ((eq kind 'normal) (cond ((eq kind 'normal)
(end-of-line) ; this handles prev node top case (end-of-line) ; this handles prev node top case
...@@ -1457,6 +1456,8 @@ The argument is the kind of section, either normal or no-pointer." ...@@ -1457,6 +1456,8 @@ The argument is the kind of section, either normal or no-pointer."
t) t)
(setq name (texinfo-copy-node-name))) (setq name (texinfo-copy-node-name)))
((eq kind 'no-pointer) ((eq kind 'no-pointer)
;; Don't need to put a blank in the pointer slot,
;; since insert "' " always has a space
(setq name " "))) ; put a blank in the pointer slot (setq name " "))) ; put a blank in the pointer slot
name)) name))
...@@ -1468,8 +1469,7 @@ The first and second arguments bound the search for a pointer to the ...@@ -1468,8 +1469,7 @@ The first and second arguments bound the search for a pointer to the
beginning and end, respectively, of the enclosing higher level beginning and end, respectively, of the enclosing higher level
section. The third argument is the hierarchical level of the Texinfo section. The third argument is the hierarchical level of the Texinfo
file, a string such as \"section\". The fourth argument is direction file, a string such as \"section\". The fourth argument is direction
towards which the pointer is directed, one of `next, `previous, or towards which the pointer is directed, one of `next', `previous', or `up'."
'up."
(end-of-line) (end-of-line)
(insert (insert
...@@ -1565,13 +1565,13 @@ regardless of its hierarchical level." ...@@ -1565,13 +1565,13 @@ regardless of its hierarchical level."
Move point to section associated with the pointer. Find point even if Move point to section associated with the pointer. Find point even if
it is in a different section. it is in a different section.
Return type of pointer (either 'normal or 'no-pointer). Return type of pointer (either `normal' or `no-pointer').
The first argument is a string specifying the general kind of section The first argument is a string specifying the general kind of section
such as \"chapter\" or \"section\". The section found will be at the such as \"chapter\" or \"section\". The section found will be at the
same hierarchical level in the Texinfo file, or, in the case of the up same hierarchical level in the Texinfo file, or, in the case of the up
pointer, some level higher. The second argument (one of 'next, pointer, some level higher. The second argument (one of `next',
'previous, or 'up) specifies whether to find the `Next', `Previous', `previous', or `up') specifies whether to find the `Next', `Previous',
or `Up' pointer." or `Up' pointer."
(let ((case-fold-search t)) (let ((case-fold-search t))
(cond ((eq direction 'next) (cond ((eq direction 'next)
...@@ -1605,7 +1605,7 @@ Move point forward. ...@@ -1605,7 +1605,7 @@ Move point forward.
The first argument is the hierarchical level of the Texinfo file, a The first argument is the hierarchical level of the Texinfo file, a
string such as \"section\". The second argument is direction, one of string such as \"section\". The second argument is direction, one of
`next, `previous, or 'up." `next', `previous', or `up'."
(end-of-line) (end-of-line)
(insert (insert
...@@ -1624,7 +1624,7 @@ string such as \"section\". The second argument is direction, one of ...@@ -1624,7 +1624,7 @@ string such as \"section\". The second argument is direction, one of
"Insert missing `@node' lines in region of Texinfo file. "Insert missing `@node' lines in region of Texinfo file.
Non-nil argument (prefix, if interactive) means also to insert the Non-nil argument (prefix, if interactive) means also to insert the
section titles as node names; and also to insert the section titles as section titles as node names; and also to insert the section titles as
node names in pre-existing @node lines that lack names." node names in pre-existing `@node' lines that lack names."
(interactive "r\nP") (interactive "r\nP")
;; Use marker; after inserting node lines, leave point at end of ;; Use marker; after inserting node lines, leave point at end of
...@@ -1785,8 +1785,7 @@ Requirements: ...@@ -1785,8 +1785,7 @@ Requirements:
* this node must be the first node in the included file, * this node must be the first node in the included file,
* each highest hierarchical level node must be of the same type. * each highest hierarchical level node must be of the same type.
Thus, normally, each included file contains one, and only one, Thus, normally, each included file contains one, and only one, chapter."
chapter."
;; The menu-list has the form: ;; The menu-list has the form:
;; ;;
...@@ -1879,7 +1878,7 @@ chapter." ...@@ -1879,7 +1878,7 @@ chapter."
(defun texinfo-multi-files-insert-main-menu (menu-list) (defun texinfo-multi-files-insert-main-menu (menu-list)
"Insert formatted main menu at point. "Insert formatted main menu at point.
Indents the first line of the description, if any, to the value of Indents the first line of the description, if any, to the value of
texinfo-column-for-description." `texinfo-column-for-description'."
(insert "@menu\n") (insert "@menu\n")
(while menu-list (while menu-list
...@@ -2019,10 +2018,15 @@ chapter." ...@@ -2019,10 +2018,15 @@ chapter."
(progn (progn
;; First, removing detailed part of any pre-existing master menu ;; First, removing detailed part of any pre-existing master menu
(goto-char (point-min)) (goto-char (point-min))
(if (re-search-forward texinfo-master-menu-header nil t) (if (search-forward texinfo-master-menu-header nil t)
;; Remove detailed master menu listing
(progn (progn
(goto-char (match-beginning 0)) (goto-char (match-beginning 0))
;; Check if @detailmenu kludge is used;
;; if so, leave point before @detailmenu.
(search-backward "\n@detailmenu"
(save-excursion (forward-line -3) (point))
t)
;; Remove detailed master menu listing
(let ((end-of-detailed-menu-descriptions (let ((end-of-detailed-menu-descriptions
(save-excursion ; beginning of end menu line (save-excursion ; beginning of end menu line
(goto-char (texinfo-menu-end)) (goto-char (texinfo-menu-end))
......
# Makefile for texinfo/info. -*- Indented-Text -*- # Makefile.in generated automatically by automake 1.2 from Makefile.am
# $Id: Makefile.in,v 1.1 1997/08/21 22:57:59 jason Exp $
#
# Copyright (C) 1993,96 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful, # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# but WITHOUT ANY WARRANTY; without even the implied warranty of # This Makefile.in is free software; the Free Software Foundation
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # gives unlimited permission to copy, distribute and modify it.
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#### Start of system configuration section. #### SHELL = /bin/sh
srcdir = @srcdir@ srcdir = @srcdir@
VPATH = $(srcdir):$(common) top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
common = $(srcdir)/../libtxi bindir = @bindir@
util = $(srcdir)/../util sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
EXEEXT = @EXEEXT@ pkgdatadir = $(datadir)/@PACKAGE@
CC = @CC@ pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
NORMAL_INSTALL = true
PRE_INSTALL = true
POST_INSTALL = true
NORMAL_UNINSTALL = true
PRE_UNINSTALL = true
POST_UNINSTALL = true
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
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@
noinst_PROGRAMS = makedoc
# Use `ginfo' for building to avoid confusion with the standard `info'
# target. The install rule removes the `g' before applying any
# user-specified name transformations.
bin_PROGRAMS = ginfo
transform = s/ginfo/info/; @program_transform_name@
localedir = $(datadir)/locale
# -I. for funs.h.
INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
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
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
bin_PROGRAMS = ginfo$(EXEEXT)
noinst_PROGRAMS = makedoc$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
ginfo_OBJECTS = dir.o display.o doc.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
ginfo_LDADD = $(LDADD)
ginfo_DEPENDENCIES = ../lib/libtxi.a
ginfo_LDFLAGS =
makedoc_OBJECTS = makedoc.o
makedoc_LDADD = $(LDADD)
makedoc_DEPENDENCIES = ../lib/libtxi.a
makedoc_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = README Makefile.am Makefile.in
LN = ln
RM = rm -f
MKDIR = mkdir
MAKEINFO= ../makeinfo/makeinfo$(EXEEXT)
DEFS = @DEFS@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
LDEFS = -DHANDLE_MAN_PAGES -DNAMED_FUNCTIONS=1 -DDEFAULT_INFOPATH='"$(DEFAULT_INFOPATH)"' TAR = tar
GZIP = --best
SOURCES = $(ginfo_SOURCES) $(makedoc_SOURCES)
OBJECTS = $(ginfo_OBJECTS) $(makedoc_OBJECTS)
TERMLIBS = @TERMLIBS@ default: all
LIBS = $(TERMLIBS) -L../libtxi -ltxi @LIBS@
LOADLIBES = $(LIBS)
SHELL = /bin/sh .SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus info/Makefile
CFLAGS = @CFLAGS@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
LDFLAGS = @LDFLAGS@ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
# Prefix for each installed program, normally empty or `g'.
binprefix =
# Prefix for each installed man page, normally empty or `g'.
manprefix =
mandir = @mandir@/man1
manext = 1
infodir = @infodir@
DEFAULT_INFOPATH= $(infodir):.
#### End of system configuration section. #### mostlyclean-binPROGRAMS:
clean-binPROGRAMS:
test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
SRCS = dir.c display.c echo_area.c filesys.c \ distclean-binPROGRAMS:
info-utils.c info.c infodoc.c infomap.c \
m-x.c nodes.c search.c session.c \
signals.c terminal.c tilde.c window.c \
xmalloc.c indices.c makedoc.c nodemenu.c \
footnotes.c dribble.c variables.c gc.c man.c \
clib.c
HDRS = display.h doc.h echo_area.h filesys.h \ maintainer-clean-binPROGRAMS:
general.h getopt.h info-utils.h info.h \
infomap.h nodes.h search.h session.h \
signals.h termdep.h terminal.h tilde.h \
indices.h window.h footnotes.h dribble.h \
variables.h gc.h clib.h
OBJS = dir.o display.o doc.o echo_area.o filesys.o info-utils.o info.o \ install-binPROGRAMS: $(bin_PROGRAMS)
infodoc.o infomap.o m-x.o nodes.o search.o session.o signals.o \ @$(NORMAL_INSTALL)
terminal.o tilde.o window.o indices.o xmalloc.o nodemenu.o \ $(mkinstalldirs) $(bindir)
footnotes.o dribble.o variables.o gc.o man.o clib.o @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)'`; \
else :; fi; \
done
# The names of files which declare info commands. uninstall-binPROGRAMS:
CMDFILES = $(srcdir)/session.c $(srcdir)/echo_area.c $(srcdir)/infodoc.c \ $(NORMAL_UNINSTALL)
$(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \ list='$(bin_PROGRAMS)'; for p in $$list; do \
$(srcdir)/footnotes.c $(srcdir)/variables.c rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
done
# The name of the program which builds documentation structure from CMDFILES. mostlyclean-noinstPROGRAMS:
MAKEDOC_OBJECTS = makedoc.o clib.o xmalloc.o
MAKEDOC_SOURCE = makedoc.c clib.c xmalloc.c
infofiles = info.info info-stnd.info clean-noinstPROGRAMS:
test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(LDEFS) $(DEFS) -I. -I$(srcdir) -I$(common) $(CFLAGS) $< $(COMPILE) -c $<
all: info$(EXEEXT) $(infofiles) mostlyclean-compile:
sub-all: all rm -f *.o core
dvi: all-dvi clean-compile:
install: all distclean-compile:
$(INSTALL_PROGRAM) info$(EXEEXT) $(bindir)/$(binprefix)info$(EXEEXT) rm -f *.tab.c
-$(INSTALL_DATA) $(srcdir)/info.1 $(mandir)/$(manprefix)info.$(manext)
$(POST_INSTALL)
install-info: maintainer-clean-compile:
-d=$(srcdir); test -f ./info.info && d=.; $(INSTALL_DATA) $$d/info.info $(infodir)/info.info
-d=$(srcdir); test -f ./info-stnd.info && d=.; $(INSTALL_DATA) $$d/info-stnd.info $(infodir)/info-stnd.info ginfo$(EXEEXT): $(ginfo_OBJECTS) $(ginfo_DEPENDENCIES)
../util/install-info --info-dir=$(infodir) $(infodir)/info.info @rm -f ginfo$(EXEEXT)
../util/install-info --info-dir=$(infodir) $(infodir)/info-stnd.info $(LINK) $(ginfo_LDFLAGS) $(ginfo_OBJECTS) $(ginfo_LDADD) $(LIBS)
makedoc$(EXEEXT): $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
@rm -f makedoc$(EXEEXT)
$(LINK) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) $(LIBS)
tags: TAGS
ID: $(HEADERS) $(SOURCES)
here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
tags=; \
here=`pwd`; \
test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS)
uninstall: mostlyclean-tags:
$(RM) $(bindir)/info$(EXEEXT)
$(RM) $(infodir)/info.info
$(RM) $(infodir)/info-stnd.info
$(RM) $(mandir)/$(manprefix)info.$(manext)
info$(EXEEXT): $(OBJS) ../libtxi/libtxi.a clean-tags:
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LOADLIBES)
all-info: info.info info-stnd.info distclean-tags:
rm -f TAGS ID
info.info: info.texi maintainer-clean-tags:
$(MAKEINFO) --no-split -I$(srcdir) info.texi
info-stnd.info: info-stnd.texi distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
$(MAKEINFO) --no-split -I$(srcdir) info-stnd.texi
dvi all-dvi: info.dvi info-stnd.dvi subdir = info
info.dvi: info.texi
PATH="$(util):$${PATH}" TEXINPUTS="$(srcdir):$(common):$${TEXINPUTS}" texi2dvi $(srcdir)/info.texi
info-stnd.dvi: info-stnd.texi distdir: $(DISTFILES)
PATH="$(util):$${PATH}" TEXINPUTS="$(srcdir):$(common):$${TEXINPUTS}" texi2dvi $(srcdir)/info-stnd.texi @for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
info:
dvi:
check: all
$(MAKE)
installcheck:
install-info:
install-exec: install-binPROGRAMS
@$(NORMAL_INSTALL)
install-data:
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-binPROGRAMS
all: Makefile $(PROGRAMS)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(bindir)
makedoc$(EXEEXT): $(MAKEDOC_OBJECTS) ../libtxi/libtxi.a
$(CC) $(LDFLAGS) -o $@ $(MAKEDOC_OBJECTS) $(LOADLIBES)
Makefile: $(srcdir)/Makefile.in ../config.status mostlyclean-generic:
cd ..; $(SHELL) config.status test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean: clean-generic:
$(RM) info$(EXEEXT) funs.h doc.c makedoc$(EXEEXT) $(OBJS) $(MAKEDOC_OBJECTS) test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean: clean texclean distclean-generic:
$(RM) Makefile config.status config.cache *~ core core.* *.core rm -f Makefile $(DISTCLEANFILES)
$(RM) *.BAK makedoc-TAGS TAGS \#* *.info* rm -f config.cache config.log stamp-h stamp-h[0-9]*
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
mostlyclean: clean maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
mostlyclean-compile mostlyclean-tags \
mostlyclean-generic
realclean: distclean clean: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile clean-tags \
$(RM) info.info info-stnd.info clean-generic mostlyclean
TAGS: $(SRCS) makedoc-TAGS distclean: distclean-binPROGRAMS distclean-noinstPROGRAMS \
etags $(SRCS) distclean-compile distclean-tags distclean-generic \
cat makedoc-TAGS >>TAGS && $(RM) makedoc-TAGS clean
rm -f config.status
makedoc-TAGS: $(CMDFILES) maintainer-clean: maintainer-clean-binPROGRAMS \
./makedoc -tags $(CMDFILES) >makedoc-TAGS maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-generic distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
texclean: .PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
$(RM) *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky *.cps clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
$(RM) *.tps *.fns *.kys *.pgs *.vrs 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-info install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
check: info
# The files `doc.c' and `funs.h' are created by ./makedoc run over the source # 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 # files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
# listing the functions found. `doc.c' is a structure containing pointers # listing the functions found. `doc.c' is a structure containing pointers
# to those functions along with completable names and documentation strings. # to those functions along with completable names and documentation strings.
funs.h: makedoc$(EXEEXT) $(CMDFILES) #
-@if test -f funs.h; then mv -f funs.h old-funs.h; fi; : # I do not know how to get this right.
-@if test -f doc.c; then mv -f doc.c old-doc.c; fi; : # BUILT_SOURCES = doc.c funs.h
./makedoc$(EXEEXT) $(CMDFILES) #
-@if cmp -s old-funs.h funs.h; then mv old-funs.h funs.h; \ #cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
else $(RM) old-funs.h; fi; : # $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
-@if cmp -s old-doc.c doc.c; then mv old-doc.c doc.c; \ # $(srcdir)/footnotes.c $(srcdir)/variables.c
else $(RM) old-doc.c; fi; : #
#$(BUILTSOURCES): makedoc $(cmd_sources)
doc.c: funs.h # ./makedoc $(cmd_sources)
dribble.o: dribble.c dribble.h
display.o: display.c
echo_area.o: echo_area.c
filesys.o: filesys.c
info-utils.o: info-utils.c
info.o: info.c filesys.h
infodoc.o: infodoc.c
infomap.o: infomap.c
m-x.o: m-x.c
nodes.o: nodes.c
search.o: search.c
session.o: session.c
signals.o: signals.c
terminal.o: terminal.c
tilde.o: tilde.c
window.o: window.c
xmalloc.o: xmalloc.c
indices.o: indices.c
makedoc.o: makedoc.c
dir.o: dir.c
display.o: nodes.h info-utils.h search.h
display.o: terminal.h window.h display.h
echo_area.o: info.h
filesys.o: general.h tilde.h filesys.h
footnotes.o: footnotes.h
info-utils.o: info-utils.h nodes.h search.h
info.o: info.h $(common)/getopt.h
infodoc.o: info.h doc.h
infomap.o: infomap.h funs.h
gc.o: info.h
m-x.o: info.h
nodes.o: search.h filesys.h
nodes.o: nodes.h info-utils.h
search.o: general.h search.h nodes.h
session.o: info.h
signals.o: info.h signals.h
terminal.o: terminal.h termdep.h
tilde.o: tilde.h
variables.c: variables.h
window.o: nodes.h window.h display.h
window.o: info-utils.h search.h infomap.h
# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
# eof # 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:
The file NEWS contains information about what has changed since the last
release.
The file ../INSTALL contains instructions on how to install Info.
Info 2.0 is a complete rewrite of the original standalone Info I wrote in Info 2.0 is a complete rewrite of the original standalone Info I wrote in
1987, the first program I wrote for rms. That program was something like 1987, the first program I wrote for rms. That program was something like
my second Unix program ever, and my die-hard machine language coding habits my second Unix program ever, and my die-hard machine language coding habits
......
/* dir.c -- How to build a special "dir" node from "localdir" files. */ /* dir.c -- How to build a special "dir" node from "localdir" files.
$Id: dir.c,v 1.6 1997/07/27 21:09:20 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,13 +19,7 @@ ...@@ -21,13 +19,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include <sys/types.h>
#include <sys/stat.h>
#if defined (HAVE_SYS_FILE_H)
#include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#include <sys/errno.h>
#include "info-utils.h" #include "info-utils.h"
#include "filesys.h" #include "filesys.h"
#include "tilde.h" #include "tilde.h"
...@@ -37,23 +29,53 @@ ...@@ -37,23 +29,53 @@
dirs_to_add which are found in INFOPATH. */ dirs_to_add which are found in INFOPATH. */
static void add_menu_to_file_buffer (), insert_text_into_fb_at_binding (); static void add_menu_to_file_buffer (), insert_text_into_fb_at_binding ();
static void build_dir_node_internal ();
static char *dirs_to_add[] = { static char *dirs_to_add[] = {
"dir", "localdir", (char *)NULL "dir", "localdir", (char *)NULL
}; };
/* Return zero if the file represented in the stat structure TEST has
already been seen, nonzero else. */
typedef struct
{
unsigned long device;
unsigned long inode;
} dir_file_list_entry_type;
static int
new_dir_file_p (test)
struct stat *test;
{
static unsigned dir_file_list_len = 0;
static dir_file_list_entry_type *dir_file_list = NULL;
unsigned i;
for (i = 0; i < dir_file_list_len; i++)
{
dir_file_list_entry_type entry;
entry = dir_file_list[i];
if (entry.device == test->st_dev && entry.inode == test->st_ino)
return 0;
}
dir_file_list_len++;
dir_file_list = xrealloc (dir_file_list,
dir_file_list_len * sizeof (dir_file_list_entry_type));
dir_file_list[dir_file_list_len - 1].device = test->st_dev;
dir_file_list[dir_file_list_len - 1].inode = test->st_ino;
return 1;
}
void void
maybe_build_dir_node (dirname) maybe_build_dir_node (dirname)
char *dirname; char *dirname;
{ {
FILE_BUFFER *dir_buffer;
int path_index, update_tags; int path_index, update_tags;
char *this_dir; char *this_dir;
FILE_BUFFER *dir_buffer = info_find_file (dirname);
/* Check to see if the file has already been built. If so, then
do not build it again. */
dir_buffer = info_find_file (dirname);
/* If there is no "dir" in the current info path, we cannot build one /* If there is no "dir" in the current info path, we cannot build one
from nothing. */ from nothing. */
...@@ -64,6 +86,10 @@ maybe_build_dir_node (dirname) ...@@ -64,6 +86,10 @@ maybe_build_dir_node (dirname)
if (dir_buffer->flags & N_CannotGC) if (dir_buffer->flags & N_CannotGC)
return; return;
/* Initialize the list we use to avoid reading the same dir file twice
with the dir file just found. */
new_dir_file_p (&dir_buffer->finfo);
path_index = update_tags = 0; path_index = update_tags = 0;
/* Using each element of the path, check for one of the files in /* Using each element of the path, check for one of the files in
...@@ -71,7 +97,7 @@ maybe_build_dir_node (dirname) ...@@ -71,7 +97,7 @@ maybe_build_dir_node (dirname)
Only files explictly named are eligible. This is a design decision. Only files explictly named are eligible. This is a design decision.
There can be an info file name "localdir.info" which contains There can be an info file name "localdir.info" which contains
information on the setting up of "localdir" files. */ information on the setting up of "localdir" files. */
while (this_dir = extract_colon_unit (infopath, &path_index)) while ((this_dir = extract_colon_unit (infopath, &path_index)))
{ {
register int da_index; register int da_index;
char *from_file; char *from_file;
...@@ -89,17 +115,15 @@ maybe_build_dir_node (dirname) ...@@ -89,17 +115,15 @@ maybe_build_dir_node (dirname)
} }
} }
/* For every file named in DIRS_TO_ADD found in the search path, /* For every different file named in DIRS_TO_ADD found in the
add the contents of that file's menu to our "dir" node. */ search path, add that file's menu to our "dir" node. */
for (da_index = 0; from_file = dirs_to_add[da_index]; da_index++) for (da_index = 0; (from_file = dirs_to_add[da_index]); da_index++)
{ {
struct stat finfo; struct stat finfo;
char *fullpath; int statable;
int namelen, statable; int namelen = strlen (from_file);
char *fullpath = xmalloc (3 + strlen (this_dir) + namelen);
namelen = strlen (from_file);
fullpath = (char *)xmalloc (3 + strlen (this_dir) + namelen);
strcpy (fullpath, this_dir); strcpy (fullpath, this_dir);
if (fullpath[strlen (fullpath) - 1] != '/') if (fullpath[strlen (fullpath) - 1] != '/')
strcat (fullpath, "/"); strcat (fullpath, "/");
...@@ -107,16 +131,12 @@ maybe_build_dir_node (dirname) ...@@ -107,16 +131,12 @@ maybe_build_dir_node (dirname)
statable = (stat (fullpath, &finfo) == 0); statable = (stat (fullpath, &finfo) == 0);
/* Only add the contents of this file if it is not identical to the /* Only add this file if we have not seen it before. */
file of the DIR buffer. */ if (statable && S_ISREG (finfo.st_mode) && new_dir_file_p (&finfo))
if ((statable && S_ISREG (finfo.st_mode)) &&
(strcmp (dir_buffer->fullpath, fullpath) != 0))
{ {
long filesize; long filesize;
char *contents; char *contents = filesys_read_info_file (fullpath, &filesize,
&finfo);
contents = filesys_read_info_file (fullpath, &filesize, &finfo);
if (contents) if (contents)
{ {
update_tags++; update_tags++;
......
/* display.c -- How to display Info windows. */ /* display.c -- How to display Info windows.
$Id: display.c,v 1.6 1997/07/24 21:13:27 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,10 +19,7 @@ ...@@ -21,10 +19,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "display.h" #include "display.h"
extern int info_any_buffered_input_p (); /* Found in session.c. */ extern int info_any_buffered_input_p (); /* Found in session.c. */
...@@ -57,7 +52,7 @@ display_clear_display (display) ...@@ -57,7 +52,7 @@ display_clear_display (display)
register int i; register int i;
register DISPLAY_LINE *display_line; register DISPLAY_LINE *display_line;
for (i = 0; display_line = display[i]; i++) for (i = 0; (display_line = display[i]); i++)
{ {
display[i]->text[0] = '\0'; display[i]->text[0] = '\0';
display[i]->textlen = 0; display[i]->textlen = 0;
...@@ -512,6 +507,7 @@ display_cursor_at_point (window) ...@@ -512,6 +507,7 @@ display_cursor_at_point (window)
vpos = window_line_of_point (window) - window->pagetop + window->first_row; vpos = window_line_of_point (window) - window->pagetop + window->first_row;
hpos = window_get_cursor_column (window); hpos = window_get_cursor_column (window);
terminal_goto_xy (hpos, vpos); terminal_goto_xy (hpos, vpos);
fflush (stdout);
} }
/* **************************************************************** */ /* **************************************************************** */
...@@ -552,7 +548,7 @@ free_display (display) ...@@ -552,7 +548,7 @@ free_display (display)
if (!display) if (!display)
return; return;
for (i = 0; display_line = display[i]; i++) for (i = 0; (display_line = display[i]); i++)
{ {
free (display_line->text); free (display_line->text);
free (display_line); free (display_line);
......
/* display.h -- How the display in Info is done. */ /* display.h -- How the display in Info is done.
$Id: display.h,v 1.2 1997/07/15 18:37:29 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_DISPLAY_H_) #ifndef INFO_DISPLAY_H
#define _DISPLAY_H_ #define INFO_DISPLAY_H
#include "info-utils.h" #include "info-utils.h"
#include "terminal.h" #include "terminal.h"
...@@ -73,4 +74,4 @@ extern void display_scroll_display (); ...@@ -73,4 +74,4 @@ extern void display_scroll_display ();
that appear in the OLD_STARTS array. */ that appear in the OLD_STARTS array. */
extern void display_scroll_line_starts (); extern void display_scroll_line_starts ();
#endif /* !_DISPLAY_H_ */ #endif /* not INFO_DISPLAY_H */
...@@ -21,18 +21,10 @@ ...@@ -21,18 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_DOC_H_) #if !defined (DOC_H)
#define _DOC_H_ #define DOC_H
#if !defined (NULL) #include "info.h" /* for NAMED_FUNCTIONS, VFunction, etc. */
# define NULL 0x0
#endif /* !NULL */
#if !defined (__FUNCTION_DEF)
# define __FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
#endif /* _FUNCTION_DEF */
typedef struct { typedef struct {
VFunction *func; VFunction *func;
...@@ -55,4 +47,4 @@ extern void dump_map_to_message_buffer (); ...@@ -55,4 +47,4 @@ extern void dump_map_to_message_buffer ();
extern char *function_name (); extern char *function_name ();
extern VFunction *named_function (); extern VFunction *named_function ();
#endif /* NAMED_FUNCTIONS */ #endif /* NAMED_FUNCTIONS */
#endif /* !_DOC_H_ */ #endif /* !DOC_H */
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include "dribble.h" #include "dribble.h"
/* When non-zero, it is a stream to write all input characters to for the /* When non-zero, it is a stream to write all input characters to for the
......
/* filesys.c -- File system specific functions for hacking this system. */ /* filesys.c -- File system specific functions for hacking this system.
$Id: filesys.c,v 1.4 1997/07/24 21:23:07 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,49 +19,17 @@ ...@@ -21,49 +19,17 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include <sys/types.h>
#include <sys/stat.h>
#if defined (HAVE_SYS_FILE_H)
#include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#include <sys/errno.h>
#include "general.h"
#include "tilde.h" #include "tilde.h"
#include "filesys.h" #include "filesys.h"
#if !defined (O_RDONLY)
#if defined (HAVE_SYS_FCNTL_H)
#include <sys/fcntl.h>
#else /* !HAVE_SYS_FCNTL_H */
#include <fcntl.h>
#endif /* !HAVE_SYS_FCNTL_H */
#endif /* !O_RDONLY */
#if !defined (errno)
extern int errno;
#endif /* !errno */
/* Found in info-utils.c. */
extern char *filename_non_directory ();
#if !defined (BUILDING_LIBRARY)
/* Found in session.c */
extern int info_windows_initialized_p;
/* Found in window.c. */
extern void message_in_echo_area (), unmessage_in_echo_area ();
#endif /* !BUILDING_LIBRARY */
/* Local to this file. */ /* Local to this file. */
static char *info_file_in_path (), *lookup_info_filename (); static char *info_file_in_path (), *lookup_info_filename ();
static void remember_info_filename (), maybe_initialize_infopath (); static void remember_info_filename (), maybe_initialize_infopath ();
#if !defined (NULL) typedef struct
# define NULL 0x0 {
#endif /* !NULL */
typedef struct {
char *suffix; char *suffix;
char *decompressor; char *decompressor;
} COMPRESSION_ALIST; } COMPRESSION_ALIST;
...@@ -183,7 +149,7 @@ info_file_in_path (filename, path) ...@@ -183,7 +149,7 @@ info_file_in_path (filename, path)
dirname_index = 0; dirname_index = 0;
while (temp_dirname = extract_colon_unit (path, &dirname_index)) while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
{ {
register int i, pre_suffix_length; register int i, pre_suffix_length;
char *temp; char *temp;
...@@ -226,7 +192,7 @@ info_file_in_path (filename, path) ...@@ -226,7 +192,7 @@ info_file_in_path (filename, path)
{ {
char *newpath, *filename_only, *newtemp; char *newpath, *filename_only, *newtemp;
newpath = strdup (temp); newpath = xstrdup (temp);
filename_only = filename_non_directory (filename); filename_only = filename_non_directory (filename);
newtemp = info_file_in_path (filename_only, newpath); newtemp = info_file_in_path (filename_only, newpath);
...@@ -344,8 +310,8 @@ remember_info_filename (filename, expansion) ...@@ -344,8 +310,8 @@ remember_info_filename (filename, expansion)
} }
new = (FILENAME_LIST *)xmalloc (sizeof (FILENAME_LIST)); new = (FILENAME_LIST *)xmalloc (sizeof (FILENAME_LIST));
new->filename = strdup (filename); new->filename = xstrdup (filename);
new->expansion = expansion ? strdup (expansion) : (char *)NULL; new->expansion = expansion ? xstrdup (expansion) : (char *)NULL;
names_and_files[names_and_files_index++] = new; names_and_files[names_and_files_index++] = new;
names_and_files[names_and_files_index] = (FILENAME_LIST *)NULL; names_and_files[names_and_files_index] = (FILENAME_LIST *)NULL;
...@@ -392,7 +358,7 @@ info_add_path (path, where) ...@@ -392,7 +358,7 @@ info_add_path (path, where)
} }
else if (where == INFOPATH_PREPEND) else if (where == INFOPATH_PREPEND)
{ {
char *temp = strdup (infopath); char *temp = xstrdup (infopath);
strcpy (infopath, path); strcpy (infopath, path);
strcat (infopath, ":"); strcat (infopath, ":");
strcat (infopath, temp); strcat (infopath, temp);
......
/* filesys.h -- External declarations of functions and vars in filesys.c. */ /* filesys.h -- External declarations of functions and vars in filesys.c.
$Id: filesys.h,v 1.3 1997/07/15 18:39:08 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_FILESYS_H_) #ifndef INFO_FILESYS_H
#define _FILESYS_H_ #define INFO_FILESYS_H
/* The path on which we look for info files. You can initialize this /* The path on which we look for info files. You can initialize this
from the environment variable INFOPATH if there is one, or you can from the environment variable INFOPATH if there is one, or you can
...@@ -70,7 +71,7 @@ extern char *extract_colon_unit (); ...@@ -70,7 +71,7 @@ extern char *extract_colon_unit ();
/* The default value of INFOPATH. */ /* The default value of INFOPATH. */
#if !defined (DEFAULT_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:." # 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:."
#endif /* !DEFAULT_INFOPATH */ #endif /* !DEFAULT_INFOPATH */
#if !defined (S_ISREG) && defined (S_IFREG) #if !defined (S_ISREG) && defined (S_IFREG)
...@@ -81,4 +82,4 @@ extern char *extract_colon_unit (); ...@@ -81,4 +82,4 @@ extern char *extract_colon_unit ();
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif /* !S_ISDIR && S_IFDIR */ #endif /* !S_ISDIR && S_IFDIR */
#endif /* !_FILESYS_H_ */ #endif /* not INFO_FILESYS_H */
/* footnotes.c -- Some functions for manipulating footnotes. */ /* footnotes.c -- Some functions for manipulating footnotes.
$Id: footnotes.c,v 1.4 1997/07/24 21:23:33 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -205,7 +203,7 @@ info_get_or_remove_footnotes (window) ...@@ -205,7 +203,7 @@ info_get_or_remove_footnotes (window)
/* If we are hacking automatic footnotes, and there are footnotes /* If we are hacking automatic footnotes, and there are footnotes
but we couldn't display them, print a message to that effect. */ but we couldn't display them, print a message to that effect. */
if (auto_footnotes_p) if (auto_footnotes_p)
inform_in_echo_area ("Footnotes could not be displayed"); inform_in_echo_area (_("Footnotes could not be displayed"));
return (FN_UNABLE); return (FN_UNABLE);
} }
} }
...@@ -231,10 +229,8 @@ info_get_or_remove_footnotes (window) ...@@ -231,10 +229,8 @@ info_get_or_remove_footnotes (window)
/* Show the footnotes associated with this node in another window. */ /* Show the footnotes associated with this node in another window. */
DECLARE_INFO_COMMAND (info_show_footnotes, DECLARE_INFO_COMMAND (info_show_footnotes,
"Show the footnotes associated with this node in another window") _("Show the footnotes associated with this node in another window"))
{ {
int result;
/* A negative argument means just make the window go away. */ /* A negative argument means just make the window go away. */
if (count < 0) if (count < 0)
{ {
......
/* footnotes.h -- Some functions for manipulating footnotes. */ /* footnotes.h -- Some functions for manipulating footnotes.
$Id: footnotes.h,v 1.3 1997/07/15 18:40:27 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,11 +22,11 @@ ...@@ -21,11 +22,11 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_FOOTNOTES_H_) #ifndef INFO_FOOTNOTES_H
#define _FOOTNOTES_H_ #define INFO_FOOTNOTES_H
/* Magic string which indicates following text is footnotes. */ /* Magic string which indicates following text is footnotes. */
#define FOOTNOTE_LABEL "---------- Footnotes ----------" #define FOOTNOTE_LABEL _("---------- Footnotes ----------")
#define FN_FOUND 0 #define FN_FOUND 0
#define FN_UNFOUND 1 #define FN_UNFOUND 1
...@@ -42,5 +43,4 @@ extern int info_get_or_remove_footnotes (); ...@@ -42,5 +43,4 @@ extern int info_get_or_remove_footnotes ();
/* Non-zero means attempt to show footnotes when displaying a new window. */ /* Non-zero means attempt to show footnotes when displaying a new window. */
extern int auto_footnotes_p; extern int auto_footnotes_p;
#endif /* !_FOOTNOTES_H_ */ #endif /* not INFO_FOOTNOTES_H */
...@@ -56,7 +56,7 @@ gc_pointers () ...@@ -56,7 +56,7 @@ gc_pointers ()
if (!info_windows || !gcable_pointers_index) if (!info_windows || !gcable_pointers_index)
return; return;
for (i = 0; iw = info_windows[i]; i++) for (i = 0; (iw = info_windows[i]); i++)
{ {
for (j = 0; j < iw->nodes_index; j++) for (j = 0; j < iw->nodes_index; j++)
{ {
......
/* gc.h -- Functions for garbage collecting unused node contents. */ /* gc.h -- Functions for garbage collecting unused node contents.
$Id: gc.h,v 1.2 1997/07/15 18:41:53 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_GC_H_) #ifndef INFO_GC_H
#define _GC_H_ #define INFO_GC_H
/* Add POINTER to the list of garbage collectible pointers. A pointer /* Add POINTER to the list of garbage collectible pointers. A pointer
is not actually garbage collected until no info window contains a node is not actually garbage collected until no info window contains a node
...@@ -33,4 +34,4 @@ extern void add_gcable_pointer (); ...@@ -33,4 +34,4 @@ extern void add_gcable_pointer ();
node->contents which are collectible, and free them. */ node->contents which are collectible, and free them. */
extern void gc_pointers (); extern void gc_pointers ();
#endif /* !_GC_H_ */ #endif /* not INFO_GC_H */
/* indices.c -- Commands for dealing with an Info file Index. */ /* indices.c -- Commands for dealing with an Info file Index.
$Id: indices.c,v 1.6 1997/07/24 21:25:53 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -65,7 +63,7 @@ add_index_to_index_nodenames (array, node) ...@@ -65,7 +63,7 @@ add_index_to_index_nodenames (array, node)
for (last = 0; array[last]; last++); for (last = 0; array[last]; last++);
assoc = (INDEX_NAME_ASSOC *)xmalloc (sizeof (INDEX_NAME_ASSOC)); assoc = (INDEX_NAME_ASSOC *)xmalloc (sizeof (INDEX_NAME_ASSOC));
assoc->name = strdup (node->nodename); assoc->name = xstrdup (node->nodename);
if (!index_nodenames_index) if (!index_nodenames_index)
{ {
...@@ -133,7 +131,7 @@ info_indices_of_file_buffer (file_buffer) ...@@ -133,7 +131,7 @@ info_indices_of_file_buffer (file_buffer)
{ {
TAG *tag; TAG *tag;
for (i = 0; tag = file_buffer->tags[i]; i++) for (i = 0; (tag = file_buffer->tags[i]); i++)
{ {
if (string_in_line ("Index", tag->nodename) != -1) if (string_in_line ("Index", tag->nodename) != -1)
{ {
...@@ -146,8 +144,8 @@ info_indices_of_file_buffer (file_buffer) ...@@ -146,8 +144,8 @@ info_indices_of_file_buffer (file_buffer)
continue; continue;
/* Remember the filename and nodename of this index. */ /* Remember the filename and nodename of this index. */
initial_index_filename = strdup (file_buffer->filename); initial_index_filename = xstrdup (file_buffer->filename);
initial_index_nodename = strdup (tag->nodename); initial_index_nodename = xstrdup (tag->nodename);
menu = info_menu_of_node (node); menu = info_menu_of_node (node);
...@@ -168,13 +166,24 @@ info_indices_of_file_buffer (file_buffer) ...@@ -168,13 +166,24 @@ info_indices_of_file_buffer (file_buffer)
/* If there is a result, clean it up so that every entry has a filename. */ /* If there is a result, clean it up so that every entry has a filename. */
for (i = 0; result && result[i]; i++) for (i = 0; result && result[i]; i++)
if (!result[i]->filename) if (!result[i]->filename)
result[i]->filename = strdup (file_buffer->filename); result[i]->filename = xstrdup (file_buffer->filename);
return (result); return (result);
} }
DECLARE_INFO_COMMAND (info_index_search, DECLARE_INFO_COMMAND (info_index_search,
"Look up a string in the index for this file") _("Look up a string in the index for this file"))
{
do_info_index_search (window, count, 0);
}
/* Look up SEARCH_STRING in the index for this file. If SEARCH_STRING
is NULL, prompt user for input. */
void
do_info_index_search (window, count, search_string)
WINDOW *window;
int count;
char *search_string;
{ {
FILE_BUFFER *fb; FILE_BUFFER *fb;
char *line; char *line;
...@@ -193,21 +202,25 @@ DECLARE_INFO_COMMAND (info_index_search, ...@@ -193,21 +202,25 @@ DECLARE_INFO_COMMAND (info_index_search,
(strcmp (initial_index_filename, fb->filename) != 0)) (strcmp (initial_index_filename, fb->filename) != 0))
{ {
info_free_references (index_index); info_free_references (index_index);
window_message_in_echo_area ("Finding index entries..."); window_message_in_echo_area (_("Finding index entries..."));
index_index = info_indices_of_file_buffer (fb); index_index = info_indices_of_file_buffer (fb);
} }
/* If there is no index, quit now. */ /* If there is no index, quit now. */
if (!index_index) if (!index_index)
{ {
info_error ("No indices found."); info_error (_("No indices found."));
return; return;
} }
/* Okay, there is an index. Let the user select one of the members of it. */ /* Okay, there is an index. Look for SEARCH_STRING, or, if it is
line = empty, prompt for one. */
info_read_maybe_completing (window, "Index entry: ", index_index); if (search_string && *search_string)
line = xstrdup (search_string);
else
{
line = info_read_maybe_completing (window, _("Index entry: "),
index_index);
window = active_window; window = active_window;
/* User aborted? */ /* User aborted? */
...@@ -226,8 +239,8 @@ DECLARE_INFO_COMMAND (info_index_search, ...@@ -226,8 +239,8 @@ DECLARE_INFO_COMMAND (info_index_search,
{ {
NODE *node; NODE *node;
node = node = info_get_node (initial_index_filename,
info_get_node (initial_index_filename, initial_index_nodename); initial_index_nodename);
set_remembered_pagetop_and_point (window); set_remembered_pagetop_and_point (window);
window_set_node_of_window (window, node); window_set_node_of_window (window, node);
remember_window_and_node (window, node); remember_window_and_node (window, node);
...@@ -235,6 +248,7 @@ DECLARE_INFO_COMMAND (info_index_search, ...@@ -235,6 +248,7 @@ DECLARE_INFO_COMMAND (info_index_search,
return; return;
} }
} }
}
/* The user typed either a completed index label, or a partial string. /* The user typed either a completed index label, or a partial string.
Find an exact match, or, failing that, the first index entry containing Find an exact match, or, failing that, the first index entry containing
...@@ -267,8 +281,55 @@ DECLARE_INFO_COMMAND (info_index_search, ...@@ -267,8 +281,55 @@ DECLARE_INFO_COMMAND (info_index_search,
} }
} }
int
index_entry_exists (window, string)
WINDOW *window;
char *string;
{
register int i;
FILE_BUFFER *fb;
/* If there is no previous search string, the user hasn't built an index
yet. */
if (!string)
return 0;
fb = file_buffer_of_window (window);
if (!initial_index_filename
|| (strcmp (initial_index_filename, fb->filename) != 0))
{
info_free_references (index_index);
index_index = info_indices_of_file_buffer (fb);
}
/* If there is no index, that is an error. */
if (!index_index)
return 0;
for (i = 0; (i > -1) && (index_index[i]); i++)
if (strcmp (string, index_index[i]->label) == 0)
break;
/* If that failed, look for the next substring match. */
if ((i < 0) || (!index_index[i]))
{
for (i = 0; (i > -1) && (index_index[i]); i++)
if (string_in_line (string, index_index[i]->label) != -1)
break;
if ((i > -1) && (index_index[i]))
string_in_line (string, index_index[i]->label);
}
/* If that failed, return 0. */
if ((i < 0) || (!index_index[i]))
return 0;
return 1;
}
DECLARE_INFO_COMMAND (info_next_index_match, DECLARE_INFO_COMMAND (info_next_index_match,
"Go to the next matching index item from the last `\\[index-search]' command") _("Go to the next matching index item from the last `\\[index-search]' command"))
{ {
register int i; register int i;
int partial, dir; int partial, dir;
...@@ -278,14 +339,14 @@ DECLARE_INFO_COMMAND (info_next_index_match, ...@@ -278,14 +339,14 @@ DECLARE_INFO_COMMAND (info_next_index_match,
yet. */ yet. */
if (!index_search) if (!index_search)
{ {
info_error ("No previous index search string."); info_error (_("No previous index search string."));
return; return;
} }
/* If there is no index, that is an error. */ /* If there is no index, that is an error. */
if (!index_index) if (!index_index)
{ {
info_error ("No index entries."); info_error (_("No index entries."));
return; return;
} }
...@@ -318,8 +379,8 @@ DECLARE_INFO_COMMAND (info_next_index_match, ...@@ -318,8 +379,8 @@ DECLARE_INFO_COMMAND (info_next_index_match,
/* If that failed, print an error. */ /* If that failed, print an error. */
if ((i < 0) || (!index_index[i])) if ((i < 0) || (!index_index[i]))
{ {
info_error ("No %sindex entries containing \"%s\".", info_error (_("No %sindex entries containing \"%s\"."),
index_offset > 0 ? "more " : "", index_search); index_offset > 0 ? _("more ") : "", index_search);
return; return;
} }
...@@ -329,7 +390,7 @@ DECLARE_INFO_COMMAND (info_next_index_match, ...@@ -329,7 +390,7 @@ DECLARE_INFO_COMMAND (info_next_index_match,
/* Report to the user on what we have found. */ /* Report to the user on what we have found. */
{ {
register int j; register int j;
char *name = "CAN'T SEE THIS"; char *name = _("CAN'T SEE THIS");
char *match; char *match;
for (j = 0; index_nodenames[j]; j++) for (j = 0; index_nodenames[j]; j++)
...@@ -344,7 +405,7 @@ DECLARE_INFO_COMMAND (info_next_index_match, ...@@ -344,7 +405,7 @@ DECLARE_INFO_COMMAND (info_next_index_match,
/* If we had a partial match, indicate to the user which part of the /* If we had a partial match, indicate to the user which part of the
string matched. */ string matched. */
match = strdup (index_index[i]->label); match = xstrdup (index_index[i]->label);
if (partial && show_index_match) if (partial && show_index_match)
{ {
...@@ -365,7 +426,7 @@ DECLARE_INFO_COMMAND (info_next_index_match, ...@@ -365,7 +426,7 @@ DECLARE_INFO_COMMAND (info_next_index_match,
char *format; char *format;
format = replace_in_documentation format = replace_in_documentation
("Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)"); (_("Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)"));
window_message_in_echo_area (format, match, name); window_message_in_echo_area (format, match, name);
} }
...@@ -420,14 +481,13 @@ apropos_in_all_indices (search_string, inform) ...@@ -420,14 +481,13 @@ apropos_in_all_indices (search_string, inform)
REFERENCE **all_indices = (REFERENCE **)NULL; REFERENCE **all_indices = (REFERENCE **)NULL;
REFERENCE **dir_menu = (REFERENCE **)NULL; REFERENCE **dir_menu = (REFERENCE **)NULL;
NODE *dir_node; NODE *dir_node;
int printed = 0;
dir_node = info_get_node ("dir", "Top"); dir_node = info_get_node ("dir", "Top");
if (dir_node) if (dir_node)
dir_menu = info_menu_of_node (dir_node); dir_menu = info_menu_of_node (dir_node);
if (!dir_menu) if (!dir_menu)
return; return NULL;
/* For every menu item in DIR, get the associated node's file buffer and /* For every menu item in DIR, get the associated node's file buffer and
read the indices of that file buffer. Gather all of the indices into read the indices of that file buffer. Gather all of the indices into
...@@ -443,9 +503,9 @@ apropos_in_all_indices (search_string, inform) ...@@ -443,9 +503,9 @@ apropos_in_all_indices (search_string, inform)
if (!this_item->filename) if (!this_item->filename)
{ {
if (dir_node->parent) if (dir_node->parent)
this_item->filename = strdup (dir_node->parent); this_item->filename = xstrdup (dir_node->parent);
else else
this_item->filename = strdup (dir_node->filename); this_item->filename = xstrdup (dir_node->filename);
} }
/* Find this node. If we cannot find it, try using the label of the /* Find this node. If we cannot find it, try using the label of the
...@@ -470,7 +530,7 @@ apropos_in_all_indices (search_string, inform) ...@@ -470,7 +530,7 @@ apropos_in_all_indices (search_string, inform)
this_fb = info_find_file (files_name); this_fb = info_find_file (files_name);
if (this_fb && inform) if (this_fb && inform)
message_in_echo_area ("Scanning indices of \"%s\"...", files_name); message_in_echo_area (_("Scanning indices of \"%s\"..."), files_name);
this_index = info_indices_of_file_buffer (this_fb); this_index = info_indices_of_file_buffer (this_fb);
free (this_node); free (this_node);
...@@ -484,7 +544,7 @@ apropos_in_all_indices (search_string, inform) ...@@ -484,7 +544,7 @@ apropos_in_all_indices (search_string, inform)
/* Remember the filename which contains this set of references. */ /* Remember the filename which contains this set of references. */
for (i = 0; this_index && this_index[i]; i++) for (i = 0; this_index && this_index[i]; i++)
if (!this_index[i]->filename) if (!this_index[i]->filename)
this_index[i]->filename = strdup (this_fb->filename); this_index[i]->filename = xstrdup (this_fb->filename);
/* Concatenate with the other indices. */ /* Concatenate with the other indices. */
all_indices = info_concatenate_references (all_indices, this_index); all_indices = info_concatenate_references (all_indices, this_index);
...@@ -524,7 +584,7 @@ apropos_in_all_indices (search_string, inform) ...@@ -524,7 +584,7 @@ apropos_in_all_indices (search_string, inform)
} }
#define APROPOS_NONE \ #define APROPOS_NONE \
"No available info files reference \"%s\" in their indices." _("No available info files reference \"%s\" in their indices.")
void void
info_apropos (string) info_apropos (string)
...@@ -553,11 +613,11 @@ info_apropos (string) ...@@ -553,11 +613,11 @@ info_apropos (string)
static char *apropos_list_nodename = "*Apropos*"; static char *apropos_list_nodename = "*Apropos*";
DECLARE_INFO_COMMAND (info_index_apropos, DECLARE_INFO_COMMAND (info_index_apropos,
"Grovel all known info file's indices for a string and build a menu") _("Grovel all known info file's indices for a string and build a menu"))
{ {
char *line; char *line;
line = info_read_in_echo_area (window, "Index apropos: "); line = info_read_in_echo_area (window, _("Index apropos: "));
window = active_window; window = active_window;
...@@ -587,7 +647,7 @@ DECLARE_INFO_COMMAND (info_index_apropos, ...@@ -587,7 +647,7 @@ DECLARE_INFO_COMMAND (info_index_apropos,
initialize_message_buffer (); initialize_message_buffer ();
printf_to_message_buffer printf_to_message_buffer
("\n* Menu: Nodes whoses indices contain \"%s\":\n", line); (_("\n* Menu: Nodes whoses indices contain \"%s\":\n"), line);
line_buffer = (char *)xmalloc (500); line_buffer = (char *)xmalloc (500);
for (i = 0; apropos_list[i]; i++) for (i = 0; apropos_list[i]; i++)
......
/* indices.h -- Functions defined in indices.c. */ /* indices.h -- Functions defined in indices.c.
$Id: indices.h,v 1.2 1997/07/06 20:50:29 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_INDICES_H_) #ifndef INFO_INDICES_H
#define _INDICES_H_ #define INFO_INDICES_H
/* User-visible variable controls the output of info-index-next. */ /* User-visible variable controls the output of info-index-next. */
extern int show_index_match; extern int show_index_match;
...@@ -35,5 +36,7 @@ REFERENCE **apropos_in_all_indices (); ...@@ -35,5 +36,7 @@ REFERENCE **apropos_in_all_indices ();
/* User visible functions declared in indices.c. */ /* User visible functions declared in indices.c. */
extern void info_index_search (), info_next_index_match (); extern void info_index_search (), info_next_index_match ();
extern void do_info_index_search ();
extern int index_intry_exists ();
#endif /* !_INDICES_H_ */ #endif /* not INFO_INDICES_H */
...@@ -21,15 +21,8 @@ ...@@ -21,15 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> /* For "NULL". Yechhh! */ #include "info.h"
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined (HAVE_STRING_H)
# include <string.h>
#endif /* HAVE_STRING_H */
#include "info-utils.h" #include "info-utils.h"
#if defined (HANDLE_MAN_PAGES) #if defined (HANDLE_MAN_PAGES)
# include "man.h" # include "man.h"
#endif /* HANDLE_MAN_PAGES */ #endif /* HANDLE_MAN_PAGES */
...@@ -280,7 +273,7 @@ info_references_internal (label, binding) ...@@ -280,7 +273,7 @@ info_references_internal (label, binding)
nodename is the same as the label. */ nodename is the same as the label. */
if (*refdef == ':') if (*refdef == ':')
{ {
entry->nodename = strdup (entry->label); entry->nodename = xstrdup (entry->label);
} }
else else
{ {
...@@ -295,10 +288,10 @@ info_references_internal (label, binding) ...@@ -295,10 +288,10 @@ info_references_internal (label, binding)
info_parse_node (refdef, SKIP_NEWLINES); info_parse_node (refdef, SKIP_NEWLINES);
if (info_parsed_filename) if (info_parsed_filename)
entry->filename = strdup (info_parsed_filename); entry->filename = xstrdup (info_parsed_filename);
if (info_parsed_nodename) if (info_parsed_nodename)
entry->nodename = strdup (info_parsed_nodename); entry->nodename = xstrdup (info_parsed_nodename);
} }
add_pointer_to_array add_pointer_to_array
......
/* info-utils.h -- Exported functions and variables from info-util.c. /* info-utils.h -- Exported functions and variables from info-util.c.
$Id: info-utils.h,v 1.1 1997/08/21 22:58:02 jason Exp $ $Id: info-utils.h,v 1.3 1997/07/15 18:42:20 karl Exp $
This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_INFO_UTILS_H_) #ifndef INFO_UTILS_H
#define _INFO_UTILS_H_ #define INFO_UTILS_H
#if !defined (HAVE_STRCHR) #if !defined (HAVE_STRCHR)
# undef strchr # undef strchr
...@@ -137,4 +137,4 @@ extern void info_parse_label (/* label, node */); ...@@ -137,4 +137,4 @@ extern void info_parse_label (/* label, node */);
info_parse_label (INFO_ALTPREV_LABEL, n); \ info_parse_label (INFO_ALTPREV_LABEL, n); \
} while (0) } while (0)
#endif /* !_INFO_UTILS_H_ */ #endif /* not INFO_UTILS_H */
/* info.c -- Display nodes of Info files in multiple windows. */ /* info.c -- Display nodes of Info files in multiple windows.
$Id: info.c,v 1.10 1997/07/30 15:21:44 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -22,6 +20,7 @@ ...@@ -22,6 +20,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include "info.h" #include "info.h"
#include "indices.h"
#include "dribble.h" #include "dribble.h"
#include "getopt.h" #include "getopt.h"
#if defined (HANDLE_MAN_PAGES) #if defined (HANDLE_MAN_PAGES)
...@@ -30,7 +29,7 @@ ...@@ -30,7 +29,7 @@
/* The version numbers of this version of Info. */ /* The version numbers of this version of Info. */
int info_major_version = 2; int info_major_version = 2;
int info_minor_version = 16; int info_minor_version = 17;
int info_patch_level = 0; int info_patch_level = 0;
/* Non-zero means search all indices for APROPOS_SEARCH_STRING. */ /* Non-zero means search all indices for APROPOS_SEARCH_STRING. */
...@@ -39,6 +38,14 @@ static int apropos_p = 0; ...@@ -39,6 +38,14 @@ static int apropos_p = 0;
/* Variable containing the string to search for when apropos_p is non-zero. */ /* Variable containing the string to search for when apropos_p is non-zero. */
static char *apropos_search_string = (char *)NULL; static char *apropos_search_string = (char *)NULL;
/* Non-zero means search all indices for INDEX_SEARCH_STRING. Unlike
apropos, this puts the user at the node, running info. */
static int index_search_p = 0;
/* Variable containing the string to search for when index_search_p is
non-zero. */
static char *index_search_string = (char *)NULL;
/* Non-zero means print version info only. */ /* Non-zero means print version info only. */
static int print_version_p = 0; static int print_version_p = 0;
...@@ -70,6 +77,7 @@ int dump_subnodes = 0; ...@@ -70,6 +77,7 @@ int dump_subnodes = 0;
#define APROPOS_OPTION 1 #define APROPOS_OPTION 1
#define DRIBBLE_OPTION 2 #define DRIBBLE_OPTION 2
#define RESTORE_OPTION 3 #define RESTORE_OPTION 3
#define IDXSRCH_OPTION 4
static struct option long_options[] = { static struct option long_options[] = {
{ "apropos", 1, 0, APROPOS_OPTION }, { "apropos", 1, 0, APROPOS_OPTION },
{ "directory", 1, 0, 'd' }, { "directory", 1, 0, 'd' },
...@@ -81,6 +89,7 @@ static struct option long_options[] = { ...@@ -81,6 +89,7 @@ static struct option long_options[] = {
{ "version", 0, &print_version_p, 1 }, { "version", 0, &print_version_p, 1 },
{ "dribble", 1, 0, DRIBBLE_OPTION }, { "dribble", 1, 0, DRIBBLE_OPTION },
{ "restore", 1, 0, RESTORE_OPTION }, { "restore", 1, 0, RESTORE_OPTION },
{ "index-search", 1, 0, IDXSRCH_OPTION },
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
...@@ -110,6 +119,15 @@ main (argc, argv) ...@@ -110,6 +119,15 @@ main (argc, argv)
remember_info_program_name (argv[0]); remember_info_program_name (argv[0]);
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
#endif
/* Set the text message domain. */
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
while (1) while (1)
{ {
int option_character; int option_character;
...@@ -147,14 +165,14 @@ main (argc, argv) ...@@ -147,14 +165,14 @@ main (argc, argv)
if (user_filename) if (user_filename)
free (user_filename); free (user_filename);
user_filename = strdup (optarg); user_filename = xstrdup (optarg);
break; break;
/* User is specifying the name of a file to output to. */ /* User is specifying the name of a file to output to. */
case 'o': case 'o':
if (user_output_filename) if (user_output_filename)
free (user_output_filename); free (user_output_filename);
user_output_filename = strdup (optarg); user_output_filename = xstrdup (optarg);
break; break;
/* User is specifying that she wishes to dump the subnodes of /* User is specifying that she wishes to dump the subnodes of
...@@ -167,7 +185,7 @@ main (argc, argv) ...@@ -167,7 +185,7 @@ main (argc, argv)
case APROPOS_OPTION: case APROPOS_OPTION:
apropos_p = 1; apropos_p = 1;
maybe_free (apropos_search_string); maybe_free (apropos_search_string);
apropos_search_string = strdup (optarg); apropos_search_string = xstrdup (optarg);
break; break;
/* User has specified a dribble file to receive keystrokes. */ /* User has specified a dribble file to receive keystrokes. */
...@@ -181,6 +199,13 @@ main (argc, argv) ...@@ -181,6 +199,13 @@ main (argc, argv)
info_set_input_from_file (optarg); info_set_input_from_file (optarg);
break; break;
/* User has specified a string to search all indices for. */
case IDXSRCH_OPTION:
index_search_p = 1;
maybe_free (index_search_string);
index_search_string = xstrdup (optarg);
break;
default: default:
usage (); usage ();
} }
...@@ -191,15 +216,15 @@ main (argc, argv) ...@@ -191,15 +216,15 @@ main (argc, argv)
to stdout, and turn on the dumping of subnodes. */ to stdout, and turn on the dumping of subnodes. */
if ((!isatty (fileno (stdout))) && (user_output_filename == (char *)NULL)) if ((!isatty (fileno (stdout))) && (user_output_filename == (char *)NULL))
{ {
user_output_filename = strdup ("-"); user_output_filename = xstrdup ("-");
dump_subnodes = 1; dump_subnodes = 1;
} }
/* If the user specified --version, then show the version and exit. */ /* If the user specified --version, then show the version and exit. */
if (print_version_p) if (print_version_p)
{ {
printf ("GNU Info (Texinfo 3.9) %s\n", version_string ()); printf ("info (GNU %s %s) %s\n", PACKAGE, VERSION, version_string ());
puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\ puts ("Copyright (C) 1997 Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\ There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\ under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING."); For more information about these matters, see the files named COPYING.");
...@@ -213,16 +238,22 @@ For more information about these matters, see the files named COPYING."); ...@@ -213,16 +238,22 @@ For more information about these matters, see the files named COPYING.");
exit (0); exit (0);
} }
/* If the user hasn't specified a path for Info files, default that path /* If the user hasn't specified a path for Info files, default it. */
now. */
if (!infopath) if (!infopath)
{ {
char *path_from_env, *getenv (); char *path_from_env = getenv ("INFOPATH");
path_from_env = getenv ("INFOPATH");
if (path_from_env) if (path_from_env)
{
unsigned len = strlen (path_from_env);
/* Trailing : on INFOPATH means insert the default path. */
if (len && path_from_env[len - 1] == ':')
{
path_from_env[len - 1] = 0;
info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
}
info_add_path (path_from_env, INFOPATH_PREPEND); info_add_path (path_from_env, INFOPATH_PREPEND);
}
else else
info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND); info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
} }
...@@ -231,10 +262,8 @@ For more information about these matters, see the files named COPYING."); ...@@ -231,10 +262,8 @@ For more information about these matters, see the files named COPYING.");
file to the contents of INFOPATH. */ file to the contents of INFOPATH. */
if (user_filename) if (user_filename)
{ {
char *directory_name, *temp; char *directory_name = xstrdup (user_filename);
char *temp = filename_non_directory (directory_name);
directory_name = strdup (user_filename);
temp = filename_non_directory (directory_name);
if (temp != directory_name) if (temp != directory_name)
{ {
...@@ -255,10 +284,8 @@ For more information about these matters, see the files named COPYING."); ...@@ -255,10 +284,8 @@ For more information about these matters, see the files named COPYING.");
/* Get the initial Info node. It is either "(dir)Top", or what the user /* Get the initial Info node. It is either "(dir)Top", or what the user
specifed with values in user_filename and user_nodenames. */ specifed with values in user_filename and user_nodenames. */
if (user_nodenames) initial_node = info_get_node (user_filename,
initial_node = info_get_node (user_filename, user_nodenames[0]); user_nodenames ? user_nodenames[0] : NULL);
else
initial_node = info_get_node (user_filename, (char *)NULL);
/* If we couldn't get the initial node, this user is in trouble. */ /* If we couldn't get the initial node, this user is in trouble. */
if (!initial_node) if (!initial_node)
...@@ -271,10 +298,10 @@ For more information about these matters, see the files named COPYING."); ...@@ -271,10 +298,10 @@ For more information about these matters, see the files named COPYING.");
exit (1); exit (1);
} }
/* Special cases for when the user specifies multiple nodes. If we are /* Special cases for when the user specifies multiple nodes. If we
dumping to an output file, dump all of the nodes specified. Otherwise, are dumping to an output file, dump all of the nodes specified.
attempt to create enough windows to handle the nodes that this user wants Otherwise, attempt to create enough windows to handle the nodes
displayed. */ that this user wants displayed. */
if (user_nodenames_index > 1) if (user_nodenames_index > 1)
{ {
free (initial_node); free (initial_node);
...@@ -288,6 +315,43 @@ For more information about these matters, see the files named COPYING."); ...@@ -288,6 +315,43 @@ For more information about these matters, see the files named COPYING.");
exit (0); 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);
}
/* If there are arguments remaining, they are the names of menu items /* If there are arguments remaining, they are the names of menu items
in sequential info files starting from the first one loaded. That in sequential info files starting from the first one loaded. That
file name is either "dir", or the contents of user_filename if one file name is either "dir", or the contents of user_filename if one
...@@ -303,7 +367,7 @@ For more information about these matters, see the files named COPYING."); ...@@ -303,7 +367,7 @@ For more information about these matters, see the files named COPYING.");
/* Remember the name of the menu entry we want. */ /* Remember the name of the menu entry we want. */
arg = argv[optind++]; arg = argv[optind++];
if (first_arg == (char *)NULL) if (!first_arg)
first_arg = arg; first_arg = arg;
/* Build and return a list of the menu items in this node. */ /* Build and return a list of the menu items in this node. */
...@@ -323,7 +387,7 @@ For more information about these matters, see the files named COPYING."); ...@@ -323,7 +387,7 @@ For more information about these matters, see the files named COPYING.");
} }
#endif /* HANDLE_MAN_PAGES */ #endif /* HANDLE_MAN_PAGES */
begin_info_session_with_error begin_info_session_with_error
(initial_node, "There is no menu in this node."); (initial_node, _("There is no menu in this node."));
exit (0); exit (0);
} }
...@@ -337,7 +401,7 @@ For more information about these matters, see the files named COPYING."); ...@@ -337,7 +401,7 @@ For more information about these matters, see the files named COPYING.");
register int i; register int i;
int best_guess = -1; int best_guess = -1;
for (i = 0; entry = menu[i]; i++) for (i = 0; (entry = menu[i]); i++)
{ {
if (strcasecmp (entry->label, arg) == 0) if (strcasecmp (entry->label, arg) == 0)
break; break;
...@@ -354,7 +418,7 @@ For more information about these matters, see the files named COPYING."); ...@@ -354,7 +418,7 @@ For more information about these matters, see the files named COPYING.");
node anyway. It is probably a misspelling. */ node anyway. It is probably a misspelling. */
if (!entry) if (!entry)
{ {
char *error_message = "There is no menu item \"%s\" in this node."; char *error_message = _("There is no menu item \"%s\" in this node.");
#if defined (HANDLE_MAN_PAGES) #if defined (HANDLE_MAN_PAGES)
if (first_arg == arg) if (first_arg == arg)
...@@ -381,9 +445,9 @@ For more information about these matters, see the files named COPYING."); ...@@ -381,9 +445,9 @@ For more information about these matters, see the files named COPYING.");
if (!entry->filename) if (!entry->filename)
{ {
if (initial_node->parent) if (initial_node->parent)
entry->filename = strdup (initial_node->parent); entry->filename = xstrdup (initial_node->parent);
else else
entry->filename = strdup (initial_node->filename); entry->filename = xstrdup (initial_node->filename);
} }
/* Find this node. If we can find it, then turn the initial_node /* Find this node. If we can find it, then turn the initial_node
...@@ -415,10 +479,10 @@ For more information about these matters, see the files named COPYING."); ...@@ -415,10 +479,10 @@ For more information about these matters, see the files named COPYING.");
} }
else else
{ {
char *temp = strdup (entry->label); char *temp = xstrdup (entry->label);
char *error_message; char *error_message;
error_message = "Unable to find the node referenced by \"%s\"."; error_message = _("Unable to find the node referenced by \"%s\".");
info_free_references (menu); info_free_references (menu);
...@@ -474,7 +538,7 @@ remember_info_program_name (fullpath) ...@@ -474,7 +538,7 @@ remember_info_program_name (fullpath)
char *filename; char *filename;
filename = filename_non_directory (fullpath); filename = filename_non_directory (fullpath);
program_name = strdup (filename); program_name = xstrdup (filename);
} }
/* Non-zero if an error has been signalled. */ /* Non-zero if an error has been signalled. */
...@@ -528,11 +592,11 @@ static void ...@@ -528,11 +592,11 @@ static void
usage () usage ()
{ {
fprintf (stderr,"%s\n%s\n%s\n%s\n%s\n", fprintf (stderr,"%s\n%s\n%s\n%s\n%s\n",
"Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]...", _("Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]..."),
" [--directory dir-path] [--file info-file] [--node node-name]...", _(" [--directory dir-path] [--file info-file] [--node node-name]..."),
" [--help] [--output output-file] [--subnodes] [--version]", _(" [--help] [--output output-file] [--subnodes] [--version]"),
" [--dribble dribble-file] [--restore from-file]", _(" [--dribble dribble-file] [--restore from-file]"),
" [menu-selection ...]"); _(" [menu-selection ...]"));
exit (1); exit (1);
} }
...@@ -540,7 +604,7 @@ usage () ...@@ -540,7 +604,7 @@ usage ()
static void static void
info_short_help () info_short_help ()
{ {
puts ("\ puts (_("\
Here is a quick description of Info's options. For a more complete\n\ Here is a quick description of Info's options. For a more complete\n\
description of how to use Info, type `info info options'.\n\ description of how to use Info, type `info info options'.\n\
\n\ \n\
...@@ -559,7 +623,7 @@ items in the initial node visited. You can easily move to the\n\ ...@@ -559,7 +623,7 @@ items in the initial node visited. You can easily move to the\n\
node of your choice by specifying the menu names which describe\n\ node of your choice by specifying the menu names which describe\n\
the path to that node. For example, `info emacs buffers'.\n\ the path to that node. For example, `info emacs buffers'.\n\
\n\ \n\
Email bug reports to bug-texinfo@prep.ai.mit.edu."); Email bug reports to bug-texinfo@prep.ai.mit.edu."));
exit (0); exit (0);
} }
/* info.h -- Header file which includes all of the other headers. */ /* info.h -- Header file which includes all of the other headers.
$Id: info.h,v 1.6 1997/07/15 18:34:15 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,24 +22,77 @@ ...@@ -21,24 +22,77 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_INFO_H_) #if !defined (INFO_H)
#define _INFO_H_ #define INFO_H
/* We always want these, so why clutter up the compile command? */
#define HANDLE_MAN_PAGES
#define NAMED_FUNCTIONS
/* System dependencies. */
#include "system.h"
/* Some of our other include files use these. */
typedef int Function ();
typedef void VFunction ();
typedef char *CFunction ();
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined (HAVE_STRING_H)
#include <string.h>
#endif /* HAVE_STRING_H */
#include "filesys.h" #include "filesys.h"
#include "display.h" #include "display.h"
#include "session.h" #include "session.h"
#include "echo_area.h" #include "echo-area.h"
#include "doc.h" #include "doc.h"
#include "footnotes.h" #include "footnotes.h"
#include "gc.h" #include "gc.h"
#define info_toupper(x) (islower (x) ? toupper (x) : x)
#define info_tolower(x) (isupper (x) ? tolower (x) : x)
#if !defined (whitespace)
# define whitespace(c) ((c == ' ') || (c == '\t'))
#endif /* !whitespace */
#if !defined (whitespace_or_newline)
# define whitespace_or_newline(c) (whitespace (c) || (c == '\n'))
#endif /* !whitespace_or_newline */
/* Add POINTER to the list of pointers found in ARRAY. SLOTS is the number
of slots that have already been allocated. INDEX is the index into the
array where POINTER should be added. GROW is the number of slots to grow
ARRAY by, in the case that it needs growing. TYPE is a cast of the type
of object stored in ARRAY (e.g., NODE_ENTRY *. */
#define add_pointer_to_array(pointer, idx, array, slots, grow, type) \
do { \
if (idx + 2 >= slots) \
array = (type *)(xrealloc (array, (slots += grow) * sizeof (type))); \
array[idx++] = (type)pointer; \
array[idx] = (type)NULL; \
} while (0)
#define maybe_free(x) do { if (x) free (x); } while (0)
#if !defined (zero_mem) && defined (HAVE_MEMSET)
# define zero_mem(mem, length) memset (mem, 0, length)
#endif /* !zero_mem && HAVE_MEMSET */
#if !defined (zero_mem) && defined (HAVE_BZERO)
# define zero_mem(mem, length) bzero (mem, length)
#endif /* !zero_mem && HAVE_BZERO */
#if !defined (zero_mem)
# define zero_mem(mem, length) \
do { \
register int zi; \
register unsigned char *place; \
\
place = (unsigned char *)mem; \
for (zi = 0; zi < length; zi++) \
place[zi] = 0; \
} while (0)
#endif /* !zero_mem */
/* A structure associating the nodes visited in a particular window. */ /* A structure associating the nodes visited in a particular window. */
typedef struct { typedef struct {
WINDOW *window; /* The window that this list is attached to. */ WINDOW *window; /* The window that this list is attached to. */
...@@ -78,23 +132,34 @@ extern int info_major_version, info_minor_version, info_patch_level; ...@@ -78,23 +132,34 @@ extern int info_major_version, info_minor_version, info_patch_level;
extern char *version_string (); extern char *version_string ();
/* Error message defines. */ /* Error message defines. */
#define CANT_FIND_NODE "Cannot find the node \"%s\"." #define CANT_FIND_NODE _("Cannot find the node \"%s\".")
#define CANT_FILE_NODE "Cannot find the node \"(%s)%s\"." #define CANT_FILE_NODE _("Cannot find the node \"(%s)%s\".")
#define CANT_FIND_WIND "Cannot find a window!" #define CANT_FIND_WIND _("Cannot find a window!")
#define CANT_FIND_POINT "Point doesn't appear within this window's node!" #define CANT_FIND_POINT _("Point doesn't appear within this window's node!")
#define CANT_KILL_LAST "Cannot delete the last window." #define CANT_KILL_LAST _("Cannot delete the last window.")
#define NO_MENU_NODE "No menu in this node." #define NO_MENU_NODE _("No menu in this node.")
#define NO_FOOT_NODE "No footnotes in this node." #define NO_FOOT_NODE _("No footnotes in this node.")
#define NO_XREF_NODE "No cross references in this node." #define NO_XREF_NODE _("No cross references in this node.")
#define NO_POINTER "No \"%s\" pointer for this node." #define NO_POINTER _("No \"%s\" pointer for this node.")
#define UNKNOWN_COMMAND "Unknown Info command `%c'. `?' for help." #define UNKNOWN_COMMAND _("Unknown Info command `%c'. `?' for help.")
#define TERM_TOO_DUMB "Terminal type \"%s\" is not smart enough to run Info." #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_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 AT_NODE_TOP _("You are already at the first page of this node.")
#define ONE_WINDOW "Only one window." #define ONE_WINDOW _("Only one window.")
#define WIN_TOO_SMALL "Resulting window would be too small." #define WIN_TOO_SMALL _("Resulting window would be too small.")
#define CANT_MAKE_HELP \ #define CANT_MAKE_HELP \
"There isn't enough room to make a help window. Please delete a window." _("There isn't enough room to make a help window. Please delete a window.")
/* Found in info-utils.c. */
extern char *filename_non_directory ();
#if !defined (BUILDING_LIBRARY)
/* Found in session.c */
extern int info_windows_initialized_p;
#endif /* !_INFO_H_ */ /* Found in window.c. */
extern void message_in_echo_area (), unmessage_in_echo_area ();
#endif /* !BUILDING_LIBRARY */
#endif /* !INFO_H */
/* infodoc.c -- Functions which build documentation nodes. */ /* infodoc.c -- Functions which build documentation nodes.
$Id: infodoc.c,v 1.4 1997/07/25 21:08:40 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -49,10 +47,12 @@ static char *internal_info_help_node_contents = (char *)NULL; ...@@ -49,10 +47,12 @@ static char *internal_info_help_node_contents = (char *)NULL;
/* The static text which appears in the internal info help node. */ /* The static text which appears in the internal info help node. */
static char *info_internal_help_text[] = { static char *info_internal_help_text[] = {
"Basic Commands in Info Windows", N_ ("Basic Commands in Info Windows"),
"******************************", "******************************",
"", "",
" h Invoke the Info tutorial.", " h Invoke the Info tutorial.",
" CTRL-x 0 Quit this help.",
" q Quit Info altogether.",
"", "",
"Selecting other nodes:", "Selecting other nodes:",
"----------------------", "----------------------",
...@@ -72,9 +72,8 @@ static char *info_internal_help_text[] = { ...@@ -72,9 +72,8 @@ static char *info_internal_help_text[] = {
" b Go to the beginning of this node.", " b Go to the beginning of this node.",
" e Go to the end of this node.", " e Go to the end of this node.",
"", "",
"\"Advanced\" commands:", "Other commands:",
"--------------------", "--------------------",
" q Quit Info.",
" 1 Pick first item in node's menu.", " 1 Pick first item in node's menu.",
" 2-9 Pick second ... ninth item in node's menu.", " 2-9 Pick second ... ninth item in node's menu.",
" 0 Pick last item in node's menu.", " 0 Pick last item in node's menu.",
...@@ -82,7 +81,7 @@ static char *info_internal_help_text[] = { ...@@ -82,7 +81,7 @@ static char *info_internal_help_text[] = {
" You may include a filename as well, as in (FILENAME)NODENAME.", " You may include a filename as well, as in (FILENAME)NODENAME.",
" s Search through this Info file for a specified string,", " s Search through this Info file for a specified string,",
" and select the node in which the next occurrence is found.", " and select the node in which the next occurrence is found.",
(char *)NULL NULL
}; };
static char *where_is (), *where_is_internal (); static char *where_is (), *where_is_internal ();
...@@ -209,7 +208,7 @@ create_internal_info_help_node () ...@@ -209,7 +208,7 @@ create_internal_info_help_node ()
{ {
printf_to_message_buffer ("---------------------\n\n"); printf_to_message_buffer ("---------------------\n\n");
printf_to_message_buffer printf_to_message_buffer
("The following commands can only be invoked via M-x:\n\n"); (_("The following commands can only be invoked via M-x:\n\n"));
printed_one_mx = 1; printed_one_mx = 1;
} }
...@@ -226,7 +225,7 @@ create_internal_info_help_node () ...@@ -226,7 +225,7 @@ create_internal_info_help_node ()
printf_to_message_buffer printf_to_message_buffer
("%s", replace_in_documentation ("%s", replace_in_documentation
("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n")); (_("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n")));
node = message_buffer_to_node (); node = message_buffer_to_node ();
internal_info_help_node_contents = node->contents; internal_info_help_node_contents = node->contents;
} }
...@@ -326,7 +325,7 @@ info_find_or_create_help_window () ...@@ -326,7 +325,7 @@ info_find_or_create_help_window ()
} }
/* Create or move to the help window. */ /* Create or move to the help window. */
DECLARE_INFO_COMMAND (info_get_help_window, "Display help message") DECLARE_INFO_COMMAND (info_get_help_window, _("Display help message"))
{ {
WINDOW *help_window; WINDOW *help_window;
...@@ -344,7 +343,7 @@ DECLARE_INFO_COMMAND (info_get_help_window, "Display help message") ...@@ -344,7 +343,7 @@ DECLARE_INFO_COMMAND (info_get_help_window, "Display help message")
/* Show the Info help node. This means that the "info" file is installed /* Show the Info help node. This means that the "info" file is installed
where it can easily be found on your system. */ where it can easily be found on your system. */
DECLARE_INFO_COMMAND (info_get_info_help_node, "Visit Info node `(info)Help'") DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'"))
{ {
NODE *node; NODE *node;
char *nodename; char *nodename;
...@@ -468,7 +467,7 @@ key_documentation (key, map) ...@@ -468,7 +467,7 @@ key_documentation (key, map)
return ((char *)NULL); return ((char *)NULL);
} }
DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
{ {
char keyname[50]; char keyname[50];
int keyname_index = 0; int keyname_index = 0;
...@@ -481,7 +480,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") ...@@ -481,7 +480,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
while (1) while (1)
{ {
message_in_echo_area ("Describe key: %s", keyname); message_in_echo_area (_("Describe key: %s"), keyname);
keystroke = info_get_input_char (); keystroke = info_get_input_char ();
unmessage_in_echo_area (); unmessage_in_echo_area ();
...@@ -490,7 +489,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") ...@@ -490,7 +489,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
if (map[ESC].type != ISKMAP) if (map[ESC].type != ISKMAP)
{ {
window_message_in_echo_area window_message_in_echo_area
("ESC %s is undefined.", pretty_keyname (UnMeta (keystroke))); (_("ESC %s is undefined."), pretty_keyname (UnMeta (keystroke)));
return; return;
} }
...@@ -507,7 +506,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") ...@@ -507,7 +506,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
if (map[keystroke].function == (VFunction *)NULL) if (map[keystroke].function == (VFunction *)NULL)
{ {
message_in_echo_area ("%s is undefined.", keyname); message_in_echo_area (_("%s is undefined."), keyname);
return; return;
} }
else if (map[keystroke].type == ISKMAP) else if (map[keystroke].type == ISKMAP)
...@@ -533,7 +532,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") ...@@ -533,7 +532,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
#if defined (NAMED_FUNCTIONS) #if defined (NAMED_FUNCTIONS)
sprintf (message, "%s (%s): %s.", keyname, funname, fundoc); sprintf (message, "%s (%s): %s.", keyname, funname, fundoc);
#else #else
sprintf (message, "%s is defined to %s.", keyname, fundoc); sprintf (message, _("%s is defined to %s."), keyname, fundoc);
#endif /* !NAMED_FUNCTIONS */ #endif /* !NAMED_FUNCTIONS */
window_message_in_echo_area ("%s", message); window_message_in_echo_area ("%s", message);
...@@ -729,7 +728,7 @@ DECLARE_INFO_COMMAND (info_where_is, ...@@ -729,7 +728,7 @@ DECLARE_INFO_COMMAND (info_where_is,
{ {
char *command_name; char *command_name;
command_name = read_function_name ("Where is command: ", window); command_name = read_function_name (_("Where is command: "), window);
if (!command_name) if (!command_name)
{ {
...@@ -751,20 +750,20 @@ DECLARE_INFO_COMMAND (info_where_is, ...@@ -751,20 +750,20 @@ DECLARE_INFO_COMMAND (info_where_is,
if (!location) if (!location)
{ {
info_error ("`%s' is not on any keys", command_name); info_error (_("`%s' is not on any keys"), command_name);
} }
else else
{ {
if (strncmp (location, "M-x ", 4) == 0) if (strncmp (location, "M-x ", 4) == 0)
window_message_in_echo_area window_message_in_echo_area
("%s can only be invoked via %s.", command_name, location); (_("%s can only be invoked via %s."), command_name, location);
else else
window_message_in_echo_area window_message_in_echo_area
("%s can be invoked via %s.", command_name, location); (_("%s can be invoked via %s."), command_name, location);
} }
} }
else else
info_error ("There is no function named `%s'", command_name); info_error (_("There is no function named `%s'"), command_name);
} }
free (command_name); free (command_name);
......
/* infomap.c -- Keymaps for Info. */ /* infomap.c -- Keymaps for Info.
$Id: infomap.c,v 1.7 1997/07/31 20:37:32 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,10 +19,10 @@ ...@@ -21,10 +19,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include "stdio.h" #include "info.h"
#include "ctype.h"
#include "infomap.h" #include "infomap.h"
#include "funs.h" #include "funs.h"
#include "terminal.h"
/* Return a new keymap which has all the uppercase letters mapped to run /* Return a new keymap which has all the uppercase letters mapped to run
the function info_do_lowercase_version (). */ the function info_do_lowercase_version (). */
...@@ -94,6 +92,53 @@ keymap_discard_keymap (map) ...@@ -94,6 +92,53 @@ keymap_discard_keymap (map)
} }
} }
/* Conditionally bind key sequence. */
int
keymap_bind_keyseq (map, keyseq, keyentry)
Keymap map;
const unsigned char *keyseq;
KEYMAP_ENTRY *keyentry;
{
register Keymap m = map;
register const unsigned char *s = keyseq;
register int c;
if (s == NULL || *s == '\0') return 0;
while ((c = *s++) != '\0')
{
switch (m[c].type)
{
case ISFUNC:
if (!(m[c].function == NULL ||
(m != map && m[c].function == info_do_lowercase_version)))
return 0;
if (*s != '\0')
{
m[c].type = ISKMAP;
m[c].function = (VFunction *)keymap_make_keymap ();
}
break;
case ISKMAP:
if (*s == '\0')
return 0;
break;
}
if (*s != '\0')
{
m = (Keymap)m[c].function;
}
else
{
m[c] = *keyentry;
}
}
return 1;
}
/* Initialize the standard info keymaps. */ /* Initialize the standard info keymaps. */
Keymap info_keymap = (Keymap)NULL; Keymap info_keymap = (Keymap)NULL;
...@@ -182,6 +227,31 @@ initialize_info_keymaps () ...@@ -182,6 +227,31 @@ initialize_info_keymaps ()
map['o'].function = info_next_window; map['o'].function = info_next_window;
map[DEL].function = ea_backward_kill_line; 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. */ /* Bind commands for Info window keymaps. */
map = info_keymap; map = info_keymap;
map[TAB].function = info_move_to_next_xref; map[TAB].function = info_move_to_next_xref;
...@@ -264,11 +334,35 @@ initialize_info_keymaps () ...@@ -264,11 +334,35 @@ initialize_info_keymaps ()
map['o'].function = info_next_window; map['o'].function = info_next_window;
map['t'].function = info_tile_windows; map['t'].function = info_tile_windows;
map['w'].function = info_toggle_wrap; map['w'].function = info_toggle_wrap;
}
/* Strings which represent the sequence of characters that the arrow keys /* Arrow key bindings for Info windows keymap. */
produce. If these keys begin with ESC, and the second character of the map = info_keymap;
sequence does not conflict with an existing binding in the Meta keymap, keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
then bind the keys to do what C-p, C-n, C-f, and C-b do. */ keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
extern char *term_ku, *term_kd, *term_kr, *term_kl; 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 */
/* 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 */
}
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_INFOMAP_H_) #ifndef INFOMAP_H
#define _INFOMAP_H_ #define INFOMAP_H
#include "general.h" #include "info.h"
#define ESC '\033' #define ESC '\033'
#define DEL '\177' #define DEL '\177'
...@@ -79,4 +79,4 @@ extern void keymap_discard_keymap (); ...@@ -79,4 +79,4 @@ extern void keymap_discard_keymap ();
/* Initialize the info keymaps. */ /* Initialize the info keymaps. */
extern void initialize_info_keymaps (); extern void initialize_info_keymaps ();
#endif /* !_INFOMAP_H_ */ #endif /* not INFOMAP_H */
/* m-x.c -- Meta-X minibuffer reader. */ /* m-x.c -- Meta-X minibuffer reader.
$Id: m-x.c,v 1.5 1997/07/24 21:28:00 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -49,7 +47,7 @@ read_function_name (prompt, window) ...@@ -49,7 +47,7 @@ read_function_name (prompt, window)
REFERENCE *entry; REFERENCE *entry;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->label = strdup (function_doc_array[i].func_name); entry->label = xstrdup (function_doc_array[i].func_name);
entry->nodename = (char *)NULL; entry->nodename = (char *)NULL;
entry->filename = (char *)NULL; entry->filename = (char *)NULL;
...@@ -68,11 +66,11 @@ read_function_name (prompt, window) ...@@ -68,11 +66,11 @@ read_function_name (prompt, window)
} }
DECLARE_INFO_COMMAND (describe_command, DECLARE_INFO_COMMAND (describe_command,
"Read the name of an Info command and describe it") _("Read the name of an Info command and describe it"))
{ {
char *line; char *line;
line = read_function_name ("Describe command: ", window); line = read_function_name (_("Describe command: "), window);
if (!line) if (!line)
{ {
...@@ -83,10 +81,7 @@ DECLARE_INFO_COMMAND (describe_command, ...@@ -83,10 +81,7 @@ DECLARE_INFO_COMMAND (describe_command,
/* Describe the function named in "LINE". */ /* Describe the function named in "LINE". */
if (*line) if (*line)
{ {
char *fundoc; VFunction *fun = named_function (line);
VFunction *fun;
fun = named_function (line);
if (!fun) if (!fun)
return; return;
...@@ -98,7 +93,7 @@ DECLARE_INFO_COMMAND (describe_command, ...@@ -98,7 +93,7 @@ DECLARE_INFO_COMMAND (describe_command,
} }
DECLARE_INFO_COMMAND (info_execute_command, DECLARE_INFO_COMMAND (info_execute_command,
"Read a command name in the echo area and execute it") _("Read a command name in the echo area and execute it"))
{ {
char *line; char *line;
...@@ -136,7 +131,7 @@ DECLARE_INFO_COMMAND (info_execute_command, ...@@ -136,7 +131,7 @@ DECLARE_INFO_COMMAND (info_execute_command,
(strncmp (line, "echo-area-", 10) == 0)) (strncmp (line, "echo-area-", 10) == 0))
{ {
free (line); free (line);
info_error ("Cannot execute an `echo-area' command here."); info_error (_("Cannot execute an `echo-area' command here."));
return; return;
} }
...@@ -152,7 +147,7 @@ DECLARE_INFO_COMMAND (info_execute_command, ...@@ -152,7 +147,7 @@ DECLARE_INFO_COMMAND (info_execute_command,
/* Okay, now that we have M-x, let the user set the screen height. */ /* Okay, now that we have M-x, let the user set the screen height. */
DECLARE_INFO_COMMAND (set_screen_height, DECLARE_INFO_COMMAND (set_screen_height,
"Set the height of the displayed window") _("Set the height of the displayed window"))
{ {
int new_height; int new_height;
...@@ -165,7 +160,7 @@ DECLARE_INFO_COMMAND (set_screen_height, ...@@ -165,7 +160,7 @@ DECLARE_INFO_COMMAND (set_screen_height,
new_height = screenheight; new_height = screenheight;
sprintf (prompt, "Set screen height to (%d): ", new_height); sprintf (prompt, _("Set screen height to (%d): "), new_height);
line = info_read_in_echo_area (window, prompt); line = info_read_in_echo_area (window, prompt);
......
/* makedoc.c -- Make DOC.C and FUNS.H from input files. */ /* makedoc.c -- Make doc.c and funs.h from input files.
$Id: makedoc.c,v 1.4 1997/07/15 18:35:59 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -26,24 +27,8 @@ ...@@ -26,24 +27,8 @@
a header file which describes the contents. This only does the functions a header file which describes the contents. This only does the functions
declared with DECLARE_INFO_COMMAND. */ declared with DECLARE_INFO_COMMAND. */
#include <stdio.h> #include "info.h"
#include <ctype.h>
#include <sys/types.h>
#if defined (HAVE_SYS_FILE_H)
#include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#include <sys/stat.h>
#include "general.h"
#if !defined (O_RDONLY)
#if defined (HAVE_SYS_FCNTL_H)
#include <sys/fcntl.h>
#else /* !HAVE_SYS_FCNTL_H */
#include <fcntl.h>
#endif /* !HAVE_SYS_FCNTL_H */
#endif /* !O_RDONLY */
extern void *xmalloc (), *xrealloc ();
static void fatal_file_error (); static void fatal_file_error ();
/* Name of the header file which receives the declarations of functions. */ /* Name of the header file which receives the declarations of functions. */
...@@ -138,7 +123,7 @@ main (argc, argv) ...@@ -138,7 +123,7 @@ main (argc, argv)
} }
fprintf (doc_stream, fprintf (doc_stream,
" Source files groveled to make this file include:\n\n"); _(" Source files groveled to make this file include:\n\n"));
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
fprintf (doc_stream, "\t%s\n", argv[i]); fprintf (doc_stream, "\t%s\n", argv[i]);
...@@ -199,19 +184,19 @@ maybe_dump_tags (stream) ...@@ -199,19 +184,19 @@ maybe_dump_tags (stream)
char digits[30]; char digits[30];
etag = block->entries[j]; etag = block->entries[j];
block_len += 3 + strlen (etag->name); block_len += 3 + strlen (etag->name);
sprintf (digits, "%d,%d", etag->line, etag->char_offset); sprintf (digits, "%d,%ld", etag->line, etag->char_offset);
block_len += strlen (digits); block_len += strlen (digits);
} }
/* Print out the defining line. */ /* Print out the defining line. */
fprintf (stream, "\f\n%s,%d\n", block->filename, block_len); fprintf (stream, "\f\n%s,%ld\n", block->filename, block_len);
/* Print out the individual tags. */ /* Print out the individual tags. */
for (j = 0; j < block->entries_index; j++) for (j = 0; j < block->entries_index; j++)
{ {
etag = block->entries[j]; etag = block->entries[j];
fprintf (stream, "%s,\177%d,%d\n", fprintf (stream, "%s,\177%d,%ld\n",
etag->name, etag->line, etag->char_offset); etag->name, etag->line, etag->char_offset);
} }
} }
...@@ -226,7 +211,7 @@ make_emacs_tag_block (filename) ...@@ -226,7 +211,7 @@ make_emacs_tag_block (filename)
EMACS_TAG_BLOCK *block; EMACS_TAG_BLOCK *block;
block = (EMACS_TAG_BLOCK *)xmalloc (sizeof (EMACS_TAG_BLOCK)); block = (EMACS_TAG_BLOCK *)xmalloc (sizeof (EMACS_TAG_BLOCK));
block->filename = strdup (filename); block->filename = xstrdup (filename);
block->entrylen = 0; block->entrylen = 0;
block->entries = (EMACS_TAG **)NULL; block->entries = (EMACS_TAG **)NULL;
block->entries_index = 0; block->entries_index = 0;
...@@ -370,7 +355,7 @@ process_one_file (filename, doc_stream, funs_stream) ...@@ -370,7 +355,7 @@ process_one_file (filename, doc_stream, funs_stream)
if (strncmp (name_start, "info_", 5) == 0) if (strncmp (name_start, "info_", 5) == 0)
name_start += 5; name_start += 5;
func_name = strdup (name_start); func_name = xstrdup (name_start);
/* Fix up "ea" commands. */ /* Fix up "ea" commands. */
if (strncmp (func_name, "ea_", 3) == 0) if (strncmp (func_name, "ea_", 3) == 0)
...@@ -462,7 +447,7 @@ static void ...@@ -462,7 +447,7 @@ static void
fatal_file_error (filename) fatal_file_error (filename)
char *filename; char *filename;
{ {
fprintf (stderr, "Couldn't manipulate the file %s.\n", filename); fprintf (stderr, _("Couldn't manipulate the file %s.\n"), filename);
exit (2); exit (2);
} }
......
/* man.h: Defines and external function declarations for man.c */ /* man.h: Defines and external function declarations for man.c.
$Id: man.h,v 1.2 1997/07/15 18:42:56 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Author: Brian J. Fox (bfox@ai.mit.edu) Sat May 6 16:19:13 1995. */ Author: Brian J. Fox (bfox@ai.mit.edu) Sat May 6 16:19:13 1995. */
#if !defined (_MAN_H_) #ifndef INFO_MAN_H
#define _MAN_H_ #define INFO_MAN_H
#define MANPAGE_FILE_BUFFER_NAME "*manpages*" #define MANPAGE_FILE_BUFFER_NAME "*manpages*"
...@@ -33,4 +34,4 @@ extern long locate_manpage_xref (/* NODE *node, long start, int dir */); ...@@ -33,4 +34,4 @@ extern long locate_manpage_xref (/* NODE *node, long start, int dir */);
extern REFERENCE **xrefs_of_manpage (/* NODE *node */); extern REFERENCE **xrefs_of_manpage (/* NODE *node */);
extern REFERENCE **manpage_xrefs_in_binding (/* NODE *node, SEARCH_BINDING *binding */); extern REFERENCE **manpage_xrefs_in_binding (/* NODE *node, SEARCH_BINDING *binding */);
#endif /* !_MAN_H_ */ #endif /* INFO_MAN_H */
/* nodemenu.c -- Produce a menu of all visited nodes. */ /* nodemenu.c -- Produce a menu of all visited nodes.
$Id: nodemenu.c,v 1.7 1997/07/24 21:30:30 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -27,10 +25,10 @@ ...@@ -27,10 +25,10 @@
static char * static char *
nodemenu_format_info () nodemenu_format_info ()
{ {
return ("\n\ return (_("\n\
* Menu:\n\ * Menu:\n\
(File)Node Lines Size Containing File\n\ (File)Node Lines Size Containing File\n\
---------- ----- ---- ---------------"); ---------- ----- ---- ---------------"));
} }
/* Produce a formatted line of information about NODE. Here is what we want /* Produce a formatted line of information about NODE. Here is what we want
...@@ -98,7 +96,7 @@ format_node_info (node) ...@@ -98,7 +96,7 @@ format_node_info (node)
} }
len = pad_to (44, line_buffer); len = pad_to (44, line_buffer);
sprintf (line_buffer + len, "%d", node->nodelen); sprintf (line_buffer + len, "%ld", node->nodelen);
if (node->filename && *(node->filename)) if (node->filename && *(node->filename))
{ {
...@@ -106,7 +104,7 @@ format_node_info (node) ...@@ -106,7 +104,7 @@ format_node_info (node)
sprintf (line_buffer + len, node->filename); sprintf (line_buffer + len, node->filename);
} }
return (strdup (line_buffer)); return xstrdup (line_buffer);
} }
/* Little string comparison routine for qsort (). */ /* Little string comparison routine for qsort (). */
...@@ -137,7 +135,7 @@ get_visited_nodes (filter_func) ...@@ -137,7 +135,7 @@ get_visited_nodes (filter_func)
if (!info_windows) if (!info_windows)
return ((NODE *)NULL); return ((NODE *)NULL);
for (iw_index = 0; info_win = info_windows[iw_index]; iw_index++) for (iw_index = 0; (info_win = info_windows[iw_index]); iw_index++)
{ {
for (i = 0; i < info_win->nodes_index; i++) for (i = 0; i < info_win->nodes_index; i++)
{ {
...@@ -196,8 +194,8 @@ get_visited_nodes (filter_func) ...@@ -196,8 +194,8 @@ get_visited_nodes (filter_func)
printf_to_message_buffer printf_to_message_buffer
("%s", replace_in_documentation ("%s", replace_in_documentation
("Here is the menu of nodes you have recently visited.\n\ (_("Here is the menu of nodes you have recently visited.\n\
Select one from this menu, or use `\\[history-node]' in another window.\n")); Select one from this menu, or use `\\[history-node]' in another window.\n")));
printf_to_message_buffer ("%s\n", nodemenu_format_info ()); printf_to_message_buffer ("%s\n", nodemenu_format_info ());
...@@ -216,7 +214,7 @@ Select one from this menu, or use `\\[history-node]' in another window.\n")); ...@@ -216,7 +214,7 @@ Select one from this menu, or use `\\[history-node]' in another window.\n"));
} }
DECLARE_INFO_COMMAND (list_visited_nodes, DECLARE_INFO_COMMAND (list_visited_nodes,
"Make a window containing a menu of all of the currently visited nodes") _("Make a window containing a menu of all of the currently visited nodes"))
{ {
WINDOW *new; WINDOW *new;
NODE *node; NODE *node;
...@@ -235,8 +233,14 @@ DECLARE_INFO_COMMAND (list_visited_nodes, ...@@ -235,8 +233,14 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
/* If we couldn't find an existing window, try to use the next window /* If we couldn't find an existing window, try to use the next window
in the chain. */ in the chain. */
if (!new && window->next) if (!new)
{
if (window->next)
new = window->next; new = window->next;
/* If there is more than one window, wrap around. */
else if (window != windows)
new = windows;
}
/* If we still don't have a window, make a new one to contain the list. */ /* If we still don't have a window, make a new one to contain the list. */
if (!new) if (!new)
...@@ -258,10 +262,16 @@ DECLARE_INFO_COMMAND (list_visited_nodes, ...@@ -258,10 +262,16 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
node = get_visited_nodes ((Function *)NULL); node = get_visited_nodes ((Function *)NULL);
name_internal_node (node, nodemenu_nodename); name_internal_node (node, nodemenu_nodename);
#if 0
/* Even if this is an internal node, we don't want the window /* Even if this is an internal node, we don't want the window
system to treat it specially. So we turn off the internalness system to treat it specially. So we turn off the internalness
of it here. */ of it here. */
/* Why? We depend on internal_info_node_p returning true, so we must
not remove the flag. Otherwise, the *Node Menu* nodes themselves
appear in the node menu. --Andreas Schwab
<schwab@issan.informatik.uni-dortmund.de>. */
node->flags &= ~N_IsInternal; node->flags &= ~N_IsInternal;
#endif
/* If this window is already showing a node menu, reuse the existing node /* If this window is already showing a node menu, reuse the existing node
slot. */ slot. */
...@@ -284,7 +294,7 @@ DECLARE_INFO_COMMAND (list_visited_nodes, ...@@ -284,7 +294,7 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
} }
DECLARE_INFO_COMMAND (select_visited_node, DECLARE_INFO_COMMAND (select_visited_node,
"Select a node which has been previously visited in a visible window") _("Select a node which has been previously visited in a visible window"))
{ {
char *line; char *line;
NODE *node; NODE *node;
...@@ -296,7 +306,7 @@ DECLARE_INFO_COMMAND (select_visited_node, ...@@ -296,7 +306,7 @@ DECLARE_INFO_COMMAND (select_visited_node,
free (node); free (node);
line = line =
info_read_completing_in_echo_area (window, "Select visited node: ", menu); info_read_completing_in_echo_area (window, _("Select visited node: "), menu);
window = active_window; window = active_window;
...@@ -316,7 +326,7 @@ DECLARE_INFO_COMMAND (select_visited_node, ...@@ -316,7 +326,7 @@ DECLARE_INFO_COMMAND (select_visited_node,
entry = info_get_labeled_reference (line, menu); entry = info_get_labeled_reference (line, menu);
if (!entry) if (!entry)
info_error ("The reference disappeared! (%s).", line); info_error (_("The reference disappeared! (%s)."), line);
else else
info_select_reference (window, entry); info_select_reference (window, entry);
} }
......
...@@ -21,17 +21,8 @@ ...@@ -21,17 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include <ctype.h>
#include <sys/types.h>
#if defined (HAVE_SYS_FILE_H)
#include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#include <sys/errno.h>
#include <sys/stat.h>
#if defined (HAVE_STRING_H)
#include <string.h>
#endif /* HAVE_STRING_H */
#include "nodes.h" #include "nodes.h"
#include "search.h" #include "search.h"
#include "filesys.h" #include "filesys.h"
...@@ -41,18 +32,6 @@ ...@@ -41,18 +32,6 @@
# include "man.h" # include "man.h"
#endif /* HANDLE_MAN_PAGES */ #endif /* HANDLE_MAN_PAGES */
#if !defined (O_RDONLY)
#if defined (HAVE_SYS_FCNTL_H)
#include <sys/fcntl.h>
#else /* !HAVE_SYS_FCNTL_H */
#include <fcntl.h>
#endif /* !HAVE_SYS_FCNTL_H */
#endif /* !O_RDONLY */
#if !defined (errno)
extern int errno;
#endif /* !errno */
/* **************************************************************** */ /* **************************************************************** */
/* */ /* */
/* Functions Static to this File */ /* Functions Static to this File */
...@@ -193,7 +172,7 @@ info_get_node_of_file_buffer (nodename, file_buffer) ...@@ -193,7 +172,7 @@ info_get_node_of_file_buffer (nodename, file_buffer)
node = (NODE *)xmalloc (sizeof (NODE)); node = (NODE *)xmalloc (sizeof (NODE));
node->filename = file_buffer->fullpath; node->filename = file_buffer->fullpath;
node->parent = (char *)NULL; node->parent = (char *)NULL;
node->nodename = strdup ("*"); node->nodename = xstrdup ("*");
node->contents = file_buffer->contents; node->contents = file_buffer->contents;
node->nodelen = file_buffer->filesize; node->nodelen = file_buffer->filesize;
node->flags = 0; node->flags = 0;
...@@ -263,7 +242,7 @@ info_find_file_internal (filename, get_tags) ...@@ -263,7 +242,7 @@ info_find_file_internal (filename, get_tags)
/* First try to find the file in our list of already loaded files. */ /* First try to find the file in our list of already loaded files. */
if (info_loaded_files) if (info_loaded_files)
{ {
for (i = 0; file_buffer = info_loaded_files[i]; i++) for (i = 0; (file_buffer = info_loaded_files[i]); i++)
if ((strcmp (filename, file_buffer->filename) == 0) || if ((strcmp (filename, file_buffer->filename) == 0) ||
(strcmp (filename, file_buffer->fullpath) == 0) || (strcmp (filename, file_buffer->fullpath) == 0) ||
((*filename != '/') && ((*filename != '/') &&
...@@ -364,7 +343,7 @@ info_load_file_internal (filename, get_tags) ...@@ -364,7 +343,7 @@ info_load_file_internal (filename, get_tags)
char *lowered_name; char *lowered_name;
char *basename; char *basename;
lowered_name = strdup (filename); lowered_name = xstrdup (filename);
basename = (char *) strrchr (lowered_name, '/'); basename = (char *) strrchr (lowered_name, '/');
if (basename) if (basename)
...@@ -402,8 +381,8 @@ info_load_file_internal (filename, get_tags) ...@@ -402,8 +381,8 @@ info_load_file_internal (filename, get_tags)
/* The file was found, and can be read. Allocate FILE_BUFFER and fill /* The file was found, and can be read. Allocate FILE_BUFFER and fill
in the various members. */ in the various members. */
file_buffer = make_file_buffer (); file_buffer = make_file_buffer ();
file_buffer->filename = strdup (filename); file_buffer->filename = xstrdup (filename);
file_buffer->fullpath = strdup (fullpath); file_buffer->fullpath = xstrdup (fullpath);
file_buffer->finfo = finfo; file_buffer->finfo = finfo;
file_buffer->filesize = filesize; file_buffer->filesize = filesize;
file_buffer->contents = contents; file_buffer->contents = contents;
...@@ -786,7 +765,7 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding) ...@@ -786,7 +765,7 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding)
char *containing_dir, *temp; char *containing_dir, *temp;
int len_containing_dir; int len_containing_dir;
containing_dir = strdup (file_buffer->fullpath); containing_dir = xstrdup (file_buffer->fullpath);
temp = (char *) strrchr (containing_dir, '/'); temp = (char *) strrchr (containing_dir, '/');
if (temp) if (temp)
...@@ -816,8 +795,7 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding) ...@@ -816,8 +795,7 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding)
/* For each node in the file's tags table, remember the starting /* For each node in the file's tags table, remember the starting
position. */ position. */
for (tags_index = 0; for (tags_index = 0; (entry = file_buffer->tags[tags_index]);
entry = file_buffer->tags[tags_index];
tags_index++) tags_index++)
{ {
for (i = 0; for (i = 0;
...@@ -878,7 +856,7 @@ info_node_of_file_buffer_tags (file_buffer, nodename) ...@@ -878,7 +856,7 @@ info_node_of_file_buffer_tags (file_buffer, nodename)
register int i; register int i;
TAG *tag; TAG *tag;
for (i = 0; tag = file_buffer->tags[i]; i++) for (i = 0; (tag = file_buffer->tags[i]); i++)
if (strcmp (nodename, tag->nodename) == 0) if (strcmp (nodename, tag->nodename) == 0)
{ {
FILE_BUFFER *subfile; FILE_BUFFER *subfile;
...@@ -1032,7 +1010,7 @@ forget_info_file (filename) ...@@ -1032,7 +1010,7 @@ forget_info_file (filename)
if (!info_loaded_files) if (!info_loaded_files)
return; return;
for (i = 0; file_buffer = info_loaded_files[i]; i++) for (i = 0; (file_buffer = info_loaded_files[i]); i++)
if ((strcmp (filename, file_buffer->filename) == 0) || if ((strcmp (filename, file_buffer->filename) == 0) ||
(strcmp (filename, file_buffer->fullpath) == 0)) (strcmp (filename, file_buffer->fullpath) == 0))
{ {
...@@ -1047,7 +1025,7 @@ forget_info_file (filename) ...@@ -1047,7 +1025,7 @@ forget_info_file (filename)
with tags. */ with tags. */
free_file_buffer_tags (file_buffer); free_file_buffer_tags (file_buffer);
while (info_loaded_files[i] = info_loaded_files[++i]) while ((info_loaded_files[i] = info_loaded_files[++i]))
; ;
break; break;
...@@ -1065,7 +1043,7 @@ free_file_buffer_tags (file_buffer) ...@@ -1065,7 +1043,7 @@ free_file_buffer_tags (file_buffer)
{ {
register TAG *tag; register TAG *tag;
for (i = 0; tag = file_buffer->tags[i]; i++) for (i = 0; (tag = file_buffer->tags[i]); i++)
free_info_tag (tag); free_info_tag (tag);
free (file_buffer->tags); free (file_buffer->tags);
......
/* nodes.h -- How we represent nodes internally. */ /* nodes.h -- How we represent nodes internally.
$Id: nodes.h,v 1.5 1997/07/18 14:33:44 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,10 +22,10 @@ ...@@ -21,10 +22,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_NODES_H_) #if !defined (NODES_H)
#define _NODES_H_ #define NODES_H
#include "general.h" #include "info.h"
/* **************************************************************** */ /* **************************************************************** */
/* */ /* */
...@@ -165,4 +166,4 @@ extern char *info_recent_file_error; ...@@ -165,4 +166,4 @@ extern char *info_recent_file_error;
/* Create a new, empty file buffer. */ /* Create a new, empty file buffer. */
extern FILE_BUFFER *make_file_buffer (); extern FILE_BUFFER *make_file_buffer ();
#endif /* !_NODES_H_ */ #endif /* !NODES_H */
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* This file is part of GNU Info, a program for reading online documentation /* This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,17 +21,11 @@ ...@@ -21,17 +21,11 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <ctype.h> #include "info.h"
#include <sys/types.h>
#include <sys/stat.h>
#include "general.h"
#include "search.h" #include "search.h"
#include "nodes.h" #include "nodes.h"
#if !defined (NULL)
# define NULL 0x0
#endif /* !NULL */
/* The search functions take two arguments: /* The search functions take two arguments:
1) a string to search for, and 1) a string to search for, and
...@@ -115,7 +109,7 @@ search_forward (string, binding) ...@@ -115,7 +109,7 @@ search_forward (string, binding)
if (binding->flags & S_FoldCase) if (binding->flags & S_FoldCase)
{ {
alternate = strdup (string); alternate = xstrdup (string);
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
...@@ -184,7 +178,7 @@ search_backward (input_string, binding) ...@@ -184,7 +178,7 @@ search_backward (input_string, binding)
if (binding->flags & S_FoldCase) if (binding->flags & S_FoldCase)
{ {
alternate = strdup (string); alternate = xstrdup (string);
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
...@@ -364,7 +358,13 @@ skip_node_characters (string, newlines_okay) ...@@ -364,7 +358,13 @@ skip_node_characters (string, newlines_okay)
((paren_seen && string[i - 1] == ')') && ((paren_seen && string[i - 1] == ')') &&
(c == ' ' || c == '.')) || (c == ' ' || c == '.')) ||
(c == '.' && (c == '.' &&
((!string[i + 1]) || (
#if 0
/* This test causes a node name ending in a period, like `This.', not to
be found. The trailing . is stripped. This occurs in the jargon
file (`I see no X here.' is a node name). */
(!string[i + 1]) ||
#endif
(whitespace_or_newline (string[i + 1])) || (whitespace_or_newline (string[i + 1])) ||
(string[i + 1] == ')')))) (string[i + 1] == ')'))))
break; break;
...@@ -482,8 +482,8 @@ find_node_in_binding (nodename, binding) ...@@ -482,8 +482,8 @@ find_node_in_binding (nodename, binding)
char *nodename; char *nodename;
SEARCH_BINDING *binding; SEARCH_BINDING *binding;
{ {
register long position; long position;
register int offset, namelen; int offset, namelen;
SEARCH_BINDING search; SEARCH_BINDING search;
namelen = strlen (nodename); namelen = strlen (nodename);
......
/* search.h -- Structure used to search large bodies of text, with bounds. */ /* search.h -- Structure used to search large bodies of text, with bounds.
$Id: search.h,v 1.3 1997/07/15 18:43:49 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -31,8 +32,8 @@ ...@@ -31,8 +32,8 @@
They return a long, which is the offset from the start of the buffer They return a long, which is the offset from the start of the buffer
at which the match was found. An offset of -1 indicates failure. */ at which the match was found. An offset of -1 indicates failure. */
#if !defined (_SEARCH_H_) #ifndef INFO_SEARCH_H
#define _SEARCH_H_ #define INFO_SEARCH_H
typedef struct { typedef struct {
char *buffer; /* The buffer of text to search. */ char *buffer; /* The buffer of text to search. */
...@@ -71,5 +72,4 @@ extern int skip_node_characters (), skip_node_separator (); ...@@ -71,5 +72,4 @@ extern int skip_node_characters (), skip_node_separator ();
extern long find_node_separator (), find_tags_table (); extern long find_node_separator (), find_tags_table ();
extern long find_node_in_binding (); extern long find_node_in_binding ();
#endif /* !_SEARCH_H_ */ #endif /* not INFO_SEARCH_H */
/* session.c -- The user windowing interface to Info. */ /* session.c -- The user windowing interface to Info.
$Id: session.c,v 1.12 1997/07/24 21:34:00 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -22,11 +20,7 @@ ...@@ -22,11 +20,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include "info.h" #include "info.h"
#if defined (HAVE_SYS_FILE_H)
#include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <fcntl.h>
#if defined (HAVE_SYS_TIME_H) #if defined (HAVE_SYS_TIME_H)
# include <sys/time.h> # include <sys/time.h>
...@@ -47,22 +41,22 @@ static void info_handle_pointer (); ...@@ -47,22 +41,22 @@ static void info_handle_pointer ();
/* **************************************************************** */ /* **************************************************************** */
/* The place that we are reading input from. */ /* The place that we are reading input from. */
static FILE *info_input_stream = (FILE *)NULL; static FILE *info_input_stream = NULL;
/* The last executed command. */ /* The last executed command. */
VFunction *info_last_executed_command = (VFunction *)NULL; VFunction *info_last_executed_command = NULL;
/* Becomes non-zero when 'q' is typed to an Info window. */ /* Becomes non-zero when 'q' is typed to an Info window. */
int quit_info_immediately = 0; int quit_info_immediately = 0;
/* Array of structures describing for each window which nodes have been /* Array of structures describing for each window which nodes have been
visited in that window. */ visited in that window. */
INFO_WINDOW **info_windows = (INFO_WINDOW **)NULL; INFO_WINDOW **info_windows = NULL;
/* Where to add the next window, if we need to add one. */ /* Where to add the next window, if we need to add one. */
static int info_windows_index = 0; static int info_windows_index = 0;
/* Number of slots allocated to INFO_WINDOWS. */ /* Number of slots allocated to `info_windows'. */
static int info_windows_slots = 0; static int info_windows_slots = 0;
void remember_window_and_node (), forget_window_and_nodes (); void remember_window_and_node (), forget_window_and_nodes ();
...@@ -92,7 +86,7 @@ begin_multiple_window_info_session (filename, nodenames) ...@@ -92,7 +86,7 @@ begin_multiple_window_info_session (filename, nodenames)
/* If this is the first node, initialize the info session. */ /* If this is the first node, initialize the info session. */
if (!window) if (!window)
{ {
initialize_info_session (node); initialize_info_session (node, 1);
window = active_window; window = active_window;
} }
else else
...@@ -145,7 +139,7 @@ begin_info_session_with_error (initial_node, format, arg) ...@@ -145,7 +139,7 @@ begin_info_session_with_error (initial_node, format, arg)
char *format; char *format;
void *arg; void *arg;
{ {
initialize_info_session (initial_node); initialize_info_session (initial_node, 1);
info_error (format, arg, (void *)NULL); info_error (format, arg, (void *)NULL);
info_session (); info_session ();
} }
...@@ -155,7 +149,7 @@ void ...@@ -155,7 +149,7 @@ void
begin_info_session (initial_node) begin_info_session (initial_node)
NODE *initial_node; NODE *initial_node;
{ {
initialize_info_session (initial_node); initialize_info_session (initial_node, 1);
display_startup_message_and_start (); display_startup_message_and_start ();
} }
...@@ -165,7 +159,7 @@ display_startup_message_and_start () ...@@ -165,7 +159,7 @@ display_startup_message_and_start ()
char *format; char *format;
format = replace_in_documentation format = replace_in_documentation
("Welcome to Info version %s. \"\\[get-help-window]\" for help, \"\\[menu-item]\" for menu item."); (_("Welcome to Info version %s. \"\\[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_string ());
info_session (); info_session ();
...@@ -175,9 +169,8 @@ display_startup_message_and_start () ...@@ -175,9 +169,8 @@ display_startup_message_and_start ()
void void
info_session () info_session ()
{ {
terminal_prep_terminal ();
display_update_display (windows); display_update_display (windows);
info_last_executed_command = (VFunction *)NULL; info_last_executed_command = NULL;
info_read_and_dispatch (); info_read_and_dispatch ();
/* On program exit, leave the cursor at the bottom of the window, and /* On program exit, leave the cursor at the bottom of the window, and
restore the terminal I/O. */ restore the terminal I/O. */
...@@ -260,14 +253,13 @@ info_read_and_dispatch () ...@@ -260,14 +253,13 @@ info_read_and_dispatch ()
extern void initialize_info_signal_handler (); extern void initialize_info_signal_handler ();
/* Initialize the first info session by starting the terminal, window, /* Initialize the first info session by starting the terminal, window,
and display systems. */ and display systems. If CLEAR_SCREEN is 0, don't clear the screen. */
void void
initialize_info_session (node) initialize_info_session (node, clear_screen)
NODE *node; NODE *node;
int clear_screen;
{ {
char *getenv (), *term_name; char *term_name = getenv ("TERM");
term_name = getenv ("TERM");
terminal_initialize_terminal (term_name); terminal_initialize_terminal (term_name);
if (terminal_is_dumb_p) if (terminal_is_dumb_p)
...@@ -279,7 +271,12 @@ initialize_info_session (node) ...@@ -279,7 +271,12 @@ initialize_info_session (node)
exit (1); exit (1);
} }
if (clear_screen)
{
terminal_prep_terminal ();
terminal_clear_screen (); terminal_clear_screen ();
}
initialize_info_keymaps (); initialize_info_keymaps ();
window_initialize_windows (screenwidth, screenheight); window_initialize_windows (screenwidth, screenheight);
initialize_info_signal_handler (); initialize_info_signal_handler ();
...@@ -290,9 +287,13 @@ initialize_info_session (node) ...@@ -290,9 +287,13 @@ initialize_info_session (node)
asynchronously deleted (e.g., user resizes window very small). */ asynchronously deleted (e.g., user resizes window very small). */
window_deletion_notifier = forget_window_and_nodes; window_deletion_notifier = forget_window_and_nodes;
/* If input has not been redirected yet, make it come from STDIN. */ /* If input has not been redirected yet, make it come from unbuffered
standard input. */
if (!info_input_stream) if (!info_input_stream)
{
setbuf(stdin, NULL);
info_input_stream = stdin; info_input_stream = stdin;
}
info_windows_initialized_p = 1; info_windows_initialized_p = 1;
} }
...@@ -361,10 +362,8 @@ remember_window_and_node (window, node) ...@@ -361,10 +362,8 @@ remember_window_and_node (window, node)
WINDOW *window; WINDOW *window;
NODE *node; NODE *node;
{ {
INFO_WINDOW *info_win;
/* See if we already have this window in our list. */ /* See if we already have this window in our list. */
info_win = get_info_window_of_window (window); INFO_WINDOW *info_win = get_info_window_of_window (window);
/* If the window wasn't already on our list, then make a new entry. */ /* If the window wasn't already on our list, then make a new entry. */
if (!info_win) if (!info_win)
...@@ -383,17 +382,15 @@ remember_window_and_node (window, node) ...@@ -383,17 +382,15 @@ remember_window_and_node (window, node)
} }
/* If this node, the current pagetop, and the current point are the /* If this node, the current pagetop, and the current point are the
same as the last saved node and pagetop, don't really add this to same as the current saved node and pagetop, don't really add this to
the list of history nodes. */ the list of history nodes. This may happen only at the very
{ beginning of the program, I'm not sure. --karl */
int ni = info_win->nodes_index - 1; if (info_win->nodes
&& info_win->current >= 0
if ((ni != -1) && && info_win->nodes[info_win->current]->contents == node->contents
(info_win->nodes[ni]->contents == node->contents) && && info_win->pagetops[info_win->current] == window->pagetop
(info_win->pagetops[ni] == window->pagetop) && && info_win->points[info_win->current] == window->point)
(info_win->points[ni] == window->point))
return; return;
}
/* Remember this node, the currently displayed pagetop, and the current /* Remember this node, the currently displayed pagetop, and the current
location of point in this window. Because we are updating pagetops location of point in this window. Because we are updating pagetops
...@@ -401,22 +398,20 @@ remember_window_and_node (window, node) ...@@ -401,22 +398,20 @@ remember_window_and_node (window, node)
add_pointer_to_array macro here. */ add_pointer_to_array macro here. */
if (info_win->nodes_index + 2 >= info_win->nodes_slots) if (info_win->nodes_index + 2 >= info_win->nodes_slots)
{ {
info_win->nodes = (NODE **) info_win->nodes_slots += 20;
xrealloc (info_win->nodes, info_win->nodes = (NODE **) xrealloc (info_win->nodes,
(info_win->nodes_slots += 20) * sizeof (NODE *)); info_win->nodes_slots * sizeof (NODE *));
info_win->pagetops = (int *) xrealloc (info_win->pagetops,
info_win->pagetops = (int *) info_win->nodes_slots * sizeof (int));
xrealloc (info_win->pagetops, info_win->nodes_slots * sizeof (int)); info_win->points = (long *) xrealloc (info_win->points,
info_win->nodes_slots * sizeof (long));
info_win->points = (long *)
xrealloc (info_win->points, info_win->nodes_slots * sizeof (long));
} }
info_win->nodes[info_win->nodes_index] = node; info_win->nodes[info_win->nodes_index] = node;
info_win->pagetops[info_win->nodes_index] = window->pagetop; info_win->pagetops[info_win->nodes_index] = window->pagetop;
info_win->points[info_win->nodes_index] = window->point; info_win->points[info_win->nodes_index] = window->point;
info_win->current = info_win->nodes_index++; info_win->current = info_win->nodes_index++;
info_win->nodes[info_win->nodes_index] = (NODE *)NULL; info_win->nodes[info_win->nodes_index] = NULL;
info_win->pagetops[info_win->nodes_index] = 0; info_win->pagetops[info_win->nodes_index] = 0;
info_win->points[info_win->nodes_index] = 0; info_win->points[info_win->nodes_index] = 0;
} }
...@@ -427,7 +422,6 @@ static void ...@@ -427,7 +422,6 @@ static void
consistency_check_info_windows () consistency_check_info_windows ()
{ {
register int i; register int i;
INFO_WINDOW *info_win;
for (i = 0; i < info_windows_index; i++) for (i = 0; i < info_windows_index; i++)
{ {
...@@ -632,7 +626,7 @@ move_to_new_line (old, new, window) ...@@ -632,7 +626,7 @@ move_to_new_line (old, new, window)
} }
/* Move WINDOW's point down to the next line if possible. */ /* Move WINDOW's point down to the next line if possible. */
DECLARE_INFO_COMMAND (info_next_line, "Move down to the next line") DECLARE_INFO_COMMAND (info_next_line, _("Move down to the next line"))
{ {
int old_line, new_line; int old_line, new_line;
...@@ -647,7 +641,7 @@ DECLARE_INFO_COMMAND (info_next_line, "Move down to the next line") ...@@ -647,7 +641,7 @@ DECLARE_INFO_COMMAND (info_next_line, "Move down to the next line")
} }
/* Move WINDOW's point up to the previous line if possible. */ /* Move WINDOW's point up to the previous line if possible. */
DECLARE_INFO_COMMAND (info_prev_line, "Move up to the previous line") DECLARE_INFO_COMMAND (info_prev_line, _("Move up to the previous line"))
{ {
int old_line, new_line; int old_line, new_line;
...@@ -662,7 +656,7 @@ DECLARE_INFO_COMMAND (info_prev_line, "Move up to the previous line") ...@@ -662,7 +656,7 @@ DECLARE_INFO_COMMAND (info_prev_line, "Move up to the previous line")
} }
/* Move WINDOW's point to the end of the true line. */ /* Move WINDOW's point to the end of the true line. */
DECLARE_INFO_COMMAND (info_end_of_line, "Move to the end of the line") DECLARE_INFO_COMMAND (info_end_of_line, _("Move to the end of the line"))
{ {
register int point, len; register int point, len;
register char *buffer; register char *buffer;
...@@ -682,7 +676,7 @@ DECLARE_INFO_COMMAND (info_end_of_line, "Move to the end of the line") ...@@ -682,7 +676,7 @@ DECLARE_INFO_COMMAND (info_end_of_line, "Move to the end of the line")
} }
/* Move WINDOW's point to the beginning of the true line. */ /* Move WINDOW's point to the beginning of the true line. */
DECLARE_INFO_COMMAND (info_beginning_of_line, "Move to the start of the line") DECLARE_INFO_COMMAND (info_beginning_of_line, _("Move to the start of the line"))
{ {
register int point; register int point;
register char *buffer; register char *buffer;
...@@ -701,7 +695,7 @@ DECLARE_INFO_COMMAND (info_beginning_of_line, "Move to the start of the line") ...@@ -701,7 +695,7 @@ DECLARE_INFO_COMMAND (info_beginning_of_line, "Move to the start of the line")
} }
/* Move point forward in the node. */ /* Move point forward in the node. */
DECLARE_INFO_COMMAND (info_forward_char, "Move forward a character") DECLARE_INFO_COMMAND (info_forward_char, _("Move forward a character"))
{ {
if (count < 0) if (count < 0)
info_backward_char (window, -count, key); info_backward_char (window, -count, key);
...@@ -717,7 +711,7 @@ DECLARE_INFO_COMMAND (info_forward_char, "Move forward a character") ...@@ -717,7 +711,7 @@ DECLARE_INFO_COMMAND (info_forward_char, "Move forward a character")
} }
/* Move point backward in the node. */ /* Move point backward in the node. */
DECLARE_INFO_COMMAND (info_backward_char, "Move backward a character") DECLARE_INFO_COMMAND (info_backward_char, _("Move backward a character"))
{ {
if (count < 0) if (count < 0)
info_forward_char (window, -count, key); info_forward_char (window, -count, key);
...@@ -735,7 +729,7 @@ DECLARE_INFO_COMMAND (info_backward_char, "Move backward a character") ...@@ -735,7 +729,7 @@ DECLARE_INFO_COMMAND (info_backward_char, "Move backward a character")
#define alphabetic(c) (islower (c) || isupper (c) || isdigit (c)) #define alphabetic(c) (islower (c) || isupper (c) || isdigit (c))
/* Move forward a word in this node. */ /* Move forward a word in this node. */
DECLARE_INFO_COMMAND (info_forward_word, "Move forward a word") DECLARE_INFO_COMMAND (info_forward_word, _("Move forward a word"))
{ {
long point; long point;
char *buffer; char *buffer;
...@@ -784,7 +778,7 @@ DECLARE_INFO_COMMAND (info_forward_word, "Move forward a word") ...@@ -784,7 +778,7 @@ DECLARE_INFO_COMMAND (info_forward_word, "Move forward a word")
info_show_point (window); info_show_point (window);
} }
DECLARE_INFO_COMMAND (info_backward_word, "Move backward a word") DECLARE_INFO_COMMAND (info_backward_word, _("Move backward a word"))
{ {
long point; long point;
char *buffer; char *buffer;
...@@ -858,9 +852,9 @@ times_description (count) ...@@ -858,9 +852,9 @@ times_description (count)
break; break;
if (counter_names[i]) if (counter_names[i])
sprintf (td_buffer, "%s%s", counter_names[i], count > 2 ? " times" : ""); sprintf (td_buffer, "%s%s", counter_names[i], count > 2 ? _(" times") : "");
else else
sprintf (td_buffer, "%d times", count); sprintf (td_buffer, _("%d times"), count);
return (td_buffer); return (td_buffer);
} }
...@@ -898,11 +892,11 @@ forward_move_node_structure (window, behaviour) ...@@ -898,11 +892,11 @@ forward_move_node_structure (window, behaviour)
case IS_NextOnly: case IS_NextOnly:
info_next_label_of_node (window->node); info_next_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename) if (!info_parsed_nodename && !info_parsed_filename)
info_error ("No \"Next\" pointer for this node."); info_error (_("No \"Next\" pointer for this node."));
else else
{ {
window_message_in_echo_area ("Following \"Next\" node..."); window_message_in_echo_area (_("Following \"Next\" node..."));
info_handle_pointer ("Next", window); info_handle_pointer (_("Next"), window);
} }
break; break;
...@@ -918,7 +912,7 @@ forward_move_node_structure (window, behaviour) ...@@ -918,7 +912,7 @@ forward_move_node_structure (window, behaviour)
if (menu) if (menu)
{ {
info_free_references (menu); info_free_references (menu);
window_message_in_echo_area ("Selecting first menu item..."); window_message_in_echo_area (_("Selecting first menu item..."));
info_menu_digit (window, 1, '1'); info_menu_digit (window, 1, '1');
return; return;
} }
...@@ -929,8 +923,8 @@ forward_move_node_structure (window, behaviour) ...@@ -929,8 +923,8 @@ forward_move_node_structure (window, behaviour)
info_next_label_of_node (window->node); info_next_label_of_node (window->node);
if (info_label_was_found) if (info_label_was_found)
{ {
window_message_in_echo_area ("Selecting \"Next\" node..."); window_message_in_echo_area (_("Selecting \"Next\" node..."));
info_handle_pointer ("Next", window); info_handle_pointer (_("Next"), window);
return; return;
} }
...@@ -953,7 +947,7 @@ forward_move_node_structure (window, behaviour) ...@@ -953,7 +947,7 @@ forward_move_node_structure (window, behaviour)
info_up_label_of_node (window->node); info_up_label_of_node (window->node);
if (info_label_was_found) if (info_label_was_found)
{ {
info_handle_pointer ("Up", window); info_handle_pointer (_("Up"), window);
if (info_error_was_printed) if (info_error_was_printed)
continue; continue;
...@@ -975,7 +969,7 @@ forward_move_node_structure (window, behaviour) ...@@ -975,7 +969,7 @@ forward_move_node_structure (window, behaviour)
/* Remember the name of the Next node, since reading /* Remember the name of the Next node, since reading
the menu can overwrite the contents of the the menu can overwrite the contents of the
info_parsed_xxx strings. */ info_parsed_xxx strings. */
next_nodename = strdup (info_parsed_nodename); next_nodename = xstrdup (info_parsed_nodename);
menu = info_menu_of_node (window->node); menu = info_menu_of_node (window->node);
if (menu && if (menu &&
...@@ -1002,7 +996,7 @@ forward_move_node_structure (window, behaviour) ...@@ -1002,7 +996,7 @@ forward_move_node_structure (window, behaviour)
("Moving \"Up\" %s, then \"Next\".", ("Moving \"Up\" %s, then \"Next\".",
times_description (up_counter)); times_description (up_counter));
info_handle_pointer ("Next", window); info_handle_pointer (_("Next"), window);
return; return;
} }
else else
...@@ -1023,7 +1017,7 @@ forward_move_node_structure (window, behaviour) ...@@ -1023,7 +1017,7 @@ forward_move_node_structure (window, behaviour)
window->point = info_win->points[old_current]; window->point = info_win->points[old_current];
recalculate_line_starts (window); recalculate_line_starts (window);
window->flags |= W_UpdateWindow; window->flags |= W_UpdateWindow;
info_error ("No more nodes."); info_error (_("No more nodes."));
} }
} }
} }
...@@ -1047,11 +1041,11 @@ backward_move_node_structure (window, behaviour) ...@@ -1047,11 +1041,11 @@ backward_move_node_structure (window, behaviour)
case IS_NextOnly: case IS_NextOnly:
info_prev_label_of_node (window->node); info_prev_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename) if (!info_parsed_nodename && !info_parsed_filename)
info_error ("No \"Prev\" for this node."); info_error (_("No \"Prev\" for this node."));
else else
{ {
window_message_in_echo_area ("Moving \"Prev\" in this window."); window_message_in_echo_area (_("Moving \"Prev\" in this window."));
info_handle_pointer ("Prev", window); info_handle_pointer (_("Prev"), window);
} }
break; break;
...@@ -1062,11 +1056,11 @@ backward_move_node_structure (window, behaviour) ...@@ -1062,11 +1056,11 @@ backward_move_node_structure (window, behaviour)
{ {
info_up_label_of_node (window->node); info_up_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename) if (!info_parsed_nodename && !info_parsed_filename)
info_error ("No \"Prev\" or \"Up\" for this node."); info_error (_("No \"Prev\" or \"Up\" for this node."));
else else
{ {
window_message_in_echo_area ("Moving \"Up\" in this window."); window_message_in_echo_area (_("Moving \"Up\" in this window."));
info_handle_pointer ("Up", window); info_handle_pointer (_("Up"), window);
} }
} }
else else
...@@ -1082,7 +1076,7 @@ backward_move_node_structure (window, behaviour) ...@@ -1082,7 +1076,7 @@ backward_move_node_structure (window, behaviour)
{ {
char *pnode; char *pnode;
pnode = strdup (info_parsed_nodename); pnode = xstrdup (info_parsed_nodename);
info_up_label_of_node (window->node); info_up_label_of_node (window->node);
if (!info_parsed_filename && info_parsed_nodename && if (!info_parsed_filename && info_parsed_nodename &&
...@@ -1103,8 +1097,8 @@ backward_move_node_structure (window, behaviour) ...@@ -1103,8 +1097,8 @@ backward_move_node_structure (window, behaviour)
/* Move to the previous node. If this node now contains a menu, /* Move to the previous node. If this node now contains a menu,
and we have not inhibited movement to it, move to the node and we have not inhibited movement to it, move to the node
corresponding to the last menu item. */ corresponding to the last menu item. */
window_message_in_echo_area ("Moving \"Prev\" in this window."); window_message_in_echo_area (_("Moving \"Prev\" in this window."));
info_handle_pointer ("Prev", window); info_handle_pointer (_("Prev"), window);
if (!inhibit_menu_traversing) if (!inhibit_menu_traversing)
{ {
...@@ -1113,7 +1107,7 @@ backward_move_node_structure (window, behaviour) ...@@ -1113,7 +1107,7 @@ backward_move_node_structure (window, behaviour)
{ {
info_free_references (menu); info_free_references (menu);
window_message_in_echo_area 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'); info_menu_digit (window, 1, '0');
} }
} }
...@@ -1124,7 +1118,7 @@ backward_move_node_structure (window, behaviour) ...@@ -1124,7 +1118,7 @@ backward_move_node_structure (window, behaviour)
/* Move continuously forward through the node structure of this info file. */ /* Move continuously forward through the node structure of this info file. */
DECLARE_INFO_COMMAND (info_global_next_node, DECLARE_INFO_COMMAND (info_global_next_node,
"Move forwards or down through node structure") _("Move forwards or down through node structure"))
{ {
if (count < 0) if (count < 0)
info_global_prev_node (window, -count, key); info_global_prev_node (window, -count, key);
...@@ -1140,7 +1134,7 @@ DECLARE_INFO_COMMAND (info_global_next_node, ...@@ -1140,7 +1134,7 @@ DECLARE_INFO_COMMAND (info_global_next_node,
/* Move continuously backward through the node structure of this info file. */ /* Move continuously backward through the node structure of this info file. */
DECLARE_INFO_COMMAND (info_global_prev_node, DECLARE_INFO_COMMAND (info_global_prev_node,
"Move backwards or up through node structure") _("Move backwards or up through node structure"))
{ {
if (count < 0) if (count < 0)
info_global_next_node (window, -count, key); info_global_next_node (window, -count, key);
...@@ -1155,7 +1149,7 @@ DECLARE_INFO_COMMAND (info_global_prev_node, ...@@ -1155,7 +1149,7 @@ DECLARE_INFO_COMMAND (info_global_prev_node,
} }
/* Show the next screen of WINDOW's node. */ /* Show the next screen of WINDOW's node. */
DECLARE_INFO_COMMAND (info_scroll_forward, "Scroll forward in this window") DECLARE_INFO_COMMAND (info_scroll_forward, _("Scroll forward in this window"))
{ {
if (count < 0) if (count < 0)
info_scroll_backward (window, -count, key); info_scroll_backward (window, -count, key);
...@@ -1200,7 +1194,7 @@ DECLARE_INFO_COMMAND (info_scroll_forward, "Scroll forward in this window") ...@@ -1200,7 +1194,7 @@ DECLARE_INFO_COMMAND (info_scroll_forward, "Scroll forward in this window")
} }
/* Show the previous screen of WINDOW's node. */ /* Show the previous screen of WINDOW's node. */
DECLARE_INFO_COMMAND (info_scroll_backward, "Scroll backward in this window") DECLARE_INFO_COMMAND (info_scroll_backward, _("Scroll backward in this window"))
{ {
if (count < 0) if (count < 0)
info_scroll_forward (window, -count, key); info_scroll_forward (window, -count, key);
...@@ -1240,14 +1234,14 @@ DECLARE_INFO_COMMAND (info_scroll_backward, "Scroll backward in this window") ...@@ -1240,14 +1234,14 @@ DECLARE_INFO_COMMAND (info_scroll_backward, "Scroll backward in this window")
} }
/* Move to the beginning of the node. */ /* Move to the beginning of the node. */
DECLARE_INFO_COMMAND (info_beginning_of_node, "Move to the start of this node") DECLARE_INFO_COMMAND (info_beginning_of_node, _("Move to the start of this node"))
{ {
window->pagetop = window->point = 0; window->pagetop = window->point = 0;
window->flags |= W_UpdateWindow; window->flags |= W_UpdateWindow;
} }
/* Move to the end of the node. */ /* Move to the end of the node. */
DECLARE_INFO_COMMAND (info_end_of_node, "Move to the end of this node") DECLARE_INFO_COMMAND (info_end_of_node, _("Move to the end of this node"))
{ {
window->point = window->node->nodelen - 1; window->point = window->node->nodelen - 1;
info_show_point (window); info_show_point (window);
...@@ -1260,7 +1254,7 @@ DECLARE_INFO_COMMAND (info_end_of_node, "Move to the end of this node") ...@@ -1260,7 +1254,7 @@ DECLARE_INFO_COMMAND (info_end_of_node, "Move to the end of this node")
/* **************************************************************** */ /* **************************************************************** */
/* Make the next window in the chain be the active window. */ /* Make the next window in the chain be the active window. */
DECLARE_INFO_COMMAND (info_next_window, "Select the next window") DECLARE_INFO_COMMAND (info_next_window, _("Select the next window"))
{ {
if (count < 0) if (count < 0)
{ {
...@@ -1299,7 +1293,7 @@ DECLARE_INFO_COMMAND (info_next_window, "Select the next window") ...@@ -1299,7 +1293,7 @@ DECLARE_INFO_COMMAND (info_next_window, "Select the next window")
} }
/* Make the previous window in the chain be the active window. */ /* Make the previous window in the chain be the active window. */
DECLARE_INFO_COMMAND (info_prev_window, "Select the previous window") DECLARE_INFO_COMMAND (info_prev_window, _("Select the previous window"))
{ {
if (count < 0) if (count < 0)
{ {
...@@ -1350,7 +1344,7 @@ DECLARE_INFO_COMMAND (info_prev_window, "Select the previous window") ...@@ -1350,7 +1344,7 @@ DECLARE_INFO_COMMAND (info_prev_window, "Select the previous window")
/* Split WINDOW into two windows, both showing the same node. If we /* Split WINDOW into two windows, both showing the same node. If we
are automatically tiling windows, re-tile after the split. */ are automatically tiling windows, re-tile after the split. */
DECLARE_INFO_COMMAND (info_split_window, "Split the current window") DECLARE_INFO_COMMAND (info_split_window, _("Split the current window"))
{ {
WINDOW *split, *old_active; WINDOW *split, *old_active;
int pagetop; int pagetop;
...@@ -1396,7 +1390,7 @@ DECLARE_INFO_COMMAND (info_split_window, "Split the current window") ...@@ -1396,7 +1390,7 @@ DECLARE_INFO_COMMAND (info_split_window, "Split the current window")
NODE *node = (NODE *)NULL; NODE *node = (NODE *)NULL;
char *filename; char *filename;
for (i = 0; iw = info_windows[i]; i++) for (i = 0; (iw = info_windows[i]); i++)
{ {
for (j = 0; j < iw->nodes_index; j++) for (j = 0; j < iw->nodes_index; j++)
if (!internal_info_node_p (iw->nodes[j])) if (!internal_info_node_p (iw->nodes[j]))
...@@ -1431,7 +1425,7 @@ DECLARE_INFO_COMMAND (info_split_window, "Split the current window") ...@@ -1431,7 +1425,7 @@ DECLARE_INFO_COMMAND (info_split_window, "Split the current window")
automatically displaying footnotes, show or remove the footnotes automatically displaying footnotes, show or remove the footnotes
window. If we are automatically tiling windows, re-tile after the window. If we are automatically tiling windows, re-tile after the
deletion. */ deletion. */
DECLARE_INFO_COMMAND (info_delete_window, "Delete the current window") DECLARE_INFO_COMMAND (info_delete_window, _("Delete the current window"))
{ {
if (!windows->next) if (!windows->next)
{ {
...@@ -1439,7 +1433,7 @@ DECLARE_INFO_COMMAND (info_delete_window, "Delete the current window") ...@@ -1439,7 +1433,7 @@ DECLARE_INFO_COMMAND (info_delete_window, "Delete the current window")
} }
else if (window->flags & W_WindowIsPerm) else if (window->flags & W_WindowIsPerm)
{ {
info_error ("Cannot delete a permanent window"); info_error (_("Cannot delete a permanent window"));
} }
else else
{ {
...@@ -1472,7 +1466,7 @@ info_delete_window_internal (window) ...@@ -1472,7 +1466,7 @@ info_delete_window_internal (window)
} }
/* Just keep WINDOW, deleting all others. */ /* Just keep WINDOW, deleting all others. */
DECLARE_INFO_COMMAND (info_keep_one_window, "Delete all other windows") DECLARE_INFO_COMMAND (info_keep_one_window, _("Delete all other windows"))
{ {
int num_deleted; /* The number of windows we deleted. */ int num_deleted; /* The number of windows we deleted. */
int pagetop, start, end; int pagetop, start, end;
...@@ -1518,7 +1512,7 @@ DECLARE_INFO_COMMAND (info_keep_one_window, "Delete all other windows") ...@@ -1518,7 +1512,7 @@ DECLARE_INFO_COMMAND (info_keep_one_window, "Delete all other windows")
} }
/* Scroll the "other" window of WINDOW. */ /* Scroll the "other" window of WINDOW. */
DECLARE_INFO_COMMAND (info_scroll_other_window, "Scroll the other window") DECLARE_INFO_COMMAND (info_scroll_other_window, _("Scroll the other window"))
{ {
WINDOW *other; WINDOW *other;
...@@ -1538,7 +1532,7 @@ DECLARE_INFO_COMMAND (info_scroll_other_window, "Scroll the other window") ...@@ -1538,7 +1532,7 @@ DECLARE_INFO_COMMAND (info_scroll_other_window, "Scroll the other window")
} }
/* Change the size of WINDOW by AMOUNT. */ /* Change the size of WINDOW by AMOUNT. */
DECLARE_INFO_COMMAND (info_grow_window, "Grow (or shrink) this window") DECLARE_INFO_COMMAND (info_grow_window, _("Grow (or shrink) this window"))
{ {
window_change_window_height (window, count); window_change_window_height (window, count);
} }
...@@ -1549,14 +1543,14 @@ int auto_tiling_p = 0; ...@@ -1549,14 +1543,14 @@ int auto_tiling_p = 0;
/* Tile all of the visible windows. */ /* Tile all of the visible windows. */
DECLARE_INFO_COMMAND (info_tile_windows, DECLARE_INFO_COMMAND (info_tile_windows,
"Divide the available screen space among the visible windows") _("Divide the available screen space among the visible windows"))
{ {
window_tile_windows (TILE_INTERNALS); window_tile_windows (TILE_INTERNALS);
} }
/* Toggle the state of this window's wrapping of lines. */ /* Toggle the state of this window's wrapping of lines. */
DECLARE_INFO_COMMAND (info_toggle_wrap, DECLARE_INFO_COMMAND (info_toggle_wrap,
"Toggle the state of line wrapping in the current window") _("Toggle the state of line wrapping in the current window"))
{ {
window_toggle_wrap (window); window_toggle_wrap (window);
} }
...@@ -1586,12 +1580,12 @@ info_select_reference (window, entry) ...@@ -1586,12 +1580,12 @@ info_select_reference (window, entry)
filename = window->node->filename; filename = window->node->filename;
if (filename) if (filename)
filename = strdup (filename); filename = xstrdup (filename);
if (entry->nodename) if (entry->nodename)
nodename = strdup (entry->nodename); nodename = xstrdup (entry->nodename);
else else
nodename = strdup ("Top"); nodename = xstrdup ("Top");
node = info_get_node (filename, nodename); node = info_get_node (filename, nodename);
...@@ -1601,7 +1595,7 @@ info_select_reference (window, entry) ...@@ -1601,7 +1595,7 @@ info_select_reference (window, entry)
if (!node) if (!node)
{ {
if (info_recent_file_error) if (info_recent_file_error)
file_system_error = strdup (info_recent_file_error); file_system_error = xstrdup (info_recent_file_error);
if (entry->nodename && (strcmp (entry->nodename, entry->label) == 0)) if (entry->nodename && (strcmp (entry->nodename, entry->label) == 0))
{ {
...@@ -1609,7 +1603,7 @@ info_select_reference (window, entry) ...@@ -1609,7 +1603,7 @@ info_select_reference (window, entry)
if (!node && info_recent_file_error) if (!node && info_recent_file_error)
{ {
maybe_free (file_system_error); maybe_free (file_system_error);
file_system_error = strdup (info_recent_file_error); file_system_error = xstrdup (info_recent_file_error);
} }
} }
} }
...@@ -1669,19 +1663,19 @@ info_handle_pointer (label, window) ...@@ -1669,19 +1663,19 @@ info_handle_pointer (label, window)
filename = nodename = (char *)NULL; filename = nodename = (char *)NULL;
if (info_parsed_filename) if (info_parsed_filename)
filename = strdup (info_parsed_filename); filename = xstrdup (info_parsed_filename);
else else
{ {
if (window->node->parent) if (window->node->parent)
filename = strdup (window->node->parent); filename = xstrdup (window->node->parent);
else if (window->node->filename) else if (window->node->filename)
filename = strdup (window->node->filename); filename = xstrdup (window->node->filename);
} }
if (info_parsed_nodename) if (info_parsed_nodename)
nodename = strdup (info_parsed_nodename); nodename = xstrdup (info_parsed_nodename);
else else
nodename = strdup ("Top"); nodename = xstrdup ("Top");
node = info_get_node (filename, nodename); node = info_get_node (filename, nodename);
...@@ -1717,30 +1711,30 @@ info_handle_pointer (label, window) ...@@ -1717,30 +1711,30 @@ info_handle_pointer (label, window)
/* Make WINDOW display the "Next:" node of the node currently being /* Make WINDOW display the "Next:" node of the node currently being
displayed. */ 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_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 /* Make WINDOW display the "Prev:" node of the node currently being
displayed. */ 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_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 /* Make WINDOW display the "Up:" node of the node currently being
displayed. */ 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_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. */ /* Make WINDOW display the last node of this info file. */
DECLARE_INFO_COMMAND (info_last_node, "Select the last node in this file") DECLARE_INFO_COMMAND (info_last_node, _("Select the last node in this file"))
{ {
register int i; register int i;
FILE_BUFFER *fb = file_buffer_of_window (window); FILE_BUFFER *fb = file_buffer_of_window (window);
...@@ -1753,7 +1747,7 @@ DECLARE_INFO_COMMAND (info_last_node, "Select the last node in this file") ...@@ -1753,7 +1747,7 @@ DECLARE_INFO_COMMAND (info_last_node, "Select the last node in this file")
} }
if (!node) if (!node)
info_error ("This window has no additional nodes"); info_error (_("This window has no additional nodes"));
else else
{ {
set_remembered_pagetop_and_point (window); set_remembered_pagetop_and_point (window);
...@@ -1762,7 +1756,7 @@ DECLARE_INFO_COMMAND (info_last_node, "Select the last node in this file") ...@@ -1762,7 +1756,7 @@ DECLARE_INFO_COMMAND (info_last_node, "Select the last node in this file")
} }
/* Make WINDOW display the first node of this info file. */ /* Make WINDOW display the first node of this info file. */
DECLARE_INFO_COMMAND (info_first_node, "Select the first node in this file") DECLARE_INFO_COMMAND (info_first_node, _("Select the first node in this file"))
{ {
FILE_BUFFER *fb = file_buffer_of_window (window); FILE_BUFFER *fb = file_buffer_of_window (window);
NODE *node = (NODE *)NULL; NODE *node = (NODE *)NULL;
...@@ -1771,7 +1765,7 @@ DECLARE_INFO_COMMAND (info_first_node, "Select the first node in this file") ...@@ -1771,7 +1765,7 @@ DECLARE_INFO_COMMAND (info_first_node, "Select the first node in this file")
node = info_get_node (fb->filename, fb->tags[0]->nodename); node = info_get_node (fb->filename, fb->tags[0]->nodename);
if (!node) if (!node)
info_error ("This window has no additional nodes"); info_error (_("This window has no additional nodes"));
else else
{ {
set_remembered_pagetop_and_point (window); set_remembered_pagetop_and_point (window);
...@@ -1779,55 +1773,15 @@ DECLARE_INFO_COMMAND (info_first_node, "Select the first node in this file") ...@@ -1779,55 +1773,15 @@ DECLARE_INFO_COMMAND (info_first_node, "Select the first node in this file")
} }
} }
/* Make WINDOW display the previous node displayed in this window. */
DECLARE_INFO_COMMAND (info_history_node,
"Select the most recently selected node")
{
INFO_WINDOW *info_win;
/* Find the INFO_WINDOW which contains WINDOW. */
info_win = get_info_window_of_window (window);
if (!info_win)
{
info_error ("Requested window is not present!");
return;
}
set_remembered_pagetop_and_point (window);
if (!info_win->current)
{
if (info_win->nodes_index > 1)
{
window_message_in_echo_area
("Now wrapped around to beginning of history.");
info_win->current = info_win->nodes_index;
}
else
{
info_error ("No earlier nodes in this window.");
return;
}
}
info_win->current--;
window_set_node_of_window (window, info_win->nodes[info_win->current]);
window->pagetop = info_win->pagetops[info_win->current];
window->point = info_win->points[info_win->current];
window->flags |= W_UpdateWindow;
if (auto_footnotes_p)
info_get_or_remove_footnotes (window);
}
/* Select the last menu item in WINDOW->node. */ /* Select the last menu item in WINDOW->node. */
DECLARE_INFO_COMMAND (info_last_menu_item, DECLARE_INFO_COMMAND (info_last_menu_item,
"Select the last item in this node's menu") _("Select the last item in this node's menu"))
{ {
info_menu_digit (window, 1, '0'); info_menu_digit (window, 1, '0');
} }
/* Use KEY (a digit) to select the Nth menu item in WINDOW->node. */ /* Use KEY (a digit) to select the Nth menu item in WINDOW->node. */
DECLARE_INFO_COMMAND (info_menu_digit, "Select this menu item") DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item"))
{ {
register int i, item; register int i, item;
register REFERENCE *entry, **menu; register REFERENCE *entry, **menu;
...@@ -1848,7 +1802,7 @@ DECLARE_INFO_COMMAND (info_menu_digit, "Select this menu item") ...@@ -1848,7 +1802,7 @@ DECLARE_INFO_COMMAND (info_menu_digit, "Select this menu item")
for (i = 0; menu[i + 1]; i++); for (i = 0; menu[i + 1]; i++);
else else
{ {
for (i = 0; entry = menu[i]; i++) for (i = 0; (entry = menu[i]); i++)
if (i == item - 1) if (i == item - 1)
break; break;
} }
...@@ -1856,7 +1810,7 @@ DECLARE_INFO_COMMAND (info_menu_digit, "Select this menu item") ...@@ -1856,7 +1810,7 @@ DECLARE_INFO_COMMAND (info_menu_digit, "Select this menu item")
if (menu[i]) if (menu[i])
info_select_reference (window, menu[i]); info_select_reference (window, menu[i]);
else else
info_error ("There aren't %d items in this menu.", item); info_error (_("There aren't %d items in this menu."), item);
info_free_references (menu); info_free_references (menu);
return; return;
...@@ -1959,14 +1913,14 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) ...@@ -1959,14 +1913,14 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
} }
defentry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); defentry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
defentry->label = strdup (refs[which]->label); defentry->label = xstrdup (refs[which]->label);
defentry->filename = refs[which]->filename; defentry->filename = refs[which]->filename;
defentry->nodename = refs[which]->nodename; defentry->nodename = refs[which]->nodename;
if (defentry->filename) if (defentry->filename)
defentry->filename = strdup (defentry->filename); defentry->filename = xstrdup (defentry->filename);
if (defentry->nodename) if (defentry->nodename)
defentry->nodename = strdup (defentry->nodename); defentry->nodename = xstrdup (defentry->nodename);
} }
info_free_references (refs); info_free_references (refs);
} }
...@@ -1987,16 +1941,16 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) ...@@ -1987,16 +1941,16 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
if (builder == info_menu_of_node) if (builder == info_menu_of_node)
{ {
if (defentry) if (defentry)
sprintf (prompt, "Menu item (%s): ", defentry->label); sprintf (prompt, _("Menu item (%s): "), defentry->label);
else else
sprintf (prompt, "Menu item: "); sprintf (prompt, _("Menu item: "));
} }
else else
{ {
if (defentry) if (defentry)
sprintf (prompt, "Follow xref (%s): ", defentry->label); sprintf (prompt, _("Follow xref (%s): "), defentry->label);
else else
sprintf (prompt, "Follow xref: "); sprintf (prompt, _("Follow xref: "));
} }
line = info_read_completing_in_echo_area (window, prompt, menu); line = info_read_completing_in_echo_area (window, prompt, menu);
...@@ -2018,7 +1972,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) ...@@ -2018,7 +1972,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
{ {
free (line); free (line);
if (defentry) if (defentry)
line = strdup (defentry->label); line = xstrdup (defentry->label);
else else
line = (char *)NULL; line = (char *)NULL;
} }
...@@ -2030,7 +1984,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) ...@@ -2030,7 +1984,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
if (!defentry) if (!defentry)
return; return;
else else
line = strdup (defentry->label); line = xstrdup (defentry->label);
} }
if (line) if (line)
...@@ -2039,7 +1993,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) ...@@ -2039,7 +1993,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
entry = info_get_labeled_reference (line, menu); entry = info_get_labeled_reference (line, menu);
if (!entry && defentry) if (!entry && defentry)
info_error ("The reference disappeared! (%s).", line); info_error (_("The reference disappeared! (%s)."), line);
else else
{ {
NODE *orig; NODE *orig;
...@@ -2085,7 +2039,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) ...@@ -2085,7 +2039,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
/* Read a line (with completion) which is the name of a menu item, /* Read a line (with completion) which is the name of a menu item,
and select that item. */ and select that item. */
DECLARE_INFO_COMMAND (info_menu_item, "Read a menu item and select its node") DECLARE_INFO_COMMAND (info_menu_item, _("Read a menu item and select its node"))
{ {
info_menu_or_ref_item (window, count, key, info_menu_of_node, 1); info_menu_or_ref_item (window, count, key, info_menu_of_node, 1);
} }
...@@ -2093,13 +2047,13 @@ DECLARE_INFO_COMMAND (info_menu_item, "Read a menu item and select its node") ...@@ -2093,13 +2047,13 @@ DECLARE_INFO_COMMAND (info_menu_item, "Read a menu item and select its node")
/* Read a line (with completion) which is the name of a reference to /* Read a line (with completion) which is the name of a reference to
follow, and select the node. */ follow, and select the node. */
DECLARE_INFO_COMMAND DECLARE_INFO_COMMAND
(info_xref_item, "Read a footnote or cross reference and select its node") (info_xref_item, _("Read a footnote or cross reference and select its node"))
{ {
info_menu_or_ref_item (window, count, key, info_xrefs_of_node, 1); info_menu_or_ref_item (window, count, key, info_xrefs_of_node, 1);
} }
/* Position the cursor at the start of this node's menu. */ /* Position the cursor at the start of this node's menu. */
DECLARE_INFO_COMMAND (info_find_menu, "Move to the start of this node's menu") DECLARE_INFO_COMMAND (info_find_menu, _("Move to the start of this node's menu"))
{ {
SEARCH_BINDING binding; SEARCH_BINDING binding;
long position; long position;
...@@ -2123,7 +2077,7 @@ DECLARE_INFO_COMMAND (info_find_menu, "Move to the start of this node's menu") ...@@ -2123,7 +2077,7 @@ DECLARE_INFO_COMMAND (info_find_menu, "Move to the start of this node's menu")
/* Visit as many menu items as is possible, each in a separate window. */ /* Visit as many menu items as is possible, each in a separate window. */
DECLARE_INFO_COMMAND (info_visit_menu, DECLARE_INFO_COMMAND (info_visit_menu,
"Visit as many menu items at once as possible") _("Visit as many menu items at once as possible"))
{ {
register int i; register int i;
REFERENCE *entry, **menu; REFERENCE *entry, **menu;
...@@ -2151,10 +2105,9 @@ DECLARE_INFO_COMMAND (info_visit_menu, ...@@ -2151,10 +2105,9 @@ DECLARE_INFO_COMMAND (info_visit_menu,
} }
/* Read a line of input which is a node name, and go to that node. */ /* Read a line of input which is a node name, and go to that node. */
DECLARE_INFO_COMMAND (info_goto_node, "Read a node name and select it") DECLARE_INFO_COMMAND (info_goto_node, _("Read a node name and select it"))
{ {
char *line; char *line;
NODE *node;
#define GOTO_COMPLETES #define GOTO_COMPLETES
#if defined (GOTO_COMPLETES) #if defined (GOTO_COMPLETES)
...@@ -2206,18 +2159,18 @@ DECLARE_INFO_COMMAND (info_goto_node, "Read a node name and select it") ...@@ -2206,18 +2159,18 @@ DECLARE_INFO_COMMAND (info_goto_node, "Read a node name and select it")
{ {
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->filename = entry->nodename = (char *)NULL; entry->filename = entry->nodename = (char *)NULL;
entry->label = strdup (fb->tags[i]->nodename); entry->label = xstrdup (fb->tags[i]->nodename);
add_pointer_to_array (entry, items_index, items, add_pointer_to_array (entry, items_index, items,
items_slots, 100, REFERENCE *); 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); info_free_references (items);
} }
#else /* !GOTO_COMPLETES */ #else /* !GOTO_COMPLETES */
line = info_read_in_echo_area (window, "Goto Node: "); line = info_read_in_echo_area (window, _("Goto Node: "));
#endif /* !GOTO_COMPLETES */ #endif /* !GOTO_COMPLETES */
/* If the user aborted, quit now. */ /* If the user aborted, quit now. */
...@@ -2238,12 +2191,11 @@ DECLARE_INFO_COMMAND (info_goto_node, "Read a node name and select it") ...@@ -2238,12 +2191,11 @@ DECLARE_INFO_COMMAND (info_goto_node, "Read a node name and select it")
} }
#if defined (HANDLE_MAN_PAGES) #if defined (HANDLE_MAN_PAGES)
DECLARE_INFO_COMMAND (info_man, "Read a manpage reference and select it") DECLARE_INFO_COMMAND (info_man, _("Read a manpage reference and select it"))
{ {
char *line; char *line;
NODE *node;
line = info_read_in_echo_area (window, "Get Manpage: "); line = info_read_in_echo_area (window, _("Get Manpage: "));
if (!line) if (!line)
{ {
...@@ -2273,49 +2225,44 @@ DECLARE_INFO_COMMAND (info_man, "Read a manpage reference and select it") ...@@ -2273,49 +2225,44 @@ DECLARE_INFO_COMMAND (info_man, "Read a manpage reference and select it")
#endif /* HANDLE_MAN_PAGES */ #endif /* HANDLE_MAN_PAGES */
/* Move to the "Top" node in this file. */ /* Move to the "Top" node in this file. */
DECLARE_INFO_COMMAND (info_top_node, "Select the node `Top' 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". */ /* Move to the node "(dir)Top". */
DECLARE_INFO_COMMAND (info_dir_node, "Select the node `(dir)'") DECLARE_INFO_COMMAND (info_dir_node, _("Select the node `(dir)'"))
{ {
info_parse_and_select ("(dir)Top", window); info_parse_and_select ("(dir)Top", window);
} }
/* Try to delete the current node appearing in this window, showing the most
recently selected node in this window. */
DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
{
register int iw, i;
register INFO_WINDOW *info_win;
char *nodename = (char *)NULL;
NODE *temp = (NODE *)NULL;
/* Read the name of a node to kill. The list of available nodes comes /* Read the name of a node to kill. The list of available nodes comes
from the nodes appearing in the current window configuration. */ from the nodes appearing in the current window configuration. */
{ static char *
REFERENCE **menu = (REFERENCE **)NULL; read_nodename_to_kill (window)
WINDOW *window;
{
int iw;
char *nodename;
INFO_WINDOW *info_win;
REFERENCE **menu = NULL;
int menu_index = 0, menu_slots = 0; int menu_index = 0, menu_slots = 0;
char *default_nodename, *prompt; char *default_nodename = xstrdup (active_window->node->nodename);
char *prompt = xmalloc (40 + strlen (default_nodename));
for (iw = 0; info_win = info_windows[iw]; iw++) sprintf (prompt, _("Kill node (%s): "), default_nodename);
{
REFERENCE *entry;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); for (iw = 0; (info_win = info_windows[iw]); iw++)
entry->label = strdup (info_win->window->node->nodename); {
REFERENCE *entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->label = xstrdup (info_win->window->node->nodename);
entry->filename = entry->nodename = (char *)NULL; entry->filename = entry->nodename = (char *)NULL;
add_pointer_to_array add_pointer_to_array (entry, menu_index, menu, menu_slots, 10,
(entry, menu_index, menu, menu_slots, 10, REFERENCE *); REFERENCE *);
} }
default_nodename = strdup (active_window->node->nodename);
prompt = (char *)xmalloc (40 + strlen (default_nodename));
sprintf (prompt, "Kill node (%s): ", default_nodename);
nodename = info_read_completing_in_echo_area (window, prompt, menu); nodename = info_read_completing_in_echo_area (window, prompt, menu);
free (prompt); free (prompt);
info_free_references (menu); info_free_references (menu);
...@@ -2326,7 +2273,21 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node") ...@@ -2326,7 +2273,21 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
} }
else else
free (default_nodename); free (default_nodename);
}
return nodename;
}
/* Delete NODENAME from this window, showing the most
recently selected node in this window. */
static void
kill_node (window, nodename)
WINDOW *window;
char *nodename;
{
int iw, i;
INFO_WINDOW *info_win;
NODE *temp;
/* If there is no nodename to kill, quit now. */ /* If there is no nodename to kill, quit now. */
if (!nodename) if (!nodename)
...@@ -2336,14 +2297,14 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node") ...@@ -2336,14 +2297,14 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
} }
/* If there is a nodename, find it in our window list. */ /* If there is a nodename, find it in our window list. */
for (iw = 0; info_win = info_windows[iw]; iw++) 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)
break; break;
if (!info_win) if (!info_win)
{ {
if (*nodename) if (*nodename)
info_error ("Cannot kill the node `%s'", nodename); info_error (_("Cannot kill node `%s'"), nodename);
else else
window_clear_echo_area (); window_clear_echo_area ();
...@@ -2353,13 +2314,12 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node") ...@@ -2353,13 +2314,12 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
/* If there are no more nodes left anywhere to view, complain and exit. */ /* If there are no more nodes left anywhere to view, complain and exit. */
if (info_windows_index == 1 && info_windows[0]->nodes_index == 1) if (info_windows_index == 1 && info_windows[0]->nodes_index == 1)
{ {
info_error ("Cannot kill the last node"); info_error (_("Cannot kill the last node"));
return; return;
} }
/* INFO_WIN contains the node that the user wants to stop viewing. /* INFO_WIN contains the node that the user wants to stop viewing. Delete
Delete this node from the list of nodes previously shown in this this node from the list of nodes previously shown in this window. */
window. */
for (i = info_win->current; i < info_win->nodes_index; i++) 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++];
...@@ -2398,13 +2358,12 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node") ...@@ -2398,13 +2358,12 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
/* Copy this node. */ /* Copy this node. */
{ {
NODE *copy; NODE *copy = xmalloc (sizeof (NODE));
temp = stealer->nodes[which]; temp = stealer->nodes[which];
point = stealer->points[which]; point = stealer->points[which];
pagetop = stealer->pagetops[which]; pagetop = stealer->pagetops[which];
copy = (NODE *)xmalloc (sizeof (NODE));
copy->filename = temp->filename; copy->filename = temp->filename;
copy->parent = temp->parent; copy->parent = temp->parent;
copy->nodename = temp->nodename; copy->nodename = temp->nodename;
...@@ -2425,16 +2384,39 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node") ...@@ -2425,16 +2384,39 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
temp = info_win->nodes[info_win->current]; temp = info_win->nodes[info_win->current];
window_set_node_of_window (info_win->window, temp); window_set_node_of_window (info_win->window, temp);
} }
if (!info_error_was_printed) if (!info_error_was_printed)
window_clear_echo_area (); window_clear_echo_area ();
if (auto_footnotes_p)
info_get_or_remove_footnotes (window);
}
/* Kill current node, thus going back one in the node history. I (karl)
do not think this is completely correct yet, because of the
window-changing stuff in kill_node, but it's a lot better than the
previous implementation, which did not account for nodes being
visited twice at all. */
DECLARE_INFO_COMMAND (info_history_node,
_("Select the most recently selected node"))
{
kill_node (window, active_window->node->nodename);
}
/* Kill named node. */
DECLARE_INFO_COMMAND (info_kill_node, _("Kill this node"))
{
char *nodename = read_nodename_to_kill (window);
kill_node (window, nodename);
} }
/* Read the name of a file and select the entire file. */ /* Read the name of a file and select the entire file. */
DECLARE_INFO_COMMAND (info_view_file, "Read the name of a file and select it") DECLARE_INFO_COMMAND (info_view_file, _("Read the name of a file and select it"))
{ {
char *line; char *line;
line = info_read_in_echo_area (window, "Find file: "); line = info_read_in_echo_area (window, _("Find file: "));
if (!line) if (!line)
{ {
info_abort_key (active_window, 1, 0); info_abort_key (active_window, 1, 0);
...@@ -2451,7 +2433,7 @@ DECLARE_INFO_COMMAND (info_view_file, "Read the name of a file and select it") ...@@ -2451,7 +2433,7 @@ DECLARE_INFO_COMMAND (info_view_file, "Read the name of a file and select it")
if (info_recent_file_error) if (info_recent_file_error)
info_error (info_recent_file_error); info_error (info_recent_file_error);
else else
info_error ("Cannot find \"%s\".", line); info_error (_("Cannot find \"%s\"."), line);
} }
else else
{ {
...@@ -2498,7 +2480,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes) ...@@ -2498,7 +2480,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes)
if (!output_stream) if (!output_stream)
{ {
info_error ("Could not create output file \"%s\".", output_filename); info_error (_("Could not create output file \"%s\"."), output_filename);
return; return;
} }
...@@ -2511,7 +2493,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes) ...@@ -2511,7 +2493,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes)
fclose (output_stream); fclose (output_stream);
#if defined (VERBOSE_NODE_DUMPING) #if defined (VERBOSE_NODE_DUMPING)
info_error ("Done."); info_error (_("Done."));
#endif /* VERBOSE_NODE_DUMPING */ #endif /* VERBOSE_NODE_DUMPING */
} }
...@@ -2568,10 +2550,10 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes) ...@@ -2568,10 +2550,10 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes)
#if defined (VERBOSE_NODE_DUMPING) #if defined (VERBOSE_NODE_DUMPING)
/* Maybe we should print some information about the node being output. */ /* Maybe we should print some information about the node being output. */
if (node->filename) if (node->filename)
info_error ("Writing node \"(%s)%s\"...", info_error (_("Writing node \"(%s)%s\"..."),
filename_non_directory (node->filename), node->nodename); filename_non_directory (node->filename), node->nodename);
else else
info_error ("Writing node \"%s\"...", node->nodename); info_error (_("Writing node \"%s\"..."), node->nodename);
#endif /* VERBOSE_NODE_DUMPING */ #endif /* VERBOSE_NODE_DUMPING */
write_node_to_stream (node, stream); write_node_to_stream (node, stream);
...@@ -2623,7 +2605,7 @@ dump_node_to_file (node, filename, dump_subnodes) ...@@ -2623,7 +2605,7 @@ dump_node_to_file (node, filename, dump_subnodes)
if (!output_stream) if (!output_stream)
{ {
info_error ("Could not create output file \"%s\".", filename); info_error (_("Could not create output file \"%s\"."), filename);
return; return;
} }
...@@ -2640,7 +2622,7 @@ dump_node_to_file (node, filename, dump_subnodes) ...@@ -2640,7 +2622,7 @@ dump_node_to_file (node, filename, dump_subnodes)
fclose (output_stream); fclose (output_stream);
#if defined (VERBOSE_NODE_DUMPING) #if defined (VERBOSE_NODE_DUMPING)
info_error ("Done."); info_error (_("Done."));
#endif /* VERBOSE_NODE_DUMPING */ #endif /* VERBOSE_NODE_DUMPING */
} }
...@@ -2649,7 +2631,7 @@ dump_node_to_file (node, filename, dump_subnodes) ...@@ -2649,7 +2631,7 @@ dump_node_to_file (node, filename, dump_subnodes)
#endif /* !DEFAULT_INFO_PRINT_COMMAND */ #endif /* !DEFAULT_INFO_PRINT_COMMAND */
DECLARE_INFO_COMMAND (info_print_node, DECLARE_INFO_COMMAND (info_print_node,
"Pipe the contents of this node through INFO_PRINT_COMMAND") _("Pipe the contents of this node through INFO_PRINT_COMMAND"))
{ {
print_node (window->node); print_node (window->node);
} }
...@@ -2659,10 +2641,8 @@ void ...@@ -2659,10 +2641,8 @@ void
print_node (node) print_node (node)
NODE *node; NODE *node;
{ {
char *print_command, *getenv ();
FILE *printer_pipe; FILE *printer_pipe;
char *print_command = getenv ("INFO_PRINT_COMMAND");
print_command = getenv ("INFO_PRINT_COMMAND");
if (!print_command || !*print_command) if (!print_command || !*print_command)
print_command = DEFAULT_INFO_PRINT_COMMAND; print_command = DEFAULT_INFO_PRINT_COMMAND;
...@@ -2671,24 +2651,24 @@ print_node (node) ...@@ -2671,24 +2651,24 @@ print_node (node)
if (!printer_pipe) if (!printer_pipe)
{ {
info_error ("Cannot open pipe to \"%s\".", print_command); info_error (_("Cannot open pipe to \"%s\"."), print_command);
return; return;
} }
#if defined (VERBOSE_NODE_DUMPING) #if defined (VERBOSE_NODE_DUMPING)
/* Maybe we should print some information about the node being output. */ /* Maybe we should print some information about the node being output. */
if (node->filename) if (node->filename)
info_error ("Printing node \"(%s)%s\"...", info_error (_("Printing node \"(%s)%s\"..."),
filename_non_directory (node->filename), node->nodename); filename_non_directory (node->filename), node->nodename);
else else
info_error ("Printing node \"%s\"...", node->nodename); info_error (_("Printing node \"%s\"..."), node->nodename);
#endif /* VERBOSE_NODE_DUMPING */ #endif /* VERBOSE_NODE_DUMPING */
write_node_to_stream (node, printer_pipe); write_node_to_stream (node, printer_pipe);
pclose (printer_pipe); pclose (printer_pipe);
#if defined (VERBOSE_NODE_DUMPING) #if defined (VERBOSE_NODE_DUMPING)
info_error ("Done."); info_error (_("Done."));
#endif /* VERBOSE_NODE_DUMPING */ #endif /* VERBOSE_NODE_DUMPING */
} }
...@@ -2798,7 +2778,7 @@ info_target_search_node (node, string, start) ...@@ -2798,7 +2778,7 @@ info_target_search_node (node, string, start)
long offset; long offset;
char *target; char *target;
target = strdup (string); target = xstrdup (string);
i = strlen (target); i = strlen (target);
/* Try repeatedly searching for this string while removing words from /* Try repeatedly searching for this string while removing words from
...@@ -2852,7 +2832,7 @@ info_search_internal (string, window, dir) ...@@ -2852,7 +2832,7 @@ info_search_internal (string, window, dir)
} }
maybe_free (last_searched_for_string); maybe_free (last_searched_for_string);
last_searched_for_string = strdup (string); last_searched_for_string = xstrdup (string);
if (ret != -1) if (ret != -1)
{ {
...@@ -2913,7 +2893,7 @@ info_search_internal (string, window, dir) ...@@ -2913,7 +2893,7 @@ info_search_internal (string, window, dir)
if (!echo_area_is_active && (last_subfile != tag->filename)) if (!echo_area_is_active && (last_subfile != tag->filename))
{ {
window_message_in_echo_area window_message_in_echo_area
("Searching subfile \"%s\"...", (_("Searching subfile \"%s\"..."),
filename_non_directory (tag->filename)); filename_non_directory (tag->filename));
last_subfile = tag->filename; last_subfile = tag->filename;
...@@ -2963,7 +2943,7 @@ info_search_internal (string, window, dir) ...@@ -2963,7 +2943,7 @@ info_search_internal (string, window, dir)
return (-1); return (-1);
} }
DECLARE_INFO_COMMAND (info_search, "Read a string and search for it") DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
{ {
char *line, *prompt; char *line, *prompt;
int result, old_pagetop; int result, old_pagetop;
...@@ -2983,8 +2963,8 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it") ...@@ -2983,8 +2963,8 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
prompt = (char *)xmalloc (50 + strlen (search_string)); prompt = (char *)xmalloc (50 + strlen (search_string));
sprintf (prompt, "%s for string [%s]: ", sprintf (prompt, _("%s for string [%s]: "),
direction < 0 ? "Search backward" : "Search", direction < 0 ? _("Search backward") : _("Search"),
search_string); search_string);
line = info_read_in_echo_area (window, prompt); line = info_read_in_echo_area (window, prompt);
...@@ -3011,7 +2991,7 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it") ...@@ -3011,7 +2991,7 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
result = info_search_internal (search_string, active_window, direction); result = info_search_internal (search_string, active_window, direction);
if (result != 0 && !info_error_was_printed) if (result != 0 && !info_error_was_printed)
info_error ("Search failed."); info_error (_("Search failed."));
else if (old_pagetop != active_window->pagetop) else if (old_pagetop != active_window->pagetop)
{ {
int new_pagetop; int new_pagetop;
...@@ -3037,13 +3017,13 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it") ...@@ -3037,13 +3017,13 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
static void incremental_search (); static void incremental_search ();
DECLARE_INFO_COMMAND (isearch_forward, DECLARE_INFO_COMMAND (isearch_forward,
"Search interactively for a string as you type it") _("Search interactively for a string as you type it"))
{ {
incremental_search (window, count, key); incremental_search (window, count, key);
} }
DECLARE_INFO_COMMAND (isearch_backward, DECLARE_INFO_COMMAND (isearch_backward,
"Search interactively for a string as you type it") _("Search interactively for a string as you type it"))
{ {
incremental_search (window, -count, key); incremental_search (window, -count, key);
} }
...@@ -3137,9 +3117,9 @@ show_isearch_prompt (dir, string, failing_p) ...@@ -3137,9 +3117,9 @@ show_isearch_prompt (dir, string, failing_p)
int prompt_len, p_rep_index, p_rep_size; int prompt_len, p_rep_index, p_rep_size;
if (dir < 0) if (dir < 0)
prefix = "I-search backward: "; prefix = _("I-search backward: ");
else else
prefix = "I-search: "; prefix = _("I-search: ");
p_rep_index = p_rep_size = 0; p_rep_index = p_rep_size = 0;
p_rep = (char *)NULL; p_rep = (char *)NULL;
...@@ -3164,7 +3144,7 @@ show_isearch_prompt (dir, string, failing_p) ...@@ -3164,7 +3144,7 @@ show_isearch_prompt (dir, string, failing_p)
prompt_len = strlen (prefix) + p_rep_index + 20; prompt_len = strlen (prefix) + p_rep_index + 20;
prompt = (char *)xmalloc (prompt_len); prompt = (char *)xmalloc (prompt_len);
sprintf (prompt, "%s%s%s", failing_p ? "Failing " : "", prefix, sprintf (prompt, "%s%s%s", failing_p ? _("Failing ") : "", prefix,
p_rep ? p_rep : ""); p_rep ? p_rep : "");
window_message_in_echo_area ("%s", prompt); window_message_in_echo_area ("%s", prompt);
...@@ -3337,7 +3317,7 @@ incremental_search (window, count, ignore) ...@@ -3337,7 +3317,7 @@ incremental_search (window, count, ignore)
if (isearch_string_index && func != info_abort_key) if (isearch_string_index && func != info_abort_key)
{ {
maybe_free (last_isearch_accepted); maybe_free (last_isearch_accepted);
last_isearch_accepted = strdup (isearch_string); last_isearch_accepted = xstrdup (isearch_string);
} }
if (key != isearch_terminate_search_key) if (key != isearch_terminate_search_key)
...@@ -3433,7 +3413,7 @@ info_gc_file_buffers () ...@@ -3433,7 +3413,7 @@ info_gc_file_buffers ()
if (!info_loaded_files) if (!info_loaded_files)
return; return;
for (fb_index = 0; fb = info_loaded_files[fb_index]; fb_index++) for (fb_index = 0; (fb = info_loaded_files[fb_index]); fb_index++)
{ {
int fb_referenced_p = 0; int fb_referenced_p = 0;
...@@ -3453,7 +3433,7 @@ info_gc_file_buffers () ...@@ -3453,7 +3433,7 @@ info_gc_file_buffers ()
/* Check each INFO_WINDOW to see if it has any nodes which reference /* Check each INFO_WINDOW to see if it has any nodes which reference
this file. */ this file. */
for (iw_index = 0; iw = info_windows[iw_index]; iw_index++) for (iw_index = 0; (iw = info_windows[iw_index]); iw_index++)
{ {
for (i = 0; iw->nodes && iw->nodes[i]; i++) for (i = 0; iw->nodes && iw->nodes[i]; i++)
{ {
...@@ -3529,7 +3509,7 @@ info_move_to_xref (window, count, key, dir) ...@@ -3529,7 +3509,7 @@ info_move_to_xref (window, count, key, dir)
if (firstmenu == -1 && firstxref == -1) if (firstmenu == -1 && firstxref == -1)
{ {
info_error ("No cross references in this node."); info_error (_("No cross references in this node."));
return; return;
} }
...@@ -3596,7 +3576,7 @@ info_move_to_xref (window, count, key, dir) ...@@ -3596,7 +3576,7 @@ info_move_to_xref (window, count, key, dir)
} }
DECLARE_INFO_COMMAND (info_move_to_prev_xref, DECLARE_INFO_COMMAND (info_move_to_prev_xref,
"Move to the previous cross reference") _("Move to the previous cross reference"))
{ {
if (count < 0) if (count < 0)
info_move_to_prev_xref (window, -count, key); info_move_to_prev_xref (window, -count, key);
...@@ -3605,7 +3585,7 @@ DECLARE_INFO_COMMAND (info_move_to_prev_xref, ...@@ -3605,7 +3585,7 @@ DECLARE_INFO_COMMAND (info_move_to_prev_xref,
} }
DECLARE_INFO_COMMAND (info_move_to_next_xref, DECLARE_INFO_COMMAND (info_move_to_next_xref,
"Move to the next cross reference") _("Move to the next cross reference"))
{ {
if (count < 0) if (count < 0)
info_move_to_next_xref (window, -count, key); info_move_to_next_xref (window, -count, key);
...@@ -3615,7 +3595,7 @@ DECLARE_INFO_COMMAND (info_move_to_next_xref, ...@@ -3615,7 +3595,7 @@ DECLARE_INFO_COMMAND (info_move_to_next_xref,
/* Select the menu item or reference that appears on this line. */ /* Select the menu item or reference that appears on this line. */
DECLARE_INFO_COMMAND (info_select_reference_this_line, DECLARE_INFO_COMMAND (info_select_reference_this_line,
"Select reference or menu item appearing on this line") _("Select reference or menu item appearing on this line"))
{ {
char *line; char *line;
NODE *orig; NODE *orig;
...@@ -3637,14 +3617,14 @@ DECLARE_INFO_COMMAND (info_select_reference_this_line, ...@@ -3637,14 +3617,14 @@ DECLARE_INFO_COMMAND (info_select_reference_this_line,
/* **************************************************************** */ /* **************************************************************** */
/* What to do when C-g is pressed in a window. */ /* What to do when C-g is pressed in a window. */
DECLARE_INFO_COMMAND (info_abort_key, "Cancel current operation") DECLARE_INFO_COMMAND (info_abort_key, _("Cancel current operation"))
{ {
/* If error printing doesn't oridinarily ring the bell, do it now, /* If error printing doesn't oridinarily ring the bell, do it now,
since C-g always rings the bell. Otherwise, let the error printer since C-g always rings the bell. Otherwise, let the error printer
do it. */ do it. */
if (!info_error_rings_bell_p) if (!info_error_rings_bell_p)
terminal_ring_bell (); terminal_ring_bell ();
info_error ("Quit"); info_error (_("Quit"));
info_initialize_numeric_arg (); info_initialize_numeric_arg ();
info_clear_pending_input (); info_clear_pending_input ();
...@@ -3653,7 +3633,7 @@ DECLARE_INFO_COMMAND (info_abort_key, "Cancel current operation") ...@@ -3653,7 +3633,7 @@ DECLARE_INFO_COMMAND (info_abort_key, "Cancel current operation")
/* Move the cursor to the desired line of the window. */ /* Move the cursor to the desired line of the window. */
DECLARE_INFO_COMMAND (info_move_to_window_line, DECLARE_INFO_COMMAND (info_move_to_window_line,
"Move to the cursor to a specific line of the window") _("Move to the cursor to a specific line of the window"))
{ {
int line; int line;
...@@ -3685,7 +3665,7 @@ DECLARE_INFO_COMMAND (info_move_to_window_line, ...@@ -3685,7 +3665,7 @@ DECLARE_INFO_COMMAND (info_move_to_window_line,
/* Clear the screen and redraw its contents. Given a numeric argument, /* Clear the screen and redraw its contents. Given a numeric argument,
move the line the cursor is on to the COUNT'th line of the window. */ move the line the cursor is on to the COUNT'th line of the window. */
DECLARE_INFO_COMMAND (info_redraw_display, "Redraw the display") DECLARE_INFO_COMMAND (info_redraw_display, _("Redraw the display"))
{ {
if ((!info_explicit_arg && count == 1) || echo_area_is_active) if ((!info_explicit_arg && count == 1) || echo_area_is_active)
{ {
...@@ -3722,7 +3702,7 @@ DECLARE_INFO_COMMAND (info_redraw_display, "Redraw the display") ...@@ -3722,7 +3702,7 @@ DECLARE_INFO_COMMAND (info_redraw_display, "Redraw the display")
} }
/* This command does nothing. It is the fact that a key is bound to it /* This command does nothing. It is the fact that a key is bound to it
that has meaning. See the code at the top of info_session (). */ that has meaning. See the code at the top of info_session (). */
DECLARE_INFO_COMMAND (info_quit, "Quit using Info") DECLARE_INFO_COMMAND (info_quit, _("Quit using Info"))
{} {}
...@@ -3745,14 +3725,14 @@ dispatch_error (keyseq) ...@@ -3745,14 +3725,14 @@ dispatch_error (keyseq)
rep = pretty_keyseq (keyseq); rep = pretty_keyseq (keyseq);
if (!echo_area_is_active) if (!echo_area_is_active)
info_error ("Unknown command (%s).", rep); info_error (_("Unknown command (%s)."), rep);
else else
{ {
char *temp; char *temp;
temp = (char *)xmalloc (1 + strlen (rep) + strlen ("\"\" is invalid")); temp = (char *)xmalloc (1 + strlen (rep) + strlen (_("\"\" is invalid")));
sprintf (temp, "\"%s\" is invalid", rep); sprintf (temp, _("\"%s\" is invalid"), rep);
terminal_ring_bell (); terminal_ring_bell ();
inform_in_echo_area (temp); inform_in_echo_area (temp);
free (temp); free (temp);
...@@ -3832,13 +3812,15 @@ display_info_keyseq (expecting_future_input) ...@@ -3832,13 +3812,15 @@ display_info_keyseq (expecting_future_input)
unsigned char unsigned char
info_get_another_input_char () info_get_another_input_char ()
{ {
int ready = 0; int ready = !info_keyseq_displayed_p; /* ready if new and pending key */
/* If there isn't any input currently available, then wait a /* If there isn't any input currently available, then wait a
moment looking for input. If we don't get it fast enough, moment looking for input. If we don't get it fast enough,
prompt a little bit with the current key sequence. */ prompt a little bit with the current key sequence. */
if (!info_keyseq_displayed_p && if (!info_keyseq_displayed_p)
!info_any_buffered_input_p () && {
ready = 1;
if (!info_any_buffered_input_p () &&
!info_input_pending_p ()) !info_input_pending_p ())
{ {
#if defined (FD_SET) #if defined (FD_SET)
...@@ -3849,9 +3831,12 @@ info_get_another_input_char () ...@@ -3849,9 +3831,12 @@ info_get_another_input_char ()
FD_SET (fileno (info_input_stream), &readfds); FD_SET (fileno (info_input_stream), &readfds);
timer.tv_sec = 1; timer.tv_sec = 1;
timer.tv_usec = 750; timer.tv_usec = 750;
ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer); ready = select (fileno(info_input_stream)+1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
#else
ready = 0;
#endif /* FD_SET */ #endif /* FD_SET */
} }
}
if (!ready) if (!ready)
display_info_keyseq (1); display_info_keyseq (1);
...@@ -3970,7 +3955,7 @@ int info_numeric_arg = 1; ...@@ -3970,7 +3955,7 @@ int info_numeric_arg = 1;
/* Add the current digit to the argument in progress. */ /* Add the current digit to the argument in progress. */
DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg, DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg,
"Add this digit to the current numeric argument") _("Add this digit to the current numeric argument"))
{ {
info_numeric_arg_digit_loop (window, 0, key); info_numeric_arg_digit_loop (window, 0, key);
} }
...@@ -3979,7 +3964,7 @@ DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg, ...@@ -3979,7 +3964,7 @@ DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg,
Read a key. If the key has nothing to do with arguments, then Read a key. If the key has nothing to do with arguments, then
dispatch on it. If the key is the abort character then abort. */ dispatch on it. If the key is the abort character then abort. */
DECLARE_INFO_COMMAND (info_universal_argument, DECLARE_INFO_COMMAND (info_universal_argument,
"Start (or multiply by 4) the current numeric argument") _("Start (or multiply by 4) the current numeric argument"))
{ {
info_numeric_arg *= 4; info_numeric_arg *= 4;
info_numeric_arg_digit_loop (window, 0, 0); info_numeric_arg_digit_loop (window, 0, 0);
...@@ -3994,7 +3979,7 @@ info_initialize_numeric_arg () ...@@ -3994,7 +3979,7 @@ info_initialize_numeric_arg ()
} }
DECLARE_INFO_COMMAND (info_numeric_arg_digit_loop, DECLARE_INFO_COMMAND (info_numeric_arg_digit_loop,
"Internally used by \\[universal-argument]") _("Internally used by \\[universal-argument]"))
{ {
unsigned char pure_key; unsigned char pure_key;
Keymap keymap = window->keymap; Keymap keymap = window->keymap;
...@@ -4147,23 +4132,6 @@ info_any_buffered_input_p () ...@@ -4147,23 +4132,6 @@ info_any_buffered_input_p ()
return (push_index != pop_index); return (push_index != pop_index);
} }
/* Push KEY into the *front* of the input buffer. Returns non-zero if
successful, zero if there is no space left in the buffer. */
static int
info_replace_key_to_typeahead (key)
unsigned char key;
{
if (info_input_buffer_space_available ())
{
pop_index--;
if (pop_index < 0)
pop_index = sizeof (info_input_buffer) - 1;
info_input_buffer[pop_index] = key;
return (1);
}
return (0);
}
/* If characters are available to be read, then read them and stuff them into /* If characters are available to be read, then read them and stuff them into
info_input_buffer. Otherwise, do nothing. */ info_input_buffer. Otherwise, do nothing. */
void void
...@@ -4188,7 +4156,7 @@ info_gather_typeahead () ...@@ -4188,7 +4156,7 @@ info_gather_typeahead ()
chars_avail = space_avail; chars_avail = space_avail;
if (chars_avail) if (chars_avail)
read (tty, &input[0], chars_avail); chars_avail = read (tty, &input[0], chars_avail);
} }
#else /* !FIONREAD */ #else /* !FIONREAD */
# if defined (O_NDELAY) # if defined (O_NDELAY)
...@@ -4230,8 +4198,16 @@ info_get_input_char () ...@@ -4230,8 +4198,16 @@ info_get_input_char ()
else if (info_get_key_from_typeahead (&keystroke) == 0) else if (info_get_key_from_typeahead (&keystroke) == 0)
{ {
int rawkey; int rawkey;
unsigned char c;
int tty = fileno (info_input_stream);
/* Using stream I/O causes FIONREAD etc to fail to work
so unless someone can find a portable way of finding
out how many characters are currently buffered, we
should stay with away from stream I/O.
--Egil Kvaleberg <egilk@sn.no>, January 1997. */
rawkey = (read (tty, &c, 1) == 1) ? c : EOF;
rawkey = getc (info_input_stream);
keystroke = rawkey; keystroke = rawkey;
if (rawkey == EOF) if (rawkey == EOF)
...@@ -4243,7 +4219,7 @@ info_get_input_char () ...@@ -4243,7 +4219,7 @@ info_get_input_char ()
display_inhibited = 0; display_inhibited = 0;
display_update_display (windows); display_update_display (windows);
display_cursor_at_point (active_window); display_cursor_at_point (active_window);
rawkey = getc (info_input_stream); rawkey = (read (tty, &c, 1) == 1) ? c : EOF;
keystroke = rawkey; keystroke = rawkey;
} }
...@@ -4259,5 +4235,5 @@ info_get_input_char () ...@@ -4259,5 +4235,5 @@ info_get_input_char ()
if (info_dribble_file) if (info_dribble_file)
dribble (keystroke); dribble (keystroke);
return (keystroke); return keystroke;
} }
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_SESSION_H_) #if !defined (SESSION_H)
#define _SESSION_H_ #define SESSION_H
#include "general.h" #include "info.h"
#include "dribble.h" #include "dribble.h"
/* All commands that can be invoked from within info_session () receive /* All commands that can be invoked from within info_session () receive
...@@ -143,4 +143,4 @@ extern void info_print_node (); ...@@ -143,4 +143,4 @@ extern void info_print_node ();
/* Miscellaneous commands. */ /* Miscellaneous commands. */
extern void info_abort_key (), info_quit (), info_do_lowercase_version (); extern void info_abort_key (), info_quit (), info_do_lowercase_version ();
#endif /* _SESSION_H_ */ #endif /* SESSION_H */
...@@ -62,28 +62,27 @@ sigprocmask (operation, newset, oldset) ...@@ -62,28 +62,27 @@ sigprocmask (operation, newset, oldset)
/* */ /* */
/* **************************************************************** */ /* **************************************************************** */
typedef void SigHandlerType; typedef RETSIGTYPE signal_handler ();
typedef SigHandlerType SigHandler ();
static SigHandlerType info_signal_handler (); static RETSIGTYPE info_signal_handler ();
static SigHandler *old_TSTP, *old_TTOU, *old_TTIN; static signal_handler *old_TSTP, *old_TTOU, *old_TTIN;
static SigHandler *old_WINCH, *old_INT; static signal_handler *old_WINCH, *old_INT;
void void
initialize_info_signal_handler () initialize_info_signal_handler ()
{ {
#if defined (SIGTSTP) #if defined (SIGTSTP)
old_TSTP = (SigHandler *) signal (SIGTSTP, info_signal_handler); old_TSTP = (signal_handler *) signal (SIGTSTP, info_signal_handler);
old_TTOU = (SigHandler *) signal (SIGTTOU, info_signal_handler); old_TTOU = (signal_handler *) signal (SIGTTOU, info_signal_handler);
old_TTIN = (SigHandler *) signal (SIGTTIN, info_signal_handler); old_TTIN = (signal_handler *) signal (SIGTTIN, info_signal_handler);
#endif /* SIGTSTP */ #endif /* SIGTSTP */
#if defined (SIGWINCH) #if defined (SIGWINCH)
old_WINCH = (SigHandler *) signal (SIGWINCH, info_signal_handler); old_WINCH = (signal_handler *) signal (SIGWINCH, info_signal_handler);
#endif #endif
#if defined (SIGINT) #if defined (SIGINT)
old_INT = (SigHandler *) signal (SIGINT, info_signal_handler); old_INT = (signal_handler *) signal (SIGINT, info_signal_handler);
#endif #endif
} }
...@@ -98,11 +97,11 @@ redisplay_after_signal () ...@@ -98,11 +97,11 @@ redisplay_after_signal ()
fflush (stdout); fflush (stdout);
} }
static SigHandlerType static RETSIGTYPE
info_signal_handler (sig) info_signal_handler (sig)
int sig; int sig;
{ {
SigHandler **old_signal_handler; signal_handler **old_signal_handler;
switch (sig) switch (sig)
{ {
...@@ -140,7 +139,7 @@ info_signal_handler (sig) ...@@ -140,7 +139,7 @@ info_signal_handler (sig)
turn on terminal handling, redraw the screen, and place the turn on terminal handling, redraw the screen, and place the
cursor where it belongs. */ cursor where it belongs. */
terminal_prep_terminal (); terminal_prep_terminal ();
*old_signal_handler = (SigHandler *) signal (sig, info_signal_handler); *old_signal_handler = (signal_handler *) signal (sig, info_signal_handler);
redisplay_after_signal (); redisplay_after_signal ();
fflush (stdout); fflush (stdout);
} }
...@@ -164,7 +163,7 @@ info_signal_handler (sig) ...@@ -164,7 +163,7 @@ info_signal_handler (sig)
terminal_prep_terminal (); terminal_prep_terminal ();
display_initialize_display (screenwidth, screenheight); display_initialize_display (screenwidth, screenheight);
window_new_screen_size (screenwidth, screenheight, (VFunction *)NULL); window_new_screen_size (screenwidth, screenheight, (VFunction *)NULL);
*old_signal_handler = (SigHandler *) signal (sig, info_signal_handler); *old_signal_handler = (signal_handler *) signal (sig, info_signal_handler);
redisplay_after_signal (); redisplay_after_signal ();
} }
break; break;
......
/* signals.h -- Header to include system dependent signal definitions. */ /* signals.h -- Header to include system dependent signal definitions.
$Id: signals.h,v 1.3 1997/07/15 18:35:59 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1993, 94, 95, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,11 +22,17 @@ ...@@ -21,11 +22,17 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_SIGNALS_H_) #ifndef INFO_SIGNALS_H
#define _SIGNALS_H_ #define INFO_SIGNALS_H
#include <sys/types.h>
#include <signal.h> #include <signal.h>
/* For sysV68 --phdm@info.ucl.ac.be. */
#if !defined (SIGCHLD) && defined (SIGCLD)
#define SIGCHLD SIGCLD
#endif
#if !defined (HAVE_SIGPROCMASK) && !defined (sigmask) #if !defined (HAVE_SIGPROCMASK) && !defined (sigmask)
# define sigmask(x) (1 << ((x)-1)) # define sigmask(x) (1 << ((x)-1))
#endif /* !HAVE_SIGPROCMASK && !sigmask */ #endif /* !HAVE_SIGPROCMASK && !sigmask */
...@@ -86,4 +93,4 @@ ...@@ -86,4 +93,4 @@
# define UNBLOCK_SIGNAL(sig) # define UNBLOCK_SIGNAL(sig)
#endif /* !HAVE_SIGPROCMASK && !HAVE_SIGSETMASK */ #endif /* !HAVE_SIGPROCMASK && !HAVE_SIGSETMASK */
#endif /* !_SIGNALS_H_ */ #endif /* not INFO_SIGNALS_H */
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* This file is part of GNU Info, a program for reading online documentation /* This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993, 96 Free Software Foundation, Inc. Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,15 +21,10 @@ ...@@ -21,15 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_TERMINAL_H_) #if !defined (TERMINAL_H)
#define _TERMINAL_H_ #define TERMINAL_H
/* We use the following data type to talk about pointers to functions. */ #include "info.h"
#if !defined (__FUNCTION_DEF)
# define __FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
#endif /* _FUNCTION_DEF */
/* For almost every function externally visible from terminal.c, there is /* For almost every function externally visible from terminal.c, there is
a corresponding "hook" function which can be bound in order to replace a corresponding "hook" function which can be bound in order to replace
...@@ -125,5 +120,6 @@ extern VFunction *terminal_ring_bell_hook; ...@@ -125,5 +120,6 @@ extern VFunction *terminal_ring_bell_hook;
/* The key sequences output by the arrow keys, if this terminal has any. */ /* The key sequences output by the arrow keys, if this terminal has any. */
extern char *term_ku, *term_kd, *term_kr, *term_kl; extern char *term_ku, *term_kd, *term_kr, *term_kl;
extern char *term_kP, *term_kN;
#endif /* !_TERMINAL_H_ */ #endif /* !TERMINAL_H */
/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). /* tilde.c -- Tilde expansion code (~/foo := $HOME/foo).
$Id: tilde.c,v 1.1 1997/08/21 22:58:05 jason Exp $ $Id: tilde.c,v 1.8 1997/07/24 21:49:03 karl Exp $
This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
/* Include config.h before doing alloca. */
#include "info.h"
#ifndef alloca
#if defined (__GNUC__) #if defined (__GNUC__)
# define alloca __builtin_alloca # define alloca __builtin_alloca
#else /* !__GNUC__ */ #else /* !__GNUC__ */
...@@ -33,28 +37,10 @@ ...@@ -33,28 +37,10 @@
# endif /* HAVE_ALLOCA_H */ # endif /* HAVE_ALLOCA_H */
# endif /* !AIX */ # endif /* !AIX */
#endif /* !__GNUC__ */ #endif /* !__GNUC__ */
#endif /* ! defined alloca */
#if defined (HAVE_STDLIB_H)
#include <stdlib.h>
#endif
#include "tilde.h"
#include <pwd.h>
#if defined (HAVE_STRING_H)
#include <string.h>
#endif
#include "clib.h"
#if !defined (NULL)
# define NULL 0x0
#endif
#if defined (TEST) || defined (STATIC_MALLOC) #if defined (TEST) || defined (STATIC_MALLOC)
static void *xmalloc (), *xrealloc (); static void *xmalloc (), *xrealloc ();
#else
extern void *xmalloc (), *xrealloc ();
#endif /* TEST || STATIC_MALLOC */ #endif /* TEST || STATIC_MALLOC */
/* The default value of tilde_additional_prefixes. This is set to /* The default value of tilde_additional_prefixes. This is set to
...@@ -214,7 +200,7 @@ tilde_expand_word (filename) ...@@ -214,7 +200,7 @@ tilde_expand_word (filename)
{ {
char *dirname; char *dirname;
dirname = filename ? strdup (filename) : (char *)NULL; dirname = filename ? xstrdup (filename) : (char *)NULL;
if (dirname && *dirname == '~') if (dirname && *dirname == '~')
{ {
...@@ -222,7 +208,6 @@ tilde_expand_word (filename) ...@@ -222,7 +208,6 @@ tilde_expand_word (filename)
if (!dirname[1] || dirname[1] == '/') if (!dirname[1] || dirname[1] == '/')
{ {
/* Prepend $HOME to the rest of the string. */ /* Prepend $HOME to the rest of the string. */
extern char *getenv ();
char *temp_home = getenv ("HOME"); char *temp_home = getenv ("HOME");
/* If there is no HOME variable, look up the directory in /* If there is no HOME variable, look up the directory in
...@@ -244,7 +229,7 @@ tilde_expand_word (filename) ...@@ -244,7 +229,7 @@ tilde_expand_word (filename)
strcpy (temp_name, temp_home); strcpy (temp_name, temp_home);
strcat (temp_name, &dirname[1]); strcat (temp_name, &dirname[1]);
free (dirname); free (dirname);
dirname = strdup (temp_name); dirname = xstrdup (temp_name);
} }
else else
{ {
...@@ -252,7 +237,7 @@ tilde_expand_word (filename) ...@@ -252,7 +237,7 @@ tilde_expand_word (filename)
char *username = (char *)alloca (257); char *username = (char *)alloca (257);
int i, c; int i, c;
for (i = 1; c = dirname[i]; i++) for (i = 1; (c = dirname[i]); i++)
{ {
if (c == '/') if (c == '/')
break; break;
...@@ -292,7 +277,7 @@ tilde_expand_word (filename) ...@@ -292,7 +277,7 @@ tilde_expand_word (filename)
strcat (temp_name, &dirname[i]); strcat (temp_name, &dirname[i]);
return_name: return_name:
free (dirname); free (dirname);
dirname = strdup (temp_name); dirname = xstrdup (temp_name);
} }
endpwent (); endpwent ();
} }
...@@ -369,7 +354,7 @@ xrealloc (pointer, bytes) ...@@ -369,7 +354,7 @@ xrealloc (pointer, bytes)
static void static void
memory_error_and_abort () memory_error_and_abort ()
{ {
fprintf (stderr, "readline: Out of virtual memory!\n"); fprintf (stderr, _("readline: Out of virtual memory!\n"));
abort (); abort ();
} }
#endif /* TEST */ #endif /* TEST */
......
...@@ -25,13 +25,10 @@ ...@@ -25,13 +25,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
/* Function pointers can be declared as (Function *)foo. */ #ifndef TILDE_H
#if !defined (__FUNCTION_DEF) #define TILDE_H
# define __FUNCTION_DEF
typedef int Function (); #include "info.h"
typedef void VFunction ();
typedef char *CFunction ();
#endif /* _FUNCTION_DEF */
/* If non-null, this contains the address of a function to call if the /* If non-null, this contains the address of a function to call if the
standard meaning for expanding a tilde fails. The function is called standard meaning for expanding a tilde fails. The function is called
...@@ -56,3 +53,4 @@ extern char *tilde_expand (); ...@@ -56,3 +53,4 @@ extern char *tilde_expand ();
tilde. If there is no expansion, call tilde_expansion_failure_hook. */ tilde. If there is no expansion, call tilde_expansion_failure_hook. */
extern char *tilde_expand_word (); extern char *tilde_expand_word ();
#endif /* not TILDE_H */
/* variables.c -- How to manipulate user visible variables in Info. */ /* variables.c -- How to manipulate user visible variables in Info.
$Id: variables.c,v 1.5 1997/07/18 14:34:23 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -36,73 +37,75 @@ static char *on_off_choices[] = { "Off", "On", (char *)NULL }; ...@@ -36,73 +37,75 @@ static char *on_off_choices[] = { "Off", "On", (char *)NULL };
VARIABLE_ALIST info_variables[] = { VARIABLE_ALIST info_variables[] = {
{ "automatic-footnotes", { "automatic-footnotes",
"When \"On\", footnotes appear and disappear automatically", N_("When \"On\", footnotes appear and disappear automatically"),
&auto_footnotes_p, (char **)on_off_choices }, &auto_footnotes_p, (char **)on_off_choices },
{ "automatic-tiling", { "automatic-tiling",
"When \"On\", creating or deleting a window resizes other windows", N_("When \"On\", creating or deleting a window resizes other windows"),
&auto_tiling_p, (char **)on_off_choices }, &auto_tiling_p, (char **)on_off_choices },
{ "visible-bell", { "visible-bell",
"When \"On\", flash the screen instead of ringing the bell", N_("When \"On\", flash the screen instead of ringing the bell"),
&terminal_use_visible_bell_p, (char **)on_off_choices }, &terminal_use_visible_bell_p, (char **)on_off_choices },
{ "errors-ring-bell", { "errors-ring-bell",
"When \"On\", errors cause the bell to ring", N_("When \"On\", errors cause the bell to ring"),
&info_error_rings_bell_p, (char **)on_off_choices }, &info_error_rings_bell_p, (char **)on_off_choices },
{ "gc-compressed-files", { "gc-compressed-files",
"When \"On\", Info garbage collects files which had to be uncompressed", N_("When \"On\", Info garbage collects files which had to be uncompressed"),
&gc_compressed_files, (char **)on_off_choices }, &gc_compressed_files, (char **)on_off_choices },
{ "show-index-match", { "show-index-match",
"When \"On\", the portion of the matched search string is highlighted", N_("When \"On\", the portion of the matched search string is highlighted"),
&show_index_match, (char **)on_off_choices }, &show_index_match, (char **)on_off_choices },
{ "scroll-behaviour", { "scroll-behaviour",
"Controls what happens when scrolling is requested at the end of a node", N_("Controls what happens when scrolling is requested at the end of a node"),
&info_scroll_behaviour, (char **)info_scroll_choices }, &info_scroll_behaviour, (char **)info_scroll_choices },
{ "scroll-step", { "scroll-step",
"The number lines to scroll when the cursor moves out of the window", N_("The number lines to scroll when the cursor moves out of the window"),
&window_scroll_step, (char **)NULL }, &window_scroll_step, (char **)NULL },
{ "ISO-Latin", { "ISO-Latin",
"When \"On\", Info accepts and displays ISO Latin characters", N_("When \"On\", Info accepts and displays ISO Latin characters"),
&ISO_Latin_p, (char **)on_off_choices }, &ISO_Latin_p, (char **)on_off_choices },
{ (char *)NULL, (char *)NULL, (int *)NULL, (char **)NULL } { (char *)NULL, (char *)NULL, (int *)NULL, (char **)NULL }
}; };
DECLARE_INFO_COMMAND (describe_variable, "Explain the use of a variable") DECLARE_INFO_COMMAND (describe_variable, _("Explain the use of a variable"))
{ {
VARIABLE_ALIST *var; VARIABLE_ALIST *var;
char *description; char *description;
/* Get the variable's name. */ /* Get the variable's name. */
var = read_variable_name ("Describe variable: ", window); var = read_variable_name (_("Describe variable: "), window);
if (!var) if (!var)
return; return;
description = (char *)xmalloc (20 + strlen (var->name) + strlen (var->doc)); description = (char *)xmalloc (20 + strlen (var->name)
+ strlen (_(var->doc)));
if (var->choices) if (var->choices)
sprintf (description, "%s (%s): %s.", sprintf (description, "%s (%s): %s.",
var->name, var->choices[*(var->value)], var->doc); var->name, var->choices[*(var->value)], _(var->doc));
else else
sprintf (description, "%s (%d): %s.", var->name, *(var->value), var->doc); sprintf (description, "%s (%d): %s.",
var->name, *(var->value), _(var->doc));
window_message_in_echo_area ("%s", description); window_message_in_echo_area ("%s", description);
free (description); free (description);
} }
DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable") DECLARE_INFO_COMMAND (set_variable, _("Set the value of an Info variable"))
{ {
VARIABLE_ALIST *var; VARIABLE_ALIST *var;
char *line; char *line;
/* Get the variable's name and value. */ /* Get the variable's name and value. */
var = read_variable_name ("Set variable: ", window); var = read_variable_name (_("Set variable: "), window);
if (!var) if (!var)
return; return;
...@@ -120,7 +123,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable") ...@@ -120,7 +123,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable")
else else
potential_value = *(var->value); potential_value = *(var->value);
sprintf (prompt, "Set %s to value (%d): ", sprintf (prompt, _("Set %s to value (%d): "),
var->name, potential_value); var->name, potential_value);
line = info_read_in_echo_area (active_window, prompt); line = info_read_in_echo_area (active_window, prompt);
...@@ -153,7 +156,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable") ...@@ -153,7 +156,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable")
REFERENCE *entry; REFERENCE *entry;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->label = strdup (var->choices[i]); entry->label = xstrdup (var->choices[i]);
entry->nodename = (char *)NULL; entry->nodename = (char *)NULL;
entry->filename = (char *)NULL; entry->filename = (char *)NULL;
...@@ -161,7 +164,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable") ...@@ -161,7 +164,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable")
(entry, array_index, array, array_slots, 10, REFERENCE *); (entry, array_index, array, array_slots, 10, REFERENCE *);
} }
sprintf (prompt, "Set %s to value (%s): ", sprintf (prompt, _("Set %s to value (%s): "),
var->name, var->choices[*(var->value)]); var->name, var->choices[*(var->value)]);
/* Ask the completer to read a variable value for us. */ /* Ask the completer to read a variable value for us. */
...@@ -259,8 +262,8 @@ make_variable_completions_array () ...@@ -259,8 +262,8 @@ make_variable_completions_array ()
{ {
REFERENCE *entry; REFERENCE *entry;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); entry = (REFERENCE *) xmalloc (sizeof (REFERENCE));
entry->label = strdup (info_variables[i].name); entry->label = xstrdup (info_variables[i].name);
entry->nodename = (char *)NULL; entry->nodename = (char *)NULL;
entry->filename = (char *)NULL; entry->filename = (char *)NULL;
......
/* variables.h -- Description of user visible variables in Info. */ /* variables.h -- Description of user visible variables in Info.
$Id: variables.h,v 1.3 1997/07/15 18:44:23 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_VARIABLES_H_) #ifndef INFO_VARIABLES_H
#define _VARIABLES_H_ #define INFO_VARIABLES_H
/* A variable (in the Info sense) is an integer value with a user-visible /* A variable (in the Info sense) is an integer value with a user-visible
name. You may supply an array of strings to complete over when the name. You may supply an array of strings to complete over when the
...@@ -61,4 +62,4 @@ extern int info_scroll_behaviour; ...@@ -61,4 +62,4 @@ extern int info_scroll_behaviour;
extern int window_scroll_step; extern int window_scroll_step;
extern int ISO_Latin_p; extern int ISO_Latin_p;
#endif /* _VARIABLES_H_ */ #endif /* not INFO_VARIABLES_H */
/* window.c -- Windows in Info. */ /* window.c -- Windows in Info.
$Id: window.c,v 1.4 1997/07/15 18:35:59 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,10 +22,7 @@ ...@@ -21,10 +22,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "nodes.h" #include "nodes.h"
#include "window.h" #include "window.h"
#include "display.h" #include "display.h"
...@@ -1101,7 +1099,7 @@ window_make_modeline (window) ...@@ -1101,7 +1099,7 @@ window_make_modeline (window)
filename = filename_non_directory (node->filename); filename = filename_non_directory (node->filename);
if (node->flags & N_UpdateTags) if (node->flags & N_UpdateTags)
update_message = "--*** Tags out of Date ***"; update_message = _("--*** Tags out of Date ***");
} }
if (update_message) if (update_message)
...@@ -1112,25 +1110,25 @@ window_make_modeline (window) ...@@ -1112,25 +1110,25 @@ window_make_modeline (window)
/* 10 for the decimal representation of the number of lines in this /* 10 for the decimal representation of the number of lines in this
node, and the remainder of the text that can appear in the line. */ node, and the remainder of the text that can appear in the line. */
modeline_len += 10 + strlen ("-----Info: (), lines ----, "); modeline_len += 10 + strlen (_("-----Info: (), lines ----, "));
modeline_len += window->width; modeline_len += window->width;
modeline = (char *)xmalloc (1 + modeline_len); modeline = (char *)xmalloc (1 + modeline_len);
/* Special internal windows have no filename. */ /* Special internal windows have no filename. */
if (!parent && !*filename) if (!parent && !*filename)
sprintf (modeline, "-%s---Info: %s, %d lines --%s--", sprintf (modeline, _("-%s---Info: %s, %d lines --%s--"),
(window->flags & W_NoWrap) ? "$" : "-", (window->flags & W_NoWrap) ? "$" : "-",
nodename, window->line_count, location_indicator); nodename, window->line_count, location_indicator);
else else
sprintf (modeline, "-%s%s-Info: (%s)%s, %d lines --%s--", sprintf (modeline, _("-%s%s-Info: (%s)%s, %d lines --%s--"),
(window->flags & W_NoWrap) ? "$" : "-", (window->flags & W_NoWrap) ? "$" : "-",
(node && (node->flags & N_IsCompressed)) ? "zz" : "--", (node && (node->flags & N_IsCompressed)) ? "zz" : "--",
parent ? parent : filename, parent ? parent : filename,
nodename, window->line_count, location_indicator); nodename, window->line_count, location_indicator);
if (parent) if (parent)
sprintf (modeline + strlen (modeline), " Subfile: %s", filename); sprintf (modeline + strlen (modeline), _(" Subfile: %s"), filename);
if (update_message) if (update_message)
sprintf (modeline + strlen (modeline), "%s", update_message); sprintf (modeline + strlen (modeline), "%s", update_message);
......
/* window.h -- Structure and flags used in manipulating Info windows. */ /* window.h -- Structure and flags used in manipulating Info windows.
$Id: window.h,v 1.4 1997/07/15 18:45:47 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_WINDOW_H_) #ifndef INFO_WINDOW_H
#define _WINDOW_H_ #define INFO_WINDOW_H
#include "nodes.h" #include "nodes.h"
#include "infomap.h" #include "infomap.h"
...@@ -54,9 +55,10 @@ ...@@ -54,9 +55,10 @@
(0, window->height + window->first_row) is the first character of this (0, window->height + window->first_row) is the first character of this
windows modeline. The number of lines that can be displayed in a window windows modeline. The number of lines that can be displayed in a window
is equal to window->height - 1. */ is equal to window->height - 1. */
typedef struct __window__ { typedef struct window_struct
struct __window__ *next; /* Next window in this chain. */ {
struct __window__ *prev; /* Previous window in this chain. */ struct window_struct *next; /* Next window in this chain. */
struct window_struct *prev; /* Previous window in this chain. */
int width; /* Width of this window. */ int width; /* Width of this window. */
int height; /* Height of this window. */ int height; /* Height of this window. */
int first_row; /* Offset of the first line in the_screen. */ int first_row; /* Offset of the first line in the_screen. */
...@@ -226,4 +228,4 @@ extern void window_get_state (), window_set_state (); ...@@ -226,4 +228,4 @@ extern void window_get_state (), window_set_state ();
offset of GOAL. */ offset of GOAL. */
extern int window_chars_to_goal (); extern int window_chars_to_goal ();
#endif /* !_WINDOW_H_ */ #endif /* not INFO_WINDOW_H */
# Makefile for GNU makeinfo. # Makefile.in generated automatically by automake 1.2 from Makefile.am
# $Id: Makefile.in,v 1.1 1997/08/21 22:58:07 jason Exp $
#
# Copyright (C) 1993, 96 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# it under the terms of the GNU General Public License as published by # This Makefile.in is free software; the Free Software Foundation
# the Free Software Foundation; either version 2, or (at your option) # gives unlimited permission to copy, distribute and modify it.
# 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 SHELL = /bin/sh
# 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. ####
srcdir = @srcdir@ srcdir = @srcdir@
VPATH = $(srcdir):$(common) top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
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
common = $(srcdir)/../libtxi pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
EXEEXT = @EXEEXT@
CC = @CC@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ 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
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
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@
bin_PROGRAMS = makeinfo
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
EXTRA_DIST = README
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
bin_PROGRAMS = makeinfo$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
makeinfo_OBJECTS = makeinfo.o multi.o
makeinfo_LDADD = $(LDADD)
makeinfo_DEPENDENCIES = ../lib/libtxi.a
makeinfo_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = README Makefile.am Makefile.in
LN = ln
RM = rm -f
MKDIR = mkdir
DEFS = @DEFS@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
LIBS = -L../libtxi -ltxi @LIBS@
LOADLIBES = $(LIBS)
SHELL = /bin/sh TAR = tar
GZIP = --best
SOURCES = $(makeinfo_SOURCES)
OBJECTS = $(makeinfo_OBJECTS)
CFLAGS = @CFLAGS@ default: all
LDFLAGS = @LDFLAGS@
prefix = @prefix@ .SUFFIXES:
exec_prefix = @exec_prefix@ .SUFFIXES: .c .o
bindir = @bindir@ $(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
# Prefix for each installed program, normally empty or `g'. cd $(top_srcdir) && $(AUTOMAKE) --cygnus makeinfo/Makefile
binprefix =
infodir = @infodir@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-binPROGRAMS:
#### End of system configuration section. #### clean-binPROGRAMS:
test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
SRCS = makeinfo.c multi.c distclean-binPROGRAMS:
OBJS = makeinfo.o multi.o
PROGS = makeinfo$(EXEEXT) maintainer-clean-binPROGRAMS:
all: $(PROGS) makeinfo.info install-binPROGRAMS: $(bin_PROGRAMS)
sub-all: all @$(NORMAL_INSTALL)
$(mkinstalldirs) $(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)'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
done
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) -I. -I$(srcdir) -I$(common) $(DEFS) $(CFLAGS) $< $(COMPILE) -c $<
mostlyclean-compile:
rm -f *.o core
clean-compile:
distclean-compile:
rm -f *.tab.c
maintainer-clean-compile:
makeinfo$(EXEEXT): $(OBJS) ../libtxi/libtxi.a makeinfo$(EXEEXT): $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES)
$(CC) $(LDFLAGS) -o makeinfo $(OBJS) $(LOADLIBES) @rm -f makeinfo$(EXEEXT)
$(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS)
../libtxi/libtxi.a: tags: TAGS
(cd ../libtxi && $(MAKE) $(MFLAGS) libtxi.a)
makeinfo.o: makeinfo.c $(common)/getopt.h ID: $(HEADERS) $(SOURCES)
here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
$(OBJS): makeinfo.h TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
tags=; \
here=`pwd`; \
test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS)
info makeinfo.info: ./makeinfo makeinfo.texi #macro.texi mostlyclean-tags:
./makeinfo --no-split -I$(srcdir) makeinfo.texi
# makeinfo.texi: ./makeinfo makeinfo.mki clean-tags:
# ./makeinfo -E makeinfo.texi -I$(srcdir) makeinfo.mki
dvi makeinfo.dvi: ./makeinfo makeinfo.texi #macro.texi distclean-tags:
$(srcdir)/../util/texi2dvi makeinfo.txi rm -f TAGS ID
install: all maintainer-clean-tags:
$(INSTALL_PROGRAM) makeinfo$(EXEEXT) $(bindir)/$(binprefix)makeinfo$(EXEEXT)
-d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info
$(POST_INSTALL)
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = makeinfo
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
info:
dvi:
check: all
$(MAKE)
installcheck:
install-info: install-info:
-d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info install-exec: install-binPROGRAMS
../util/install-info --info-dir=$(infodir) $(infodir)/makeinfo.info @$(NORMAL_INSTALL)
install-data:
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-binPROGRAMS
all: Makefile $(PROGRAMS)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(bindir)
mostlyclean-generic:
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
uninstall: distclean-generic:
for f in $(PROGS); do rm -f $(bindir)/$(binprefix)$$f; done rm -f Makefile $(DISTCLEANFILES)
rm -f $(infodir)/makeinfo.info rm -f config.cache config.log stamp-h stamp-h[0-9]*
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
TAGS: $(SRCS) maintainer-clean-generic:
etags $(SRCS) test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic
clean: clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \
rm -f *.o a.out core core.* $(PROGS) mostlyclean
mostlyclean: clean distclean: distclean-binPROGRAMS distclean-compile distclean-tags \
distclean-generic clean
rm -f config.status
distclean: clean maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \
rm -f TAGS Makefile config.status *.info */*.info maintainer-clean-tags maintainer-clean-generic \
distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
realclean: distclean .PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
maintainer-clean: distclean clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir info dvi installcheck \
install-info install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
Makefile: Makefile.in ../config.status
cd .. && sh config.status
# Prevent GNU make v3 from overflowing arg limit on SysV. # 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: .NOEXPORT:
/* makeinfo.h -- Declarations for Makeinfo. /* makeinfo.h -- Declarations for Makeinfo.
$Id: makeinfo.h,v 1.1 1997/08/21 22:58:08 jason Exp $ $Id: makeinfo.h,v 1.3 1997/07/15 18:28:38 karl Exp $
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -35,12 +35,14 @@ ...@@ -35,12 +35,14 @@
enum insertion_type enum insertion_type
{ {
menu, detailmenu, quotation, lisp, smalllisp, example, smallexample, cartouche, defcv, deffn, defivar, defmac, defmethod,
display, itemize, format, enumerate, cartouche, multitable, table, defop, defopt, defspec, deftp, deftypefn, deftypefun,
ftable, vtable, group, ifinfo, flushleft, flushright, ifset, deftypemethod, deftypevar, deftypevr, defun, defvar,
ifclear, deffn, defun, defmac, defspec, defvr, defvar, defopt, defvr, detailmenu, direntry, display, enumerate, example,
deftypefn, deftypefun, deftypevr, deftypevar, defcv, defivar, defop, flushleft, flushright, format, ftable, group, ifclear,
defmethod, deftypemethod, deftp, direntry, bad_type ifinfo, ifnothtml, ifnottex, ifset, itemize, lisp, menu,
multitable, quotation, smallexample, smalllisp, table, vtable,
bad_type
}; };
DECLARE (int, insertion_level, 0); DECLARE (int, insertion_level, 0);
...@@ -48,13 +50,13 @@ DECLARE (int, insertion_level, 0); ...@@ -48,13 +50,13 @@ DECLARE (int, insertion_level, 0);
#if defined (COMPILING_MAKEINFO) #if defined (COMPILING_MAKEINFO)
char *insertion_type_names[] = char *insertion_type_names[] =
{ {
"menu", "detailmenu", "quotation", "lisp", "smalllisp", "example", "cartouche", "defcv", "deffn", "defivar", "defmac", "defmethod",
"smallexample", "display", "itemize", "format", "enumerate", "defop", "defopt", "defspec", "deftp", "deftypefn", "deftypefun",
"cartouche", "multitable", "table", "ftable", "vtable", "group", "deftypemethod", "deftypevar", "deftypevr", "defun", "defvar",
"ifinfo", "flushleft", "flushright", "ifset", "ifclear", "deffn", "defvr", "detailmenu", "direntry", "display", "enumerate", "example",
"defun", "defmac", "defspec", "defvr", "defvar", "defopt", "flushleft", "flushright", "format", "ftable", "group", "ifclear",
"deftypefn", "deftypefun", "deftypevr", "deftypevar", "defcv", "ifinfo", "ifnothtml", "ifnottex", "ifset", "itemize", "lisp", "menu",
"defivar", "defop", "defmethod", "deftypemethod", "deftp", "direntry", "multitable", "quotation", "smallexample", "smalllisp", "table", "vtable",
"bad_type" "bad_type"
}; };
#endif #endif
......
/* multi.c -- Multitable stuff for makeinfo. /* multi.c -- multitable stuff for makeinfo.
$Id: multi.c,v 1.1 1997/08/21 22:58:08 jason Exp $ $Id: multi.c,v 1.9 1997/07/24 22:01:00 karl Exp $
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation, along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h> #include "system.h"
#include "makeinfo.h" #include "makeinfo.h"
#define MAXCOLS 100 /* remove this limit later @@ */ #define MAXCOLS 100 /* remove this limit later @@ */
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
* `select_output_environment' function switches from one output * `select_output_environment' function switches from one output
* environment to another. * environment to another.
* *
* Environment #0 (i.e. element #0 of the table) is the regular * Environment #0 (i.e., element #0 of the table) is the regular
* environment that is used when we're not formatting a multitable. * environment that is used when we're not formatting a multitable.
* *
* Environment #N (where N = 1,2,3,...) is the env. for column #N of * Environment #N (where N = 1,2,3,...) is the env. for column #N of
...@@ -67,6 +67,40 @@ static int last_column; ...@@ -67,6 +67,40 @@ static int last_column;
to be drawn, separating rows and columns in the current multitable. */ to be drawn, separating rows and columns in the current multitable. */
static int hsep, vsep; static int hsep, vsep;
/* 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. */
static void
out_char (ch)
int ch;
{
extern int output_position;
putc (ch, output_stream);
output_position++;
}
void
draw_horizontal_separator ()
{
int i, j, s;
for (s = 0; s < envs[0].current_indent; s++)
out_char (' ');
if (vsep)
out_char ('+');
for (i = 1; i <= last_column; i++) {
for (j = 0; j <= envs[i].fill_column; j++)
out_char ('-');
if (vsep)
out_char ('+');
}
out_char ('\n');
}
void void
do_multitable () do_multitable ()
{ {
...@@ -116,7 +150,7 @@ setup_multitable_parameters () ...@@ -116,7 +150,7 @@ setup_multitable_parameters ()
char *params = insertion_stack->item_function; char *params = insertion_stack->item_function;
int nchars; int nchars;
float columnfrac; float columnfrac;
char command[200]; char command[200]; /* naughty, should be no fixed limits */
int i = 1; int i = 1;
/* We implement @hsep and @vsep even though TeX doesn't. /* We implement @hsep and @vsep even though TeX doesn't.
...@@ -129,21 +163,31 @@ setup_multitable_parameters () ...@@ -129,21 +163,31 @@ setup_multitable_parameters ()
params++; params++;
if (*params == '@') { if (*params == '@') {
sscanf (params, "%s%n", command, &nchars); sscanf (params, "%200s", command);
nchars = strlen (command);
params += nchars; params += nchars;
if (strcmp (command, "@hsep") == 0) if (strcmp (command, "@hsep") == 0)
hsep++; hsep++;
else if (strcmp (command, "@vsep") == 0) else if (strcmp (command, "@vsep") == 0)
vsep++; vsep++;
else if (strcmp (command, "@columnfractions") == 0) { else if (strcmp (command, "@columnfractions") == 0) {
/* Clobber old environments and create new ones, /* Clobber old environments and create new ones, starting at #1.
starting at #1. Environment #0 is the normal standard output, Environment #0 is the normal output, so don't mess with it. */
so we don't mess with it. */
for ( ; i <= MAXCOLS; i++) { for ( ; i <= MAXCOLS; i++) {
if (sscanf (params, "%f%n", &columnfrac, &nchars) < 1) if (sscanf (params, "%f", &columnfrac) < 1)
goto done; goto done;
params += nchars; /* Unfortunately, can't use %n since some m68k-hp-bsd libc
setup_output_environment (i, (int) (columnfrac * fill_column + .5)); 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
it's invalid input anyway. */
while (*params && *params != ' ' && *params != '\t'
&& *params != '\n' && *params != '@')
params++;
setup_output_environment (i,
(int) (columnfrac * (fill_column - current_indent) + .5));
} }
} }
...@@ -154,18 +198,17 @@ setup_multitable_parameters () ...@@ -154,18 +198,17 @@ setup_multitable_parameters ()
} }
/* This gives us two spaces between columns. Seems reasonable. /* This gives us two spaces between columns. Seems reasonable.
Really should expand the text, though, so a template of Really should expand the text, though, so a template of
`@code{foo}' has a width of three, not ten. Also have to match `@code{foo}' has a width of five, not ten. Also have to match
braces, then. */ braces, then. How to take into account current_indent here? */
setup_output_environment (i++, params++ - start); setup_output_environment (i++, params++ - start);
} else { } else {
warning ("ignoring stray text `%s' after @multitable", params); warning (_("ignoring stray text `%s' after @multitable"), params);
break; break;
} }
} }
done: done:
flush_output (); flush_output ();
inhibit_output_flushing (); inhibit_output_flushing ();
...@@ -227,12 +270,12 @@ select_output_environment (n) ...@@ -227,12 +270,12 @@ select_output_environment (n)
} }
/* advance to the next environment number */ /* advance to the next environment number */
int void
nselect_next_environment () nselect_next_environment ()
{ {
if (current_env_no >= last_column) { if (current_env_no >= last_column) {
line_error ("Too many columns in multitable item (max %d)", last_column); line_error (_("Too many columns in multitable item (max %d)"), last_column);
return 1; return;
} }
select_output_environment (current_env_no + 1); select_output_environment (current_env_no + 1);
} }
...@@ -240,12 +283,25 @@ nselect_next_environment () ...@@ -240,12 +283,25 @@ nselect_next_environment ()
static void output_multitable_row (); static void output_multitable_row ();
/* do anything needed at the beginning of processing a
multitable column. */
void
init_column ()
{
/* don't indent 1st paragraph in the item */
cm_noindent ();
/* throw away possible whitespace after @item or @tab command */
skip_whitespace ();
}
/* start a new item (row) of a multitable */ /* start a new item (row) of a multitable */
int
multitable_item () multitable_item ()
{ {
if (!multitable_active) { if (!multitable_active) {
/* impossible, I think. */ /* impossible, I think. */
error ("multitable item not in active multitable"); error (_("multitable item not in active multitable"));
exit (1); exit (1);
} }
if (current_env_no > 0) { if (current_env_no > 0) {
...@@ -254,7 +310,7 @@ multitable_item () ...@@ -254,7 +310,7 @@ multitable_item ()
/* start at column 1 */ /* start at column 1 */
select_output_environment (1); select_output_environment (1);
if (!output_paragraph) { if (!output_paragraph) {
line_error ("Cannot select column #%d in multitable", current_env_no); line_error (_("Cannot select column #%d in multitable"), current_env_no);
exit (FATAL); exit (FATAL);
} }
...@@ -263,38 +319,10 @@ multitable_item () ...@@ -263,38 +319,10 @@ multitable_item ()
return 0; return 0;
} }
/* do anything needed at the beginning of processing a
multitable column. */
init_column ()
{
/* don't indent 1st paragraph in the item */
cm_noindent ();
/* throw away possible whitespace after @item or @tab command */
skip_whitespace ();
}
/* 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. */
static void
out_char (ch)
int ch;
{
extern int output_position;
putc (ch, output_stream);
output_position++;
}
static void static void
output_multitable_row () output_multitable_row ()
{ {
int i, j, remaining; int i, j, s, remaining;
/* offset in the output paragraph of the next char needing /* offset in the output paragraph of the next char needing
to be output for that column. */ to be output for that column. */
...@@ -332,10 +360,15 @@ output_multitable_row () ...@@ -332,10 +360,15 @@ output_multitable_row ()
if (!remaining) if (!remaining)
break; break;
for (s = 0; s < envs[0].current_indent; s++)
out_char (' ');
if (vsep) if (vsep)
out_char ('|'); out_char ('|');
for (i = 1; i <= last_column; i++) { for (i = 1; i <= last_column; i++) {
for (s = 0; i < envs[i].current_indent; s++)
out_char (' ');
for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) { for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) {
if (CHAR_AT (j) == '\n') if (CHAR_AT (j) == '\n')
break; break;
...@@ -363,27 +396,12 @@ output_multitable_row () ...@@ -363,27 +396,12 @@ output_multitable_row ()
#undef CHAR_AT #undef CHAR_AT
#undef CHAR_ADDR #undef CHAR_ADDR
int
draw_horizontal_separator ()
{
int i, j;
if (vsep)
out_char ('+');
for (i = 1; i <= last_column; i++) {
for (j = 0; j <= envs[i].fill_column; j++)
out_char ('-');
if (vsep)
out_char ('+');
}
out_char ('\n');
}
/* select a new column in current row of multitable */ /* select a new column in current row of multitable */
void void
cm_tab () cm_tab ()
{ {
if (!multitable_active) if (!multitable_active)
error ("ignoring @tab outside of multitable"); error (_("ignoring @tab outside of multitable"));
nselect_next_environment (); nselect_next_environment ();
init_column (); init_column ();
...@@ -394,8 +412,6 @@ cm_tab () ...@@ -394,8 +412,6 @@ cm_tab ()
void void
end_multitable () end_multitable ()
{ {
int i;
output_multitable_row (); output_multitable_row ();
/* Multitables cannot be nested. Otherwise, we'd have to save the /* Multitables cannot be nested. Otherwise, we'd have to save the
...@@ -409,10 +425,10 @@ end_multitable () ...@@ -409,10 +425,10 @@ end_multitable ()
uninhibit_output_flushing (); uninhibit_output_flushing ();
#if 0 #if 0
printf ("** Multicolumn output from last row:\n"); printf (_("** Multicolumn output from last row:\n"));
for (i = 1; i <= last_column; i++) { for (i = 1; i <= last_column; i++) {
select_output_environment (i); select_output_environment (i);
printf ("* column #%d: output = %s\n", i, output_paragraph); printf (_("* column #%d: output = %s\n"), i, output_paragraph);
} }
#endif #endif
} }
%% TeX macros to handle Texinfo files. %% TeX macros to handle Texinfo files.
%% $Id: texinfo.tex,v 1.1 1997/08/21 22:57:53 jason Exp $ %% $Id: texinfo.tex,v 2.218 1997/07/26 19:12:35 karl Exp $
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, % Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
% 94, 95, 96, 97 Free Software Foundation, Inc. % 94, 95, 96, 97 Free Software Foundation, Inc.
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
% This automatically updates the version number based on RCS. % This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
\deftexinfoversion$Revision: 1.1 $ \deftexinfoversion$Revision: 2.218 $
\message{Loading texinfo package [Version \texinfoversion]:} \message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number % If in a .fmt file, print the version number
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
\hyphenation{ap-pen-dix} \hyphenation{ap-pen-dix}
\hyphenation{mini-buf-fer mini-buf-fers} \hyphenation{mini-buf-fer mini-buf-fers}
\hyphenation{eshell} \hyphenation{eshell}
\hyphenation{white-space}
% Margin to add to right of even pages, to left of odd pages. % Margin to add to right of even pages, to left of odd pages.
\newdimen \bindingoffset \newdimen \bindingoffset
...@@ -185,7 +186,13 @@ ...@@ -185,7 +186,13 @@
% %
\unvbox\headlinebox \unvbox\headlinebox
\pagebody{#1}% \pagebody{#1}%
\ifdim\ht\footlinebox > 0pt
% Only leave this space if the footline is nonempty.
% (We lessened \vsize for it in \oddfootingxxx.)
% The \baselineskip=24pt in plain's \makefootline has no effect.
\vskip 2\baselineskip
\unvbox\footlinebox \unvbox\footlinebox
\fi
% %
\ifcropmarks \ifcropmarks
\egroup % end of \vbox\bgroup \egroup % end of \vbox\bgroup
...@@ -729,10 +736,11 @@ where each line of input produces a line of output.} ...@@ -729,10 +736,11 @@ where each line of input produces a line of output.}
% %
\def\ignore{\doignore{ignore}} \def\ignore{\doignore{ignore}}
% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text. % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
% %
\def\ifinfo{\doignore{ifinfo}} \def\ifinfo{\doignore{ifinfo}}
\def\ifhtml{\doignore{ifhtml}} \def\ifhtml{\doignore{ifhtml}}
\def\ifnottex{\doignore{ifnottex}}
\def\html{\doignore{html}} \def\html{\doignore{html}}
\def\menu{\doignore{menu}} \def\menu{\doignore{menu}}
\def\direntry{\doignore{direntry}} \def\direntry{\doignore{direntry}}
...@@ -759,6 +767,10 @@ where each line of input produces a line of output.} ...@@ -759,6 +767,10 @@ where each line of input produces a line of output.}
% Make sure that spaces turn into tokens that match what \doignoretext wants. % Make sure that spaces turn into tokens that match what \doignoretext wants.
\catcode32 = 10 \catcode32 = 10
% %
% Ignore braces, too, so mismatched braces don't cause trouble.
\catcode`\{ = 9
\catcode`\} = 9
%
% And now expand that command. % And now expand that command.
\doignoretext \doignoretext
} }
...@@ -850,7 +862,7 @@ where each line of input produces a line of output.} ...@@ -850,7 +862,7 @@ where each line of input produces a line of output.}
\pretolerance = 10000 \pretolerance = 10000
% %
% Do not execute instructions in @tex % Do not execute instructions in @tex
\def\tex{\doignore{tex}} \def\tex{\doignore{tex}}%
} }
% @set VAR sets the variable VAR to an empty value. % @set VAR sets the variable VAR to an empty value.
...@@ -926,11 +938,16 @@ where each line of input produces a line of output.} ...@@ -926,11 +938,16 @@ where each line of input produces a line of output.}
\def\ifclearfail{\nestedignore{ifclear}} \def\ifclearfail{\nestedignore{ifclear}}
\defineunmatchedend{ifclear} \defineunmatchedend{ifclear}
% @iftex always succeeds; we read the text following, through @end % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
% iftex). But `@end iftex' should be valid only after an @iftex. % following, through the first @end iftex (etc.). Make `@end iftex'
% (etc.) valid only after an @iftex.
% %
\def\iftex{\conditionalsucceed{iftex}} \def\iftex{\conditionalsucceed{iftex}}
\def\ifnothtml{\conditionalsucceed{ifnothtml}}
\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
\defineunmatchedend{iftex} \defineunmatchedend{iftex}
\defineunmatchedend{ifnothtml}
\defineunmatchedend{ifnotinfo}
% We can't just want to start a group at @iftex (for example) and end it % 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 % at @end iftex, since then @set commands inside the conditional have no
...@@ -1006,6 +1023,15 @@ where each line of input produces a line of output.} ...@@ -1006,6 +1023,15 @@ where each line of input produces a line of output.}
\openindices \openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'. \fixbackslash % Turn off hack to swallow `\input texinfo'.
\global\let\setfilename=\comment % Ignore extra @setfilename cmds. \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
%
% If texinfo.cnf is present on the system, read it.
% Useful for site-wide @afourpaper, etc.
% Just to be on the safe side, close the input stream before the \input.
\openin 1 texinfo.cnf
\ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
\closein1
\temp
%
\comment % Ignore the actual filename. \comment % Ignore the actual filename.
} }
...@@ -1041,8 +1067,9 @@ where each line of input produces a line of output.} ...@@ -1041,8 +1067,9 @@ where each line of input produces a line of output.}
% We don't need math for this one. % We don't need math for this one.
\def\ttsl{\tenttsl} \def\ttsl{\tenttsl}
%% Try out Computer Modern fonts at \magstephalf % Use Computer Modern fonts at \magstephalf (11pt).
\let\mainmagstep=\magstephalf \newcount\mainmagstep
\mainmagstep=\magstephalf
% Set the font macro #1 to the font named #2, adding on the % Set the font macro #1 to the font named #2, adding on the
% specified font prefix (normally `cm'). % specified font prefix (normally `cm').
...@@ -1114,13 +1141,26 @@ where each line of input produces a line of output.} ...@@ -1114,13 +1141,26 @@ where each line of input produces a line of output.}
\font\indi=cmmi9 \font\indi=cmmi9
\font\indsy=cmsy9 \font\indsy=cmsy9
% Fonts for title page:
\setfont\titlerm\rmbshape{12}{\magstep3}
\setfont\titleit\itbshape{10}{\magstep4}
\setfont\titlesl\slbshape{10}{\magstep4}
\setfont\titlett\ttbshape{12}{\magstep3}
\setfont\titlettsl\ttslshape{10}{\magstep4}
\setfont\titlesf\sfbshape{17}{\magstep1}
\let\titlebf=\titlerm
\setfont\titlesc\scbshape{10}{\magstep4}
\font\titlei=cmmi12 scaled \magstep3
\font\titlesy=cmsy10 scaled \magstep4
\def\authorrm{\secrm}
% Chapter (and unnumbered) fonts (17.28pt). % Chapter (and unnumbered) fonts (17.28pt).
\setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chaprm\rmbshape{12}{\magstep2}
\setfont\chapit\itbshape{10}{\magstep3} \setfont\chapit\itbshape{10}{\magstep3}
\setfont\chapsl\slbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3}
\setfont\chaptt\ttbshape{12}{\magstep2} \setfont\chaptt\ttbshape{12}{\magstep2}
\setfont\chapttsl\ttslshape{10}{\magstep3} \setfont\chapttsl\ttslshape{10}{\magstep3}
\setfont\chapsf\sfbshape{12}{\magstep2} \setfont\chapsf\sfbshape{17}{1000}
\let\chapbf=\chaprm \let\chapbf=\chaprm
\setfont\chapsc\scbshape{10}{\magstep3} \setfont\chapsc\scbshape{10}{\magstep3}
\font\chapi=cmmi12 scaled \magstep2 \font\chapi=cmmi12 scaled \magstep2
...@@ -1157,19 +1197,15 @@ where each line of input produces a line of output.} ...@@ -1157,19 +1197,15 @@ where each line of input produces a line of output.}
\setfont\ssecit\itbshape{10}{1315} \setfont\ssecit\itbshape{10}{1315}
\setfont\ssecsl\slbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315}
\setfont\ssectt\ttbshape{12}{\magstephalf} \setfont\ssectt\ttbshape{12}{\magstephalf}
\setfont\ssecttsl\ttslshape{10}{\magstep1} \setfont\ssecttsl\ttslshape{10}{1315}
\setfont\ssecsf\sfbshape{12}{\magstephalf} \setfont\ssecsf\sfbshape{12}{\magstephalf}
\let\ssecbf\ssecrm \let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{\magstep1} \setfont\ssecsc\scbshape{10}{\magstep1}
\font\sseci=cmmi12 scaled \magstephalf \font\sseci=cmmi12 scaled \magstephalf
\font\ssecsy=cmsy10 scaled \magstep1 \font\ssecsy=cmsy10 scaled 1315
% The smallcaps and symbol fonts should actually be scaled \magstep1.5, % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
% but that is not a standard magnification. % but that is not a standard magnification.
% Fonts for title page:
\setfont\titlerm\rmbshape{12}{\magstep3}
\let\authorrm = \secrm
% In order for the font changes to affect most math symbols and letters, % In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families. Since % we have to define the \textfont of the standard families. Since
% texinfo doesn't allow for producing subscripts and superscripts, we % texinfo doesn't allow for producing subscripts and superscripts, we
...@@ -1194,6 +1230,13 @@ where each line of input produces a line of output.} ...@@ -1194,6 +1230,13 @@ where each line of input produces a line of output.}
\let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
\let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
\resetmathfonts} \resetmathfonts}
\def\titlefonts{%
\let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
\let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
\let\tenttsl=\titlettsl
\resetmathfonts \setleading{25pt}}
\def\titlefont#1{{\titlefonts #1}}
\def\chapfonts{% \def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
...@@ -1330,18 +1373,56 @@ where each line of input produces a line of output.} ...@@ -1330,18 +1373,56 @@ where each line of input produces a line of output.}
% @kbd is like @code, except that if the argument is just one @key command, % @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect. % then @kbd has no effect.
%
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
% `example' (@kbd uses ttsl only inside of @example and friends),
% or `code' (@kbd uses normal tty font always).
\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
\def\kbdinputstylexxx#1{%
\def\arg{#1}%
\ifx\arg\worddistinct
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
\else\ifx\arg\wordexample
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
\else\ifx\arg\wordcode
\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
\fi\fi\fi
}
\def\worddistinct{distinct}
\def\wordexample{example}
\def\wordcode{code}
% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
% the catcodes are wrong for parsearg to work.)
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
\def\xkey{\key} \def\xkey{\key}
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
\ifx\one\xkey\ifx\threex\three \key{#2}% \ifx\one\xkey\ifx\threex\three \key{#2}%
\else{\tclose{\ttsl\look}}\fi \else{\tclose{\kbdfont\look}}\fi
\else{\tclose{\ttsl\look}}\fi} \else{\tclose{\kbdfont\look}}\fi}
% @url. Quotes do not seem necessary, 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}%
\ifdim\wd0 > 0pt
\unhbox0\ (\code{#1})%
\else
\code{#1}%
\fi
}
% @url, @email. Quotes do not seem necessary.
\let\url=\code % perhaps include a hypertex \special eventually
% rms does not like the angle brackets --karl, 17may97. % rms does not like the angle brackets --karl, 17may97.
% So now @email is just like @uref.
%\def\email#1{$\langle${\tt #1}$\rangle$} %\def\email#1{$\langle${\tt #1}$\rangle$}
\let\email=\code \let\email=\uref
% Check if we are currently using a typewriter font. Since all the % Check if we are currently using a typewriter font. Since all the
% Computer Modern typewriter fonts have zero interword stretch (and % Computer Modern typewriter fonts have zero interword stretch (and
...@@ -1378,8 +1459,6 @@ where each line of input produces a line of output.} ...@@ -1378,8 +1459,6 @@ where each line of input produces a line of output.}
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
% First the title page. Must do @settitle before @titlepage. % First the title page. Must do @settitle before @titlepage.
\def\titlefont#1{{\titlerm #1}}
\newif\ifseenauthor \newif\ifseenauthor
\newif\iffinishedtitlepage \newif\iffinishedtitlepage
...@@ -1401,7 +1480,7 @@ where each line of input produces a line of output.} ...@@ -1401,7 +1480,7 @@ where each line of input produces a line of output.}
% %
% Now you can print the title using @title. % Now you can print the title using @title.
\def\title{\parsearg\titlezzz}% \def\title{\parsearg\titlezzz}%
\def\titlezzz##1{\leftline{\titlefont{##1}} \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
% print a rule at the page bottom also. % print a rule at the page bottom also.
\finishedtitlepagefalse \finishedtitlepagefalse
\vskip4pt \hrule height 4pt width \hsize \vskip4pt}% \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
...@@ -1490,10 +1569,7 @@ where each line of input produces a line of output.} ...@@ -1490,10 +1569,7 @@ where each line of input produces a line of output.}
\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish} \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
...@@ -1501,12 +1577,15 @@ where each line of input produces a line of output.} ...@@ -1501,12 +1577,15 @@ where each line of input produces a line of output.}
\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
%
% Leave some space for the footline. Hopefully ok to assume
% @evenfooting will not be used by itself.
\global\advance\pageheight by -\baselineskip
\global\advance\vsize by -\baselineskip
}
\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish} \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
% %
}% unbind the catcode of @. }% unbind the catcode of @.
...@@ -2230,7 +2309,13 @@ width0pt\relax} \fi ...@@ -2230,7 +2309,13 @@ width0pt\relax} \fi
%\def\char{\realbackslash char}% %\def\char{\realbackslash char}%
\def\TeX{\realbackslash TeX}% \def\TeX{\realbackslash TeX}%
\def\dots{\realbackslash dots }% \def\dots{\realbackslash dots }%
\def\copyright{\realbackslash copyright }% \def\result{\realbackslash result}%
\def\equiv{\realbackslash equiv}%
\def\expansion{\realbackslash expansion}%
\def\print{\realbackslash print}%
\def\error{\realbackslash error}%
\def\point{\realbackslash point}%
\def\copyright{\realbackslash copyright}%
\def\tclose##1{\realbackslash tclose {##1}}% \def\tclose##1{\realbackslash tclose {##1}}%
\def\code##1{\realbackslash code {##1}}% \def\code##1{\realbackslash code {##1}}%
\def\dotless##1{\realbackslash dotless {##1}}% \def\dotless##1{\realbackslash dotless {##1}}%
...@@ -2248,6 +2333,7 @@ width0pt\relax} \fi ...@@ -2248,6 +2333,7 @@ width0pt\relax} \fi
\def\kbd##1{\realbackslash kbd {##1}}% \def\kbd##1{\realbackslash kbd {##1}}%
\def\dfn##1{\realbackslash dfn {##1}}% \def\dfn##1{\realbackslash dfn {##1}}%
\def\emph##1{\realbackslash emph {##1}}% \def\emph##1{\realbackslash emph {##1}}%
\def\value##1{\realbackslash value {##1}}%
\unsepspaces \unsepspaces
} }
...@@ -2682,6 +2768,12 @@ width0pt\relax} \fi ...@@ -2682,6 +2768,12 @@ width0pt\relax} \fi
\def\print{\realbackslash print}% \def\print{\realbackslash print}%
\def\TeX{\realbackslash TeX}% \def\TeX{\realbackslash TeX}%
\def\dots{\realbackslash dots}% \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\copyright{\realbackslash copyright}%
\def\tt{\realbackslash tt}% \def\tt{\realbackslash tt}%
\def\bf{\realbackslash bf}% \def\bf{\realbackslash bf}%
...@@ -3208,7 +3300,9 @@ width0pt\relax} \fi ...@@ -3208,7 +3300,9 @@ width0pt\relax} \fi
\unnumbchapmacro{#1}\def\thischapter{}% \unnumbchapmacro{#1}\def\thischapter{}%
\begingroup % Set up to handle contents files properly. \begingroup % Set up to handle contents files properly.
\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi % We can't do this, because then an actual ^ in a section
% title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
%\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
\raggedbottom % Worry more about breakpoints than the bottom. \raggedbottom % Worry more about breakpoints than the bottom.
\advance\hsize by -\contentsrightmargin % Don't use the full line length. \advance\hsize by -\contentsrightmargin % Don't use the full line length.
} }
...@@ -3563,11 +3657,12 @@ width0pt\relax} \fi ...@@ -3563,11 +3657,12 @@ width0pt\relax} \fi
% %
\def\nonfillfinish{\afterenvbreak\endgroup}% \def\nonfillfinish{\afterenvbreak\endgroup}%
% This macro is
\def\lisp{\begingroup \def\lisp{\begingroup
\nonfillstart \nonfillstart
\let\Elisp = \nonfillfinish \let\Elisp = \nonfillfinish
\tt \tt
% Make @kbd do something special, if requested.
\let\kbdfont\kbdexamplefont
\rawbackslash % have \ input char produce \ char from current font \rawbackslash % have \ input char produce \ char from current font
\gobble \gobble
} }
...@@ -4303,29 +4398,27 @@ width0pt\relax} \fi ...@@ -4303,29 +4398,27 @@ width0pt\relax} \fi
% Read the last existing aux file, if any. No error if none exists. % Read the last existing aux file, if any. No error if none exists.
\def\readauxfile{\begingroup \def\readauxfile{\begingroup
\catcode`\^^@=\other \catcode`\^^@=\other
\catcode`\=\other \catcode`\^^A=\other
\catcode`\=\other \catcode`\^^B=\other
\catcode`\^^C=\other \catcode`\^^C=\other
\catcode`\^^D=\other \catcode`\^^D=\other
\catcode`\^^E=\other \catcode`\^^E=\other
\catcode`\^^F=\other \catcode`\^^F=\other
\catcode`\^^G=\other \catcode`\^^G=\other
\catcode`\^^H=\other \catcode`\^^H=\other
\catcode`\ =\other \catcode`\^^K=\other
\catcode`\^^L=\other \catcode`\^^L=\other
\catcode`\=\other \catcode`\^^N=\other
\catcode`\=\other \catcode`\^^P=\other
\catcode`\=\other \catcode`\^^Q=\other
\catcode`\=\other \catcode`\^^R=\other
\catcode`\=\other \catcode`\^^S=\other
\catcode`\=\other \catcode`\^^T=\other
\catcode`\=\other \catcode`\^^U=\other
\catcode`\=\other \catcode`\^^V=\other
\catcode`\=\other \catcode`\^^W=\other
\catcode`\=\other \catcode`\^^X=\other
\catcode`\=\other \catcode`\^^Z=\other
\catcode`\=\other
\catcode26=\other
\catcode`\^^[=\other \catcode`\^^[=\other
\catcode`\^^\=\other \catcode`\^^\=\other
\catcode`\^^]=\other \catcode`\^^]=\other
...@@ -4403,7 +4496,7 @@ width0pt\relax} \fi ...@@ -4403,7 +4496,7 @@ width0pt\relax} \fi
% space to prevent strange expansion errors.) % space to prevent strange expansion errors.)
\def\supereject{\par\penalty -20000\footnoteno =0 } \def\supereject{\par\penalty -20000\footnoteno =0 }
% @footnotestyle is meaningful for info output only.. % @footnotestyle is meaningful for info output only.
\let\footnotestyle=\comment \let\footnotestyle=\comment
\let\ptexfootnote=\footnote \let\ptexfootnote=\footnote
...@@ -4518,9 +4611,51 @@ width0pt\relax} \fi ...@@ -4518,9 +4611,51 @@ width0pt\relax} \fi
% %
\def\finalout{\overfullrule=0pt} \def\finalout{\overfullrule=0pt}
% @image. We use the macros from epsf.tex to support this.
% If epsf.tex is not installed and @image is used, we complain.
%
% Check for and read epsf.tex up front. If we read it only at @image
% time, we might be inside a group, and then its definitions would get
% undone and the next image would fail.
\openin 1 = xepsf.tex
\ifeof 1 \else
\closein 1
\def\epsfannounce{\toks0 = }% do not bother showing banner
\input epsf.tex
\fi
%
\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.}
%
% Only complain once about lack of epsf.tex.
\def\image#1{%
\ifx\epsfbox\undefined
\ifwarnednoepsf \else
\errhelp = \noepsfhelp
\errmessage{epsf.tex not found, images will be ignored}%
\global\warnednoepsftrue
\fi
\else
\imagexxx #1,,,\finish
\fi
}
%
% Arguments to @image:
% #1 is (mandatory) image filename; we tack on .eps extension.
% #2 is (optional) width, #3 is (optional) height.
% #4 is just the usual extra ignored arg for parsing this stuff.
\def\imagexxx#1,#2,#3,#4\finish{%
% \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}%
}
% End of control word definitions. % End of control word definitions.
\message{and turning on texinfo input format.} \message{and turning on texinfo input format.}
\def\openindices{% \def\openindices{%
......
# Makefile for GNU Texindex and other utilities. # Makefile.in generated automatically by automake 1.2 from Makefile.am
# $Id: Makefile.in,v 1.1 1997/08/21 22:58:12 jason Exp $
#
# Copyright (C) 1990, 91, 92, 96 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# it under the terms of the GNU General Public License as published by # This Makefile.in is free software; the Free Software Foundation
# the Free Software Foundation; either version 2, or (at your option) # gives unlimited permission to copy, distribute and modify it.
# any later version.
# This program is distributed in the hope that it will be useful, SHELL = /bin/sh
# 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 srcdir = @srcdir@
# along with this program; if not, write to the Free Software top_srcdir = @top_srcdir@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
#### Start 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
srcdir = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@
VPATH = $(srcdir):$(common) pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
common = $(srcdir)/../libtxi top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
EXEEXT = @EXEEXT@
CC = @CC@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
LN = ln NORMAL_INSTALL = true
RM = rm -f PRE_INSTALL = true
MKDIR = mkdir POST_INSTALL = true
NORMAL_UNINSTALL = true
PRE_UNINSTALL = true
POST_UNINSTALL = true
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
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@
DEFS = @DEFS@ bin_PROGRAMS = texindex
LIBS = -L../libtxi -ltxi @LIBS@ bin_SCRIPTS = texi2dvi
LOADLIBES = $(LIBS)
SHELL = /bin/sh noinst_PROGRAMS = install-inf
install_inf_SOURCES = install-info.c
CFLAGS = @CFLAGS@ 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
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
bin_PROGRAMS = texindex$(EXEEXT)
noinst_PROGRAMS = install-inf$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
texindex_SOURCES = texindex.c
texindex_OBJECTS = texindex.o
texindex_LDADD = $(LDADD)
texindex_DEPENDENCIES = ../lib/libtxi.a
texindex_LDFLAGS =
install_inf_OBJECTS = install-info.o
install_inf_LDADD = $(LDADD)
install_inf_DEPENDENCIES = ../lib/libtxi.a
install_inf_LDFLAGS =
SCRIPTS = $(bin_SCRIPTS)
prefix = @prefix@ CFLAGS = @CFLAGS@
exec_prefix = @exec_prefix@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
bindir = @bindir@ LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
# Prefix for each installed program, normally empty or `g'. DIST_COMMON = README Makefile.am Makefile.in
binprefix =
# Prefix for each installed man page, normally empty or `g'.
manprefix = DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
mandir = @mandir@/man1
manext = 1 TAR = tar
infodir = @infodir@ GZIP = --best
SOURCES = texindex.c $(install_inf_SOURCES)
OBJECTS = texindex.o $(install_inf_OBJECTS)
default: all
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus util/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-binPROGRAMS:
#### End of system configuration section. #### clean-binPROGRAMS:
test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
all: texindex$(EXEEXT) install-info$(EXEEXT) distclean-binPROGRAMS:
sub-all: all
maintainer-clean-binPROGRAMS:
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(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)'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
done
mostlyclean-noinstPROGRAMS:
clean-noinstPROGRAMS:
test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -I$(common) $(CFLAGS) $< $(COMPILE) -c $<
mostlyclean-compile:
rm -f *.o core
install: all clean-compile:
$(INSTALL_PROGRAM) texindex$(EXEEXT) $(bindir)/texindex$(EXEEXT)
$(INSTALL_PROGRAM) $(srcdir)/texi2dvi $(bindir)/texi2dvi
$(INSTALL_PROGRAM) install-info$(EXEEXT) $(bindir)/install-info$(EXEEXT)
install-info: distclean-compile:
rm -f *.tab.c
maintainer-clean-compile:
texindex$(EXEEXT): $(texindex_OBJECTS) $(texindex_DEPENDENCIES)
@rm -f texindex$(EXEEXT)
$(LINK) $(texindex_LDFLAGS) $(texindex_OBJECTS) $(texindex_LDADD) $(LIBS)
install-inf$(EXEEXT): $(install_inf_OBJECTS) $(install_inf_DEPENDENCIES)
@rm -f install-inf$(EXEEXT)
$(LINK) $(install_inf_LDFLAGS) $(install_inf_OBJECTS) $(install_inf_LDADD) $(LIBS)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(bindir)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT)"; \
$(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT); \
else if test -f $(srcdir)/$$p; then \
echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT)"; \
$(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT); \
else :; fi; fi; \
done
uninstall-binSCRIPTS:
$(NORMAL_UNINSTALL)
list='$(bin_SCRIPTS)'; for p in $$list; do \
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES)
here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
tags=; \
here=`pwd`; \
test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = util
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
info:
dvi: dvi:
check: all
$(MAKE)
installcheck:
install-info:
install-exec: install-binPROGRAMS install-binSCRIPTS install-exec-local
@$(NORMAL_INSTALL)
install-data:
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-binPROGRAMS uninstall-binSCRIPTS
all: Makefile $(PROGRAMS) $(SCRIPTS)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(bindir) $(bindir)
uninstall:
rm -f $(bindir)/texindex$(EXEEXT) $(bindir)/texi2dvi $(bindir)/install-info$(EXEEXT)
Makefile: Makefile.in ../config.status mostlyclean-generic:
cd ..; $(SHELL) config.status test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
TAGS: clean-generic:
etags *.c *.h $(common)/getopt*.c $(common)/getopt.h test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
clean: distclean-generic:
rm -f *.o a.out core core.* texindex install-info 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)
mostlyclean: clean maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
mostlyclean-compile mostlyclean-tags \
mostlyclean-generic
distclean: clean clean: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile clean-tags \
rm -f Makefile config.status clean-generic mostlyclean
realclean: distclean distclean: distclean-binPROGRAMS distclean-noinstPROGRAMS \
rm -f TAGS distclean-compile distclean-tags distclean-generic \
clean
rm -f config.status
texindex: texindex.o ../libtxi/libtxi.a maintainer-clean: maintainer-clean-binPROGRAMS \
$(CC) $(LDFLAGS) -o texindex texindex.o $(LOADLIBES) maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-generic distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
texindex.o: texindex.c $(common)/getopt.h .PHONY: default 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 uninstall-binSCRIPTS install-binSCRIPTS tags \
mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
distdir info dvi installcheck install-info install-exec install-data \
install uninstall all installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
install-info: install-info.o
$(CC) $(LDFLAGS) -o install-info install-info.o $(LOADLIBES)
install-info.o: install-info.c $(common)/getopt.h install-exec-local: $(noinst_PROGRAMS)
$(mkinstalldirs) $(bindir)
$(INSTALL_PROGRAM) install-inf$(EXEEXT) $(bindir)/`echo install-info$(EXEEXT)|sed '$(transform)'`; \
# Prevent GNU make v3 from overflowing arg limit on SysV. # 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: .NOEXPORT:
#!/bin/sh #!/bin/sh
# $Id: gen-dir-node,v 1.1 1997/08/21 22:58:12 jason Exp $ # $Id: gen-dir-node,v 1.1 1997/05/22 22:02:43 karl Exp $
# Generate the top-level Info node, given a directory of Info files # Generate the top-level Info node, given a directory of Info files
# and (optionally) a skeleton file. The output will be suitable for a # 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 # top-level dir file. The skeleton file contains info topic names in the
...@@ -164,9 +164,14 @@ else ...@@ -164,9 +164,14 @@ else
fi fi
for file in ${infofiles}; do for file in ${infofiles}; do
case $file in
*.gz) zcat=zcat; file=`echo $file|sed 's/\.gz$//'`; gz=.gz;;
*) zcat=cat; gz=;;
esac
infoname=`echo $file | sed 's/\.info$//'` infoname=`echo $file | sed 's/\.info$//'`
entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \ entry=`$zcat ${INFODIR}/${file}$gz \
-e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/${file}` |sed -e '1,/START-INFO-DIR-ENTRY/d' \
-e '/END-INFO-DIR-ENTRY/,$d'`
if [ ! -z "${entry}" ] ; then if [ ! -z "${entry}" ] ; then
echo "${entry}" echo "${entry}"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
# $Id: texi2dvi,v 1.1 1997/08/21 22:58:13 jason Exp $ # $Id: texi2dvi,v 0.6 1997/07/14 19:23:18 karl Exp $
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
progname=`echo "$0" | sed -e 's/[^\/]*\///g'` progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
# This string is expanded by rcs automatically when this file is checked out. # This string is expanded by rcs automatically when this file is checked out.
rcs_revision='$Revision: 1.1 $' rcs_revision='$Revision: 0.6 $'
version=`set - $rcs_revision; echo $2` version=`set - $rcs_revision; echo $2`
# To prevent hairy quoting and escaping later. # To prevent hairy quoting and escaping later.
...@@ -329,39 +329,6 @@ done ...@@ -329,39 +329,6 @@ done
$verbose "$0 done." $verbose "$0 done."
true # exit successfully. true # exit successfully.
# texi2dvi ends here
# $Log: texi2dvi,v $
# Revision 1.1 1997/08/21 22:58:13 jason
# Initial revision
#
# Revision 1.10 1996/10/04 18:21:55 karl
# Include only the current year in the copyright message.
#
# Revision 1.9 1996/10/04 11:49:48 karl
# Exit successfully. From arnold.
#
# Revision 1.8 1996/10/03 23:14:26 karl
# Only show diff if verbose.
# Update version number.
#
# Revision 1.7 1996/09/29 22:56:08 karl
# Use $progname instead of $0 for --version.
#
# Revision 1.6 1996/09/28 21:01:23 karl
# Recompute original index files each time through loop.
# Make indentation uniform.
# Use same basename for the temp input files.
# Standardize --version output.
#
# Revision 1.5 1996/09/26 14:46:34 karl
# (texi2dvi): Run TeX until the aux/index files stabilize, instead of just
# twice. From: David Shaw <daves@gsms01.alcatel.com.au>.
#
# Revision 1.4 1996/08/27 18:59:26 karl
# Include bug reporting address.
#
# Revision 1.3 1996/07/26 18:20:56 karl
# Do macro expansion with makeinfo before running TeX. # Do macro expansion with makeinfo before running TeX.
# Various expansion safety measures added for test; avoid use of -o. # Various expansion safety measures added for test; avoid use of -o.
# #
/* Prepare TeX index dribble output into an actual index. /* Prepare TeX index dribble output into an actual index.
$Id: texindex.c,v 1.1 1997/08/21 22:58:13 jason Exp $ $Id: texindex.c,v 1.17 1997/07/24 23:34:45 karl Exp $
Copyright (C) 1987, 91, 92, 96 Free Software Foundation, Inc. Copyright (C) 1987, 91, 92, 96, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -17,12 +17,8 @@ ...@@ -17,12 +17,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307. */ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307. */
#include <stdio.h> #include "system.h"
#include <ctype.h> #include <getopt.h>
#include <errno.h>
#include "getopt.h"
#define TEXINDEX_VERSION_STRING "GNU Texindex (Texinfo 3.9) 2.1"
#if defined (emacs) #if defined (emacs)
# include "../src/config.h" # include "../src/config.h"
...@@ -33,26 +29,6 @@ ...@@ -33,26 +29,6 @@
# undef open # undef open
#endif #endif
#if defined (HAVE_STRING_H)
# include <string.h>
#endif /* HAVE_STRING_H */
#if !defined (HAVE_STRCHR)
char *strrchr ();
#endif /* !HAVE_STRCHR */
#if defined (STDC_HEADERS)
# include <stdlib.h>
#else /* !STDC_HEADERS */
char *getenv (), *malloc (), *realloc ();
#endif /* !STDC_HEADERS */
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#else /* !HAVE_UNISTD_H */
off_t lseek ();
#endif /* !HAVE_UNISTD_H */
#if !defined (HAVE_MEMSET) #if !defined (HAVE_MEMSET)
#undef memset #undef memset
#define memset(ptr, ignore, count) bzero (ptr, count) #define memset(ptr, ignore, count) bzero (ptr, count)
...@@ -89,13 +65,6 @@ char *mktemp (); ...@@ -89,13 +65,6 @@ char *mktemp ();
# define SEEK_END 2 # define SEEK_END 2
#endif /* !SEEK_SET */ #endif /* !SEEK_SET */
#ifndef errno
extern int errno;
#endif
#ifndef strerror
extern char *strerror ();
#endif
/* When sorting in core, this structure describes one line /* When sorting in core, this structure describes one line
and the position and length of its first keyfield. */ and the position and length of its first keyfield. */
struct lineinfo struct lineinfo
...@@ -214,6 +183,15 @@ main (argc, argv) ...@@ -214,6 +183,15 @@ main (argc, argv)
else else
program_name = argv[0]; program_name = argv[0];
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
#endif
/* Set the text message domain. */
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Describe the kind of sorting to do. */ /* Describe the kind of sorting to do. */
/* The first keyfield uses the first braced field and folds case. */ /* The first keyfield uses the first braced field and folds case. */
keyfields[0].braced = 1; keyfields[0].braced = 1;
...@@ -282,15 +260,15 @@ typedef struct ...@@ -282,15 +260,15 @@ typedef struct
TEXINDEX_OPTION texindex_options[] = { TEXINDEX_OPTION texindex_options[] = {
{ "--keep", "-k", &keep_tempfiles, 1, (char *)NULL, { "--keep", "-k", &keep_tempfiles, 1, (char *)NULL,
"keep temporary files around after processing" }, N_("keep temporary files around after processing") },
{ "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL, { "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL,
"do not keep temporary files around after processing (default)" }, N_("do not keep temporary files around after processing (default)") },
{ "--output", "-o", (int *)NULL, 0, "FILE", { "--output", "-o", (int *)NULL, 0, "FILE",
"send output to FILE" }, N_("send output to FILE") },
{ "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL, { "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL,
"display version information and exit" }, N_("display version information and exit") },
{ "--help", "-h", (int *)NULL, 0, (char *)NULL, { "--help", "-h", (int *)NULL, 0, (char *)NULL,
"display this help and exit" }, N_("display this help and exit") },
{ (char *)NULL, (char *)NULL, (int *)NULL, 0, (char *)NULL } { (char *)NULL, (char *)NULL, (int *)NULL, 0, (char *)NULL }
}; };
...@@ -301,11 +279,11 @@ usage (result_value) ...@@ -301,11 +279,11 @@ usage (result_value)
register int i; register int i;
FILE *f = result_value ? stderr : stdout; FILE *f = result_value ? stderr : stdout;
fprintf (f, "Usage: %s [OPTION]... FILE...\n", program_name); fprintf (f, _("Usage: %s [OPTION]... FILE...\n"), program_name);
fprintf (f, "Generate a sorted index for each TeX output FILE.\n"); fprintf (f, _("Generate a sorted index for each TeX output FILE.\n"));
/* Avoid trigraph nonsense. */ /* Avoid trigraph nonsense. */
fprintf (f, "Usually FILE... is `foo.??\' for a document `foo.texi'.\n"); fprintf (f, _("Usually FILE... is `foo.??\' for a document `foo.texi'.\n"));
fprintf (f, "\nOptions:\n"); fprintf (f, _("\nOptions:\n"));
for (i = 0; texindex_options[i].long_name; i++) for (i = 0; texindex_options[i].long_name; i++)
{ {
...@@ -317,9 +295,9 @@ usage (result_value) ...@@ -317,9 +295,9 @@ usage (result_value)
texindex_options[i].arg_name texindex_options[i].arg_name
? texindex_options[i].arg_name : ""); ? texindex_options[i].arg_name : "");
fprintf (f, "\t%s\n", texindex_options[i].doc_string); fprintf (f, "\t%s\n", _(texindex_options[i].doc_string));
} }
puts ("\nEmail bug reports to bug-texinfo@prep.ai.mit.edu."); puts (_("\nEmail bug reports to bug-texinfo@prep.ai.mit.edu."));
exit (result_value); exit (result_value);
} }
...@@ -333,7 +311,6 @@ decode_command (argc, argv) ...@@ -333,7 +311,6 @@ decode_command (argc, argv)
char **argv; char **argv;
{ {
int arg_index = 1; int arg_index = 1;
int optc;
char **ip; char **ip;
char **op; char **op;
...@@ -367,11 +344,11 @@ decode_command (argc, argv) ...@@ -367,11 +344,11 @@ decode_command (argc, argv)
{ {
if (strcmp (arg, "--version") == 0) if (strcmp (arg, "--version") == 0)
{ {
puts (TEXINDEX_VERSION_STRING); printf (_("texindex (GNU %s %s) 2.1\n"), PACKAGE, VERSION);
puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\ puts (_("Copyright (C) 1996 Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\ There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\ under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING."); For more information about these matters, see the files named COPYING."));
exit (0); exit (0);
} }
else if ((strcmp (arg, "--keep") == 0) || else if ((strcmp (arg, "--keep") == 0) ||
...@@ -946,7 +923,7 @@ sort_offline (infile, nfiles, total, outfile) ...@@ -946,7 +923,7 @@ sort_offline (infile, nfiles, total, outfile)
if (lb.buffer[0] != '\\' && lb.buffer[0] != '@') if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
{ {
error ("%s: not a texinfo index file", infile); error (_("%s: not a texinfo index file"), infile);
return; return;
} }
...@@ -980,7 +957,7 @@ sort_offline (infile, nfiles, total, outfile) ...@@ -980,7 +957,7 @@ sort_offline (infile, nfiles, total, outfile)
if (lb.buffer[0] != '\\' && lb.buffer[0] != '@') if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
{ {
error ("%s: not a texinfo index file", infile); error (_("%s: not a texinfo index file"), infile);
failure = 1; failure = 1;
goto fail; goto fail;
} }
...@@ -1041,7 +1018,7 @@ sort_in_core (infile, total, outfile) ...@@ -1041,7 +1018,7 @@ sort_in_core (infile, total, outfile)
int desc = open (infile, O_RDONLY, 0); int desc = open (infile, O_RDONLY, 0);
if (desc < 0) if (desc < 0)
fatal ("failure reopening %s", infile); fatal (_("failure reopening %s"), infile);
for (file_size = 0;;) for (file_size = 0;;)
{ {
i = read (desc, data + file_size, total - file_size); i = read (desc, data + file_size, total - file_size);
...@@ -1056,7 +1033,7 @@ sort_in_core (infile, total, outfile) ...@@ -1056,7 +1033,7 @@ sort_in_core (infile, total, outfile)
if (file_size > 0 && data[0] != '\\' && data[0] != '@') if (file_size > 0 && data[0] != '\\' && data[0] != '@')
{ {
error ("%s: not a texinfo index file", infile); error (_("%s: not a texinfo index file"), infile);
return; return;
} }
...@@ -1084,7 +1061,7 @@ sort_in_core (infile, total, outfile) ...@@ -1084,7 +1061,7 @@ sort_in_core (infile, total, outfile)
nextline = parsefile (infile, nextline, file_data, file_size); nextline = parsefile (infile, nextline, file_data, file_size);
if (nextline == 0) if (nextline == 0)
{ {
error ("%s: not a texinfo index file", infile); error (_("%s: not a texinfo index file"), infile);
return; return;
} }
...@@ -1310,7 +1287,7 @@ indexify (line, ostream) ...@@ -1310,7 +1287,7 @@ indexify (line, ostream)
{ {
fprintf (ostream, "\\initial {"); fprintf (ostream, "\\initial {");
fwrite (initial, 1, initiallength, ostream); fwrite (initial, 1, initiallength, ostream);
fprintf (ostream, "}\n", initial); fputs ("}\n", ostream);
if (initial == initial1) if (initial == initial1)
{ {
lastinitial = lastinitial1; lastinitial = lastinitial1;
...@@ -1354,7 +1331,7 @@ indexify (line, ostream) ...@@ -1354,7 +1331,7 @@ indexify (line, ostream)
/* Should not have an entry with no subtopic following one with a subtopic. */ /* Should not have an entry with no subtopic following one with a subtopic. */
if (nosecondary && *lastsecondary) if (nosecondary && *lastsecondary)
error ("entry %s follows an entry with a secondary name", line); error (_("entry %s follows an entry with a secondary name"), line);
/* Start a new secondary entry if necessary. */ /* Start a new secondary entry if necessary. */
if (!nosecondary && strncmp (secondary, lastsecondary, secondarylength)) if (!nosecondary && strncmp (secondary, lastsecondary, secondarylength))
...@@ -1692,7 +1669,7 @@ pfatal_with_name (name) ...@@ -1692,7 +1669,7 @@ pfatal_with_name (name)
s = strerror (errno); s = strerror (errno);
printf ("%s: ", program_name); printf ("%s: ", program_name);
printf ("%s; for file `%s'.\n", s, name); printf (_("%s; for file `%s'.\n"), s, name);
exit (TI_FATAL_ERROR); exit (TI_FATAL_ERROR);
} }
...@@ -1745,6 +1722,21 @@ strrchr (string, character) ...@@ -1745,6 +1722,21 @@ strrchr (string, character)
} }
#endif /* HAVE_STRCHR */ #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. */ /* Just like malloc, but kills the program in case of fatal error. */
void * void *
xmalloc (nbytes) xmalloc (nbytes)
...@@ -1776,18 +1768,3 @@ xrealloc (pointer, nbytes) ...@@ -1776,18 +1768,3 @@ xrealloc (pointer, nbytes)
return (temp); return (temp);
} }
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 ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment