From: downsj Date: Sun, 15 Dec 1996 21:37:43 +0000 (+0000) Subject: Import of texinfo-3.9. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=40248eced16a3ade83b83a09d22bb308e8803774;p=openbsd Import of texinfo-3.9. --- diff --git a/gnu/usr.bin/texinfo/COPYING b/gnu/usr.bin/texinfo/COPYING index a43ea2126fb..916d1f0f284 100644 --- a/gnu/usr.bin/texinfo/COPYING +++ b/gnu/usr.bin/texinfo/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found. 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., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Also add information on how to contact you by electronic and paper mail. diff --git a/gnu/usr.bin/texinfo/ChangeLog b/gnu/usr.bin/texinfo/ChangeLog index 48e217611db..06d0464a688 100644 --- a/gnu/usr.bin/texinfo/ChangeLog +++ b/gnu/usr.bin/texinfo/ChangeLog @@ -1,3 +1,625 @@ +Fri Oct 4 07:49:49 1996 Karl Berry + + * Version 3.9. + + * Makefile.in (install): Say to install texinfo.tex manually. + + * util/texi2dvi, + * util/texindex.c, + * makeinfo/makeinfo.c, + * info/info.c: Include only the current year in the copyright message. + + * util/texi2dvi: Exit successfully. + From: Andreas Schwab . + +Thu Oct 3 12:58:32 1996 Karl Berry + + * Rename install.sh to the preferred install-sh. + + * Makefile.in (VERSION), + * util/texi2dvi, + * util/texindex.c, + * util/install-info.c, + * makeinfo/makeinfo.c (minor_version, print_version_info), + * info/info.c: Update version number. + + * util/texi2dvi: Only show diff if verbose. + + * util/install-info.c (main): Check for a missing dir file as well + as a missing info files. + (main): At start of a node, completely initialize the newly-malloced + node structure. + + * texinfo.texi: Fix incorrect uses of @key, + insert missing newline in Installing Dir Entries' @menu item, + document install-info invocation. + + * Makefile.in (DISTFILES): Do not put .gdbinit's in distribution. + (dist): Use || instead of && (and invert sense) so make doesn't think + the command failed. + (dist): Exclude more junk. + + * makeinfo/makeinfo.c (cm_xref): Back out patch from Tom T., since + we generate a good-enough error message that is suppressible + without it. + + * util/gen-dir-node: The recommended name for the top-level info + file is dir, not dir.info. + + * util/install-info.c (main): At `Mark the end of the Top node', + make sure the node name is non-NULL before comparing it. From + lvirden@cas.org. + + * configure.in (AC_REPLACE_FUNCS): Use this for memcpy, memmove, + and strdup. + (AC_CHECK_FUNCS): Instead of this. + Because both bcopy and memmove are missing on the 3b2, as reported by + Gaylen Miller , hence we must provide our own. + * libtxi/Makefile.in (LIBOBJS): New variable. + (OBJS): Include it. + * libtxi/memcpy.c, libtxi/memmove.c, libtxi/strdup.c: New files, + taken from fileutils 3.13. + * makeinfo/makeinfo.c, + * info/clib.c (strdup): Move to libtxi. + +Wed Oct 2 18:23:30 1996 Karl Berry + + * info/info-utils.h (memcpy) [!HAVE_MEMCPY], + * info/termdep.h (memcpy) [!HAVE_MEMCPY], + * makeinfo/makeinfo.c (memmove) [!HAVE_MEMMOVE]: Remove this + #ifdef, as we now include it in libtxi if missing. + +Tue Oct 1 17:41:52 1996 Karl Berry + + * makeinfo/Makefile.in (install), + * info/Makefile.in (install), + * Makefile.in (install): Use new option name --info-dir instead of + --infodir. + + * makeinfo/multi.c (out_char): New fn. Replace all calls to + putc/fprintf with calls to this. + + * util/install-info.c: Rename --infodir to info-dir. + +Mon Sep 30 10:07:21 1996 Karl Berry + + * Version 3.8. + + * texinfo.tex: Untabify. + + * texinfo.tex (\ptexl, \ptexL): Do not save, we have our own + commands now. + (\onepageout): Reformat for readability, and call \indexdummies + to avoid expansion of Texinfo commands (e.g., accents) in \write's. + (\,, \dotaccent, \ringaccent, \tieaccent, \ubaraccent, udotaccent, + \questiondown, \exclamdown, \dotless): New macros. + (\l): Let plain TeX definition remain, instead of switching + to ``lisp'' font. + (\multitable): Ensure space between the columns, + insert struts to make interline spacing constant, + use real strut instead of a box containing `Xy'. + (\indexdummies): Do not define \rm, \char, but + do define \@, \{, \}, \dotless, and \,. And \t should generate + \t, not \r. + (\indexnofonts): Define \, and \dotless as \indexdummyfont, + and let \@ be @. + (\doind): Reformat for readability, and use temp control sequence + names that actually make sense. + (\doublecolumnout, \pagesofar, \enddoublecolumns): Restore + Knuth's original code to avoid spurious overfull vbox messages. + (No boxes are actually overfull). + (\shortcontents): Do not allow hyphenations. + (\dochapentry, \tocentry): Make glue above and below flexible, to allow + better page breaks. + (\tex): Reset \, to its plain TeX meaning, + and do not reset \l. + + * COPYING: Update for new FSF address (from gcc dist). + + * libtxi/Makefile.in: Various simplifications. + +Sun Sep 29 12:58:44 1996 Karl Berry + + * util/texi2dvi: Use $progname instead of $0 for --version. + + * util/install-info.c (xmalloc, xrealloc): Declare malloc and + realloc as returning void *, + to avoid ptr/int problems on Digital Unix. + + * info/tilde.c (tilde_expand_word): Declare getenv as returning char *, + to avoid warning on Digital Unix. + + * makeinfo/multi.c (multitable_active): Declare extern here to + avoid ld warning on rs6000. + + * util/texindex.c (usage): Avoid ??' trigraph. + + * util/install-info.c: Include or , + according to HAVE_SYS_FCNTL_H, + and only include if HAVE_SYS_FILE_H. + (readlines): Oops, had NULL's and 0's reversed for ptr/int members. + + * info/terminal.c (terminal_goto_xy): Remove spurious extra ;. + + * util/install-info.c: Untabify. (input_sections): Initialize. + (find_lines): Initialize the terminating element of the array. + (print_help): Document --infodir. + (main): Compare the basename of infile sans .info to the dir entry, + not infile itself. + * util/Makefile.in (clean): Remove the install-info binary. + + * info/Makefile.in (distclean): Remove *.info* files. + + * Makefile.in (install), + * info/Makefile.in (install), + * makeinfo/Makefile.in (install): Use --infodir instead of --info-file. + + * info/info.c, + * makeinfo/makeinfo.c: Avoid newlines in string constants for the + sake of SunOS cc. + + * makeinfo/multi.c: Do not assume ANSI C. + + * info/info.texi: Oops, need @end vtable for a @vtable. + +Sat Sep 28 16:31:28 1996 Karl Berry + + * Makefile.in (texinfo): Do not depend on sub-all, as then + makeinfo is always run. Instead, depend on texinfo.texi. + + * makeinfo/Makefile.in (info, dvi): New targets. + makeinfo.info, makeinfo.dvi: Do not depend on macro.texi for now. + + * info/Makefile.in (install): Must call install-info twice. + + * info/info-stnd.texi, + * info/info.texi, + * makeinfo/makeinfo.texi: Include direntry. + + * emacs/Makefile.in: Use && after cd, etc. + + * texinfo.texi: Kludges so makeinfo -E will not create spurious + differences. Add new direntries. + + * util/install-info.c, + * util/texindex.c, + * makeinfo/makeinfo.c, + * info/info.c: Standardize --version output. + + * makeinfo/makeinfo.c (defun_internal): Don't insert index command + if expanding macros. + (cm_footnotestyle): Don't change the footnote style if it was set + on the command line. + + * util/texi2dvi: Recompute original index files each time through loop. + Make indentation uniform. + Use same basename for the temp input files. + Standardize --version output. + + * info/Makefile.in (install), + * makeinfo/Makefile.in (install): Insert $(POST_INSTALL). + +Fri Sep 27 13:27:30 1996 Karl Berry + + * texinfo.texi (Format with texi2dvi): Rewrite now that the script + runs in a loop. + + * info/Makefile.in (MAKEINFO): Simplify to ../makeinfo/makeinfo. + +Fri Sep 27 00:26:03 1996 Miles Bader + + * info/terminal.c [HAVE_TERMIOS_H] (terminal_prep_terminal, + terminal_unprep_terminal): Add code for termios. + [HAVE_TERMIOS_H] (original_termios, ttybuff): New variables. + * info/termdep.h: [HAVE_TERMIOS_H]: Add include of . + * configure.in: Add check for . + +Thu Sep 26 10:46:34 1996 Karl Berry + + * emacs/texnfo-upd.el, + * emacs/texinfo.el, + * emacs/texinfmt.el: Update from bob for new Texinfo commands, etc. + + * emacs/info.el, emacs/informat.el, emacs/makeinfo.el, + emacs/texnfo-tex.el: Update from Emacs 19.34 dist. + + * emacs/elisp-comp: Use TMPDIR if set. + + * util/Makefile.in (libdir): Remove. + + * makeinfo/Makefile.in (install), + * Makefile.in (install), + * info/Makefile.in (install): Run install-info. + (libdir): Remove. + + * texinfo.texi: Various fixes as I make this go through TeX. + + * util/install-info.c: Quote newlines in help message. + + * util/texi2dvi (texi2dvi): Run TeX until the aux/index files + stabilize, instead of just twice. From: David Shaw + . + +Tue Sep 24 14:43:03 1996 Karl Berry + + * dir: Blank dir file for installation on new systems. + +Mon Sep 23 12:18:43 1996 Karl Berry + + * makeinfo/makeinfo.c (args_from_string): Do not back up at a }; + that leads to an infinite loop. + +Sat Sep 21 17:48:04 1996 Karl Berry + + * makeinfo/makeinfo.c (cm_xref): Do not seg fault if outside of + any node. From: Tom Tromey . + (cm_ctrl): Make obsolete. + +Tue Sep 17 13:30:08 1996 Karl Berry + + * texinfo.tex (\inforef): Move to more appropriate place. + (\pounds): Remove spurious extra $. + (\email): Typeset argument in angle brackets. + (\macro): Use \doignore for robustness, instead of just letting TeX + parse the argument. + (\unmacro): Define. + +Sat Sep 14 16:17:35 1996 Karl Berry + + * texinfo.texi: Document multitables, new ISBN number. + +Wed Sep 11 18:01:24 1996 Karl Berry + + * makeinfo/multi.c (struct env): Remove unused output_position + field; this needs to be global. + (setup_multitable_parameters): Implement template-defined multitables. + (output_multitable_row): Remove trailing whitespace. + + * makeinfo/makeinfo.c (_READ_BUFFER_GROWTH, struct _defines): + Remove leading underscore for POSIX/ANSI pedants. + (init_conversion): Initialize output_position here. + (init_paragraph): Instead of here, where it loses with the + multitable calls, eventually resulting in negative counts to the + write call when the output file is split. + + * texinfo.texi: First cut at macro documentation. + Change accent doc to use tables. + Remove whitespace experiments, they are now the default. + +Mon Sep 9 14:16:24 1996 Karl Berry + + * makeinfo/makeinfo.c: Use putc instead of fprintf where possible. + (cm_accent): Put _ from @ubaraccent after argument. + + * util/texindex.c (strerror) [!strerror]: Conditionalize + declaration. + +Sat Sep 7 14:13:24 1996 Karl Berry + + * makeinfo/makeinfo.c (commandTable): Obsolete @setchapterstyle. + +Thu Sep 5 15:45:11 1996 Karl Berry + + * makeinfo/makeinfo.c (convert_from_loaded_file): Oops, fix + wording of initial output comment. + + * makeinfo/makeinfo.c (cm_angle_brackets): Rename from cm_key. + (commandTable): @email should produce angle brackets. + @key: Change name. + +Tue Sep 3 14:52:17 1996 Karl Berry + + * texinfo.tex (\hsize): Decrease. + (\hoffset): Increase. + (\setleading): Decrease dramatically. + This change affects 8.5x11 format only. + + * texinfo.texi: Document accent commands. + +Mon Sep 2 11:10:49 1996 Karl Berry + + * makeinfo/makeinfo.c (commandTable): Deprecate @ichapter and + @titlespec. + Move all the deprecated @i
commands to the end of the list. + + * texinfo.texi: Document @pounds{} and @centerchap{}. + + * texinfo.tex (\centerchfplain): Rewrite to use \chfplain, and to + actually center. + (\unnchfplain): Just call \chfplain. + (\chfplain): Rewrite to be generally callable. + (\centerparametersmaybe): Hook, a no-op except with @centerchap. + +Sun Sep 1 15:01:49 1996 Karl Berry + + * texinfo.texi: Document @, rearrange spacing section. + + * makeinfo.c (commandTable): Make @. @? @! insert themselves, + not be sentence-non-enders. They are sentence *enders*. Also, + make @\t and @\n insert a normal space character, not themselves. + Also, define @hyphenation. + (insert_space): New function. + (cm_ignore_sentence_ender): Remove this. + (flush_output): Check only for META-SPC, not META-. + +Fri Aug 30 18:55:30 1996 Karl Berry + + * texinfo.texi: Document @- and @hyphenation{}. + Miscellanous fixes. + + * makeinfo/makeinfo.c (commandTable): Define @- as cm_no_op, since + makeinfo doesn't do hyphenation. + +Thu Aug 29 13:05:38 1996 Karl Berry + + * texinfo.tex (\key): Do not uppercase the argument; key names + can be mixed case, e.g., `Control'. + + * makeinfo/makeinfo.c: @infotop, @infounnumbered, + @infounnumberedsec, @infounnumberedsubsec, + @infounnumberedsubsubsec, @infoappendix, @infoappendixsec, + @infoappendixsubsec, @infoappendixsubsubsec, @infochapter, + @infosection, @infosubsection, @infosubsubsection: + Remove these long-since obsolete commands. + @iappendix, @iappendixsection, @iappendixsec, @iappendixsubsec, + @iappendixsubsubsec, @ichapter, @isection, @isubsection, + @isubsubsection, @iunnumbered, @iunnumberedsec, @iunnumberedsubsec, + @iunnumberedsubsubsec: + Deprecate these. + @infoinclude: + Obsolete this. + @,: Have to take an argument, since have to do @,{c} not c@,; can't + feasibly implement the latter in TeX. + + * makeinfo/makeinfo.c: Rename @d to @udotaccent, since this is + relatively infrequently used. + +Tue Aug 27 14:58:56 1996 Karl Berry + + * info/info.c (print_short_help), + * util/install-info.c (print_help), + * util/texi2dvi, + * makeinfo/makeinfo.c (usage) Include bug reporting address. + +Mon Aug 26 15:27:17 1996 Karl Berry + + * makeinfo/makeinfo.c (commandTable): Remove @input, @medbreak, + @smallbreak, @overfullrule, @br. + +Sun Aug 25 17:25:48 1996 Karl Berry + + * makeinfo/makeinfo.c (commandTable): Unify commands that perform + the same operation, such as cm_file, cm_samp, cm_email, + etc., which all do cm_code. + + * texinfo.texi: Document @ifhtml ... @end ifhtml. Change + `PlainTeX' to `plain TeX'. + +Fri Aug 23 16:03:16 1996 Karl Berry + + * texinfo.tex (\pounds): New Texinfo command @pounds{}. + (\parskip): New smaller value. + (\chapheadingskip, \secheadingskip, \subsecheadingskip): New smaller + values, both for 8.5x11 and @smallbook formats. From Bob. + + * makeinfo/makeinfo.c (cm_special_char): @pounds{} prints a #. + (commandTable): Add new command @pounds. + +Tue Aug 20 13:47:20 1996 Karl Berry + + * makeinfo/makeinfo.c (CommandTable): Restore "!", accidentally + removed previously. + + * texinfo.tex (\key): Typeset a lozenge around the argument (from + gildea@intouchsys.com). + * makeinfo/makeinfo.c (cm_key): Surround arg with <...> to match + new lozenge style in TeX. + +Wed Aug 14 16:59:23 1996 Karl Berry + + * texinfo.texi: Propagate change from rms. + +Tue Aug 13 11:33:27 1996 Karl Berry + + * texinfo.texi: Propagate change from rms. + + * texinfo.texi: Document other @headings options. + +Sun Aug 11 13:19:42 1996 Karl Berry + + * makeinfo/makeinfo.c (cm_accent, cm_special_char, cm_dotless): + New functions. + (CommandTable): Add new commands for all of plain.tex's + accents and non-English characters. + +Fri Aug 9 14:12:07 1996 Karl Berry + + * makeinfo/makeinfo.c (convert_from_loaded_file): Say we're making + ``text'' file if no_headers. Also, use `input_filename' instead + of just `name' for clarity. + (suffixes): Check for no suffix last, i.e., prefer `foo.texi' as an + input file to `foo'. (The latter is probably a binary.) + +Mon Aug 5 13:52:39 1996 Karl Berry + + * texinfo.tex (\heading, \subheading, \subsubheading): Can no + longer call the nonexistent \*secheadingi series. Instead, call + \plain*secheading. + (\plainsubsecheading, \plainsubsubsecheading): New macros, by analogy + with \plainsecheading. + (\unnumberedsubseczzz, \unnumberedsubsubseczzz): Call them. + +Sun Aug 4 16:46:10 1996 Karl Berry + + * makeinfo/makeinfo.c (flush_output): Mask out eighth bit, that we + turned on in non-sentence enders. + +Sat Aug 3 14:03:10 1996 Karl Berry + + * texinfo.tex (\HEADINGSdouble, \HEADINGSsingle, + HEADINGSdoubleafter, \HEADINGSsingleafter, \CHAPPAGoff, + \CHAPPAGon, \CHAPPAGodd): Set \contentsalignmacro, analogous to + \pagealignmacro. + (\startcontents): Call \contentsalignmacro instead of \pagealignmacro. + +Mon Jul 29 14:44:33 1996 Karl Berry + + * texinfo.tex (\indexfonts): Make leading be 12pt. Otherwise, it's + too crammed. + (\smalllispx): Remove \setleading{10pt}. That was too small. + (\doprintindex): Do not call \tex ... \Etex. Index files are Texinfo + source, not TeX source, except for using \ instead of @ as the + escape character (for now). + +Sun Jul 28 13:37:05 1996 Karl Berry + + * texinfo.tex (paragraphindent): Move to more reasonable place in + the source file. + (chapfonts, secfonts, subsecfonts, indexfonts): Call \setleading. + (\chfplain, \secheading, \plainsecheading, \subsecheading, + \subsubheading): Rewrite to properly \hangindent the title. + (\sectionheading): New generic macro to print section titles. + + * texinfo.texi: Update the `Obtaining TeX' node. + +Fri Jul 26 14:11:48 1996 Karl Berry + + * util/texi2dvi: Do macro expansion with makeinfo before running TeX. + Various expansion safety measures added for test; avoid use of -o. + + * makeinfo/makeinfo.c (usage): More usage message tweaks. + +Fri Jul 26 11:55:37 1996 Karl Berry + + * util/texi2dvi: Format usage message to conform to the other *utils. + +Thu Jul 25 17:05:47 1996 Karl Berry + + * emacs/Makefile.in: Do not compile the Elisp by default. We + don't install it, so it confuses people to compile it. + +Sun Jul 21 07:20:09 1996 Karl Berry + + * util/Makefile.in (install-info): Dependency should be + install-info.o, not install-info. Also, update copyright years. + + * makeinfo/makeinfo.c (cm_printindex): Don't call execute_string + to print index entries, we've already done the expansion now. + + * makeinfo/makeinfo.h: Add copyright. Finish merge of rms changes. + * makeinfo/makeinfo.c: Finish merge, add my expansion changes again. + * makeinfo/multi.c: Add copyright message. + +Fri Jul 19 10:35:22 1996 Karl Berry + + * info/info.c: Update copyright date. + + * info/info.texi, + * util/install-info.c, + * emacs/Makefile.in, + * emacs/texnfo-tex.el, + * emacs/Makefile.in: Change FSF address. + + * Merged changes from bfox -- below, plus multitable changes, plus + lots more. + + Sun Apr 14 08:49:50 1996 Brian J. Fox + + * makeinfo/makeinfo.c (remember_node_reference): Numerous commands + call remember_node_reference. If a node has not yet been defined, + use the empty string as the current node for those cases. + + Mon Feb 12 17:35:38 1996 Brian J. Fox + + * makeinfo/makeinfo.c (push_node_filename): Clean up calls to + xmalloc and xrealloc. Only have to call xrealloc. + + Fri Jan 26 08:00:38 1996 Brian J. Fox + + * info/session.c (info_input_buffer_space_available): Fix typo + which forced the limitation of the sizeof (int) instead of sizeof + (buffer). + + * Makefile.in (PACKVER): now at 3.8. Add TERMIOS support to + Info. Minor bugs fixed in Makeinfo. + +Sat Jul 13 11:58:57 1996 Karl Berry + + * texinfo.texi (ftable vtable): Mention example. + +Sun Jun 30 14:59:51 1996 Karl Berry + + * makeinfo/makeinfo.c (cm_email): New function for new @email command. + * texinfo.texi (email): New node documenting it. + +Wed Apr 17 18:07:34 1996 Richard Stallman + + * makeinfo/makeinfo.c (cm_kbd): Do nothing if in @example or @code. + (struct brace_element): New field in_fixed_with_font. + (remember_brace_1): Save in_fixed_with_font. + (pop_and_call_brace): Restore in_fixed_with_font. + (cm_code): Don't decrement in_fixed_with_font at end of construct. + (struct istack_elt): New field in_fixed_with_font. + (push_insertion, pop_insertion): Save and restore in_fixed_with_font. + (end_insertion): Don't decrement in_fixed_with_font here. + (not_fixed_width): New function. + (cm_sc, cm_var, cm_italic, cm_roman, cm_titlefont): + Use not_fixed_width. + +Sat Apr 13 23:22:05 1996 Richard Stallman + + * util/install-info.c (main): Fatal error if no input file spec'd. + Look for START-INFO-DIR-ENTRY, not BEGIN-INFO-DIR-ENTRY. + +Thu Apr 11 18:21:50 1996 Richard Stallman + + * makeinfo/makeinfo.c (cm_enddots): New function. + (self_delimiting): Accept -, ^ and ". + (CommandTable): Add commands -, ^, ", enddots, centerchap. + +Sun Mar 24 12:18:32 1996 Richard Stallman + + * makeinfo/makeinfo.c (enum insertion_type): Add `direntry'. + (insertion_type_names): Add "direntry". + (cm_dircategory): New function. + (cm_direntry): New function. + (CommandTable): Add "dircategory" and "direntry". + (insert_string): New function. + (end_insertion): Handle direntry. + (begin_insertion): Handle direntry. + +Sun Mar 24 11:10:05 1996 Karl Berry + + * makeinfo/makeinfo.c (cm_url): New function for new @url command. + +Fri Feb 23 21:14:40 1996 Richard Stallman + + * info/Makefile.in (install, uninstall): Use manprefix. + +Fri Feb 23 19:50:18 1996 Richard Stallman + + * util/Makefile.in (install-info, install-info.o): New targets. + (all): Depend on install-info. + (install, uninstall): Operate on install-info. + + * install-info.c: New file. + +Wed Jan 3 10:01:45 1996 Brian J. Fox + + * makeinfo/makeinfo.c (make_index_entries_unique): Be a little bit + stricter about what makes two index entries identical. + +Fri Dec 29 13:00:24 1995 Brian J. Fox + + * makeinfo/makeinfo.c (Whole File): Add @detailmenu for allowing + detailed menu listings to appear while still defaulting nodes. + +Wed Dec 27 13:54:30 1995 Brian Fox + + * makeinfo/makeinfo.c (cm_code): Always notice that we are in + fixed_width_font, even if other formatting changes are not to take + place. + Sat Dec 23 11:48:43 1995 Brian J. Fox * info/man.c: (clean_manpage) Remove ^L's from page. diff --git a/gnu/usr.bin/texinfo/NEWS b/gnu/usr.bin/texinfo/NEWS index 5b643060003..ffc70933396 100644 --- a/gnu/usr.bin/texinfo/NEWS +++ b/gnu/usr.bin/texinfo/NEWS @@ -1,325 +1,93 @@ -Please report bugs you find to bug-texinfo@prep.ai.mit.edu - -Changes between Texinfo 3.0 and 3.2: - -Many bug fixes, and a few functional additions. Note that standalone -Info can now read Un*x man pages. - -Changes between Texinfo 3.0 and 3.1: - +This file records noteworthy changes. + +3.9 (4 October 1996) +* makeinfo: + - Give a suppressible (with --no-validate) error for references + outside of any node. + - Keep track of multitable output correctly for split files; this + caused nodes after the first multitable to be ``undefined''. +* install-info: + - Rename --infodir option to --info-dir. + - More robust error checking to avoid various crashes. +* configure: Include replacements for memcpy and memmove functions in + the distribution, in case they are missing. + +3.8 (30 September 1996) +* Define and/or document new and/or previously existing commands: + Accents: @" @' @, @" @= @^ @` @~ @H @d @dotaccent @dotless @ringaccent + @tieaccent @u @ubaraccent @v + Special characters: @AA @AE @L @O @OE @aa @ae @exclamdown @l @o @oe + @pounds @questiondown @ss + Special punctuation: @! @? @enddots + dir file maintenance: @dircategory @direntry; also new program, install-info + HTML support: @email @url @ifhtml...@end ifhtml + Macros: @macro @unmacro + Tables: @multitable @tab + Hyphenation: @- @hyphenation + Spacing: @ @ @ + Sectioning: + @headings singleafter/doubleafter (change heading style after current page) + @centerchap + @setchapterstyle + Other: + @shorttitlepage (simple title pages) + @detailmenu...@end detailmenu (help makeinfo parse master menus) +* Makeinfo prefers an input file named `foo.texinfo' or `foo.texi' or + `foo.txinfo' to just `foo' (the latter most likely being an executable). +* Makeinfo implements @. @! @? correctly, as end-of-sentence punctuation. +* @key marks its argument with a lozenge in TeX and <...> in Info. +* TeX output has substantially decreased interline spacing and other + formatting changes. +* Remove these obsolete and never-documented commands: + @infotop + @infoappendix @infoappendixsec @infoappendixsubsec @infoappendixsubsubsec + @infochapter @infosection @infosubsection @infosubsubsection + @infounnumbered @infounnumberedsec @infounnumberedsubsec + @infounnumberedsubsubsec + @input + @smallbreak @medbreak + @overfullrule + @br +* Deprecate these obsolete commands, to be removed in the next release: + @ctrl + @infoinclude + @iappendix @iappendixsection @iappendixsec @iappendixsubsec + @iappendixsubsubsec + @ichapter @isection @isubsection @isubsubsection + @iunnumbered @iunnumberedsec @iunnumberedsubsec @iunnumberedsubsubsec + @setchapterstyle + @titlespec + +3.7 (24 December 1995) +* Have --version print texinfo release number as well as the individual + program version. +* Better man page cleaning. +* Update Elisp files from current Emacs release. + +3.6 (21 June 1995) +* Unmatched brace error reporting improved. +* Missing comment terminator prevented compilation. + +3.5 (20 June 1995) +* Autoconf update. +* Support for parallel makes. +* make install does not install Elisp files. + +3.4 (19 June 1995) +* Handle @ifhtml in Elisp. +* Update FSF address. + +3.3 (15 June 1995) +* Portability changes. +* Compile Elisp files. +* Don't distribute .info* files. + +3.2 (9 June 1995) +* Standalone Info can read Unix man pages. +* New commands: @! @? @^ @" @enddots. +* makeinfo -E does macro expansion (and nothing else). + +3.1 (23 May 1993) Just bug fixes, see ChangeLog for full details. - - -Texinfo 2 -********* - -The second edition of the Texinfo manual is now released in a package -with the second version of the various Texinfo support files, -including `texinfo.el', `texnfo-upd.el', and `makeinfo.c'. The new -manual is considerably larger than the previous one. - -Here is a brief description of the new Texinfo mode commands -and the newly described @-commands: - -New Texinfo Mode Commands -========================= - -Texinfo mode provides commands and features especially designed for -working with Texinfo files. More than 20 new commands have been -added, including commands for automatically creating and updating both -nodes and menus. This is a tedious task when done by hand. - -The keybindings are intended to be somewhat mnemonic. - -Update everything ------------------ - -The `texinfo-master-menu' command is the primary command: - - C-c C-u m Create or update a master menu. - With an argument, first create or - update all nodes and regular menus. - -Update Pointers ---------------- - -Create or update `Next', `Previous', and `Up' node pointers. - - C-c C-u C-n Update a node. - C-c C-u C-e Update every node in the buffer. - -Update Menus ------------- - -Create or update menus. - - C-c C-u C-m Make or update a menu. - - C-c C-u C-a Make or update all the menus - in a buffer; with an argument, - first update all the nodes. - -Insert Title as Description ---------------------------- - -Insert a node's chapter or section title in the space for the -description in a menu entry line; position point so you can edit the -insert. (This command works somewhat differently than the other -insertion commands, which insert only a predefined string.) - - C-c C-c C-d Insert title. - -Format for Info ---------------- - -Provide keybindings both for the Info formatting commands that are -written in Emacs Lisp and for `makeinfo' which is written in C. - -Use the Emacs lisp `texinfo-format...' commands: - - C-c C-e C-r Format the region. - C-c C-e C-b Format the buffer. - -Use `makeinfo': - - C-c C-m C-r Format the region. - C-c C-m C-b Format the buffer. - C-c C-m C-l Recenter the `makeinfo' output buffer. - C-c C-m C-k Kill the `makeinfo' formatting job. - -Typeset and Print ------------------ - -Typeset and print Texinfo documents from within Emacs. - - C-c C-t C-r Run TeX on the region. - C-c C-t C-b Run TeX on the buffer. - C-c C-t C-i Run `texindex'. - C-c C-t C-p Print the DVI file. - C-c C-t C-q Show the print queue. - C-c C-t C-d Delete a job from the print queue. - C-c C-t C-k Kill the current TeX formatting job. - C-c C-t C-x Quit a currently stopped TeX formatting job. - C-c C-t C-l Recenter the output buffer. - -Other Updating Commands ------------------------ - -The `other updating commands' do not have standard keybindings because -they are less frequently used. - - M-x texinfo-insert-node-lines - Insert missing node lines using - section titles as node names. - - M-x texinfo-multiple-files-update - Update a multi-file document. - - M-x texinfo-indent-menu-description - Indent descriptions in menus. - - M-x texinfo-sequential-update-node - Insert node pointers in strict sequence. - -Newly Described Texinfo @-Commands -================================== - -The second edition of the Texinfo manual describes more than 50 -commands that were not described in the first edition. A third or so -of these commands existed in Texinfo but were not documented in the -manual; the others are new. Here is a listing, with brief -descriptions of them: - - -Commands for creating your own index and for merging two indices: - -`@defindex INDEX-NAME' - Define a new index and its indexing command. Print entries in a - roman font. Also, the `@defcodeindex' command, which prints - entries in an `@code' font. - -`@synindex FROM-INDEX INTO-INDEX' - Merge the index named in the first argument into the index named - in the second argument. Sets FROM-INDEX in the same (roman) font - as INTO-INDEX. Also, the `@syncodeindex' command, which prints - the entries from the first index in `@code' font. - - -Many commands to help you describe functions, variables, macros, -commands, user options, special forms and other such artifacts in a -uniform format. - -`@deffn CATEGORY NAME ARGUMENTS...' - Format a description for functions, interactive commands, and - similar entities that may take arguments. Takes as arguments the - category of entity being described, the name of this particular - entity, and its arguments, if any. - -`@defvr, @defop, ...' - 15 other related commands. - - -Special symbols to indicate the results of evaluation or an expansion, -printed output, an error message, equivalence of expressions, and the -location of point. - -`@equiv{}' - Indicate the exact equivalence of two forms; special glyph: `=='. - -`@error{}' - Indicate that the following text is an error message: `error-->'. - -`@expansion{}' - Indicate the result of a macro expansion; special glyph: `==>'. - -`@point{}' - Indicate the position of point; special glyph: `-!-'. - -`@print{}' - Indicate printed output; special glyph: `-|'. - -`@result{}' - Indicate the result of an expression; special glyph: `=>'. - - -Commands to customize headings: - -`@headings ON-OFF-SINGLE-DOUBLE' - Turn headings on or off, or specify single-sided or double-sided - headings for printing. - -`@evenfooting [LEFT] @| [CENTER] @| [RIGHT]' - Specify footings for even-numbered (left-hand) pages. Not - relevant to Info. - -`@evenheading, @everyheading, @oddheading, ...' - Five other related commands. - -`@thischapter' - In a heading or footing, stands for the number and name of the - current chapter, in the format `Chapter 1: First Chapter'. - -`@thischaptername, @thisfile, @thistitle, @thispage' - Related commands. - - -Commands for formatting text: - -`@cartouche' - Draw rounded box surrounding text (not in Info). - -`@enumerate OPTIONAL-ARG' - Enumerate a list with letters or numbers. - -`@exdent LINE-OF-TEXT' - Remove any indentation a line might have. - -`@flushleft' - Left justify every line but leave the right end ragged. Leave - font as is. - -`@flushright' - Right justify every line but leave the left end ragged. Leave - font as is. - -`@format' - Like `@example' or `@display', but do not narrow the margins or - select the fixed-width font. - -`@ftable FORMATTING-COMMAND' -`@vtable FORMATTING-COMMAND' - Begin a two-column table, using `@item' for each entry. - `@ftable' automatically enters each of the items in the - first column into the index of functions and `@vtable' - enters them into the index of variables. The commands - are the same as `@table', except for indexing. - -`@lisp' - Indent text, do not fill, select fixed-width font. - -`@smallexample' - Indent text, do not fill, select fixed-width font. In - `@smallbook' format, print text in a smaller font than with the - `@example' environment. Also, the `@smalllisp' command. - -Commands for formatting if a flag is set or cleared: - -`@set FLAG [STRING]' - Set FLAG, causing the Texinfo formatting commands to format text - between subsequent pairs of `@ifset FLAG' and `@end ifset' - commands. Optionally, set value of FLAG to STRING. - -`@value{FLAG}' - Replace with value to which FLAG is set. - -`@ifset FLAG ... @end ifset' - If FLAG is set, the Texinfo formatting commands format text - between `@ifset FLAG' and the following `@end ifset' command. - -`@clear FLAG' - Unset FLAG, preventing the Texinfo formatting commands from - formatting text between subsequent pairs of `@ifset FLAG' and - `@end ifset' commands. - -`@ifclear FLAG ... @end ifclear' - If FLAG is unset, the Texinfo formatting commands format text - between `@ifclear FLAG' and the following `@end ifclear' command. - -Produce unnumbered headings that do not appear in a table of contents: - -`@heading TITLE' - Print an unnumbered section-like heading in the text, but not in - the table of contents of a printed manual. - -`@chapheading, @majorheading' -`@subheading, @subsubheading' - Related commands. - - -Font commands: - -`@r{TEXT}' - Print TEXT in roman font. No effect in Info. - -`@sc{TEXT}' - Set TEXT in the printed output in THE SMALL CAPS FONT and set - text in the Info file in uppercase letters. - - -Miscellaneous: - -`@author AUTHOR' - Typeset author's name flushleft and underline it. - -`@finalout' - Prevent TeX from printing large black warning rectangles beside - over-wide lines. - -`@footnotestyle STYLE' - Specify footnote style, end or separate. - -`@dmn{DIMENSION}' - Format a dimension. - -`@minus{}' - Generate a minus sign. - -`@paragraphindent INDENT' - Specify paragraph indentation, asis or a number. - -`@ref{NODE-NAME, [ENTRY], [TOPIC], [INFO-FILE], [MANUAL]}' - Make a reference. In the printed manual, the reference does not - start with a `See'. - -`@title TITLE' - Alternative format for a title page. In the printed manual, set - a title flush to the left-hand side of the page in a larger than - normal font and underline it with a black rule. Also, - `@subtitle' command. - -`@subtitle SUBTITLE' - Subtitle in the alternative title page format. - -`@today{}' - Insert the current date. +texinfo-3.0: first release of Texinfo version 2, with many new commands. diff --git a/gnu/usr.bin/texinfo/README b/gnu/usr.bin/texinfo/README index d1c2a60e08c..357a98fb555 100644 --- a/gnu/usr.bin/texinfo/README +++ b/gnu/usr.bin/texinfo/README @@ -3,12 +3,11 @@ Texinfo, Version 3 This is the README file for version 3 of the Texinfo distribution. Files within this distribution have their own version and edition -numbers. When you refer to a file, please mention its own number. +numbers. When you refer to a file, please mention its own number, as +well as the version number of the Texinfo distribution. PLEASE REPORT BUGS TO: bug-texinfo@prep.ai.mit.edu -23 March 1993 - Texinfo is a documentation system that uses a single source file to produce both on-line information and printed output. This means that instead of writing two different documents, one for the on-line help @@ -18,18 +17,21 @@ is revised, you need revise only one document. You can read the on-line information, known as an "Info file", with an Info documentation-reading program. By convention, Texinfo source file names end with a `.texi' or `.texinfo' extension. Texinfo is -described in the Texinfo Manual. - -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, you can format Texinfo files into Info files using `makeinfo' -and read them using `info'. Use TeX, which is not included in this -package, to typeset Texinfo files for printing. - -For instructions on 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. +described in the Texinfo manual (the file ./texinfo.texi). + +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, +you can format Texinfo files into Info files using `makeinfo' and read +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 +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: @@ -83,7 +85,8 @@ Printing related files: texi2dvi This is a shell script for producing an indexed DVI file using - TeX and texindex. + TeX and texindex. Must be used if the + source document uses Texinfo @macros. GNU Emacs related files: @@ -158,4 +161,3 @@ Other files: tex3patch This handles a bug for version 3.0 of TeX that does not occur in more recent versions. - diff --git a/gnu/usr.bin/texinfo/TODO b/gnu/usr.bin/texinfo/TODO index 96083b755ae..de5b571722f 100644 --- a/gnu/usr.bin/texinfo/TODO +++ b/gnu/usr.bin/texinfo/TODO @@ -1,8 +1,35 @@ -* Implement a detexinfo program, like detex or delatex. This command would - strip all the texinfo commands out, and would be used as a filter on the - way to a speller. +If you are interested in working on any of these, +email bug-texinfo@prep.ai.mit.edu. - An option would be to NOT strip comments out. +* Use Automake. - makeinfo --noheaders come close. +* Use a config header file instead of @DEFS@. +* A detexinfo program, like detex or delatex. This command would + 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. + makeinfo --no-headers come close. + +* Change bars. This is difficult or impossible in TeX, + unfortunately. To do it right requires device driver support. + +* The dark corner symbol for the gawk manual. + +* Better i18n support, including support for 8-bit input + characters. Requires fonts, and the DC fonts are not (as of this + writing) free. + +* @exercise/@answer command for, e.g., gawk. + +* @figure. + +* HTML output in makeinfo. + +* Include a complete functional summary, a la a reference card, in the manual. + +* Use @ as the escape character, and Texinfo syntax generally, in the + table of contents, aux, and index files. Eliminate all the crazy + redefinitions of every Texinfo command (which lists always seem to be + incomplete). + +* Improve the manuals for makeinfo, standalone info, etc. diff --git a/gnu/usr.bin/texinfo/configure b/gnu/usr.bin/texinfo/configure index 7007fe4c74e..b02b2784a3e 100644 --- a/gnu/usr.bin/texinfo/configure +++ b/gnu/usr.bin/texinfo/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.7 -# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# Generated automatically using autoconf version 2.10 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -330,7 +330,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.7" + echo "configure generated by autoconf version 2.10" exit 0 ;; -with-* | --with-*) @@ -495,12 +495,9 @@ fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='echo $CPP $CPPFLAGS 1>&5; -$CPP $CPPFLAGS' -ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5; -${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' -ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5; -${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -534,7 +531,6 @@ else fi done IFS="$ac_save_ifs" - test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" fi fi CC="$ac_cv_prog_CC" @@ -544,6 +540,55 @@ else echo "$ac_t""no" 1>&6 fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + ac_prog_rejected=no + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then @@ -554,7 +599,7 @@ else yes; #endif EOF -if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -606,12 +651,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -620,12 +666,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -652,7 +699,7 @@ if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -670,7 +717,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -824,11 +871,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -866,22 +914,26 @@ fi # Needed on sysV68 for sigblock, sigsetmask. echo $ac_n "checking for -lbsd""... $ac_c" 1>&6 -ac_lib_var=`echo bsd | tr '.-/+' '___p'` +ac_lib_var=`echo bsd'_'sigblock | tr './+\055' '__p_'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -909,22 +961,26 @@ fi TERMLIBS= for termlib in curses termcap terminfo termlib ; do echo $ac_n "checking for -l${termlib}""... $ac_c" 1>&6 -ac_lib_var=`echo ${termlib} | tr '.-/+' '___p'` +ac_lib_var=`echo ${termlib}'_'tputs | tr './+\055' '__p_'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-l${termlib} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -954,11 +1010,11 @@ else ac_cv_c_cross=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_c_cross=no else @@ -976,14 +1032,15 @@ if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -998,7 +1055,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1016,7 +1073,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1037,7 +1094,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1048,7 +1105,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -eval $ac_link +{ (eval echo configure:1109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then : else @@ -1067,7 +1124,7 @@ EOF fi -for ac_hdr in unistd.h termio.h string.h varargs.h \ +for ac_hdr in unistd.h termios.h termio.h strings.h string.h varargs.h \ sys/time.h sys/fcntl.h sys/ttold.h sys/ptem.h sys/file.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` @@ -1076,11 +1133,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1110,7 +1168,7 @@ if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1141,7 +1199,7 @@ if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1215,7 +1273,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1224,7 +1282,7 @@ int t() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if eval $ac_compile; then +if { (eval echo configure:1286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -1251,7 +1309,7 @@ if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return 0; } @@ -1259,7 +1317,7 @@ int t() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1283,7 +1341,7 @@ if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* ac_cv_func_alloca=yes else @@ -1342,7 +1400,7 @@ if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { return 0; } @@ -1393,7 +1453,7 @@ $ac_func(); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1425,7 +1485,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_c_stack_direction=1 else @@ -1469,7 +1529,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < /* If setvbuf has the reversed format, exit 0. */ @@ -1483,7 +1543,7 @@ main () { exit(0); /* Non-reversed systems segv here. */ } EOF -eval $ac_link +{ (eval echo configure:1547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_func_setvbuf_reversed=yes else @@ -1502,21 +1562,22 @@ EOF fi -for ac_func in setvbuf getcwd bzero bcopy memset memcpy memmove strchr \ - strcasecmp strdup vfprintf vsprintf strerror sigprocmask \ - sigsetmask +for ac_func in setvbuf getcwd memset bzero strchr strcasecmp \ + vfprintf vsprintf strerror sigprocmask sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { return 0; } @@ -1533,7 +1594,7 @@ $ac_func(); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1555,6 +1616,57 @@ else fi done +for ac_func in memcpy memmove strdup +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { return 0; } +int t() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +LIBOBJS="$LIBOBJS ${ac_func}.o" +fi + +done + trap '' 1 2 15 cat > confcache <<\EOF @@ -1609,7 +1721,7 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g @@ -1644,7 +1756,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.7" + echo "$CONFIG_STATUS generated by autoconf version 2.10" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1692,6 +1804,7 @@ s%@INSTALL_DATA@%$INSTALL_DATA%g s%@RANLIB@%$RANLIB%g s%@TERMLIBS@%$TERMLIBS%g s%@ALLOCA@%$ALLOCA%g +s%@LIBOBJS@%$LIBOBJS%g CEOF EOF diff --git a/gnu/usr.bin/texinfo/configure.in b/gnu/usr.bin/texinfo/configure.in index b7060963017..abfdc374861 100644 --- a/gnu/usr.bin/texinfo/configure.in +++ b/gnu/usr.bin/texinfo/configure.in @@ -1,4 +1,5 @@ dnl Process this file with autoconf to produce a configure script. +dnl $Id: configure.in,v 1.1.1.3 1996/12/15 21:37:55 downsj Exp $ AC_INIT(texinfo.texi) dnl Checks for programs. @@ -22,7 +23,7 @@ AC_SUBST(TERMLIBS) dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(unistd.h termio.h string.h varargs.h \ +AC_CHECK_HEADERS(unistd.h termios.h termio.h strings.h string.h varargs.h \ sys/time.h sys/fcntl.h sys/ttold.h sys/ptem.h sys/file.h) dnl Checks for typedefs, structures, and compiler characteristics. @@ -33,8 +34,9 @@ AC_STRUCT_TM dnl Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_SETVBUF_REVERSED -AC_CHECK_FUNCS(setvbuf getcwd bzero bcopy memset memcpy memmove strchr \ - strcasecmp strdup vfprintf vsprintf strerror sigprocmask \ - sigsetmask) +AC_CHECK_FUNCS(setvbuf getcwd memset bzero strchr strcasecmp \ + vfprintf vsprintf strerror sigprocmask sigsetmask) +dnl strcasecmp, strerror, xmalloc, xrealloc, probably others should be added. +AC_REPLACE_FUNCS(memcpy memmove strdup) AC_OUTPUT(Makefile libtxi/Makefile makeinfo/Makefile info/Makefile util/Makefile emacs/Makefile) diff --git a/gnu/usr.bin/texinfo/dir b/gnu/usr.bin/texinfo/dir new file mode 100644 index 00000000000..0b42f12c9dd --- /dev/null +++ b/gnu/usr.bin/texinfo/dir @@ -0,0 +1,16 @@ +$Id: dir,v 1.1.1.1 1996/12/15 21:37:56 downsj Exp $ +This is the file .../info/dir, which contains the topmost node of the +Info hierarchy. The first time you invoke Info you start off +looking at that node, which is (dir)Top. + +File: dir Node: Top This is the top of the INFO tree + + This (the Directory node) gives a menu of major topics. + Typing "q" exits, "?" lists all Info commands, "d" returns here, + "h" gives a primer for first-timers, + "mEmacs" visits the Emacs topic, etc. + + In Emacs, you can click mouse button 2 on a menu item or cross reference + to select it. + +* Menu: diff --git a/gnu/usr.bin/texinfo/dir-example b/gnu/usr.bin/texinfo/dir-example new file mode 100644 index 00000000000..d8dd444f721 --- /dev/null +++ b/gnu/usr.bin/texinfo/dir-example @@ -0,0 +1,309 @@ +This is the directory file `dir' a.k.a. `DIR', which contains the +topmost node of the Info hierarchy. This file is merely made available +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. + +$Id: dir-example,v 1.1.1.1 1996/12/15 21:37:56 downsj Exp $ + +File: dir Node: Top This is the top of the INFO tree. + +This node gives a menu of the major topics accessible through Info. + + `q' quits; + `?' lists all Info commands; + `h' starts the Info tutorial; + `mTexinfo RET' visits the Texinfo manual, etc. + +* Menu: + +GNU packages +* Bash: (bash). Bourne again shell. +* Cpio: (cpio). Cpio archiver. +* DC: (dc). Postfix arbitrary expression calculator. +* Diff: (diff). Comparing and merging programs. +* Ed: (ed). Line editor. +* Emacs: (emacs). Extensible self-documenting text editor. +* File utilities: (fileutils). GNU file utilities. +* Finding files: (find). Operating on files matching certain criteria. +* Font utilities: (fontu). Programs for font manipulation. +* Gawk: (gawk). A text processing and scanning language. +* Gzip: (gzip). General (de)compression. +* Identifier DB: (id-utils). Identifier database utilities. +* Ispell: (ispell). Interactive spelling corrector. +* M4: (m4). Macro processor. +* Make: (make). Remake files automatically. +* Ptx: (ptx). Permuted index generator. +* Shar: (sharutils). Shell archiver, uudecode/uuencode. +* Shell utilities: (sh-utils). GNU shell utilities. +* Tar: (tar). ``Tape'' archiver. +* Text utilities: (textutils). GNU text utilities. +* Time: (time). Measuring program resource usage. +* UUCP: (uucp). Copying between machines, offline. +* Wdiff: (wdiff). Word-by-word comparison. + +GNU programming tools +* As: (as). Assembler. +* Binutils: (binutils). ar/copy/objdump/nm/size/strip/ranlib. +* Bison: (bison). LALR(1) parser generator. +* CPP: (cpp). C preprocessor. +* CVS: (cvs). Concurrent versions system for source control. +* DejaGnu: (dejagnu). Testing framework. +* Flex: (flex). A fast scanner generator. +* Gasp: (gasp). GNU Assembler preprocessor. +* Libtool: (libtool). Generic library support script. +* GCC: (gcc). C compiler. +* GDB: (gdb). Source-level debugger for C and C++. +* Gperf: (gperf). Perfect hash function generator. +* Gprof: (gprof). Profiler. +* Indent: (indent). Prettyprinter for programs. +* Ld: (ld). Linker. + +Texinfo documentation system +* Info: (info). Documentation browsing system. +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* info program: (info-stnd). Standalone Info-reading program. +* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII. + +GNU Emacs Lisp +* Elisp: (elisp). GNU Emacs Lisp reference manual. +* Intro Elisp: (emacs-lisp-intro). Introduction to Elisp programming. + +* Calc: (calc). Calculator and more. +* CC-mode: (ccmode). Editing C, C++, and Objective C. +* Common Lisp: (cl). Partial Common Lisp support for Emacs Lisp. +* Dired-x: (dired-x). Extra directory editor features. +* Edebug: (edebug). Source-level debugger for Emacs Lisp. +* Ediff: (ediff). Comprehensive visual interface to diff & patch. +* EDB: (edb). Database for Emacs. +* Forms: (forms). Fill-in-the-form data entry. +* Gmhist: (gmhist). Generic minibuffer history. +* GNUS: (gnus). Netnews reading and posting. +* Mailcrypt: (mailcrypt). Use PGP in Emacs. +* MH-E: (mh-e). Emacs interface to the MH mail system. +* PCL-CVS: (pcl-cvs). Emacs front end to CVS. +* Supercite: (sc). Supercite for including other people's words. +* VIP: (vip). vi emulation. +* VIPER: (viper). The new VI-emulation mode in Emacs-19.29. +* VM: (vm). Mail reader. +* W3: (w3). WWW browser. + +GNU admin +* Autoconf: (autoconf). Automatic generation of package configuration. +* Automake: (automake). Making Makefile.in's. +* Configure: (configure). Cygnus configure. +* Gettext: (gettext). Internationalization. +* Gnats: (gnats). Cygnus bug tracking system. +* Maintaining: (maintain). Maintaining GNU software. +* Remsync: (remsync). Remote synchronization of directory trees. +* 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 +* Annotate: (annotate). High-level GDB to GUI's. +* BFD: (bfd). Binary file descriptors for object file IO. +* GDB library: (libgdb). Application programming interface to GDB. +* GDBM: (gdbm). Hashed databases. +* History: (history). Recall previous lines of input. +* Iostream: (iostream). C++ input/output. +* Libc: (libc). C library. +* Libg++: (libg++). C++ classes. +* Mmalloc: (mmalloc). Memory-mapped malloc. +* Readline: (readline). General command-line interface. +* Regex: (regex). Regular expressions. +* Termcap: (termcap). All about /etc/termcap. + +GNU programming documentation +* GDB internals: (gdbint). Debugger internals. +* Ld internals: (ldint). GNU linker internals. +* Stabs: (stabs). Symbol table debugging information format. + +DOS +* Demacs: (demacs). GNU Emacs for DOS. +* GNUish: (gnuish). GNU utilities for DOS. + +TeX things +* Afm2tfm: (dvips)Invoking afm2tfm. Making Type 1 fonts available to TeX. +* Dvips: (dvips). DVI-to-PostScript translator. +* Eplain: (eplain). Expanding on plain TeX. +* Kpathsearch: (kpathsea). File lookup along search paths. +* LaTeX: (latex). LaTeX. +* MakeIndex: (makeindex). Index creation for TeX. +* Naming fonts: (fontname). Filenames for TeX fonts. +* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX. +* Web2c: (web2c). TeX, Metafont, and their companion programs. + +Other things +* Amd: (amdref). Filesystem automounter. +* CMUCL: (cmu-user). CMU Common Lisp. +* File headers: (filehdr). Bibliographic information for computer files. +* HTML: (snafu). Hypertext Markup Language 2.0 specification. +* Jargon: (jargon). The jargon file. +* Perl: (perl). Practical extraction and report language. +* PRCS: (prcs). Project revision control system. +* Screen: (screen). Virtual screen manager. +* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info. + +Individual utilities +* aid: (id-utils)aid invocation. Matching strings. +* ar: (binutils)ar. Create/modify/extract archives. +* at-pr: (gnats)at-pr. Bug report timely reminders. +* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's. +* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in. +* awk: (Gawk)Invoking gawk. Text processing and scanning. +* basename: (sh-utils)basename invocation. Strip directory and suffix. +* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies. +* c++filt: (binutils)c++filt. Demangle C++ symbols. +* cat: (textutils)cat invocation. Concatenate and write files. +* chgrp: (fileutils)chgrp invocation. Change file groups. +* chmod: (fileutils)chmod invocation. Change file permissions. +* chown: (fileutils)chown invocation. Change file owners/groups. +* chroot: (sh-utils)chroot invocation. Specify the root directory. +* cksum: (textutils)cksum invocation. Print POSIX CRC checksum. +* cmp: (diff)Invoking cmp. Character-by-character diff. +* comm: (textutils)comm invocation. Compare sorted files by line. +* cp: (fileutils)cp invocation. Copy files. +* csplit: (textutils)csplit invocation. Split by context. +* cut: (textutils)cut invocation. Print selected parts of lines. +* date: (sh-utils)date invocation. Print/set system date and time. +* dd: (fileutils)dd invocation. Copy and convert a file. +* df: (fileutils)df invocation. Report filesystems' disk usage. +* diff3: (diff)Invoking diff3. Three-way diff. +* dir: (fileutils)dir invocation. List directories briefly. +* dirname: (sh-utils)dirname invocation. Strip non-directory suffix. +* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures). +* du: (fileutils)du invocation. Report on disk usage. +* dvicopy: (web2c)DVIcopy invocation. Virtual font expansion +* dvitomp: (web2c)DVItoMP invocation. DVI to MPX (MetaPost pictures). +* dvitype: (web2c)DVItype invocation. DVI to human-readable text. +* echo: (sh-utils)echo invocation. Print a line of text. +* edit-pr: (gnats)Invoking edit-pr. Changing bugs. +* eid: (id-utils)eid invocation. Invoking an editor on matches. +* emacsclient: (emacs)Emacs Server. Connecting to a running Emacs. +* emacsserver: (emacs)Emacs Server. Connecting to a running Emacs. +* env: (sh-utils)env invocation. Modify the environment. +* etags: (emacs)Create Tags Table. Creating a TAGS table. +* expand: (textutils)expand invocation. Convert tabs to spaces. +* expr: (sh-utils)expr invocation. Evaluate expressions. +* false: (sh-utils)false invocation. Do nothing, unsuccessfully. +* fid: (id-utils)fid invocation. Listing a file's identifiers. +* file-pr: (gnats)file-pr. Processing incoming traffic. +* find: (find)Invoking find. Finding and acting on files. +* fmt: (textutils)fmt invocation. Reformat paragraph text. +* fold: (textutils)fold invocation. Wrap long input lines. +* g++: (gcc)Invoking G++. The GNU C++ compiler. +* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets. +* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts. +* gftype: (web2c)GFtype invocation. GF to human-readable text. +* gid: (id-utils)gid invocation. Listing all matching lines. +* groups: (sh-utils)groups invocation. Print group names a user is in. +* gunzip: (gzip)Overview. Decompression. +* head: (textutils)head invocation. Output the first part of files. +* hostname: (sh-utils)hostname invocation. Print or set system name. +* id: (sh-utils)id invocation. Print real/effective uid/gid. +* idx: (id-utils)idx invocation. Testing mkid scanners. +* ifnames: (autoconf)Invoking ifnames. List conditionals in source. +* iid: (id-utils)iid invocation. Interactive complex queries. +* inimf: (web2c)inimf invocation. Initial Metafont. +* inimp: (web2c)inimp invocation. Initial MetaPost. +* initex: (web2c)initex invocation. Initial TeX. +* install: (fileutils)install invocation. Copy and change attributes. +* join: (textutils)join invocation. Join lines on a common field. +* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching. +* lid: (id-utils)lid invocation. Matching identifier patterns. +* ln: (fileutils)ln invocation. Make links between files. +* locate: (find)Invoking locate. Finding files in a database. +* logname: (sh-utils)logname invocation. Print current login name. +* ls: (fileutils)ls invocation. List directory contents. +* makempx: (web2c)MakeMPX invocation. MetaPost label typesetting. +* maketexmf: (kpathsea)MakeTeX scripts. MF source generation. +* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation. +* maketextex: (kpathsea)MakeTeX scripts. TeX source generation. +* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation. +* mf: (web2c)mf invocation. Creating typeface families. +* mft: (web2c)MFT invocation. Prettyprinting Metafont source. +* mkdir: (fileutils)mkdir invocation. Create directories. +* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes). +* mkid: (id-utils)mkid invocation. Creating an ID database. +* mknod: (fileutils)mknod invocation. Create special files. +* mp: (web2c)mp invocation. Creating technical diagrams. +* mpto: (web2c)MPto invocation. MetaPost label extraction. +* mv: (fileutils)mv invocation. Rename files. +* newer: (web2c)Newer invocation. Compare modification times. +* nice: (sh-utils)nice invocation. Modify scheduling priority. +* nl: (textutils)nl invocation. Number lines and write files. +* nlmconv: (binutils)nlmconv. Convert object to NetWare LM. +* nm: (binutils)nm. List symbols in object files. +* nohup: (sh-utils)nohup invocation. Immunize to hangups. +* objcopy: (binutils)objcopy. Copy/translate object files. +* objdump: (binutils)objdump. Display info from object files. +* od: (textutils)od invocation. Dump files in octal, etc. +* paste: (textutils)paste invocation. Merge lines of files. +* patch: (diff)Invoking patch. Automatically applying diffs. +* patgen: (web2c)Patgen invocation. Creating hyphenation patterns. +* pathchk: (sh-utils)pathchk invocation. Check file name portability. +* pid: (id-utils)pid invocation. Looking up filenames. +* pktogf: (web2c)PKtoGF invocation. Packed to generic fonts. +* pktype: (web2c)PKtype invocation. PK to human-readable text. +* pltotf: (web2c)PLtoTF invocation. Property list to TFM. +* pooltype: (web2c)Pooltype invocation. Display WEB pool files. +* pr-addr: (gnats)pr-addr. Bug report address retrieval. +* pr-edit: (gnats)pr-edit. The edit-pr driver. +* pr: (textutils)pr invocation. Paginate or columnate files. +* printenv: (sh-utils)printenv invocation. Print environment variables. +* printf: (sh-utils)printf invocation. Format and print data. +* pwd: (sh-utils)pwd invocation. Print working directory. +* query-pr: (gnats)Invoking query-pr. Bug searching/reporting. +* queue-pr: (gnats)queue-pr. Handling incoming traffic. +* ranlib: (binutils)ranlib. Index archive file contents. +* rm: (fileutils)rm invocation. Remove files. +* rmdir: (fileutils)rmdir invocation. Remove empty directories. +* sdiff: (diff)Invoking sdiff. Interactively merge files. +* send-pr: (gnats)Invoking send-pr. Submitting bugs. +* shar: (sharutils)shar invocation. Create shell archive. +* size: (binutils)size. List object file section sizes. +* sleep: (sh-utils)sleep invocation. Delay for a specified time. +* sort: (textutils)sort invocation. Sort text files. +* split: (textutils)split invocation. Split into fixed-size pieces. +* strings: (binutils)strings. List printable strings. +* strip: (binutils)strip. Discard symbols. +* stty: (sh-utils)stty invocation. Print/change terminal settings. +* su: (sh-utils)su invocation. Modify user and group id. +* sum: (textutils)sum invocation. Print traditional checksum. +* sync: (fileutils)sync invocation. Synchronize memory and disk. +* tabs: (tput)Invoking tabs. Tab settings. +* tac: (textutils)tac invocation. Reverse files. +* tail: (textutils)tail invocation. Output the last part of files. +* tangle: (web2c)Tangle invocation. WEB to Pascal. +* tee: (sh-utils)tee invocation. Redirect to multiple files. +* test: (sh-utils)test invocation. File/string tests. +* tex: (web2c)tex invocation. Typesetting. +* tftopl: (web2c)TFtoPL invocation. TFM -> property list. +* touch: (fileutils)touch invocation. Change file timestamps. +* tput: (tput)Invoking tput. Termcap in shell scripts. +* tr: (textutils)tr invocation. Translate characters. +* true: (sh-utils)true invocation. Do nothing, successfully. +* tty: (sh-utils)tty invocation. Print terminal name. +* uname: (sh-utils)uname invocation. Print system information. +* unexpand: (textutils)unexpand invocation. Convert spaces to tabs. +* uniq: (textutils)uniq invocation. Uniqify files. +* unshar: (sharutils)unshar invocation. Extract from shell archive. +* updatedb: (find)Invoking updatedb. Building the locate database. +* users: (sh-utils)users invocation. Print current user names. +* vdir: (fileutils)vdir invocation. List directories verbosely. +* vftovp: (web2c)VFtoVP invocation. Virtual font -> virtual pl. +* view-pr: (gnats)Invoking view-pr. Showing bug reports. +* virmf: (web2c)virmf invocation. Virgin Metafont. +* virmp: (web2c)virmp invocation. Virgin MetaPost. +* virtex: (web2c)virtex invocation. Virgin TeX. +* vptovf: (web2c)VPtoVF invocation. Virtual pl -> virtual font. +* wc: (textutils)wc invocation. Byte, word, and line counts. +* weave: (web2c)Weave invocation. WEB to TeX. +* who: (sh-utils)who invocation. Print who is logged in. +* whoami: (sh-utils)whoami invocation. Print effective user id. +* xargs: (find)Invoking xargs. Operating on many files. +* yes: (sh-utils)yes invocation. Print a string indefinitely. +* zcat: (gzip)Overview. Decompression to stdout. diff --git a/gnu/usr.bin/texinfo/emacs/Makefile.in b/gnu/usr.bin/texinfo/emacs/Makefile.in index f936e0d3e65..cb0657c34eb 100644 --- a/gnu/usr.bin/texinfo/emacs/Makefile.in +++ b/gnu/usr.bin/texinfo/emacs/Makefile.in @@ -1,5 +1,6 @@ -# Makefile for Texinfo/emacs. -*- Indented-Text -*- -# Copyright (C) 1995 Free Software Foundation, Inc. +# Makefile for Texinfo/emacs. +# Copyright (C) 1995, 96 Free Software Foundation, Inc. +# $Id: Makefile.in,v 1.1.1.3 1996/12/15 21:38:10 downsj 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 @@ -13,34 +14,16 @@ # 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., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Author: Brian J. Fox (bfox@ai.mit.edu) # -#### Start of system configuration section. #### - -RM = rm -f -CP = cp srcdir = @srcdir@ VPATH = $(srcdir) -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = $(exec_prefix)/bin -# Prefix for each installed program, normally empty or `g'. -binprefix = -libdir = $(prefix)/lib -# Prefix for each installed man page, normally empty or `g'. -manprefix = -mandir = $(prefix)/man/man1 -manext = 1 -infodir = $(prefix)/info -lispdir = $(libdir)/emacs/site-lisp - -#### End of system configuration section. #### +SHELL = /bin/sh +RM = rm -f + ELISP_SRCS = info.el makeinfo.el texinfo.el texnfo-upd.el \ texnfo-tex.el texinfmt.el informat.el detexinfo.el @@ -52,16 +35,19 @@ ELISP_OBJS = info.elc makeinfo.elc texinfo.elc texnfo-upd.elc \ .el.elc: $(srcdir)/elisp-comp $< -all: $(ELISP_OBJS) +all: sub-all: all +elisp: $(ELISP_OBJS) +.PHONY: elisp + # Nobody likes any of these install targets. Fine. Install it # manually, then. install: - @echo Please install the lisp files manually. + @echo Please install the Emacs Lisp files manually. uninstall: - @echo Nothing to be done for uninstall. + @echo Please uninstall the Emacs Lisp files manually. # install: $(ELISP_OBJS) # @(echo "(print (car load-path))" >/tmp/elc.$$$$; \ @@ -90,13 +76,13 @@ texinfmt.elc: texinfo.elc texinfmt.elc: texnfo-upd.elc Makefile: $(srcdir)/Makefile.in ../config.status - cd ..; sh config.status + cd .. && sh config.status realclean distclean: clean - $(RM) -f Makefile *.log + $(RM) Makefile *.log clean: FORCE - $(RM) -f *.elc + $(RM) *.elc FORCE: diff --git a/gnu/usr.bin/texinfo/emacs/elisp-comp b/gnu/usr.bin/texinfo/emacs/elisp-comp index 8f27d7bde8f..f914d25e5b0 100644 --- a/gnu/usr.bin/texinfo/emacs/elisp-comp +++ b/gnu/usr.bin/texinfo/emacs/elisp-comp @@ -1,5 +1,7 @@ #!/bin/sh -setpath=/tmp/elc.$$ +# $Id: elisp-comp,v 1.1.1.2 1996/12/15 21:38:12 downsj Exp $ +# Trivial script to compile the Elisp files. +setpath=${TMPDIR-/tmp}/elc.$$ echo "(setq load-path (cons nil load-path))" > $setpath -emacs -batch -l $setpath -f batch-byte-compile $* +emacs -batch -l $setpath -f batch-byte-compile "$@" rm -f $setpath diff --git a/gnu/usr.bin/texinfo/emacs/info.el b/gnu/usr.bin/texinfo/emacs/info.el index ed4f7ff11d3..ead6ab92c98 100644 --- a/gnu/usr.bin/texinfo/emacs/info.el +++ b/gnu/usr.bin/texinfo/emacs/info.el @@ -18,12 +18,13 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Commentary: -;;; Note that nowadays we expect info files to be made using makeinfo. +;; Note that nowadays we expect info files to be made using makeinfo. ;;; Code: @@ -38,9 +39,10 @@ However, we recommend that you not do this. It is better to write a Texinfo file and generate the Info file from that, because that gives you a printed manual as well.") -(defvar Info-enable-active-nodes t +(defvar Info-enable-active-nodes nil "Non-nil allows Info to execute Lisp code associated with nodes. The Lisp code is executed when the node is selected.") +(put 'Info-enable-active-nodes 'risky-local-variable t) (defvar Info-fontify t "*Non-nil enables highlighting and fonts in Info nodes.") @@ -158,9 +160,10 @@ be last in the list.") (ext-len (max 0 (- (length filename) (length sans-exts) 1))) ext-left) ;; SUFFIX starts with a dot. If FILENAME already has one, - ;; get rid of the one in SUFFIX. + ;; get rid of the one in SUFFIX (unless suffix is empty). (or (and (<= ext-len 0) (not (eq (aref filename (1- (length filename))) ?.))) + (= (length suffix) 0) (setq suffix (substring suffix 1))) ;; How many chars of that extension should we keep? (setq ext-left (min ext-len (max 0 (- 3 (length suffix))))) @@ -217,7 +220,11 @@ Optional argument FILE specifies the file to examine; the default is the top-level directory of Info. In interactive use, a prefix argument directs this command -to read a file name from the minibuffer." +to read a file name from the minibuffer. + +The search path for Info files is in the variable `Info-directory-list'. +The top-level Info directory is made by combining all the files named `dir' +in all the directories in that path." (interactive (if current-prefix-arg (list (read-file-name "Info file name: " nil nil t)))) (if file @@ -253,7 +260,7 @@ In standalone mode, \\\\[Info-exit] exits Emacs itself." (if filename (let (temp temp-downcase found) (setq filename (substitute-in-file-name filename)) - (if (string= (downcase (file-name-nondirectory filename)) "dir") + (if (string= (downcase filename) "dir") (setq found t) (let ((dirs (if (string-match "^\\./" filename) ;; If specified name starts with `./' @@ -369,7 +376,7 @@ In standalone mode, \\\\[Info-exit] exits Emacs itself." (if (not (eq (current-buffer) (get-buffer "*info*"))) (setq guesspos (Info-read-subfile guesspos)))) - (error "No such node: \"%s\"" nodename)))) + (error "No such node: %s" nodename)))) (goto-char (max (point-min) (- guesspos 1000))) ;; Now search from our advised position (or from beg of buffer) ;; to find the actual node. @@ -457,23 +464,21 @@ In standalone mode, \\\\[Info-exit] exits Emacs itself." Info-dir-file-attributes (cons (cons file attrs) Info-dir-file-attributes)))))) + (or (cdr dirs) (setq Info-dir-contents-directory (car dirs))) (setq dirs (cdr dirs)))) (or buffers - (error "Can't find the info directory node")) + (error "Can't find the Info directory node")) ;; Distinguish the dir file that comes with Emacs from all the ;; others. Yes, that is really what this is supposed to do. ;; If it doesn't work, fix it. (setq buffer (car buffers) others (cdr buffers)) - ;; Insert the entire original dir file as a start; use its - ;; default directory as the default directory for the whole - ;; concatenation. + ;; Insert the entire original dir file as a start; note that we've + ;; already saved its default directory to use as the default + ;; directory for the whole concatenation. (insert-buffer buffer) - (setq Info-dir-contents-directory (save-excursion - (set-buffer buffer) - default-directory)) ;; Look at each of the other buffers one by one. (while others @@ -791,7 +796,7 @@ In standalone mode, \\\\[Info-exit] exits Emacs itself." (Info-following-node-name)) (if (eq errorname t) nil - (error (concat "Node has no " (capitalize (or errorname name)))))))) + (error "Node has no %s" (capitalize (or errorname name))))))) ;; Return the node name in the buffer following point. ;; ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp @@ -1179,7 +1184,10 @@ N is the digit argument used to invoke this command." ((Info-no-error (Info-up)) ;; Since we have already gone thru all the items in this menu, ;; go up to the end of this node. - (goto-char (point-max))) + (goto-char (point-max)) + ;; Since logically we are done with the node with that menu, + ;; move on from it. + (Info-next-preorder)) (t (error "No more nodes")))) @@ -1191,9 +1199,20 @@ N is the digit argument used to invoke this command." ;; If we go down a menu item, go to the end of the node ;; so we can scroll back through it. (goto-char (point-max))) + ;; Keep going down, as long as there are nested menu nodes. + (while (Info-no-error + (Info-last-menu-item) + ;; If we go down a menu item, go to the end of the node + ;; so we can scroll back through it. + (goto-char (point-max)))) (recenter -1)) ((Info-no-error (Info-prev)) (goto-char (point-max)) + (while (Info-no-error + (Info-last-menu-item) + ;; If we go down a menu item, go to the end of the node + ;; so we can scroll back through it. + (goto-char (point-max)))) (recenter -1)) ((Info-no-error (Info-up)) (goto-char (point-min)) @@ -1229,14 +1248,19 @@ previous node or back up to the parent node." (if (or (< (window-start) (point-min)) (> (window-start) (point-max))) (set-window-start (selected-window) (point))) - (let ((virtual-end (save-excursion - (goto-char (point-min)) - (search-forward "\n* Menu:" nil t)))) + (let* ((current-point (point)) + (virtual-end (save-excursion + (beginning-of-line) + (setq current-point (point)) + (goto-char (point-min)) + (search-forward "\n* Menu:" + current-point + t)))) (if (or virtual-end (pos-visible-in-window-p (point-min))) (Info-last-preorder) (scroll-down)))) -(defun Info-next-reference () +(defun Info-next-reference (&optional recur) "Move cursor to the next cross-reference or menu item in the node." (interactive) (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:") @@ -1251,9 +1275,11 @@ previous node or back up to the parent node." (error "No cross references in this node"))))) (goto-char (match-beginning 0)) (if (looking-at "\\* Menu:") - (Info-next-reference)))) + (if recur + (error "No cross references in this node") + (Info-next-reference t))))) -(defun Info-prev-reference () +(defun Info-prev-reference (&optional recur) "Move cursor to the previous cross-reference or menu item in the node." (interactive) (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:") @@ -1267,7 +1293,9 @@ previous node or back up to the parent node." (error "No cross references in this node"))))) (goto-char (match-beginning 0)) (if (looking-at "\\* Menu:") - (Info-prev-reference)))) + (if recur + (error "No cross references in this node") + (Info-prev-reference t))))) (defun Info-index (topic) "Look up a string in the index for this file. @@ -1322,8 +1350,8 @@ Give a blank topic name to go to the Index node itself." (Info-goto-node node)) (or matches (progn - (Info-last) - (error "No \"%s\" in index" topic))) + (Info-goto-node orignode) + (error "No `%s' in index" topic))) ;; Here it is a feature that assoc is case-sensitive. (while (setq found (assoc topic matches)) (setq exact (cons found exact) @@ -1348,24 +1376,28 @@ Give a blank topic name to go to the Index node itself." (forward-line (nth 3 (car Info-index-alternatives))) (forward-line 3) ; don't search in headers (let ((name (car (car Info-index-alternatives)))) - (if (or (re-search-forward (format - "\\(Function\\|Command\\): %s\\( \\|$\\)" - (regexp-quote name)) nil t) - (search-forward (format "`%s'" name) nil t) - (and (string-match "\\`.*\\( (.*)\\)\\'" name) - (search-forward - (format "`%s'" (substring name 0 (match-beginning 1))) - nil t)) - (search-forward name nil t)) - (beginning-of-line) - (goto-char (point-min))))) - (message "Found \"%s\" in %s. %s" + (Info-find-index-name name))) + (message "Found `%s' in %s. %s" (car (car Info-index-alternatives)) (nth 2 (car Info-index-alternatives)) (if (cdr Info-index-alternatives) "(Press `,' for more)" "(Only match)"))) +(defun Info-find-index-name (name) + "Move point to the place within the current node where NAME is defined." + (if (or (re-search-forward (format + "[a-zA-Z]+: %s\\( \\|$\\)" + (regexp-quote name)) nil t) + (search-forward (format "`%s'" name) nil t) + (and (string-match "\\`.*\\( (.*)\\)\\'" name) + (search-forward + (format "`%s'" (substring name 0 (match-beginning 1))) + nil t)) + (search-forward name nil t)) + (beginning-of-line) + (goto-char (point-min)))) + (defun Info-undefined () "Make command be undefined in Info." (interactive) @@ -1405,7 +1437,7 @@ POS must be somewhere inside the token START is a regular expression which will match the beginning of the tokens delimited string ALL is a regular expression with a single - parenthized subpattern which is the token to be + parenthesized subpattern which is the token to be returned. E.g. '{\(.*\)}' would return any string enclosed in braces around POS. SIG optional fourth argument, controls action on no match @@ -1631,7 +1663,7 @@ Allowed only if variable `Info-enable-edit' is non-nil." (or Info-enable-edit (error "Editing info nodes is not enabled")) (Info-edit-mode) - (message (substitute-command-keys + (message "%s" (substitute-command-keys "Editing: Type \\\\[Info-cease-edit] to return to info"))) (defun Info-cease-edit () @@ -1729,12 +1761,12 @@ the variable `Info-file-list-for-emacs'." ;; Info-history. Put the other nodes that were found on ;; the history. (setq Info-history (nconc (cdr where) Info-history)) - (message (substitute-command-keys - "Found %d other entr%s. Use \\[Info-last] to see %s.") + (message "Found %d other entr%s. Use %s to see %s." (1- num-matches) (if (> num-matches 2) "ies" "y") + (substitute-command-keys "\\[Info-last]") (if (> num-matches 2) "them" "it"))))) - (error "Couldn't find documentation for %s." command)))) + (error "Couldn't find documentation for %s" command)))) ;;;###autoload (defun Info-goto-emacs-key-command-node (key) diff --git a/gnu/usr.bin/texinfo/emacs/informat.el b/gnu/usr.bin/texinfo/emacs/informat.el index 7d7d73725bf..0b195b9e620 100644 --- a/gnu/usr.bin/texinfo/emacs/informat.el +++ b/gnu/usr.bin/texinfo/emacs/informat.el @@ -18,8 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Code: diff --git a/gnu/usr.bin/texinfo/emacs/makeinfo.el b/gnu/usr.bin/texinfo/emacs/makeinfo.el index dbc5996d93f..a649d522156 100644 --- a/gnu/usr.bin/texinfo/emacs/makeinfo.el +++ b/gnu/usr.bin/texinfo/emacs/makeinfo.el @@ -18,8 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Commentary: diff --git a/gnu/usr.bin/texinfo/emacs/new-useful-setqs b/gnu/usr.bin/texinfo/emacs/new-useful-setqs new file mode 100644 index 00000000000..4241ae429ef --- /dev/null +++ b/gnu/usr.bin/texinfo/emacs/new-useful-setqs @@ -0,0 +1,180 @@ +;; -*- Mode: Emacs-Lisp -*- + +;; This is the `new-useful-setqs' file +;; This overrides old defvars since they were revised. + +(setq texinfmt-version "2.35 of 10 September 1996") + +(setq texinfo-master-menu-header + "\n@detailmenu\n --- The Detailed Node Listing ---\n") + +(setq texinfo-environment-regexp + (concat + "^@" + "\\(" + "cartouche\\|" + "display\\|" + "end\\|" + "enumerate\\|" + "example\\|" + "f?table\\|" + "flushleft\\|" + "flushright\\|" + "format\\|" + "group\\|" + "ifhtml\\|" + "ifinfo\\|" + "iftex\\|" + "ignore\\|" + "itemize\\|" + "lisp\\|" + "macro\\|" + "multitable\\|" + "quotation\\|" + "smallexample\\|" + "smalllisp\\|" + "tex" + "\\)") +) + +(setq texinfo-no-refill-regexp + (concat + "^@" + "\\(" + "example\\|" + "smallexample\\|" + "lisp\\|" + "smalllisp\\|" + "display\\|" + "format\\|" + "flushleft\\|" + "flushright\\|" + "menu\\|" + "multitable\\|" + "titlepage\\|" + "iftex\\|" + "ifhtml\\|" + "tex\\|" + "html" + "\\)")) + + +(setq texinfo-accent-commands + (concat + "@OE\\|" + "@oe\\|" + "@AA\\|" + "@aa\\|" + "@AE\\|" + "@ae\\|" + "@ss\\|" + "@^\\|" + "@`\\|" + "@'\\|" + "@\"\\|" + "@,\\|" + "@=\\|" + "@~\\|" + "@questiondown{\\|" + "@exclamdown{\\|" + "@L{\\|" + "@l{\\|" + "@O{\\|" + "@o{\\|" + "@dotaccent{\\|" + "@ubaraccent{\\|" + "@d{\\|" + "@H{\\|" + "@ringaccent{\\|" + "@tieaccent{\\|" + "@u{\\|" + "@v{\\|" + "@dotless{" + )) + +(setq texinfo-part-of-para-regexp + (concat + "^@" + "\\(" + "b{\\|" + "bullet{\\|" + "cite{\\|" + "code{\\|" + "emph{\\|" + "equiv{\\|" + "error{\\|" + "expansion{\\|" + "file{\\|" + "i{\\|" + "inforef{\\|" + "kbd{\\|" + "key{\\|" + "lisp{\\|" + "email{\\|" + "minus{\\|" + "point{\\|" + "print{\\|" + "pxref{\\|" + "r{\\|" + "ref{\\|" + "result{\\|" + "samp{\\|" + "sc{\\|" + "t{\\|" + "TeX{\\|" + "today{\\|" + "url{\\|" + "var{\\|" + "w{\\|" + "xref{\\|" + "@-\\|" ; @- is a descretionary hyphen (not an accent) (a noop). + texinfo-accent-commands + "\\)" + )) + +(setq texinfo-raisesections-alist + '((@chapter . @chapter) ; Cannot go higher + (@unnumbered . @unnumbered) + (@centerchap . @unnumbered) + + (@majorheading . @majorheading) + (@chapheading . @chapheading) + (@appendix . @appendix) + + (@section . @chapter) + (@unnumberedsec . @unnumbered) + (@heading . @chapheading) + (@appendixsec . @appendix) + + (@subsection . @section) + (@unnumberedsubsec . @unnumberedsec) + (@subheading . @heading) + (@appendixsubsec . @appendixsec) + + (@subsubsection . @subsection) + (@unnumberedsubsubsec . @unnumberedsubsec) + (@subsubheading . @subheading) + (@appendixsubsubsec . @appendixsubsec))) + +(setq texinfo-lowersections-alist + '((@chapter . @section) + (@unnumbered . @unnumberedsec) + (@centerchap . @unnumberedsec) + (@majorheading . @heading) + (@chapheading . @heading) + (@appendix . @appendixsec) + + (@section . @subsection) + (@unnumberedsec . @unnumberedsubsec) + (@heading . @subheading) + (@appendixsec . @appendixsubsec) + + (@subsection . @subsubsection) + (@unnumberedsubsec . @unnumberedsubsubsec) + (@subheading . @subsubheading) + (@appendixsubsec . @appendixsubsubsec) + + (@subsubsection . @subsubsection) ; Cannot go lower. + (@unnumberedsubsubsec . @unnumberedsubsubsec) + (@subsubheading . @subsubheading) + (@appendixsubsubsec . @appendixsubsubsec))) diff --git a/gnu/usr.bin/texinfo/emacs/texinfmt.el b/gnu/usr.bin/texinfo/emacs/texinfmt.el index 497c4d784bc..c0d09635a8d 100644 --- a/gnu/usr.bin/texinfo/emacs/texinfmt.el +++ b/gnu/usr.bin/texinfo/emacs/texinfmt.el @@ -1,9 +1,12 @@ ;;; texinfmt.el --- format Texinfo files into Info files. -;; Copyright (C) 1985, 1986, 1988, -;; 1990, 1991, 1992, 1993 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1988, 1990, 1991, +;; 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. +;; Author: Robert J. Chassell +;; Date: 10 Sep 1996 ;; Maintainer: Robert J. Chassell +;; Keywords: maint, tex, docs ;; This file is part of GNU Emacs. @@ -18,14 +21,28 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Code: ;;; Emacs lisp functions to convert Texinfo files to Info files. -(defvar texinfmt-version "2.32 of 19 November 1993") +(defvar texinfmt-version "2.35 of 10 September 1996") + +(defun texinfmt-version (&optional here) + "Show the version of texinfmt.el in the minibuffer. +If optional argument HERE is non-nil, insert info at point." + (interactive "P") + (let ((version-string + (format "Version of \`texinfmt.el\': %s" texinfmt-version))) + (if here + (insert version-string) + (if (interactive-p) + (message "%s" version-string) + version-string)))) + ;;; Variable definitions @@ -394,12 +411,102 @@ converted to Info is stored in a temporary buffer." ;;; Handle paragraph filling +;; Keep as concatinated lists for ease of maintenance + (defvar texinfo-no-refill-regexp - "^@\\(example\\|smallexample\\|lisp\\|smalllisp\\|display\\|format\\|flushleft\\|flushright\\|menu\\|titlepage\\|iftex\\|ifhtml\\|tex\\|html\\)" + (concat + "^@" + "\\(" + "example\\|" + "smallexample\\|" + "lisp\\|" + "smalllisp\\|" + "display\\|" + "format\\|" + "flushleft\\|" + "flushright\\|" + "menu\\|" + "multitable\\|" + "titlepage\\|" + "iftex\\|" + "ifhtml\\|" + "tex\\|" + "html" + "\\)") "Regexp specifying environments in which paragraphs are not filled.") +(defvar texinfo-accent-commands + (concat + "@^\\|" + "@`\\|" + "@'\\|" + "@\"\\|" + "@,\\|" + "@=\\|" + "@~\\|" + "@OE{\\|" + "@oe{\\|" + "@AA{\\|" + "@aa{\\|" + "@AE{\\|" + "@ae{\\|" + "@ss{\\|" + "@questiondown{\\|" + "@exclamdown{\\|" + "@L{\\|" + "@l{\\|" + "@O{\\|" + "@o{\\|" + "@dotaccent{\\|" + "@ubaraccent{\\|" + "@d{\\|" + "@H{\\|" + "@ringaccent{\\|" + "@tieaccent{\\|" + "@u{\\|" + "@v{\\|" + "@dotless{" + )) + (defvar texinfo-part-of-para-regexp - "^@\\(b{\\|bullet{\\|cite{\\|code{\\|emph{\\|equiv{\\|error{\\|expansion{\\|file{\\|i{\\|inforef{\\|kbd{\\|key{\\|lisp{\\|minus{\\|point{\\|print{\\|pxref{\\|r{\\|ref{\\|result{\\|samp{\\|sc{\\|t{\\|TeX{\\|today{\\|var{\\|w{\\|xref{\\)" + (concat + "^@" + "\\(" + "b{\\|" + "bullet{\\|" + "cite{\\|" + "code{\\|" + "emph{\\|" + "equiv{\\|" + "error{\\|" + "expansion{\\|" + "file{\\|" + "i{\\|" + "inforef{\\|" + "kbd{\\|" + "key{\\|" + "lisp{\\|" + "email{\\|" + "minus{\\|" + "point{\\|" + "print{\\|" + "pxref{\\|" + "r{\\|" + "ref{\\|" + "result{\\|" + "samp{\\|" + "sc{\\|" + "t{\\|" + "TeX{\\|" + "today{\\|" + "url{\\|" + "var{\\|" + "w{\\|" + "xref{\\|" + "@-\\|" ; @- is a descretionary hyphen (not an accent) (a noop). + texinfo-accent-commands + "\\)" + ) "Regexp specifying @-commands found within paragraphs.") (defun texinfo-append-refill () @@ -436,11 +543,17 @@ Do not append @refill to paragraphs containing @w{TEXT} or @*." (buffer-substring (match-beginning 1) (match-end 1)))) (progn (re-search-forward (concat "^@end " environment) nil t) (forward-line 1))) - ;; 3. Do not refill a paragraph containing @w or @* + ;; Else + ;; 3. Do not refill a paragraph containing @w or @*, or ending + ;; with @ followed by a newline. (if (or (>= (point) (point-max)) - (re-search-forward - "@w{\\|@\\*" (save-excursion (forward-paragraph) (point)) t)) + (re-search-forward + "@w{\\|@\\*\\|@\n\n" + (save-excursion + (forward-paragraph) + (forward-line 1) + (point)) t)) ;; Go to end of paragraph and do nothing. (forward-paragraph) ;; 4. Else go to end of paragraph and insert @refill @@ -584,6 +697,7 @@ commands." (defvar texinfo-raisesections-alist '((@chapter . @chapter) ; Cannot go higher (@unnumbered . @unnumbered) + (@centerchap . @unnumbered) (@majorheading . @majorheading) (@chapheading . @chapheading) @@ -612,6 +726,7 @@ higher types.") (defvar texinfo-lowersections-alist '((@chapter . @section) (@unnumbered . @unnumberedsec) + (@centerchap . @unnumberedsec) (@majorheading . @heading) (@chapheading . @heading) (@appendix . @appendixsec) @@ -645,19 +760,57 @@ lower types.") ;; Scan for @-commands. (goto-char (point-min)) (while (search-forward "@" nil t) - (if (looking-at "[@{}^'` *\"?!]") - ;; Handle a few special @-followed-by-one-char commands. - (if (= (following-char) ?*) - (progn - ;; remove command - (delete-region (1- (point)) (1+ (point))) - ;; insert return if not at end of line; - ;; else line is already broken. - (if (not (= (following-char) ?\n)) - (insert ?\n))) - ;; The other characters are simply quoted. Delete the @. - (delete-char -1) - (forward-char 1)) + ;; + ;; These are the single-character accent commands: @^ @` @' @" @= @~ + ;; In Info, they are simply quoted and the @ deleted. + ;; Other single-character commands: + ;; @* forces a line break, + ;; @- is a discretionary hyphenation point; does nothing in Info. + ;; @, @, @ each produce a single space, + ;; unless followed by a newline. + ;; + ;; Old version 2.34 expression: (looking-at "[@{}^'` *\"?!]") + (if (looking-at "[@{}^'`\"=~ \t\n*?!-]") + ;; @*, causes a line break. + (cond + ;; @*, a line break + ((= (following-char) ?*) + ;; remove command + (delete-region (1- (point)) (1+ (point))) + ;; insert return if not at end of line; + ;; else line is already broken. + (if (not (= (following-char) ?\n)) + (insert ?\n))) + ;; @-, deleted + ((= (following-char) ?-) + (delete-region (1- (point)) (1+ (point)))) + ;; @, @, @: produce a single space, + ;; unless followed by a newline. + ((= (following-char) ? ) + (delete-region (1- (point)) (1+ (point))) + ;; insert single space if not at end of line; + ;; else line is already broken. + (if (not (= (following-char) ?\n)) + (insert ? ))) + ((= (following-char) ?\t) + (delete-region (1- (point)) (1+ (point))) + ;; insert single space if not at end of line; + ;; else line is already broken. + (if (not (= (following-char) ?\n)) + (insert ? ))) + ;; following char is a carriage return + ((= (following-char) ? +) + ;; remove command + (delete-region (1- (point)) (1+ (point))) + ;; insert single space if not at end of line; + ;; else line is already broken. + (if (not (= (following-char) ?\n)) + (insert ? ))) + ;; Otherwise: the other characters are simply quoted. Delete the @. + (t + (delete-char -1) + (forward-char 1))) ;; @ is followed by a command-word; find the end of the word. (setq texinfo-command-start (1- (point))) (if (= (char-syntax (following-char)) ?w) @@ -709,6 +862,11 @@ lower types.") ;;; Parsing functions (defun texinfo-parse-line-arg () + "Return argument of @-command as string. +Argument is separated from command either by a space or by a brace. +If a space, return rest of line, with beginning and ending white +space removed. If a brace, return string between braces. +Leave point after argument." (goto-char texinfo-command-end) (let ((start (point))) (cond ((looking-at " ") @@ -762,6 +920,7 @@ lower types.") (goto-char (point-max)))) (defun texinfo-parse-arg-discard () + "Delete command and argument; return argument of command." (prog1 (texinfo-parse-line-arg) (texinfo-discard-command))) @@ -908,7 +1067,7 @@ lower types.") texinfmt-version ".\n\n"))) -;;; @node, @menu +;;; @node, @menu, @detailmenu (put 'node 'texinfo-format 'texinfo-format-node) (put 'nwnode 'texinfo-format 'texinfo-format-node) @@ -944,26 +1103,43 @@ lower types.") (put 'menu 'texinfo-end 'texinfo-discard-command) +;; The @detailmenu should be removed eventually. + +;; According to Karl Berry, 31 August 1996: +;; +;; You don't like, I don't like it. I agree, it would be better just to +;; fix the bug [in `makeinfo']. .. At this point, since inserting those +;; two commands in the Elisp fn is trivial, I don't especially want to +;; expend more effort... +;; +;; I added a couple sentences of documentation to the manual (putting the +;; blame on makeinfo where it belongs :-(). + +(put 'detailmenu 'texinfo-format 'texinfo-discard-line) +(put 'detailmenu 'texinfo-end 'texinfo-discard-command) + +;; (Also see `texnfo-upd.el') + ;;; Cross references -; @xref {NODE, FNAME, NAME, FILE, DOCUMENT} -; -> *Note FNAME: (FILE)NODE -; If FILE is missing, -; *Note FNAME: NODE -; If FNAME is empty and NAME is present -; *Note NAME: Node -; If both NAME and FNAME are missing -; *Note NODE:: -; texinfo ignores the DOCUMENT argument. -; -> See section [NAME, else NODE], page -; If FILE is specified, (FILE)NODE is used for xrefs. -; If fifth argument DOCUMENT is specified, produces -; See section [NAME, else NODE], page -; of DOCUMENT - -; @ref a reference that does not put `See' or `see' in -; the hardcopy and is the same as @xref in Info +;; @xref {NODE, FNAME, NAME, FILE, DOCUMENT} +;; -> *Note FNAME: (FILE)NODE +;; If FILE is missing, +;; *Note FNAME: NODE +;; If FNAME is empty and NAME is present +;; *Note NAME: Node +;; If both NAME and FNAME are missing +;; *Note NODE:: +;; texinfo ignores the DOCUMENT argument. +;; -> See section [NAME, else NODE], page +;; If FILE is specified, (FILE)NODE is used for xrefs. +;; If fifth argument DOCUMENT is specified, produces +;; See section [NAME, else NODE], page +;; of DOCUMENT + +;; @ref a reference that does not put `See' or `see' in +;; the hardcopy and is the same as @xref in Info (put 'ref 'texinfo-format 'texinfo-format-xref) (put 'xref 'texinfo-format 'texinfo-format-xref) @@ -987,9 +1163,9 @@ lower types.") (looking-at "::")) (insert "."))) -;@inforef{NODE, FNAME, FILE} -;Like @xref{NODE, FNAME,,FILE} in texinfo. -;In Tex, generates "See Info file FILE, node NODE" +;; @inforef{NODE, FNAME, FILE} +;; Like @xref{NODE, FNAME,,FILE} in texinfo. +;; In Tex, generates "See Info file FILE, node NODE" (put 'inforef 'texinfo-format 'texinfo-format-inforef) (defun texinfo-format-inforef () (let ((args (texinfo-format-parse-args))) @@ -1010,6 +1186,7 @@ lower types.") (put 'iunnumbered 'texinfo-format 'texinfo-format-chapter) (put 'top 'texinfo-format 'texinfo-format-chapter) (put 'unnumbered 'texinfo-format 'texinfo-format-chapter) +(put 'centerchap 'texinfo-format 'texinfo-format-chapter) (defun texinfo-format-chapter () (texinfo-format-chapter-1 ?*)) @@ -1112,29 +1289,29 @@ If used within a line, follow `@br' with braces." ;;; @footnote and @footnotestyle -; In Texinfo, footnotes are created with the `@footnote' command. -; This command is followed immediately by a left brace, then by the text of -; the footnote, and then by a terminating right brace. The -; template for a footnote is: -; -; @footnote{TEXT} -; -; Info has two footnote styles: -; -; * In the End of node style, all the footnotes for a single node -; are placed at the end of that node. The footnotes are -; separated from the rest of the node by a line of dashes with -; the word `Footnotes' within it. -; -; * In the Separate node style, all the footnotes for a single node -; are placed in an automatically constructed node of their own. - -; Footnote style is specified by the @footnotestyle command, either -; @footnotestyle separate -; or -; @footnotestyle end -; -; The default is separate +;; In Texinfo, footnotes are created with the `@footnote' command. +;; This command is followed immediately by a left brace, then by the text of +;; the footnote, and then by a terminating right brace. The +;; template for a footnote is: +;; +;; @footnote{TEXT} +;; +;; Info has two footnote styles: +;; +;; * In the End of node style, all the footnotes for a single node +;; are placed at the end of that node. The footnotes are +;; separated from the rest of the node by a line of dashes with +;; the word `Footnotes' within it. +;; +;; * In the Separate node style, all the footnotes for a single node +;; are placed in an automatically constructed node of their own. + +;; Footnote style is specified by the @footnotestyle command, either +;; @footnotestyle separate +;; or +;; @footnotestyle end +;; +;; The default is separate (defvar texinfo-footnote-style "separate" "Footnote style, either separate or end.") @@ -1416,7 +1593,7 @@ Used by @refill indenting command to avoid indenting within lists, etc.") ;;; @table -; The `@table' command produces two-column tables. +;; The `@table' command produces two-column tables. (put 'table 'texinfo-format 'texinfo-table) (defun texinfo-table () @@ -1457,9 +1634,9 @@ Used by @refill indenting command to avoid indenting within lists, etc.") ;;; @ftable, @vtable -; The `@ftable' and `@vtable' commands are like the `@table' command -; but they also insert each entry in the first column of the table -; into the function or variable index. +;; The `@ftable' and `@vtable' commands are like the `@table' command +;; but they also insert each entry in the first column of the table +;; into the function or variable index. ;; Handle the @ftable and @vtable commands: @@ -1508,6 +1685,353 @@ Used by @refill indenting command to avoid indenting within lists, etc.") (texinfo-do-itemize (nth 1 stacktop)))) +;;; @multitable ... @end multitable + +;; Produce a multi-column table, with as many columns as desired. +;; +;; A multi-column table has this template: +;; +;; @multitable {A1} {A2} {A3} +;; @item A1 @tab A2 @tab A3 +;; @item B1 @tab B2 @tab B3 +;; @item C1 @tab C2 @tab C3 +;; @end multitable +;; +;; where the width of the text in brackets specifies the width of the +;; respective column. +;; +;; Or else: +;; +;; @multitable @columnfractions .25 .3 .45 +;; @item A1 @tab A2 @tab A3 +;; @item B1 @tab B2 @tab B3 +;; @end multitable +;; +;; where the fractions specify the width of each column as a percent +;; of the current width of the text (i.e., of the fill-column). +;; +;; Long lines of text are filled within columns. +;; +;; Using the Emacs Lisp formatter, texinfmt.el, +;; the whitespace between columns can be increased by setting +;; `extra-inter-column-width' to a value greater than 0. By default, +;; there is at least one blank space between columns. +;; +;; The Emacs Lisp formatter, texinfmt.el, ignores the following four +;; commands that are defined in texinfo.tex for printed output. +;; +;; @multitableparskip, +;; @multitableparindent, +;; @multitablecolmargin, +;; @multitablelinespace. + +;; How @multitable works. +;; ===================== +;; +;; `texinfo-multitable' reads the @multitable line and determines from it +;; how wide each column should be. +;; +;; Also, it pushes this information, along with an identifying symbol, +;; onto the `texinfo-stack'. At the @end multitable command, the stack +;; is checked for its matching @multitable command, and then popped, or +;; else an error is signaled. Also, this command pushes the location of +;; the start of the table onto the stack. +;; +;; `texinfo-end-multitable' checks the `texinfo-stack' that the @end +;; multitable truly is ending a corresponding beginning, and if it is, +;; pops the stack. +;; +;; `texinfo-multitable-widths' is called by `texinfo-multitable'. +;; The function returns a list of the widths of each column in a +;; multi-column table, based on the information supplied by the arguments +;; to the @multitable command (by arguments, I mean the text on the rest +;; of the @multitable line, not the remainder of the multi-column table +;; environment). +;; +;; `texinfo-multitable-item' formats a row within a multicolumn table. +;; This command is executed when texinfmt sees @item inside @multitable. +;; Cells in row are separated by `@tab's. Widths of cells are specified +;; by the arguments in the @multitable line. Cells are filled. All cells +;; are made to be the same height by padding their bottoms, as needed, +;; with blanks. +;; +;; `texinfo-multitable-extract-row' is called by `texinfo-multitable-item'. +;; This function returns the text in a multitable row, as a string. +;; The start of a row is marked by an @item and the end of row is the +;; beginning of next @item or beginning of the @end multitable line. +;; Cells within a row are separated by @tab. +;; +;; Note that @tab, the cell separators, are not treated as independent +;; Texinfo commands. + +(defvar extra-inter-column-width 0 +"*Insert NUMBER of additional columns of whitespace between entries of +a multi-column table.") + +(defvar multitable-temp-buffer-name "*multitable-temporary-buffer*") +(defvar multitable-temp-rectangle-name "texinfo-multitable-temp-") + +;; These commands are defined in texinfo.tex for printed output. +(put 'multitableparskip 'texinfo-format 'texinfo-discard-line-with-args) +(put 'multitableparindent 'texinfo-format 'texinfo-discard-line-with-args) +(put 'multitablecolmargin 'texinfo-format 'texinfo-discard-line-with-args) +(put 'multitablelinespace 'texinfo-format 'texinfo-discard-line-with-args) + +(put 'multitable 'texinfo-format 'texinfo-multitable) +(defun texinfo-multitable () + "Produce multi-column tables. + +A multi-column table has this template: + + @multitable {A1} {A2} {A3} + @item A1 @tab A2 @tab A3 + @item B1 @tab B2 @tab B3 + @item C1 @tab C2 @tab C3 + @end multitable + +where the width of the text in brackets specifies the width of the +respective column. + +Or else: + + @multitable @columnfractions .25 .3 .45 + @item A1 @tab A2 @tab A3 + @item B1 @tab B2 @tab B3 + @end multitable + +where the fractions specify the width of each column as a percent +of the current width of the text (i.e., of the fill-column). + +Long lines of text are filled within columns. + +Using the Emacs Lisp formatter, texinfmt.el, +the whitespace between columns can be increased by setting +`extra-inter-column-width' to a value greater than 0. By default, +there is at least one blank space between columns. + +The Emacs Lisp formatter, texinfmt.el, ignores the following four +commands that are defined in texinfo.tex for printed output. + + @multitableparskip, + @multitableparindent, + @multitablecolmargin, + @multitablelinespace." + +;; This function pushes information onto the `texinfo-stack'. +;; A stack element consists of: +;; - type-of-command, i.e., multitable +;; - the information about column widths, and +;; - the position of texinfo-command-start. +;; e.g., ('multitable (1 2 3 4) 123) +;; The command line is then deleted. + (texinfo-push-stack + 'multitable + ;; push width information on stack + (texinfo-multitable-widths)) + (texinfo-discard-line-with-args)) + +(put 'multitable 'texinfo-end 'texinfo-end-multitable) +(defun texinfo-end-multitable () + "Discard the @end multitable line and pop the stack of multitable." + (texinfo-discard-command) + (texinfo-pop-stack 'multitable)) + +(defun texinfo-multitable-widths () + "Return list of widths of each column in a multi-column table." + (let (texinfo-multitable-width-list) + ;; Fractions format: + ;; @multitable @columnfractions .25 .3 .45 + ;; + ;; Template format: + ;; @multitable {Column 1 template} {Column 2} {Column 3 example} + ;; Place point before first argument + (skip-chars-forward " \t") + (cond + ;; Check for common misspelling + ((looking-at "@columnfraction ") + (error "In @multitable, @columnfractions misspelled")) + ;; Case 1: @columnfractions .25 .3 .45 + ((looking-at "@columnfractions") + (forward-word 1) + (while (not (eolp)) + (setq texinfo-multitable-width-list + (cons + (truncate + (1- + (* fill-column (read (get-buffer (current-buffer)))))) + texinfo-multitable-width-list)))) + ;; + ;; Case 2: {Column 1 template} {Column 2} {Column 3 example} + ((looking-at "{") + (let ((start-of-templates (point))) + (while (not (eolp)) + (skip-chars-forward " \t") + (let* ((start-of-template (1+ (point))) + (end-of-template + ;; forward-sexp works with braces in Texinfo mode + (progn (forward-sexp 1) (1- (point))))) + (setq texinfo-multitable-width-list + (cons (- end-of-template start-of-template) + texinfo-multitable-width-list)) + ;; Remove carriage return from within a template, if any. + ;; This helps those those who want to use more than + ;; one line's worth of words in @multitable line. + (narrow-to-region start-of-template end-of-template) + (goto-char (point-min)) + (while (search-forward " +" nil t) + (delete-char -1)) + (goto-char (point-max)) + (widen) + (forward-char 1))))) + ;; + ;; Case 3: Trouble + (t + (error + "You probably need to specify column widths for @multitable correctly."))) + ;; Check whether columns fit on page. + (let ((desired-columns + (+ + ;; between column spaces + (length texinfo-multitable-width-list) + ;; additional between column spaces, if any + extra-inter-column-width + ;; sum of spaces for each entry + (apply '+ texinfo-multitable-width-list)))) + (if (> desired-columns fill-column) + (error + (format + "Multi-column table width, %d chars, is greater than page width, %d chars." + desired-columns fill-column)))) + texinfo-multitable-width-list)) + +;; @item A1 @tab A2 @tab A3 +(defun texinfo-multitable-extract-row () + "Return multitable row, as a string. +End of row is beginning of next @item or beginning of @end. +Cells within rows are separated by @tab." + (skip-chars-forward " \t") + (let* ((start (point)) + (end (progn + (re-search-forward "@item\\|@end") + (match-beginning 0))) + (row (progn (goto-char end) + (skip-chars-backward " ") + ;; remove whitespace at end of argument + (delete-region (point) end) + (buffer-substring start (point))))) + (delete-region texinfo-command-start end) + row)) + +(put 'multitable 'texinfo-item 'texinfo-multitable-item) +(defun texinfo-multitable-item () + "Format a row within a multicolumn table. +Cells in row are separated by @tab. +Widths of cells are specified by the arguments in the @multitable line. +All cells are made to be the same height. +This command is executed when texinfmt sees @item inside @multitable." + (let ((original-buffer (current-buffer)) + (table-widths (reverse (car (cdr (car texinfo-stack))))) + (existing-fill-column fill-column) + start + end + (table-column 0) + (table-entry-height 0) + ;; unformatted row looks like: A1 @tab A2 @tab A3 + ;; extract-row command deletes the source line in the table. + (unformated-row (texinfo-multitable-extract-row))) + ;; Use a temporary buffer + (set-buffer (get-buffer-create multitable-temp-buffer-name)) + (delete-region (point-min) (point-max)) + (insert unformated-row) + (goto-char (point-min)) +;; 1. Check for correct number of @tab in line. + (let ((tab-number 1)) ; one @tab between two columns + (while (search-forward "@tab" nil t) + (setq tab-number (1+ tab-number))) + (if (/= tab-number (length table-widths)) + (error "Wrong number of @tab's in a @multitable row."))) + (goto-char (point-min)) +;; 2. Format each cell, and copy to a rectangle + ;; buffer looks like this: A1 @tab A2 @tab A3 + ;; Cell #1: format up to @tab + ;; Cell #2: format up to @tab + ;; Cell #3: format up to eob + (while (not (eobp)) + (setq start (point)) + (setq end (save-excursion + (if (search-forward "@tab" nil 'move) + ;; Delete the @tab command, including the @-sign + (delete-region + (point) + (progn (forward-word -1) (1- (point))))) + (point))) + ;; Set fill-column *wider* than needed to produce inter-column space + (setq fill-column (+ 1 + extra-inter-column-width + (nth table-column table-widths))) + (narrow-to-region start end) + ;; Remove whitespace before and after entry. + (skip-chars-forward " ") + (delete-region (point) (save-excursion (beginning-of-line) (point))) + (goto-char (point-max)) + (skip-chars-backward " ") + (delete-region (point) (save-excursion (end-of-line) (point))) + ;; Temorarily set texinfo-stack to nil so texinfo-format-scan + ;; does not see an unterminated @multitable. + (let (texinfo-stack) ; nil + (texinfo-format-scan)) + (let (fill-prefix) ; no fill prefix + (fill-region (point-min) (point-max))) + (setq table-entry-height + (max table-entry-height (count-lines (point-min) (point-max)))) +;; 3. Move point to end of bottom line, and pad that line to fill column. + (goto-char (point-min)) + (forward-line (1- table-entry-height)) + (let* ((beg (point)) ; beginning of line + ;; add one more space for inter-column spacing + (needed-whitespace + (1+ + (- fill-column + (- + (progn (end-of-line) (point)) ; end of existing line + beg))))) + (insert (make-string + (if (> needed-whitespace 0) needed-whitespace 1) + ? ))) + ;; now, put formatted cell into a rectangle + (set (intern (concat multitable-temp-rectangle-name + (int-to-string table-column))) + (extract-rectangle (point-min) (point))) + (delete-region (point-min) (point)) + (goto-char (point-max)) + (setq table-column (1+ table-column)) + (widen)) +;; 4. Add extra lines to rectangles so all are of same height + (let ((total-number-of-columns table-column) + (column-number 0) + here) + (while (> table-column 0) + (let ((this-rectangle (int-to-string table-column))) + (while (< (length this-rectangle) table-entry-height) + (setq this-rectangle (append this-rectangle '(""))))) + (setq table-column (1- table-column))) +;; 5. Insert formatted rectangles in original buffer + (switch-to-buffer original-buffer) + (open-line table-entry-height) + (while (< column-number total-number-of-columns) + (setq here (point)) + (insert-rectangle + (eval (intern + (concat multitable-temp-rectangle-name + (int-to-string column-number))))) + (goto-char here) + (end-of-line) + (setq column-number (1+ column-number)))) + (kill-buffer multitable-temp-buffer-name) + (setq fill-column existing-fill-column))) + + ;;; @ifinfo, @iftex, @tex, @ifhtml, @html (put 'ifinfo 'texinfo-format 'texinfo-discard-line) @@ -1548,7 +2072,7 @@ Used by @refill indenting command to avoid indenting within lists, etc.") (put 'endtitlepage 'texinfo-format 'texinfo-discard-line) -; @titlespec an alternative titling command; ignored by Info +;; @titlespec an alternative titling command; ignored by Info (put 'titlespec 'texinfo-format 'texinfo-format-titlespec) (defun texinfo-format-titlespec () @@ -1563,8 +2087,8 @@ Used by @refill indenting command to avoid indenting within lists, etc.") (put 'today 'texinfo-format 'texinfo-format-today) -; Produces Day Month Year style of output. eg `1 Jan 1900' -; The `@today{}' command requires a pair of braces, like `@dots{}'. +;; Produces Day Month Year style of output. eg `1 Jan 1900' +;; The `@today{}' command requires a pair of braces, like `@dots{}'. (defun texinfo-format-today () (texinfo-parse-arg-discard) (insert (format "%s %s %s" @@ -1586,64 +2110,64 @@ Used by @refill indenting command to avoid indenting within lists, etc.") ;;; Define the Info enclosure command: @definfoenclose -; A `@definfoenclose' command may be used to define a highlighting -; command for Info, but not for TeX. A command defined using -; `@definfoenclose' marks text by enclosing it in strings that precede -; and follow the text. -; -; Presumably, if you define a command with `@definfoenclose` for Info, -; you will also define the same command in the TeX definitions file, -; `texinfo.tex' in a manner appropriate for typesetting. -; -; Write a `@definfoenclose' command on a line and follow it with three -; arguments separated by commas (commas are used as separators in an -; `@node' line in the same way). The first argument to -; `@definfoenclose' is the @-command name \(without the `@'\); the -; second argument is the Info start delimiter string; and the third -; argument is the Info end delimiter string. The latter two arguments -; enclose the highlighted text in the Info file. A delimiter string -; may contain spaces. Neither the start nor end delimiter is -; required. However, if you do not provide a start delimiter, you -; must follow the command name with two commas in a row; otherwise, -; the Info formatting commands will misinterpret the end delimiter -; string as a start delimiter string. -; -; If you do a @definfoenclose{} on the name of a pre-defined macro (such -; as @emph{}, @strong{}, @tt{}, or @i{}) the enclosure definition will -; override the built-in definition. -; -; An enclosure command defined this way takes one argument in braces. -; -; For example, you can write: -; -; @ifinfo -; @definfoenclose phoo, //, \\ -; @end ifinfo -; -; near the beginning of a Texinfo file at the beginning of the lines -; to define `@phoo' as an Info formatting command that inserts `//' -; before and `\\' after the argument to `@phoo'. You can then write -; `@phoo{bar}' wherever you want `//bar\\' highlighted in Info. -; -; Also, for TeX formatting, you could write -; -; @iftex -; @global@let@phoo=@i -; @end iftex -; -; to define `@phoo' as a command that causes TeX to typeset -; the argument to `@phoo' in italics. -; -; Note that each definition applies to its own formatter: one for TeX, -; the other for texinfo-format-buffer or texinfo-format-region. -; -; Here is another example: write -; -; @definfoenclose headword, , : -; -; near the beginning of the file, to define `@headword' as an Info -; formatting command that inserts nothing before and a colon after the -; argument to `@headword'. +;; A `@definfoenclose' command may be used to define a highlighting +;; command for Info, but not for TeX. A command defined using +;; `@definfoenclose' marks text by enclosing it in strings that precede +;; and follow the text. +;; +;; Presumably, if you define a command with `@definfoenclose` for Info, +;; you will also define the same command in the TeX definitions file, +;; `texinfo.tex' in a manner appropriate for typesetting. +;; +;; Write a `@definfoenclose' command on a line and follow it with three +;; arguments separated by commas (commas are used as separators in an +;; `@node' line in the same way). The first argument to +;; `@definfoenclose' is the @-command name \(without the `@'\); the +;; second argument is the Info start delimiter string; and the third +;; argument is the Info end delimiter string. The latter two arguments +;; enclose the highlighted text in the Info file. A delimiter string +;; may contain spaces. Neither the start nor end delimiter is +;; required. However, if you do not provide a start delimiter, you +;; must follow the command name with two commas in a row; otherwise, +;; the Info formatting commands will misinterpret the end delimiter +;; string as a start delimiter string. +;; +;; If you do a @definfoenclose{} on the name of a pre-defined macro (such +;; as @emph{}, @strong{}, @tt{}, or @i{}) the enclosure definition will +;; override the built-in definition. +;; +;; An enclosure command defined this way takes one argument in braces. +;; +;; For example, you can write: +;; +;; @ifinfo +;; @definfoenclose phoo, //, \\ +;; @end ifinfo +;; +;; near the beginning of a Texinfo file at the beginning of the lines +;; to define `@phoo' as an Info formatting command that inserts `//' +;; before and `\\' after the argument to `@phoo'. You can then write +;; `@phoo{bar}' wherever you want `//bar\\' highlighted in Info. +;; +;; Also, for TeX formatting, you could write +;; +;; @iftex +;; @global@let@phoo=@i +;; @end iftex +;; +;; to define `@phoo' as a command that causes TeX to typeset +;; the argument to `@phoo' in italics. +;; +;; Note that each definition applies to its own formatter: one for TeX, +;; the other for texinfo-format-buffer or texinfo-format-region. +;; +;; Here is another example: write +;; +;; @definfoenclose headword, , : +;; +;; near the beginning of the file, to define `@headword' as an Info +;; formatting command that inserts nothing before and a colon after the +;; argument to `@headword'. (put 'definfoenclose 'texinfo-format 'texinfo-define-info-enclosure) (defun texinfo-define-info-enclosure () @@ -1664,32 +2188,16 @@ Used by @refill indenting command to avoid indenting within lists, etc.") ;;; @var, @code and the like (put 'var 'texinfo-format 'texinfo-format-var) -; @sc a small caps font for TeX; formatted as `var' in Info +;; @sc a small caps font for TeX; formatted as `var' in Info (put 'sc 'texinfo-format 'texinfo-format-var) (defun texinfo-format-var () (insert (upcase (texinfo-parse-arg-discard))) (goto-char texinfo-command-start)) -; various noops - -(put 'b 'texinfo-format 'texinfo-format-noop) -(put 'i 'texinfo-format 'texinfo-format-noop) -(put 'r 'texinfo-format 'texinfo-format-noop) -(put 't 'texinfo-format 'texinfo-format-noop) -(put 'w 'texinfo-format 'texinfo-format-noop) -(put 'asis 'texinfo-format 'texinfo-format-noop) -(put 'dmn 'texinfo-format 'texinfo-format-noop) -(put 'key 'texinfo-format 'texinfo-format-noop) -(put 'math 'texinfo-format 'texinfo-format-noop) -(put 'titlefont 'texinfo-format 'texinfo-format-noop) -(defun texinfo-format-noop () - (insert (texinfo-parse-arg-discard)) - (goto-char texinfo-command-start)) - +(put 'url 'texinfo-format 'texinfo-format-code) (put 'cite 'texinfo-format 'texinfo-format-code) (put 'code 'texinfo-format 'texinfo-format-code) (put 'file 'texinfo-format 'texinfo-format-code) -(put 'kbd 'texinfo-format 'texinfo-format-code) (put 'samp 'texinfo-format 'texinfo-format-code) (defun texinfo-format-code () (insert "`" (texinfo-parse-arg-discard) "'") @@ -1707,6 +2215,12 @@ Used by @refill indenting command to avoid indenting within lists, etc.") (insert "\"" (texinfo-parse-arg-discard) "\"") (goto-char texinfo-command-start)) +(put 'email 'texinfo-format 'texinfo-format-key) +(put 'key 'texinfo-format 'texinfo-format-key) +(defun texinfo-format-key () + (insert "<" (texinfo-parse-arg-discard) ">") + (goto-char texinfo-command-start)) + (put 'bullet 'texinfo-format 'texinfo-format-bullet) (defun texinfo-format-bullet () "Insert an asterisk. @@ -1715,6 +2229,66 @@ If used within a line, follow `@bullet' with braces." (insert "*")) +;;; @kbd + +;; Inside of @example ... @end example and similar environments, +;; @kbd does nothing; but outside of such environments, it places +;; single quotation markes around its argument. + +(defvar texinfo-format-kbd-regexp + (concat + "^@" + "\\(" + "example\\|" + "smallexample\\|" + "lisp\\|" + "smalllisp" + "\\)") + "Regexp specifying environments in which @kbd does not put `...' + around argument.") + +(defvar texinfo-format-kbd-end-regexp + (concat + "^@end " + "\\(" + "example\\|" + "smallexample\\|" + "lisp\\|" + "smalllisp" + "\\)") + "Regexp specifying end of environments in which @kbd does not put `...' + around argument. (See `texinfo-format-kbd-regexp')") + +(put 'kbd 'texinfo-format 'texinfo-format-kbd) +(defun texinfo-format-kbd () + "Place single quote marks around arg, except in @example and similar." + ;; Search forward for @end example closer than an @example. + ;; Can stop search at nearest @node or texinfo-section-types-regexp + (let* ((stop + (save-excursion + (re-search-forward + (concat "^@node\\|\\(" texinfo-section-types-regexp "\\)") + nil + 'move-to-end) ; if necessary, return point at end of buffer + (point))) + (example-location + (save-excursion + (re-search-forward texinfo-format-kbd-regexp stop 'move-to-end) + (point))) + (end-example-location + (save-excursion + (re-search-forward texinfo-format-kbd-end-regexp stop 'move-to-end) + (point)))) + ;; If inside @example, @end example will be closer than @example + ;; or end of search i.e., end-example-location less than example-location + (if (>= end-example-location example-location) + ;; outside an @example or equivalent + (insert "`" (texinfo-parse-arg-discard) "'") + ;; else, in @example; do not surround with `...' + (insert (texinfo-parse-arg-discard))) + (goto-char texinfo-command-start))) + + ;;; @example, @lisp, @quotation, @display, @smalllisp, @smallexample (put 'display 'texinfo-format 'texinfo-format-example) @@ -1758,8 +2332,8 @@ If used within a line, follow `@bullet' with braces." ;;; @cartouche -; The @cartouche command is a noop in Info; in a printed manual, -; it makes a box with rounded corners. +;; The @cartouche command is a noop in Info; in a printed manual, +;; it makes a box with rounded corners. (put 'cartouche 'texinfo-format 'texinfo-discard-line) (put 'cartouche 'texinfo-end 'texinfo-discard-command) @@ -1767,12 +2341,12 @@ If used within a line, follow `@bullet' with braces." ;;; @flushleft and @format -; The @flushleft command left justifies every line but leaves the -; right end ragged. As far as Info is concerned, @flushleft is a -; `do-nothing' command +;; The @flushleft command left justifies every line but leaves the +;; right end ragged. As far as Info is concerned, @flushleft is a +;; `do-nothing' command -; The @format command is similar to @example except that it does not -; indent; this means that in Info, @format is similar to @flushleft. +;; The @format command is similar to @example except that it does not +;; indent; this means that in Info, @format is similar to @flushleft. (put 'format 'texinfo-format 'texinfo-format-flushleft) (put 'flushleft 'texinfo-format 'texinfo-format-flushleft) @@ -1787,9 +2361,9 @@ If used within a line, follow `@bullet' with braces." ;;; @flushright -; The @flushright command right justifies every line but leaves the -; left end ragged. Spaces and tabs at the right ends of lines are -; removed so that visible text lines up on the right side. +;; The @flushright command right justifies every line but leaves the +;; left end ragged. Spaces and tabs at the right ends of lines are +;; removed so that visible text lines up on the right side. (put 'flushright 'texinfo-format 'texinfo-format-flushright) (defun texinfo-format-flushright () @@ -1822,7 +2396,7 @@ If used within a line, follow `@bullet' with braces." ? ))))) -;;; @ctrl, @TeX, @copyright, @minus, @dots +;;; @ctrl, @TeX, @copyright, @minus, @dots, @enddots, @pounds (put 'ctrl 'texinfo-format 'texinfo-format-ctrl) (defun texinfo-format-ctrl () @@ -1856,19 +2430,24 @@ If used within a line, follow `@minus' with braces." (texinfo-parse-arg-discard) (insert "....")) +(put 'pounds 'texinfo-format 'texinfo-format-pounds) +(defun texinfo-format-pounds () + (texinfo-parse-arg-discard) + (insert "#")) + ;;; Refilling and indenting: @refill, @paragraphindent, @noindent ;;; Indent only those paragraphs that are refilled as a result of an ;;; @refill command. -; * If the value is `asis', do not change the existing indentation at -; the starts of paragraphs. +;; * If the value is `asis', do not change the existing indentation at +;; the starts of paragraphs. -; * If the value zero, delete any existing indentation. +;; * If the value zero, delete any existing indentation. -; * If the value is greater than zero, indent each paragraph by that -; number of spaces. +;; * If the value is greater than zero, indent each paragraph by that +;; number of spaces. ;;; But do not refill paragraphs with an @refill command that are ;;; preceded by @noindent or are part of a table, list, or deffn. @@ -1917,9 +2496,11 @@ Default is to leave paragraph indentation as is." ;; are used to underline it. This could occur if the line following ;; the underlining is not an index entry and has text within it. (let* ((previous-paragraph-separate paragraph-separate) - (paragraph-separate (concat paragraph-separate "\\|[-=*.]+")) + (paragraph-separate + (concat paragraph-separate "\\|[-=.]+\\|\\*\\*+")) (previous-paragraph-start paragraph-start) - (paragraph-start (concat paragraph-start "\\|[-=*.]+"))) + (paragraph-start + (concat paragraph-start "\\|[-=.]+\\|\\*\\*+"))) (unwind-protect (fill-paragraph nil) (setq paragraph-separate previous-paragraph-separate) @@ -2091,7 +2672,7 @@ Default is to leave paragraph indentation as is." (setq opoint (point)) (texinfo-print-index nil indexelts) - (if (eq system-type 'vax-vms) + (if (memq system-type '(vax-vms windows-nt ms-dos)) (texinfo-sort-region opoint (point)) (shell-command-on-region opoint (point) "sort -fd" 1)))) @@ -2156,6 +2737,245 @@ Default is to leave paragraph indentation as is." (insert "=>")) +;;; Accent commands + +;; Info presumes a plain ASCII output, so the accented characters do +;; not look as they would if typeset, or output with a different +;; character set. + +;; See the `texinfo-accent-commands' variable +;; in the section for `texinfo-append-refill'. +;; Also, see the defun for `texinfo-format-scan' +;; for single-character accent commands. + +;; Command Info output Name + +;; These do not have braces: +;; @^ ==> ^ circumflex accent +;; @` ==> ` grave accent +;; @' ==> ' acute accent +;; @" ==> " umlaut accent +;; @= ==> = overbar accent +;; @~ ==> ~ tilde accent + +;; These have braces, but take no argument: +;; @OE{} ==> OE French-OE-ligature +;; @oe{} ==> oe +;; @AA{} ==> AA Scandinavian-A-with-circle +;; @aa{} ==> aa +;; @AE{} ==> AE Latin-Scandinavian-AE +;; @ae{} ==> ae +;; @ss{} ==> ss German-sharp-S + +;; @questiondown{} ==> ? upside-down-question-mark +;; @exclamdown{} ==> ! upside-down-exclamation-mark +;; @L{} ==> L/ Polish suppressed-L (Lslash) +;; @l{} ==> l/ Polish suppressed-L (Lslash) (lower case) +;; @O{} ==> O/ Scandinavian O-with-slash +;; @o{} ==> o/ Scandinavian O-with-slash (lower case) + +;; These have braces, and take an argument: +;; @,{c} ==> c, cedilla accent +;; @dotaccent{o} ==> .o overdot-accent +;; @ubaraccent{o} ==> _o underbar-accent +;; @udotaccent{o} ==> o-. underdot-accent +;; @H{o} ==> ""o long Hungarian umlaut +;; @ringaccent{o} ==> *o ring accent +;; @tieaccent{oo} ==> [oo tie after accent +;; @u{o} ==> (o breve accent +;; @v{o} ==> i dotless i and dotless j + +;; ========== + +;; Note: The defun texinfo-format-scan +;; looks at "[@{}^'`\",=~ *?!-]" +;; In the case of @*, a line break is inserted; +;; in the other cases, the characters are simply quoted and the @ is deleted. +;; Thus, `texinfo-format-scan' handles the following +;; single-character accent commands: @^ @` @' @" @, @- @= @~ + +;; @^ ==> ^ circumflex accent +;; (put '^ 'texinfo-format 'texinfo-format-circumflex-accent) +;; (defun texinfo-format-circumflex-accent () +;; (texinfo-discard-command) +;; (insert "^")) +;; +;; @` ==> ` grave accent +;; (put '\` 'texinfo-format 'texinfo-format-grave-accent) +;; (defun texinfo-format-grave-accent () +;; (texinfo-discard-command) +;; (insert "\`")) +;; +;; @' ==> ' acute accent +;; (put '\' 'texinfo-format 'texinfo-format-acute-accent) +;; (defun texinfo-format-acute-accent () +;; (texinfo-discard-command) +;; (insert "'")) +;; +;; @" ==> " umlaut accent +;; (put '\" 'texinfo-format 'texinfo-format-umlaut-accent) +;; (defun texinfo-format-umlaut-accent () +;; (texinfo-discard-command) +;; (insert "\"")) +;; +;; @= ==> = overbar accent +;; (put '= 'texinfo-format 'texinfo-format-overbar-accent) +;; (defun texinfo-format-overbar-accent () +;; (texinfo-discard-command) +;; (insert "=")) +;; +;; @~ ==> ~ tilde accent +;; (put '~ 'texinfo-format 'texinfo-format-tilde-accent) +;; (defun texinfo-format-tilde-accent () +;; (texinfo-discard-command) +;; (insert "~")) + +;; @OE{} ==> OE French-OE-ligature +(put 'OE 'texinfo-format 'texinfo-format-French-OE-ligature) +(defun texinfo-format-French-OE-ligature () + (insert "OE" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @oe{} ==> oe +(put 'oe 'texinfo-format 'texinfo-format-French-oe-ligature) +(defun texinfo-format-French-oe-ligature () ; lower case + (insert "oe" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @AA{} ==> AA Scandinavian-A-with-circle +(put 'AA 'texinfo-format 'texinfo-format-Scandinavian-A-with-circle) +(defun texinfo-format-Scandinavian-A-with-circle () + (insert "AA" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @aa{} ==> aa +(put 'aa 'texinfo-format 'texinfo-format-Scandinavian-a-with-circle) +(defun texinfo-format-Scandinavian-a-with-circle () ; lower case + (insert "aa" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @AE{} ==> AE Latin-Scandinavian-AE +(put 'AE 'texinfo-format 'texinfo-format-Latin-Scandinavian-AE) +(defun texinfo-format-Latin-Scandinavian-AE () + (insert "AE" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @ae{} ==> ae +(put 'ae 'texinfo-format 'texinfo-format-Latin-Scandinavian-ae) +(defun texinfo-format-Latin-Scandinavian-ae () ; lower case + (insert "ae" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @ss{} ==> ss German-sharp-S +(put 'ss 'texinfo-format 'texinfo-format-German-sharp-S) +(defun texinfo-format-German-sharp-S () + (insert "ss" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @questiondown{} ==> ? upside-down-question-mark +(put 'questiondown 'texinfo-format 'texinfo-format-upside-down-question-mark) +(defun texinfo-format-upside-down-question-mark () + (insert "?" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @exclamdown{} ==> ! upside-down-exclamation-mark +(put 'exclamdown 'texinfo-format 'texinfo-format-upside-down-exclamation-mark) +(defun texinfo-format-upside-down-exclamation-mark () + (insert "!" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @L{} ==> L/ Polish suppressed-L (Lslash) +(put 'L 'texinfo-format 'texinfo-format-Polish-suppressed-L) +(defun texinfo-format-Polish-suppressed-L () + (insert (texinfo-parse-arg-discard) "/L") + (goto-char texinfo-command-start)) + +;; @l{} ==> l/ Polish suppressed-L (Lslash) (lower case) +(put 'l 'texinfo-format 'texinfo-format-Polish-suppressed-l-lower-case) +(defun texinfo-format-Polish-suppressed-l-lower-case () + (insert (texinfo-parse-arg-discard) "/l") + (goto-char texinfo-command-start)) + + +;; @O{} ==> O/ Scandinavian O-with-slash +(put 'O 'texinfo-format 'texinfo-format-Scandinavian-O-with-slash) +(defun texinfo-format-Scandinavian-O-with-slash () + (insert (texinfo-parse-arg-discard) "O/") + (goto-char texinfo-command-start)) + +;; @o{} ==> o/ Scandinavian O-with-slash (lower case) +(put 'o 'texinfo-format 'texinfo-format-Scandinavian-o-with-slash-lower-case) +(defun texinfo-format-Scandinavian-o-with-slash-lower-case () + (insert (texinfo-parse-arg-discard) "o/") + (goto-char texinfo-command-start)) + +;; Take arguments + +;; @,{c} ==> c, cedilla accent +(put ', 'texinfo-format 'texinfo-format-cedilla-accent) +(defun texinfo-format-cedilla-accent () + (insert (texinfo-parse-arg-discard) ",") + (goto-char texinfo-command-start)) + + +;; @dotaccent{o} ==> .o overdot-accent +(put 'dotaccent 'texinfo-format 'texinfo-format-overdot-accent) +(defun texinfo-format-overdot-accent () + (insert "." (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @ubaraccent{o} ==> _o underbar-accent +(put 'ubaraccent 'texinfo-format 'texinfo-format-underbar-accent) +(defun texinfo-format-underbar-accent () + (insert "_" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @udotaccent{o} ==> o-. underdot-accent +(put 'udotaccent 'texinfo-format 'texinfo-format-underdot-accent) +(defun texinfo-format-underdot-accent () + (insert (texinfo-parse-arg-discard) "-.") + (goto-char texinfo-command-start)) + +;; @H{o} ==> ""o long Hungarian umlaut +(put 'H 'texinfo-format 'texinfo-format-long-Hungarian-umlaut) +(defun texinfo-format-long-Hungarian-umlaut () + (insert "\"\"" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @ringaccent{o} ==> *o ring accent +(put 'ringaccent 'texinfo-format 'texinfo-format-ring-accent) +(defun texinfo-format-ring-accent () + (insert "*" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @tieaccent{oo} ==> [oo tie after accent +(put 'tieaccent 'texinfo-format 'texinfo-format-tie-after-accent) +(defun texinfo-format-tie-after-accent () + (insert "[" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + + +;; @u{o} ==> (o breve accent +(put 'u 'texinfo-format 'texinfo-format-breve-accent) +(defun texinfo-format-breve-accent () + (insert "(" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @v{o} ==> i dotless i and dotless j +(put 'dotless 'texinfo-format 'texinfo-format-dotless) +(defun texinfo-format-dotless () + (insert (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + + ;;; Definition formatting: @deffn, @defun, etc ;; What definition formatting produces: @@ -2887,13 +3707,67 @@ The command `@value{foo}' expands to the value." ())))) +;;; @ifeq + +(put 'ifeq 'texinfo-format 'texinfo-format-ifeq) +(defun texinfo-format-ifeq () + "If ARG1 and ARG2 caselessly string compare to same string, performs COMMAND. +Otherwise produces no output. + +Thus: + @ifeq{ arg1 , arg1 , @code{foo}} bar + + ==> `foo' bar. +but + @ifeq{ arg1 , arg2 , @code{foo}} bar + + ==> bar + +Note that the Texinfo command and its arguments must be arguments to +the @ifeq command." + ;; compare-buffer-substrings does not exist in version 18; don't use + (goto-char texinfo-command-end) + (let* ((case-fold-search t) + (stop (save-excursion (forward-sexp 1) (point))) + start end + ;; @ifeq{arg1, arg2, @command{optional-args}} + (arg1 + (progn + (forward-char 1) + (skip-chars-forward " ") + (setq start (point)) + (search-forward "," stop t) + (skip-chars-backward ", ") + (buffer-substring start (point)))) + (arg2 + (progn + (search-forward "," stop t) + (skip-chars-forward " ") + (setq start (point)) + (search-forward "," stop t) + (skip-chars-backward ", ") + (buffer-substring start (point)))) + (texinfo-command + (progn + (search-forward "," stop t) + (skip-chars-forward " ") + (setq start (point)) + (goto-char (1- stop)) + (skip-chars-backward " ") + (buffer-substring start (point))))) + (delete-region texinfo-command-start stop) + (if (equal arg1 arg2) + (insert texinfo-command)) + (goto-char texinfo-command-start))) + + ;;; Process included files: `@include' command ;; Updated 19 October 1990 ;; In the original version, include files were ignored by Info but ;; incorporated in to the printed manual. To make references to the ;; included file, the Texinfo source file has to refer to the included -;; files using the `(filename)nodename' format for refering to other +;; files using the `(filename)nodename' format for referring to other ;; Info files. Also, the included files had to be formatted on their ;; own. It was just like they were another file. @@ -2913,67 +3787,105 @@ The command `@value{foo}' expands to the value." ;; is treated like other @-commands. (put 'include 'texinfo-format 'texinfo-format-noop) -; Original definition: -; (defun texinfo-format-include () -; (let ((filename (texinfo-parse-arg-discard)) -; (default-directory input-directory) -; subindex) -; (setq subindex -; (save-excursion -; (progn (find-file -; (cond ((file-readable-p (concat filename ".texinfo")) -; (concat filename ".texinfo")) -; ((file-readable-p (concat filename ".texi")) -; (concat filename ".texi")) -; ((file-readable-p (concat filename ".tex")) -; (concat filename ".tex")) -; ((file-readable-p filename) -; filename) -; (t (error "@include'd file %s not found" -; filename)))) -; (texinfo-format-buffer-1)))) -; (texinfo-subindex 'texinfo-vindex (car subindex) (nth 1 subindex)) -; (texinfo-subindex 'texinfo-findex (car subindex) (nth 2 subindex)) -; (texinfo-subindex 'texinfo-cindex (car subindex) (nth 3 subindex)) -; (texinfo-subindex 'texinfo-pindex (car subindex) (nth 4 subindex)) -; (texinfo-subindex 'texinfo-tindex (car subindex) (nth 5 subindex)) -; (texinfo-subindex 'texinfo-kindex (car subindex) (nth 6 subindex)))) -; -;(defun texinfo-subindex (indexvar file content) -; (set indexvar (cons (list 'recurse file content) -; (symbol-value indexvar)))) - -; Second definition: -; (put 'include 'texinfo-format 'texinfo-format-include) -; (defun texinfo-format-include () -; (let ((filename (concat input-directory -; (texinfo-parse-arg-discard))) -; (default-directory input-directory)) -; (message "Reading: %s" filename) -; (save-excursion -; (save-restriction -; (narrow-to-region -; (point) -; (+ (point) (car (cdr (insert-file-contents filename))))) -; (goto-char (point-min)) -; (texinfo-append-refill) -; (texinfo-format-convert (point-min) (point-max)))) -; (setq last-input-buffer input-buffer) ; to bypass setfilename -; )) +;; Original definition: +;; (defun texinfo-format-include () +;; (let ((filename (texinfo-parse-arg-discard)) +;; (default-directory input-directory) +;; subindex) +;; (setq subindex +;; (save-excursion +;; (progn (find-file +;; (cond ((file-readable-p (concat filename ".texinfo")) +;; (concat filename ".texinfo")) +;; ((file-readable-p (concat filename ".texi")) +;; (concat filename ".texi")) +;; ((file-readable-p (concat filename ".tex")) +;; (concat filename ".tex")) +;; ((file-readable-p filename) +;; filename) +;; (t (error "@include'd file %s not found" +;; filename)))) +;; (texinfo-format-buffer-1)))) +;; (texinfo-subindex 'texinfo-vindex (car subindex) (nth 1 subindex)) +;; (texinfo-subindex 'texinfo-findex (car subindex) (nth 2 subindex)) +;; (texinfo-subindex 'texinfo-cindex (car subindex) (nth 3 subindex)) +;; (texinfo-subindex 'texinfo-pindex (car subindex) (nth 4 subindex)) +;; (texinfo-subindex 'texinfo-tindex (car subindex) (nth 5 subindex)) +;; (texinfo-subindex 'texinfo-kindex (car subindex) (nth 6 subindex)))) +;; +;;(defun texinfo-subindex (indexvar file content) +;; (set indexvar (cons (list 'recurse file content) +;; (symbol-value indexvar)))) + +;; Second definition: +;; (put 'include 'texinfo-format 'texinfo-format-include) +;; (defun texinfo-format-include () +;; (let ((filename (concat input-directory +;; (texinfo-parse-arg-discard))) +;; (default-directory input-directory)) +;; (message "Reading: %s" filename) +;; (save-excursion +;; (save-restriction +;; (narrow-to-region +;; (point) +;; (+ (point) (car (cdr (insert-file-contents filename))))) +;; (goto-char (point-min)) +;; (texinfo-append-refill) +;; (texinfo-format-convert (point-min) (point-max)))) +;; (setq last-input-buffer input-buffer) ; to bypass setfilename +;; )) -;;; Numerous commands do nothing in Texinfo - +;;; Numerous commands do nothing in Info ;; These commands are defined in texinfo.tex for printed output. + +;;; various noops, such as @b{foo}, that take arguments in braces + +(put 'b 'texinfo-format 'texinfo-format-noop) +(put 'i 'texinfo-format 'texinfo-format-noop) +(put 'r 'texinfo-format 'texinfo-format-noop) +(put 't 'texinfo-format 'texinfo-format-noop) +(put 'w 'texinfo-format 'texinfo-format-noop) +(put 'asis 'texinfo-format 'texinfo-format-noop) +(put 'dmn 'texinfo-format 'texinfo-format-noop) +(put 'math 'texinfo-format 'texinfo-format-noop) +(put 'titlefont 'texinfo-format 'texinfo-format-noop) +(defun texinfo-format-noop () + (insert (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @hyphenation command discards an argument within braces +(put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg) +(defun texinfo-discard-command-and-arg () + "Discard both @-command and its argument in braces." + (goto-char texinfo-command-end) + (forward-list 1) + (setq texinfo-command-end (point)) + (delete-region texinfo-command-start texinfo-command-end)) + + +;;; Do nothing commands, such as @smallbook, that have no args and no braces +;; These must appear on a line of their own + (put 'bye 'texinfo-format 'texinfo-discard-line) +(put 'smallbook 'texinfo-format 'texinfo-discard-line) +(put 'finalout 'texinfo-format 'texinfo-discard-line) +(put 'overfullrule 'texinfo-format 'texinfo-discard-line) +(put 'smallbreak 'texinfo-format 'texinfo-discard-line) +(put 'medbreak 'texinfo-format 'texinfo-discard-line) +(put 'bigbreak 'texinfo-format 'texinfo-discard-line) + + +;;; These noop commands discard the rest of the line. + (put 'c 'texinfo-format 'texinfo-discard-line-with-args) (put 'comment 'texinfo-format 'texinfo-discard-line-with-args) (put 'contents 'texinfo-format 'texinfo-discard-line-with-args) -(put 'finalout 'texinfo-format 'texinfo-discard-line) (put 'group 'texinfo-end 'texinfo-discard-line-with-args) (put 'group 'texinfo-format 'texinfo-discard-line-with-args) (put 'headings 'texinfo-format 'texinfo-discard-line-with-args) +(put 'setchapterstyle 'texinfo-format 'texinfo-discard-line-with-args) (put 'hsize 'texinfo-format 'texinfo-discard-line-with-args) (put 'itemindent 'texinfo-format 'texinfo-discard-line-with-args) (put 'lispnarrowing 'texinfo-format 'texinfo-discard-line-with-args) @@ -2986,8 +3898,10 @@ The command `@value{foo}' expands to the value." (put 'settitle 'texinfo-format 'texinfo-discard-line-with-args) (put 'setx 'texinfo-format 'texinfo-discard-line-with-args) (put 'shortcontents 'texinfo-format 'texinfo-discard-line-with-args) -(put 'smallbook 'texinfo-format 'texinfo-discard-line) +(put 'shorttitlepage 'texinfo-format 'texinfo-discard-line-with-args) (put 'summarycontents 'texinfo-format 'texinfo-discard-line-with-args) +(put 'input 'texinfo-format 'texinfo-discard-line-with-args) +(put 'dircategory 'texinfo-format 'texinfo-discard-line-with-args) ;;; Some commands cannot be handled diff --git a/gnu/usr.bin/texinfo/emacs/texinfo.el b/gnu/usr.bin/texinfo/emacs/texinfo.el index 53ed2a76364..0a1ab13401e 100644 --- a/gnu/usr.bin/texinfo/emacs/texinfo.el +++ b/gnu/usr.bin/texinfo/emacs/texinfo.el @@ -1,10 +1,12 @@ -;;; texinfo.el --- major mode for editing Texinfo files +;;; texinfo.el--major mode for editing Texinfo files. -;; Copyright (C) 1985, '88, '89, -;; '90, '91, '92, '93 Free Software Foundation, Inc. +;; Copyright (C) 1985, '88, '89, '90, '91, +;; '92, '93, '96 Free Software Foundation, Inc. ;; Author: Robert J. Chassell -;; Maintainer: FSF +;; Date: 6 Sep 1996 +;; Maintainer: bug-texinfo@prep.ai.mit.edu +;; Keywords: maint, tex, docs ;; This file is part of GNU Emacs. @@ -19,43 +21,91 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Autoloads: (autoload 'makeinfo-region - "makeinfo" + "makeinfo" "Make Info file from region of current Texinfo file, and switch to it. This command does not offer the `next-error' feature since it would apply to a temporary file, not the original; use the `makeinfo-buffer' command to gain use of `next-error'." - t nil) + t nil) (autoload 'makeinfo-buffer - "makeinfo" + "makeinfo" "Make Info file from current buffer. Use the \\[next-error] command to move to the next error \(if there are errors\)." - t nil) + t nil) (autoload 'kill-compilation - "compile" + "compile" "Kill the process made by the \\[compile] command." - t nil) + t nil) (autoload 'makeinfo-recenter-compilation-buffer - "makeinfo" + "makeinfo" "Redisplay `*compilation*' buffer so most recent output can be seen. The last line of the buffer is displayed on line LINE of the window, or centered if LINE is nil." - t nil) + t nil) + +(autoload 'texinfo-update-node + "texnfo-upd" + "Without any prefix argument, update the node in which point is located. +Non-nil argument (prefix, if interactive) means update the nodes in the +marked region. + +The functions for creating or updating nodes and menus, and their +keybindings, are: + + texinfo-update-node (&optional region-p) \\[texinfo-update-node] + texinfo-every-node-update () \\[texinfo-every-node-update] + texinfo-sequential-node-update (&optional region-p) + + texinfo-make-menu (&optional region-p) \\[texinfo-make-menu] + texinfo-all-menus-update () \\[texinfo-all-menus-update] + texinfo-master-menu () + + texinfo-indent-menu-description (column &optional region-p) + +The `texinfo-column-for-description' variable specifies the column to +which menu descriptions are indented. Its default value is 32." + t nil) + +(autoload 'texinfo-every-node-update + "texnfo-upd" + "Update every node in a Texinfo file." + t nil) + +(autoload 'texinfo-sequential-node-update + "texnfo-upd" + "Update one node (or many) in a Texinfo file with sequential pointers. + +This function causes the `Next' or `Previous' pointer to point to the +immediately preceding or following node, even if it is at a higher or +lower hierarchical level in the document. Continually pressing `n' or +`p' takes you straight through the file. + +Without any prefix argument, update the node in which point is located. +Non-nil argument (prefix, if interactive) means update the nodes in the +marked region. + +This command makes it awkward to navigate among sections and +subsections; it should be used only for those documents that are meant +to be read like a novel rather than a reference, and for which the +Info `g*' command is inadequate." + t nil) (autoload 'texinfo-make-menu - "texnfo-upd" + "texnfo-upd" "Without any prefix argument, make or update a menu. Make the menu for the section enclosing the node found following point. @@ -66,19 +116,19 @@ Whenever a menu exists, and is being updated, the descriptions that are associated with node names in the pre-existing menu are incorporated into the new menu. Otherwise, the nodes' section titles are inserted as descriptions." - t nil) + t nil) (autoload 'texinfo-all-menus-update - "texnfo-upd" + "texnfo-upd" "Update every regular menu in a Texinfo file. Remove pre-existing master menu, if there is one. If called with a non-nil argument, this function first updates all the nodes in the buffer before updating the menus." - t nil) + t nil) (autoload 'texinfo-master-menu - "texnfo-upd" + "texnfo-upd" "Make a master menu for a whole Texinfo file. Non-nil argument (prefix, if interactive) means first update all existing nodes and menus. Remove pre-existing master menu, if there is one. @@ -92,7 +142,7 @@ menus in the buffer (incorporating descriptions from pre-existing menus) before it constructs the master menu. The function removes the detailed part of an already existing master -menu. This action depends on the pre-exisitng master menu using the +menu. This action depends on the pre-existing master menu using the standard `texinfo-master-menu-header'. The master menu has the following format, which is adapted from the @@ -110,36 +160,36 @@ recommendation in the Texinfo Manual: Each of the menus in the detailed node listing is introduced by the title of the section containing the menu." - t nil) + t nil) (autoload 'texinfo-indent-menu-description - "texnfo-upd" + "texnfo-upd" "Indent every description in menu following point to COLUMN. Non-nil argument (prefix, if interactive) means indent every description in every menu in the region. Does not indent second and subsequent lines of a multi-line description." - t nil) + t nil) (autoload 'texinfo-insert-node-lines - "texnfo-upd" + "texnfo-upd" "Insert missing `@node' lines in region of Texinfo file. Non-nil argument (prefix, if interactive) means also to insert the section titles as node names; and also to insert the section titles as node names in pre-existing @node lines that lack names." - t nil) + t nil) (autoload 'texinfo-start-menu-description - "texnfo-upd" + "texnfo-upd" "In this menu entry, insert the node's section title as a description. Position point at beginning of description ready for editing. Do not insert a title if the line contains an existing description. You will need to edit the inserted text since a useful description complements the node name rather than repeats it as a title does." - t nil) + t nil) (autoload 'texinfo-multiple-files-update - "texnfo-upd" + "texnfo-upd" "Update first node pointers in each file included in OUTER-FILE; create or update main menu in the outer file that refers to such nodes. This does not create or update menus or pointers within the included files. @@ -173,7 +223,7 @@ Requirements: Thus, normally, each included file contains one, and only one, chapter." - t nil) + t nil) ;;; Code: @@ -198,7 +248,7 @@ chapter." (modify-syntax-entry ?\' "w" texinfo-mode-syntax-table)) ;; Written by Wolfgang Bangerth -;; To overide this example, set either `imenu-generic-expression' +;; To override this example, set either `imenu-generic-expression' ;; or `imenu-create-index-function'. (defvar texinfo-imenu-generic-expression '((nil "^@node[ \t]+\\([^,\n]*\\)" 1) @@ -207,22 +257,56 @@ chapter." "Imenu generic expression for TexInfo mode. See `imenu-generic-expression'.") (defvar texinfo-font-lock-keywords - (list - ;; All but the first 2 had an OVERRIDE of t. - ;; It didn't seem to be any better, and it's slower--simon. - '("^\\(@c\\|@comment\\)\\>.*" . font-lock-comment-face) ;comments - ;; Robert J. Chassell says remove this line. - ;'("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t) - "@\\(@\\|[^}\t \n{]+\\)" ;commands - '("^\\(*.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items - '("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face) - '("@\\(file\\|kbd\\|key\\){\\([^}]+\\)" 2 font-lock-string-face) - '("@\\(samp\\|code\\|var\\|math\\){\\([^}]+\\)" + '(;; All but the first 2 had an OVERRIDE of t. + ;; It didn't seem to be any better, and it's slower--simon. + ("^\\(@c\\|@comment\\)\\>.*" . font-lock-comment-face) ;comments + ;; Robert J. Chassell says remove this line. + ;("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t) + ("@\\([a-zA-Z]+\\|[^ \t\n]\\)" 1 font-lock-keyword-face) ;commands + ("^\\*\\(.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items + ("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face) + ("@\\(file\\|kbd\\|key\\){\\([^}]+\\)" 2 font-lock-string-face) + ("@\\(samp\\|code\\|var\\|math\\){\\([^}]+\\)" 2 font-lock-variable-name-face) - '("@\\(cite\\|xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-reference-face) - '("@\\(end\\|item\\) *\\(.+\\)" 2 font-lock-function-name-face keep) - ) + ("@\\(cite\\|xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-reference-face) + ("@\\(end\\|itemx?\\) +\\(.+\\)" 2 font-lock-function-name-face keep) + ) "Additional expressions to highlight in TeXinfo mode.") + +(defvar texinfo-section-list + '(("top" 1) + ("majorheading" 1) + ("chapter" 2) + ("unnumbered" 2) + ("appendix" 2) + ("chapheading" 2) + ("section" 3) + ("unnumberedsec" 3) + ("appendixsec" 3) + ("heading" 3) + ("subsection" 4) + ("unnumberedsubsec" 4) + ("appendixsubsec" 4) + ("subheading" 4) + ("subsubsection" 5) + ("unnumberedsubsubsec" 5) + ("appendixsubsubsec" 5) + ("subsubheading" 5)) + "Alist of sectioning commands and their relative level.") + +(defun texinfo-outline-level () + ;; Calculate level of current texinfo outline heading. + (save-excursion + (if (bobp) + 0 + (forward-char 1) + (let* ((word (buffer-substring-no-properties + (point) (progn (forward-word 1) (point)))) + (entry (assoc word texinfo-section-list))) + (if entry + (nth 1 entry) + 5))))) + ;;; Keybindings (defvar texinfo-mode-map nil) @@ -259,7 +343,7 @@ chapter." (define-key texinfo-mode-map "\C-c\C-m\C-r" 'makeinfo-region) (define-key texinfo-mode-map "\C-c\C-m\C-b" 'makeinfo-buffer) - ; Bindings for texinfmt.el. + ;; bindings for `texinfmt.el' (define-key texinfo-mode-map "\C-c\C-e\C-r" 'texinfo-format-region) (define-key texinfo-mode-map "\C-c\C-e\C-b" 'texinfo-format-buffer) @@ -274,8 +358,9 @@ chapter." (define-key texinfo-mode-map "\C-c\C-s" 'texinfo-show-structure) - (define-key texinfo-mode-map "\C-c}" 'up-list) - (define-key texinfo-mode-map "\C-c{" 'texinfo-insert-braces) + (define-key texinfo-mode-map "\C-c}" 'up-list) + (define-key texinfo-mode-map "\C-c]" 'up-list) + (define-key texinfo-mode-map "\C-c{" 'texinfo-insert-braces) ;; bindings for inserting strings @@ -386,9 +471,9 @@ value of texinfo-mode-hook." (make-local-variable 'indent-tabs-mode) (setq indent-tabs-mode nil) (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) - (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) (setq fill-column 72) (make-local-variable 'comment-start) @@ -401,6 +486,13 @@ value of texinfo-mode-hook." (setq imenu-generic-expression texinfo-imenu-generic-expression) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(texinfo-font-lock-keywords t)) + (make-local-variable 'outline-regexp) + (setq outline-regexp + (concat "@\\(" + (mapconcat 'car texinfo-section-list "\\>\\|") + "\\>\\)")) + (make-local-variable 'outline-level) + (setq outline-level 'texinfo-outline-level) (make-local-variable 'tex-start-of-header) (setq tex-start-of-header "%**start") (make-local-variable 'tex-end-of-header) @@ -410,14 +502,40 @@ value of texinfo-mode-hook." ;;; Insert string commands +;; Keep as concatinated lists for ease of maintenance (defconst texinfo-environment-regexp - "^[ \t]*@\\(f?table\\|enumerate\\|itemize\ -\\|ifhtml\\|ifinfo\\|iftex\\|ifset\\|ifclear\ -\\|example\\|quotation\\|lisp\\|smallexample\\|smalllisp\\|display\\|format\ -\\|flushleft\\|flushright\\|ignore\\|group\\|tex\\|html\\|cartouche\\|menu\ -\\|titlepage\\|end\\|def[a-z]*[a-wyz]\\>\\)" - "Regexp for environment-like Texinfo list commands. -Subexpression 1 is what goes into the corresponding `@end' statement.") + (concat + "^@" + "\\(" + "cartouche\\|" + "display\\|" + "end\\|" + "enumerate\\|" + "example\\|" + "f?table\\|" + "flushleft\\|" + "flushright\\|" + "format\\|" + "group\\|" + "ifhtml\\|" + "ifinfo\\|" + "iftex\\|" + "ignore\\|" + "itemize\\|" + "lisp\\|" + "macro\\|" + "multitable\\|" + "quotation\\|" + "smallexample\\|" + "smalllisp\\|" + "tex" + "\\)") + "Regexp for environment-like TexInfo list commands. + Subexpression 1 is what goes into the corresponding `@end' statement.") + +;; The following texinfo-insert-@end command not only inserts a SPC +;; after the @end, but tries to find out what belongs there. It is +;; not very smart: it does not understand nested lists. (defun texinfo-insert-@end () "Insert the matching `@end' for the last Texinfo command that needs one." @@ -425,15 +543,15 @@ Subexpression 1 is what goes into the corresponding `@end' statement.") (let ((depth 1) string) (save-excursion (while (and (> depth 0) - (re-search-backward texinfo-environment-regexp nil t) - (if (looking-at "@end") - (setq depth (1+ depth)) - (setq depth (1- depth))))) + (re-search-backward texinfo-environment-regexp nil t) + (if (looking-at "@end") + (setq depth (1+ depth)) + (setq depth (1- depth))))) (looking-at texinfo-environment-regexp) (if (zerop depth) - (setq string - (buffer-substring (match-beginning 1) - (match-end 1))))) + (setq string + (buffer-substring (match-beginning 1) + (match-end 1))))) (insert "@end ") (if string (insert string "\n")))) @@ -544,6 +662,13 @@ The default is not to surround any existing words with the braces." ;;; Texinfo file structure +;; These are defined in texnfo-upd.el. +;; texinfo-section-types-regexp +;; texinfo-section-level-regexp +;; texinfo-subsection-level-regexp +;; texinfo-subsubsection-level-regexp + +;; `texinfo-show-structure' requires texnfo-upd.el (defun texinfo-show-structure (&optional nodes-too) "Show the structure of a Texinfo file. List the lines in the file that begin with the @-sign commands for @@ -647,21 +772,21 @@ The value of `texinfo-tex-trailer' is appended to the temporary file after the r (tex-start-shell)) (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 + (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)) + (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) + (write-region (point) (save-excursion (end-of-line) (point)) tex-out-file nil nil) @@ -673,10 +798,10 @@ The value of `texinfo-tex-trailer' is appended to the temporary file after the r (if (search-forward tex-start-of-header search-end t) (progn (beginning-of-line) - (setq hbeg (point)) ; Mark beginning of header. + (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 hend (point))) ; Mark end of header. (setq hbeg (point-min))))) ; Else no header. ;; Copy header to temp file. @@ -699,14 +824,19 @@ The value of `texinfo-tex-trailer' is appended to the temporary file after the r (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) - )) +;;; (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)) - (tex-recenter-output-buffer 0)) + (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 () "Run TeX on visited file, once or twice, to make a correct `.dvi' file." @@ -726,9 +856,19 @@ The value of `texinfo-tex-trailer' is appended to the temporary file after the r (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 () @@ -738,6 +878,10 @@ This runs the shell command defined by `texinfo-texindex-command'." (interactive) (require 'tex-mode) (tex-send-command texinfo-texindex-command (concat tex-zap-file ".??")) + ;; alternatively + ;; (send-string "tex-shell" + ;; (concat texinfo-texindex-command + ;; " " tex-zap-file ".??" "\n")) (tex-recenter-output-buffer nil)) (defun texinfo-tex-print () @@ -746,6 +890,10 @@ This runs the shell command defined by `tex-dvi-print-command'." (interactive) (require 'tex-mode) (tex-send-command tex-dvi-print-command (concat tex-zap-file ".dvi")) + ;; alternatively: + ;; (send-string "tex-shell" + ;; (concat tex-dvi-print-command + ;; " " tex-zap-file ".dvi" "\n")) (tex-recenter-output-buffer nil)) (defun texinfo-quit-job () @@ -754,17 +902,29 @@ This runs the shell command defined by `tex-dvi-print-command'." (if (not (get-process "tex-shell")) (error "No TeX shell running")) (tex-send-command "x")) +;; alternatively: +;; save-excursion +;; (set-buffer (get-buffer "*tex-shell*")) +;; (goto-char (point-max)) +;; (insert "x") +;; (comint-send-input) (defun texinfo-delete-from-print-queue (job-number) "Delete job from the line printer spooling queue. You are prompted for the job number (use a number shown by a previous -\\[texinfo-show-print-queue] command)." +\\[tex-show-print-queue] command)." (interactive "nPrinter job number for deletion: ") (require 'tex-mode) (if (tex-shell-running) (tex-kill-job) (tex-start-shell)) (tex-send-command texinfo-delete-from-print-queue-command job-number) + ;; alternatively + ;; (send-string "tex-shell" + ;; (concat + ;; texinfo-delete-from-print-queue-command + ;; " " + ;; job-number"\n")) (tex-recenter-output-buffer nil)) (provide 'texinfo) diff --git a/gnu/usr.bin/texinfo/emacs/texnfo-tex.el b/gnu/usr.bin/texinfo/emacs/texnfo-tex.el index d419f289f7f..225ea685c04 100644 --- a/gnu/usr.bin/texinfo/emacs/texnfo-tex.el +++ b/gnu/usr.bin/texinfo/emacs/texnfo-tex.el @@ -17,7 +17,7 @@ ;; GNU Emacs 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 1, or (at your option) +;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;;; The Texinfo mode TeX related commands are: diff --git a/gnu/usr.bin/texinfo/emacs/texnfo-upd.el b/gnu/usr.bin/texinfo/emacs/texnfo-upd.el index 48da6614960..4827fe5f819 100644 --- a/gnu/usr.bin/texinfo/emacs/texnfo-upd.el +++ b/gnu/usr.bin/texinfo/emacs/texnfo-upd.el @@ -1,9 +1,10 @@ ;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files -;; Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +;; Copyright 1989, 1990, 1991, 1992, 1996 Free Software Foundation, Inc. ;; Author: Robert J. Chassell -;; Maintainer: bug-texinfo@prep.ai.mit.edu +;; Date: 12 Sep 1996 +;; Maintainer: Robert J. Chassell ;; Keywords: maint, tex, docs ;; This file is part of GNU Emacs. @@ -19,131 +20,132 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Commentary: -;;; Known bug: update commands fail to ignore @ignore. - -;;; Summary: how to use the updating commands - -; The node and menu updating functions automatically - -; * insert missing `@node' lines, -; * insert the `Next', `Previous' and `Up' pointers of a node, -; * insert or update the menu for a section, -; * create a master menu for a Texinfo source file. -; -; Passed an argument, the `texinfo-update-node' and -; `texinfo-make-menu' functions do their jobs in the region. -; -; In brief, the functions for creating or updating nodes and menus, are: -; -; texinfo-update-node (&optional region-p) -; texinfo-every-node-update () -; texinfo-sequential-node-update (&optional region-p) -; -; texinfo-make-menu (&optional region-p) -; texinfo-all-menus-update () -; texinfo-master-menu () -; -; texinfo-insert-node-lines (&optional title-p) -; -; texinfo-indent-menu-description (column &optional region-p) - -; The `texinfo-column-for-description' variable specifies the column to -; which menu descriptions are indented. - -; Texinfo file structure -; ---------------------- - -; To use the updating commands, you must structure your Texinfo file -; hierarchically. Each `@node' line, with the exception of the top -; node, must be accompanied by some kind of section line, such as an -; `@chapter' or `@section' line. Each node-line/section-line -; combination must look like this: - -; @node Lists and Tables, Cross References, Structuring, Top -; @comment node-name, next, previous, up -; @chapter Making Lists and Tables - -; or like this (without the `@comment' line): - -; @node Lists and Tables, Cross References, Structuring, Top -; @chapter Making Lists and Tables - -; If the file has a `top' node, it must be called `top' or `Top' and -; be the first node in the file. +;; Known bug: update commands fail to ignore @ignore. + +;; Summary: how to use the updating commands + +;; The node and menu updating functions automatically + +;; * insert missing `@node' lines, +;; * insert the `Next', `Previous' and `Up' pointers of a node, +;; * insert or update the menu for a section, +;; * create a master menu for a Texinfo source file. +;; +;; Passed an argument, the `texinfo-update-node' and +;; `texinfo-make-menu' functions do their jobs in the region. +;; +;; In brief, the functions for creating or updating nodes and menus, are: +;; +;; texinfo-update-node (&optional region-p) +;; texinfo-every-node-update () +;; texinfo-sequential-node-update (&optional region-p) +;; +;; texinfo-make-menu (&optional region-p) +;; texinfo-all-menus-update () +;; texinfo-master-menu () +;; +;; texinfo-insert-node-lines (&optional title-p) +;; +;; texinfo-indent-menu-description (column &optional region-p) + +;; The `texinfo-column-for-description' variable specifies the column to +;; which menu descriptions are indented. + +;; Texinfo file structure +;; ---------------------- + +;; To use the updating commands, you must structure your Texinfo file +;; hierarchically. Each `@node' line, with the exception of the top +;; node, must be accompanied by some kind of section line, such as an +;; `@chapter' or `@section' line. Each node-line/section-line +;; combination must look like this: + +;; @node Lists and Tables, Cross References, Structuring, Top +;; @comment node-name, next, previous, up +;; @chapter Making Lists and Tables + +;; or like this (without the `@comment' line): + +;; @node Lists and Tables, Cross References, Structuring, Top +;; @chapter Making Lists and Tables + +;; If the file has a `top' node, it must be called `top' or `Top' and +;; be the first node in the file. ;;; The update node functions described in detail -; The `texinfo-update-node' function without an argument inserts -; the correct next, previous and up pointers for the node in which -; point is located (i.e., for the node preceding point). +;; The `texinfo-update-node' function without an argument inserts +;; the correct next, previous and up pointers for the node in which +;; point is located (i.e., for the node preceding point). -; With an argument, the `texinfo-update-node' function inserts the -; correct next, previous and up pointers for the nodes inside the -; region. +;; With an argument, the `texinfo-update-node' function inserts the +;; correct next, previous and up pointers for the nodes inside the +;; region. -; It does not matter whether the `@node' line has pre-existing -; `Next', `Previous', or `Up' pointers in it. They are removed. +;; It does not matter whether the `@node' line has pre-existing +;; `Next', `Previous', or `Up' pointers in it. They are removed. -; The `texinfo-every-node-update' function runs `texinfo-update-node' -; on the whole buffer. +;; The `texinfo-every-node-update' function runs `texinfo-update-node' +;; on the whole buffer. -; The `texinfo-sequential-node-update' function inserts the -; immediately following and preceding node into the `Next' or -; `Previous' pointers regardless of their hierarchical level. This is -; only useful for certain kinds of text, like a novel, which you go -; through sequentially. +;; The `texinfo-sequential-node-update' function inserts the +;; immediately following and preceding node into the `Next' or +;; `Previous' pointers regardless of their hierarchical level. This is +;; only useful for certain kinds of text, like a novel, which you go +;; through sequentially. ;;; The menu making functions described in detail -; The `texinfo-make-menu' function without an argument creates or -; updates a menu for the section encompassing the node that follows -; point. With an argument, it makes or updates menus for the nodes -; within or part of the marked region. - -; Whenever an existing menu is updated, the descriptions from -; that menu are incorporated into the new menu. This is done by copying -; descriptions from the existing menu to the entries in the new menu -; that have the same node names. If the node names are different, the -; descriptions are not copied to the new menu. - -; Menu entries that refer to other Info files are removed since they -; are not a node within current buffer. This is a deficiency. - -; The `texinfo-all-menus-update' function runs `texinfo-make-menu' -; on the whole buffer. - -; The `texinfo-master-menu' function creates an extended menu located -; after the top node. (The file must have a top node.) The function -; first updates all the regular menus in the buffer (incorporating the -; descriptions from pre-existing menus), and then constructs a master -; menu that includes every entry from every other menu. (However, the -; function cannot update an already existing master menu; if one -; exists, it must be removed before calling the function.) - -; The `texinfo-indent-menu-description' function indents every -; description in the menu following point, to the specified column. -; Non-nil argument (prefix, if interactive) means indent every -; description in every menu in the region. This function does not -; indent second and subsequent lines of a multi-line description. - -; The `texinfo-insert-node-lines' function inserts `@node' before the -; `@chapter', `@section', and such like lines of a region in a Texinfo -; file where the `@node' lines are missing. -; -; With a non-nil argument (prefix, if interactive), the function not -; only inserts `@node' lines but also inserts the chapter or section -; titles as the names of the corresponding nodes; and inserts titles -; as node names in pre-existing `@node' lines that lack names. -; -; Since node names should be more concise than section or chapter -; titles, node names so inserted will need to be edited manually. +;; The `texinfo-make-menu' function without an argument creates or +;; updates a menu for the section encompassing the node that follows +;; point. With an argument, it makes or updates menus for the nodes +;; within or part of the marked region. + +;; Whenever an existing menu is updated, the descriptions from +;; that menu are incorporated into the new menu. This is done by copying +;; descriptions from the existing menu to the entries in the new menu +;; that have the same node names. If the node names are different, the +;; descriptions are not copied to the new menu. + +;; Menu entries that refer to other Info files are removed since they +;; are not a node within current buffer. This is a deficiency. + +;; The `texinfo-all-menus-update' function runs `texinfo-make-menu' +;; on the whole buffer. + +;; The `texinfo-master-menu' function creates an extended menu located +;; after the top node. (The file must have a top node.) The function +;; first updates all the regular menus in the buffer (incorporating the +;; descriptions from pre-existing menus), and then constructs a master +;; menu that includes every entry from every other menu. (However, the +;; function cannot update an already existing master menu; if one +;; exists, it must be removed before calling the function.) + +;; The `texinfo-indent-menu-description' function indents every +;; description in the menu following point, to the specified column. +;; Non-nil argument (prefix, if interactive) means indent every +;; description in every menu in the region. This function does not +;; indent second and subsequent lines of a multi-line description. + +;; The `texinfo-insert-node-lines' function inserts `@node' before the +;; `@chapter', `@section', and such like lines of a region in a Texinfo +;; file where the `@node' lines are missing. +;; +;; With a non-nil argument (prefix, if interactive), the function not +;; only inserts `@node' lines but also inserts the chapter or section +;; titles as the names of the corresponding nodes; and inserts titles +;; as node names in pre-existing `@node' lines that lack names. +;; +;; Since node names should be more concise than section or chapter +;; titles, node names so inserted will need to be edited manually. ;;; Code: @@ -170,7 +172,7 @@ are inserted as descriptions." ;; else (message "Making or updating menus in %s... " (buffer-name)) (let ((beginning (region-beginning)) - (region-end (region-end)) + (region-end (region-end)) (level (progn ; find section type following point (goto-char (region-beginning)) (texinfo-hierarchic-level)))) @@ -199,10 +201,10 @@ at the level specified by LEVEL. Point is left at the end of menu." (let* ((case-fold-search t) (beginning - (save-excursion - (goto-char (texinfo-update-menu-region-beginning level)) - (end-of-line) - (point))) + (save-excursion + (goto-char (texinfo-update-menu-region-beginning level)) + (end-of-line) + (point))) (end (texinfo-update-menu-region-end level)) (first (texinfo-menu-first-node beginning end)) (node-name (progn @@ -249,10 +251,10 @@ nodes in the buffer before updating the menus." (sleep-for 2) (push-mark (point-max) t) (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)))) + ;; 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)) (sleep-for 2) @@ -261,7 +263,7 @@ nodes in the buffer before updating the menus." ;; 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)) + (texinfo-make-menu t)) (if master-menu-p (progn @@ -676,8 +678,8 @@ complements the node name rather than repeats it as a title does." ;;; Handling description indentation -; Since the make-menu functions indent descriptions, these functions -; are useful primarily for indenting a single menu specially. +;; Since the make-menu functions indent descriptions, these functions +;; are useful primarily for indenting a single menu specially. (defun texinfo-indent-menu-description (column &optional region-p) "Indent every description in menu following point to COLUMN. @@ -749,7 +751,7 @@ menus in the buffer (incorporating descriptions from pre-existing menus) before it constructs the master menu. The function removes the detailed part of an already existing master -menu. This action depends on the pre-exisitng master menu using the +menu. This action depends on the pre-existing master menu using the standard `texinfo-master-menu-header'. The master menu has the following format, which is adapted from the @@ -893,7 +895,13 @@ However, there does not need to be a title field." ;; Only insert detailed master menu if there is one.... (if (car (car master-menu-list)) - (insert texinfo-master-menu-header)) +;; @detailmenu added 5 Sept 1996 at Karl Berry's request to avert a +;; bug in `makeinfo'; all agree this is a bad kluge and should +;; eventually be removed. @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' + (insert texinfo-master-menu-header)) ;; Now, insert all the other menus @@ -917,10 +925,12 @@ However, there does not need to be a title field." (setq master-menu-list (cdr master-menu-list))) ;; Finish menu - (insert "@end menu\n\n"))) +;; @detailmenu (see note above) + (insert "\n@end detailmenu") + (insert "\n@end menu\n\n"))) (defvar texinfo-master-menu-header - "\n --- The Detailed Node Listing ---\n" + "\n@detailmenu\n --- The Detailed Node Listing ---\n" "String inserted before lower level entries in Texinfo master menu. It comes after the chapter-level menu entries.") @@ -963,11 +973,11 @@ and leave point on the line before the `@end menu' line." ; last `* ' entry (goto-char end-of-menu) ;; handle multi-line description - (if (not (re-search-backward "^\* " nil t)) + (if (not (re-search-backward "^\\* " nil t)) (error "No entries in menu.")) (point)))) (while (< (point) last-entry) - (if (re-search-forward "^\* " end-of-menu t) + (if (re-search-forward "^\\* " end-of-menu t) (progn (setq this-menu-list (cons @@ -975,7 +985,7 @@ and leave point on the line before the `@end menu' line." (point) ;; copy multi-line descriptions (save-excursion - (re-search-forward "\\(^\* \\|^@e\\)" nil t) + (re-search-forward "\\(^\\* \\|^@e\\)" nil t) (- (point) 3))) this-menu-list))))) this-menu-list)) @@ -995,18 +1005,18 @@ error if the node is not the top node and a section is not found." (cond ((re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" ;;; Following search limit by cph but causes a bug -;;; (save-excursion -;;; (end-of-line) -;;; (point)) +;;; (save-excursion +;;; (end-of-line) +;;; (point)) nil t) "top") ((re-search-forward texinfo-section-types-regexp nil t) (buffer-substring-no-properties - (progn (beginning-of-line) ; copy its name - (1+ (point))) - (progn (forward-word 1) - (point)))) + (progn (beginning-of-line) ; copy its name + (1+ (point))) + (progn (forward-word 1) + (point)))) (t (error "texinfo-specific-section-type: Chapter or section not found.")))))) @@ -1257,16 +1267,16 @@ which menu descriptions are indented. Its default value is 32." (message "Done...updated the node. You may save the buffer.")) ;; else (let ((auto-fill-function nil) - (auto-fill-hook nil) + (auto-fill-hook nil) (beginning (region-beginning)) - (end (region-end))) + (end (region-end))) (if (= end beginning) (error "Please mark a region!")) (save-restriction - (narrow-to-region beginning end) - (goto-char beginning) + (narrow-to-region beginning end) + (goto-char beginning) (push-mark (point) t) - (while (re-search-forward "^@node" (point-max) t) + (while (re-search-forward "^@node" (point-max) t) (beginning-of-line) (texinfo-update-the-node)) (message "Done...updated nodes in region. You may save the buffer."))))) @@ -1361,7 +1371,7 @@ Return type of pointer (either 'normal or 'no-pointer). The first and second arguments bound the search for a pointer to the beginning and end, respectively, of the enclosing higher level section. The third argument is a string specifying the general kind -of section such as \"chapter\ or \"section\". When looking for the +of section such as \"chapter\" or \"section\". When looking for the `Next' pointer, the section found will be at the same hierarchical level in the Texinfo file; when looking for the `Previous' pointer, the section found will be at the same or higher hierarchical level in @@ -1446,8 +1456,8 @@ The argument is the kind of section, either normal or no-pointer." (save-excursion (forward-line -3)) t) (setq name (texinfo-copy-node-name))) - ((eq kind 'no-pointer) - (setq name " "))) ; put a blank in the pointer slot + ((eq kind 'no-pointer) + (setq name " "))) ; put a blank in the pointer slot name)) (defun texinfo-insert-pointer (beginning end level direction) @@ -1476,13 +1486,13 @@ towards which the pointer is directed, one of `next, `previous, or ;;; Updating nodes sequentially -; These sequential update functions insert `Next' or `Previous' -; pointers that point to the following or preceding nodes even if they -; are at higher or lower hierarchical levels. This means that if a -; section contains one or more subsections, the section's `Next' -; pointer will point to the subsection and not the following section. -; (The subsection to which `Next' points will most likely be the first -; item on the section's menu.) +;; These sequential update functions insert `Next' or `Previous' +;; pointers that point to the following or preceding nodes even if they +;; are at higher or lower hierarchical levels. This means that if a +;; section contains one or more subsections, the section's `Next' +;; pointer will point to the subsection and not the following section. +;; (The subsection to which `Next' points will most likely be the first +;; item on the section's menu.) ;;;###autoload (defun texinfo-sequential-node-update (&optional region-p) @@ -1513,7 +1523,7 @@ Info `g*' command is inadequate." "Done...sequentially updated the node . You may save the buffer.")) ;; else (let ((auto-fill-function nil) - (auto-fill-hook nil) + (auto-fill-hook nil) (beginning (region-beginning)) (end (region-end))) (if (= end beginning) @@ -1558,7 +1568,7 @@ it is in a different section. Return type of pointer (either 'normal or 'no-pointer). 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 pointer, some level higher. The second argument (one of 'next, 'previous, or 'up) specifies whether to find the `Next', `Previous', @@ -1606,9 +1616,9 @@ string such as \"section\". The second argument is direction, one of ;;; Inserting `@node' lines -; The `texinfo-insert-node-lines' function inserts `@node' lines as needed -; before the `@chapter', `@section', and such like lines of a region -; in a Texinfo file. +;; The `texinfo-insert-node-lines' function inserts `@node' lines as needed +;; before the `@chapter', `@section', and such like lines of a region +;; in a Texinfo file. (defun texinfo-insert-node-lines (beginning end &optional title-p) "Insert missing `@node' lines in region of Texinfo file. @@ -1778,15 +1788,15 @@ Requirements: Thus, normally, each included file contains one, and only one, chapter." -; The menu-list has the form: -; -; \(\(\"node-name1\" . \"title1\"\) -; \(\"node-name2\" . \"title2\"\) ... \) -; -; However, there does not need to be a title field and this function -; does not fill it; however a comment tells you how to do so. -; You would use the title field if you wanted to insert titles in the -; description slot of a menu as a description. +;; The menu-list has the form: +;; +;; \(\(\"node-name1\" . \"title1\"\) +;; \(\"node-name2\" . \"title2\"\) ... \) +;; +;; However, there does not need to be a title field and this function +;; does not fill it; however a comment tells you how to do so. +;; You would use the title field if you wanted to insert titles in the +;; description slot of a menu as a description. (let ((case-fold-search t) menu-list) diff --git a/gnu/usr.bin/texinfo/info/clib.c b/gnu/usr.bin/texinfo/info/clib.c index 733342c2e50..b83b9169fe8 100644 --- a/gnu/usr.bin/texinfo/info/clib.c +++ b/gnu/usr.bin/texinfo/info/clib.c @@ -1,6 +1,7 @@ -/* clib.c: Functions which we normally expect to find in the C library. */ +/* clib.c: Functions which we normally expect to find in the C library. + $Id: clib.c,v 1.1.1.2 1996/12/15 21:38:29 downsj 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. Copyright (C) 1995 Free Software Foundation, Inc. @@ -44,19 +45,6 @@ extern void *xmalloc (), *xrealloc (); extern int errno; #endif -#if !defined (HAVE_STRDUP) -char * -strdup (string) - char *string; -{ - char *result; - - result = (char *)xmalloc (1 + strlen (string)); - strcpy (result, string); - return (result); -} -#endif /* !HAVE_STRDUP */ - #if !defined (HAVE_STRERROR) extern char *sys_errlist[]; extern int sys_nerr; diff --git a/gnu/usr.bin/texinfo/info/info-stnd.texi b/gnu/usr.bin/texinfo/info/info-stnd.texi index bd5ac7d081a..862edde9620 100644 --- a/gnu/usr.bin/texinfo/info/info-stnd.texi +++ b/gnu/usr.bin/texinfo/info/info-stnd.texi @@ -9,6 +9,12 @@ @synindex fn cp @synindex ky cp @comment %**end of header +@comment $Id: info-stnd.texi,v 1.1.1.2 1996/12/15 21:38:46 downsj Exp $ + +@dircategory Texinfo documentation system +@direntry +* info program: (info-stnd). Standalone Info-reading program. +@end direntry @ifinfo This file documents GNU Info, a program for viewing the on-line formatted @@ -17,7 +23,7 @@ documentation for the Info reader that is part of GNU Emacs. If you do not know how to use Info, but have a working Info reader, you should read that documentation first. -Copyright @copyright{} 1992, 1993 Free Software Foundation, Inc. +Copyright @copyright{} 1992, 93, 96 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are diff --git a/gnu/usr.bin/texinfo/info/info-utils.h b/gnu/usr.bin/texinfo/info/info-utils.h index 5ca2e0c15cd..f81ec27bebe 100644 --- a/gnu/usr.bin/texinfo/info/info-utils.h +++ b/gnu/usr.bin/texinfo/info/info-utils.h @@ -1,9 +1,10 @@ -/* 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.1.2 1996/12/15 21:38:50 downsj 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. - Copyright (C) 1993 Free Software Foundation, Inc. + 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 @@ -31,11 +32,6 @@ # define strrchr rindex #endif /* !HAVE_STRCHR */ -#if !defined (HAVE_MEMCPY) -# undef memcpy -# define memcpy(dest, source, count) bcopy(source, dest, count) -#endif /* !HAVE_MEMCPY */ - #include "nodes.h" #include "window.h" #include "search.h" diff --git a/gnu/usr.bin/texinfo/info/info.c b/gnu/usr.bin/texinfo/info/info.c index 0a1d6bce4d8..223df55acb2 100644 --- a/gnu/usr.bin/texinfo/info/info.c +++ b/gnu/usr.bin/texinfo/info/info.c @@ -3,7 +3,7 @@ /* This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993 Free Software Foundation, Inc. + 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 @@ -30,8 +30,8 @@ /* The version numbers of this version of Info. */ int info_major_version = 2; -int info_minor_version = 14; -int info_patch_level = 1; +int info_minor_version = 16; +int info_patch_level = 0; /* Non-zero means search all indices for APROPOS_SEARCH_STRING. */ static int apropos_p = 0; @@ -198,7 +198,11 @@ main (argc, argv) /* If the user specified --version, then show the version and exit. */ if (print_version_p) { - printf ("GNU Info, Version %s, from texinfo-3.7.\n", version_string ()); + printf ("GNU Info (Texinfo 3.9) %s\n", version_string ()); + puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU General Public License.\n\ +For more information about these matters, see the files named COPYING."); exit (0); } @@ -536,15 +540,15 @@ usage () static void info_short_help () { - printf ("%s", "\ + puts ("\ 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\ \n\ --directory DIR Add DIR to INFOPATH.\n\ + --dribble FILENAME Remember user keystrokes in FILENAME.\n\ --file FILENAME Specify Info file to visit.\n\ --node NODENAME Specify nodes in first visited Info file.\n\ --output FILENAME Output selected nodes to FILENAME.\n\ - --dribble FILENAME Remember user keystrokes in FILENAME.\n\ --restore FILENAME Read initial keystrokes from FILENAME.\n\ --subnodes Recursively output menu items.\n\ --help Get this help message.\n\ @@ -553,7 +557,9 @@ description of how to use Info, type `info info options'.\n\ Remaining arguments to Info are treated as the names of menu\n\ 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\ -the path to that node. For example, `info emacs buffers'.\n"); +the path to that node. For example, `info emacs buffers'.\n\ +\n\ +Email bug reports to bug-texinfo@prep.ai.mit.edu."); exit (0); } diff --git a/gnu/usr.bin/texinfo/info/info.texi b/gnu/usr.bin/texinfo/info/info.texi index 6fdb71c710d..5ffa5119e15 100644 --- a/gnu/usr.bin/texinfo/info/info.texi +++ b/gnu/usr.bin/texinfo/info/info.texi @@ -3,16 +3,18 @@ @setfilename info.info @settitle Info 1.0 @comment %**end of header +@comment $Id: info.texi,v 1.1.1.2 1996/12/15 21:38:53 downsj Exp $ -@iftex -@finalout -@end iftex +@dircategory Texinfo documentation system +@direntry +* Info: (info). Documentation browsing system. +@end direntry @ifinfo This file describes how to use Info, the on-line, menu-driven GNU documentation system. -Copyright (C) 1989, 1992 Free Software Foundation, Inc. +Copyright (C) 1989, 92, 96 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -36,7 +38,6 @@ except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end ifinfo -@setchapternewpage odd @titlepage @sp 11 @center @titlefont{Info} @@ -53,8 +54,8 @@ Copyright @copyright{} 1989, 1992, 1993 Free Software Foundation, Inc. @sp 2 Published by the Free Software Foundation @* -675 Massachusetts Avenue, @* -Cambridge, MA 02139 USA @* +59 Temple Place - Suite 330 @* +Boston, MA 02111-1307, USA. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -879,7 +880,7 @@ in your @file{~/.emacs} init file. @xref{Examining, Examining and Setting Variables, Examining and Setting Variables, emacs, The GNU Emacs Manual}. -@table @code +@vtable @code @item Info-enable-edit Set to @code{nil}, disables the @samp{e} (@code{Info-edit}) command. A non-@code{nil} value enables it. @xref{Add, Edit}. @@ -896,7 +897,7 @@ string (directory name) or @code{nil} (try default directory). @item Info-directory The standard directory for Info documentation files. Only used when the function @code{Info-directory} is called. -@end table +@end vtable @node Create an Info File, , Advanced Info, Top @comment node-name, next, previous, up diff --git a/gnu/usr.bin/texinfo/info/infomap.c b/gnu/usr.bin/texinfo/info/infomap.c index 27a959eb517..3f24f1f55d5 100644 --- a/gnu/usr.bin/texinfo/info/infomap.c +++ b/gnu/usr.bin/texinfo/info/infomap.c @@ -266,4 +266,9 @@ initialize_info_keymaps () map['w'].function = info_toggle_wrap; } - +/* Strings which represent the sequence of characters that the arrow keys + produce. If these keys begin with ESC, and the second character of the + sequence does not conflict with an existing binding in the Meta keymap, + then bind the keys to do what C-p, C-n, C-f, and C-b do. */ +extern char *term_ku, *term_kd, *term_kr, *term_kl; + diff --git a/gnu/usr.bin/texinfo/info/session.c b/gnu/usr.bin/texinfo/info/session.c index f26fb006da0..be3076c9ac1 100644 --- a/gnu/usr.bin/texinfo/info/session.c +++ b/gnu/usr.bin/texinfo/info/session.c @@ -3,7 +3,7 @@ /* This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993 Free Software Foundation, Inc. + 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 @@ -278,6 +278,7 @@ initialize_info_session (node) info_error (TERM_TOO_DUMB, term_name); exit (1); } + terminal_clear_screen (); initialize_info_keymaps (); window_initialize_windows (screenwidth, screenheight); @@ -4118,7 +4119,7 @@ info_input_buffer_space_available () if (pop_index > push_index) return (pop_index - push_index); else - return (sizeof (info_input_buffer - (push_index - pop_index))); + return (sizeof (info_input_buffer) - (push_index - pop_index)); } /* Get a key from the buffer of characters to be read. @@ -4168,6 +4169,7 @@ info_replace_key_to_typeahead (key) void info_gather_typeahead () { + register int i = 0; int tty, space_avail; long chars_avail; unsigned char input[MAX_INFO_INPUT_BUFFERING]; @@ -4205,13 +4207,11 @@ info_gather_typeahead () # endif /* O_NDELAY */ #endif /* !FIONREAD */ - /* Store the input characters just read into our input buffer. */ - { - register int i; - - for (i = 0; i < chars_avail; i++) + while (i < chars_avail) + { info_push_typeahead (input[i]); - } + i++; + } } /* How to read a single character. */ diff --git a/gnu/usr.bin/texinfo/info/termdep.h b/gnu/usr.bin/texinfo/info/termdep.h index 4784b7ab7ee..10786bc9265 100644 --- a/gnu/usr.bin/texinfo/info/termdep.h +++ b/gnu/usr.bin/texinfo/info/termdep.h @@ -1,9 +1,10 @@ -/* termdep.h -- System things that terminal.c depends on. */ +/* termdep.h -- System things that terminal.c depends on. + $Id: termdep.h,v 1.1.1.2 1996/12/15 21:39:06 downsj 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. - Copyright (C) 1993 Free Software Foundation, Inc. + 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 @@ -30,25 +31,36 @@ # include #endif /* !HAVE_SYS_FCNTL_H */ -#if defined (HAVE_TERMIO_H) -# include -# include -# if defined (HAVE_SYS_PTEM_H) -# if defined (M_UNIX) || !defined (M_XENIX) -# include -# include -# undef TIOCGETC -# else /* M_XENIX */ -# define tchars tc -# endif /* M_XENIX */ -# endif /* HAVE_SYS_PTEM_H */ -#else /* !HAVE_TERMIO_H */ -# if defined (HAVE_SYS_FILE_H) -# include -# endif /* HAVE_SYS_FILE_H */ -# include +#if defined (HAVE_SYS_FILE_H) +# include +#endif /* HAVE_SYS_FILE_H */ + +#if defined (HAVE_STRINGS_H) # include -#endif /* !HAVE_TERMIO_H */ +#else +# if defined (HAVE_STRING_H) +# include +# endif +#endif + +#if defined (HAVE_TERMIOS_H) +# include +#else +# if defined (HAVE_TERMIO_H) +# include +# if defined (HAVE_SYS_PTEM_H) +# if defined (M_UNIX) || !defined (M_XENIX) +# include +# include +# undef TIOCGETC +# else /* M_XENIX */ +# define tchars tc +# endif /* M_XENIX */ +# endif /* HAVE_SYS_PTEM_H */ +# else /* !HAVE_TERMIO_H */ +# include +# endif /* !HAVE_TERMIO_H */ +#endif /* !HAVE_TERMIOS_H */ #if defined (HAVE_SYS_TTOLD_H) # include @@ -61,9 +73,4 @@ # define strrchr rindex #endif /* !HAVE_STRCHR */ -#if !defined (HAVE_MEMCPY) -#undef memcpy -#define memcpy(dest, source, count) bcopy(source, dest, count) -#endif /* !HAVE_MEMCPY */ - #endif /* _TERMDEP_H_ */ diff --git a/gnu/usr.bin/texinfo/info/terminal.c b/gnu/usr.bin/texinfo/info/terminal.c index e51c8765141..9c1017696c6 100644 --- a/gnu/usr.bin/texinfo/info/terminal.c +++ b/gnu/usr.bin/texinfo/info/terminal.c @@ -6,8 +6,7 @@ This file has appeared in prior works by the Free Software Foundation; thus it carries copyright dates from 1988 through 1993. - Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software - Foundation, Inc. + Copyright (C) 1988, 89, 90, 91, 92, 93, 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 @@ -166,7 +165,10 @@ int terminal_use_visible_bell_p = 0; int terminal_can_scroll = 0; /* The key sequences output by the arrow keys, if this terminal has any. */ -char *term_ku, *term_kd, *term_kr, *term_kl; +char *term_ku = (char *)NULL; +char *term_kd = (char *)NULL; +char *term_kr = (char *)NULL; +char *term_kl = (char *)NULL; /* Move the cursor to the terminal location of X and Y. */ void @@ -595,15 +597,19 @@ struct tchars original_tchars; struct ltchars original_ltchars; #endif -#if defined (HAVE_TERMIO_H) +#if defined (HAVE_TERMIOS_H) +struct termios original_termios, ttybuff; +#else +# if defined (HAVE_TERMIO_H) /* A buffer containing the terminal mode flags upon entry to info. */ struct termio original_termio, ttybuff; -#else /* !HAVE_TERMIO_H */ +# else /* !HAVE_TERMIO_H */ /* Buffers containing the terminal mode flags upon entry to info. */ int original_tty_flags = 0; int original_lmode; struct sgttyb ttybuff; -#endif /* !HAVE_TERMIO_H */ +# endif /* !HAVE_TERMIO_H */ +#endif /* !HAVE_TERMIOS_H */ /* Prepare to start using the terminal to read characters singly. */ void @@ -619,9 +625,17 @@ terminal_prep_terminal () tty = fileno (stdin); -#if defined (HAVE_TERMIO_H) +#if defined (HAVE_TERMIOS_H) + tcgetattr (tty, &original_termios); + tcgetattr (tty, &ttybuff); +#else +# if defined (HAVE_TERMIO_H) ioctl (tty, TCGETA, &original_termio); ioctl (tty, TCGETA, &ttybuff); +# endif +#endif + +#if defined (HAVE_TERMIOS_H) || defined (HAVE_TERMIO_H) ttybuff.c_iflag &= (~ISTRIP & ~INLCR & ~IGNCR & ~ICRNL & ~IXON); ttybuff.c_oflag &= (~ONLCR & ~OCRNL); ttybuff.c_lflag &= (~ICANON & ~ECHO); @@ -634,22 +648,28 @@ terminal_prep_terminal () if (ttybuff.c_cc[VQUIT] == '\177') ttybuff.c_cc[VQUIT] = -1; +#endif +#if defined (HAVE_TERMIOS_H) + tcsetattr (tty, TCSANOW, &ttybuff); +#else +# if defined (HAVE_TERMIO_H) ioctl (tty, TCSETA, &ttybuff); +# endif +#endif -#else /* !HAVE_TERMIO_H */ - +#if !defined (HAVE_TERMIOS_H) && !defined (HAVE_TERMIO_H) ioctl (tty, TIOCGETP, &ttybuff); if (!original_tty_flags) original_tty_flags = ttybuff.sg_flags; /* Make this terminal pass 8 bits around while we are using it. */ -#if defined (PASS8) +# if defined (PASS8) ttybuff.sg_flags |= PASS8; -#endif /* PASS8 */ +# endif /* PASS8 */ -#if defined (TIOCLGET) && defined (LPASS8) +# if defined (TIOCLGET) && defined (LPASS8) { int flags; ioctl (tty, TIOCLGET, &flags); @@ -657,9 +677,9 @@ terminal_prep_terminal () flags |= LPASS8; ioctl (tty, TIOCLSET, &flags); } -#endif /* TIOCLGET && LPASS8 */ +# endif /* TIOCLGET && LPASS8 */ -#if defined (TIOCGETC) +# if defined (TIOCGETC) { struct tchars temp; @@ -682,9 +702,9 @@ terminal_prep_terminal () ioctl (tty, TIOCSETC, &temp); } -#endif /* TIOCGETC */ +# endif /* TIOCGETC */ -#if defined (TIOCGLTC) +# if defined (TIOCGLTC) { struct ltchars temp; @@ -697,12 +717,12 @@ terminal_prep_terminal () temp.t_flushc = -1; /* C-o. */ ioctl (tty, TIOCSLTC, &temp); } -#endif /* TIOCGLTC */ +# endif /* TIOCGLTC */ ttybuff.sg_flags &= ~ECHO; ttybuff.sg_flags |= CBREAK; ioctl (tty, TIOCSETN, &ttybuff); -#endif /* !HAVE_TERMIO_H */ +#endif /* !HAVE_TERMIOS_H && !HAVE_TERMIO_H */ } /* Restore the tty settings back to what they were before we started using @@ -720,26 +740,30 @@ terminal_unprep_terminal () tty = fileno (stdin); -#if defined (HAVE_TERMIO_H) +#if defined (HAVE_TERMIOS_H) + tcsetattr (tty, TCSANOW, &original_termios); +#else +# if defined (HAVE_TERMIO_H) ioctl (tty, TCSETA, &original_termio); -#else /* !HAVE_TERMIO_H */ +# else /* !HAVE_TERMIO_H */ ioctl (tty, TIOCGETP, &ttybuff); ttybuff.sg_flags = original_tty_flags; ioctl (tty, TIOCSETN, &ttybuff); -#if defined (TIOCGETC) +# if defined (TIOCGETC) ioctl (tty, TIOCSETC, &original_tchars); -#endif /* TIOCGETC */ +# endif /* TIOCGETC */ -#if defined (TIOCGLTC) +# if defined (TIOCGLTC) ioctl (tty, TIOCSLTC, &original_ltchars); -#endif /* TIOCGLTC */ +# endif /* TIOCGLTC */ -#if defined (TIOCLGET) && defined (LPASS8) +# if defined (TIOCLGET) && defined (LPASS8) ioctl (tty, TIOCLSET, &original_lmode); -#endif /* TIOCLGET && LPASS8 */ +# endif /* TIOCLGET && LPASS8 */ -#endif /* !HAVE_TERMIO_H */ +# endif /* !HAVE_TERMIO_H */ +#endif /* !HAVE_TERMIOS_H */ terminal_end_using_terminal (); } diff --git a/gnu/usr.bin/texinfo/info/terminal.h b/gnu/usr.bin/texinfo/info/terminal.h index f60574f31c8..7cb115835c6 100644 --- a/gnu/usr.bin/texinfo/info/terminal.h +++ b/gnu/usr.bin/texinfo/info/terminal.h @@ -3,7 +3,7 @@ /* This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993 Free Software Foundation, Inc. + 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 @@ -123,4 +123,7 @@ extern VFunction *terminal_scroll_terminal_hook; extern void terminal_ring_bell (); extern VFunction *terminal_ring_bell_hook; +/* The key sequences output by the arrow keys, if this terminal has any. */ +extern char *term_ku, *term_kd, *term_kr, *term_kl; + #endif /* !_TERMINAL_H_ */ diff --git a/gnu/usr.bin/texinfo/info/tilde.c b/gnu/usr.bin/texinfo/info/tilde.c index df2f6dcde18..fdb5d1e0e14 100644 --- a/gnu/usr.bin/texinfo/info/tilde.c +++ b/gnu/usr.bin/texinfo/info/tilde.c @@ -1,13 +1,10 @@ -/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */ +/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). + $Id: tilde.c,v 1.1.1.2 1996/12/15 21:39:09 downsj 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. - This file has appeared in prior works by the Free Software Foundation; - thus it carries copyright dates from 1988 through 1993. - - Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software - Foundation, Inc. + Copyright (C) 1988, 89, 90, 91, 92, 93, 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 @@ -225,7 +222,8 @@ tilde_expand_word (filename) if (!dirname[1] || dirname[1] == '/') { /* Prepend $HOME to the rest of the string. */ - char *temp_home = (char *)getenv ("HOME"); + extern char *getenv (); + char *temp_home = getenv ("HOME"); /* If there is no HOME variable, look up the directory in the password database. */ diff --git a/gnu/usr.bin/texinfo/install-sh b/gnu/usr.bin/texinfo/install-sh new file mode 100644 index 00000000000..2c212ccf4ae --- /dev/null +++ b/gnu/usr.bin/texinfo/install-sh @@ -0,0 +1,250 @@ +#! /bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/gnu/usr.bin/texinfo/libtxi/Makefile.in b/gnu/usr.bin/texinfo/libtxi/Makefile.in index 8474091d758..ef23593c0a0 100644 --- a/gnu/usr.bin/texinfo/libtxi/Makefile.in +++ b/gnu/usr.bin/texinfo/libtxi/Makefile.in @@ -1,5 +1,7 @@ # Makefile for GNU texinfo/libtxi. -*- Indented-Text -*- -# Copyright (C) 1993 Free Software Foundation, Inc. +# $Id: Makefile.in,v 1.1.1.2 1996/12/15 21:39:15 downsj 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 @@ -15,53 +17,30 @@ # 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@ VPATH = $(srcdir) CC = @CC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -LN = ln -RM = rm -f -TAR = tar -MKDIR = mkdir -COMPRESS= compress - +AR = ar RANLIB = @RANLIB@ DEFS = @DEFS@ LIBS = @LIBS@ LOADLIBES = $(LIBS) -# This is normally inherited from parent make, but if someone wants to -# build libtxi.a alone, this variable will still be properly defined. -ALLOCA = @ALLOCA@ - -SHELL = /bin/sh - CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = $(exec_prefix)/bin -# Prefix for each installed program, normally empty or `g'. -binprefix = -libdir = $(prefix)/lib -# Prefix for each installed man page, normally empty or `g'. -manprefix = -mandir = $(prefix)/man/man1 -manext = 1 -infodir = $(prefix)/info +# This is normally inherited from parent make, but if someone wants to +# build libtxi.a alone, this variable will still be properly defined. +ALLOCA = @ALLOCA@ -#### End of system configuration section. #### +# Standard functions that may be missing. +LIBOBJS = @LIBOBJS@ -SRCS = getopt.c getopt.h getopt1.c bzero.c -OBJS = getopt.o getopt1.o bzero.o $(ALLOCA) +SRCS = getopt.c getopt1.c bzero.c getopt.h +OBJS = getopt.o getopt1.o bzero.o $(ALLOCA) $(LIBOBJS) PROGS = libtxi.a @@ -72,8 +51,9 @@ sub-all: all $(CC) -c $(CPPFLAGS) -I. -I$(srcdir) $(DEFS) $(CFLAGS) $< libtxi.a: $(OBJS) - ar qcv libtxi.a $(OBJS) - $(RANLIB) libtxi.a + rm -f $@ + $(AR) cq $@ $(OBJS) + $(RANLIB) $@ getopt.o: getopt.c getopt.h getopt1.o: getopt1.c getopt.h @@ -91,15 +71,12 @@ clean: mostlyclean: clean distclean: clean - rm -f Makefile config.status + rm -f Makefile config.status TAGS ID realclean: distclean - rm -f TAGS Makefile: Makefile.in ../config.status - cd ..; sh config.status + cd .. && sh config.status # Prevent GNU make v3 from overflowing arg limit on SysV. .NOEXPORT: - -# eof diff --git a/gnu/usr.bin/texinfo/libtxi/alloca.c b/gnu/usr.bin/texinfo/libtxi/alloca.c index 7020f32c882..8f98b73dbb9 100644 --- a/gnu/usr.bin/texinfo/libtxi/alloca.c +++ b/gnu/usr.bin/texinfo/libtxi/alloca.c @@ -25,6 +25,13 @@ #include #endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + #ifdef emacs #include "blockinput.h" #endif @@ -66,7 +73,9 @@ typedef void *pointer; typedef char *pointer; #endif +#ifndef NULL #define NULL 0 +#endif /* Different portions of Emacs need to call different versions of malloc. The Emacs executable needs alloca to call xmalloc, because @@ -171,7 +180,7 @@ alloca (size) #endif /* Reclaim garbage, defined as all alloca'd storage that - was allocated from deeper in the stack than currently. */ + was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ @@ -209,6 +218,9 @@ alloca (size) register pointer new = malloc (sizeof (header) + size); /* Address of header. */ + if (new == 0) + abort(); + ((header *) new)->h.next = last_alloca_header; ((header *) new)->h.deep = depth; @@ -338,7 +350,7 @@ struct stk_trailer #ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. - I doubt that "lint" will like this much. */ + I doubt that "lint" will like this much. */ static long i00afunc (long *address) diff --git a/gnu/usr.bin/texinfo/libtxi/memcpy.c b/gnu/usr.bin/texinfo/libtxi/memcpy.c new file mode 100644 index 00000000000..521625464cd --- /dev/null +++ b/gnu/usr.bin/texinfo/libtxi/memcpy.c @@ -0,0 +1,20 @@ +/* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined + if the source overlaps with the destination. + Return DESTADDR. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +char * +memcpy (destaddr, srcaddr, len) + char *destaddr; + const char *srcaddr; + int len; +{ + char *dest = destaddr; + + while (len-- > 0) + *destaddr++ = *srcaddr++; + return dest; +} diff --git a/gnu/usr.bin/texinfo/libtxi/memmove.c b/gnu/usr.bin/texinfo/libtxi/memmove.c new file mode 100644 index 00000000000..d7bdd7cd995 --- /dev/null +++ b/gnu/usr.bin/texinfo/libtxi/memmove.c @@ -0,0 +1,24 @@ +/* memmove.c -- copy memory. + Copy LENGTH bytes from SOURCE to DEST. Does not null-terminate. + In the public domain. + By David MacKenzie . */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +void +memmove (dest, source, length) + char *dest; + const char *source; + unsigned length; +{ + if (source < dest) + /* Moving from low mem to hi mem; start at end. */ + for (source += length, dest += length; length; --length) + *--dest = *--source; + else if (source != dest) + /* Moving from hi mem to low mem; start at beginning. */ + for (; length; --length) + *dest++ = *source++; +} diff --git a/gnu/usr.bin/texinfo/libtxi/strdup.c b/gnu/usr.bin/texinfo/libtxi/strdup.c new file mode 100644 index 00000000000..1d60f13948a --- /dev/null +++ b/gnu/usr.bin/texinfo/libtxi/strdup.c @@ -0,0 +1,43 @@ +/* strdup.c -- return a newly allocated copy of a string + Copyright (C) 1990 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, + 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef STDC_HEADERS +#include +#include +#else +char *malloc (); +char *strcpy (); +#endif + +/* Return a newly allocated copy of STR, + or 0 if out of memory. */ + +char * +strdup (str) + const char *str; +{ + char *newstr; + + newstr = (char *) malloc (strlen (str) + 1); + if (newstr) + strcpy (newstr, str); + return newstr; +} diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile.in b/gnu/usr.bin/texinfo/makeinfo/Makefile.in index 03f8359247f..160d0ab8e58 100644 --- a/gnu/usr.bin/texinfo/makeinfo/Makefile.in +++ b/gnu/usr.bin/texinfo/makeinfo/Makefile.in @@ -1,5 +1,7 @@ -# Makefile for GNU makeinfo. -*- Indented-Text -*- -# Copyright (C) 1993 Free Software Foundation, Inc. +# Makefile for GNU makeinfo. +# $Id: Makefile.in,v 1.1.1.3 1996/12/15 21:39:21 downsj 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 @@ -29,9 +31,7 @@ INSTALL_DATA = @INSTALL_DATA@ LN = ln RM = rm -f -TAR = tar MKDIR = mkdir -COMPRESS= compress DEFS = @DEFS@ LIBS = -L../libtxi -ltxi @LIBS@ @@ -47,17 +47,12 @@ exec_prefix = @exec_prefix@ bindir = $(exec_prefix)/bin # Prefix for each installed program, normally empty or `g'. binprefix = -libdir = $(prefix)/lib -# Prefix for each installed man page, normally empty or `g'. -manprefix = -mandir = $(prefix)/man/man1 -manext = 1 infodir = $(prefix)/info #### End of system configuration section. #### -SRCS = makeinfo.c -OBJS = makeinfo.o +SRCS = makeinfo.c multi.c +OBJS = makeinfo.o multi.o PROGS = makeinfo @@ -71,24 +66,27 @@ makeinfo: $(OBJS) ../libtxi/libtxi.a $(CC) $(LDFLAGS) -o makeinfo $(OBJS) $(LOADLIBES) ../libtxi/libtxi.a: - (cd ../libtxi; $(MAKE) $(MFLAGS) libtxi.a) + (cd ../libtxi && $(MAKE) $(MFLAGS) libtxi.a) makeinfo.o: makeinfo.c $(common)/getopt.h -makeinfo.info: ./makeinfo makeinfo.texi macro.texi +$(OBJS): makeinfo.h + +info makeinfo.info: ./makeinfo makeinfo.texi #macro.texi ./makeinfo --no-split -I$(srcdir) makeinfo.texi # makeinfo.texi: ./makeinfo makeinfo.mki # ./makeinfo -E makeinfo.texi -I$(srcdir) makeinfo.mki -makeinfo.dvi: ./makeinfo makeinfo.texi macro.texi - ./makeinfo -E makeinfo.txi -I$(srcdir) makeinfo.texi +dvi makeinfo.dvi: ./makeinfo makeinfo.texi #macro.texi $(srcdir)/../util/texi2dvi makeinfo.txi install: all - for f in $(PROGS); do $(INSTALL_PROGRAM) $$f $(bindir)/$(binprefix)$$f; done + $(INSTALL_PROGRAM) makeinfo $(bindir)/$(binprefix)makeinfo -d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info - + $(POST_INSTALL) + ../util/install-info --info-dir=$(infodir) $(infodir)/makeinfo.info + uninstall: for f in $(PROGS); do rm -f $(bindir)/$(binprefix)$$f; done rm -f $(infodir)/makeinfo.info @@ -105,11 +103,10 @@ distclean: clean rm -f TAGS Makefile config.status *.info */*.info realclean: distclean +maintainer-clean: distclean Makefile: Makefile.in ../config.status - cd ..; sh config.status + cd .. && sh config.status # Prevent GNU make v3 from overflowing arg limit on SysV. .NOEXPORT: - -# eof diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c index 78014935357..a3bd34b3702 100644 --- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c +++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c @@ -1,34 +1,27 @@ /* Makeinfo -- convert texinfo format files into info files. + $Id: makeinfo.c,v 1.1.1.3 1996/12/15 21:39:24 downsj Exp $ - Copyright (C) 1987, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 1987, 92, 93, 94, 95, 96 Free Software Foundation, Inc. - This file is part of GNU Info. + 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. - Makeinfo is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY. No author or distributor accepts - responsibility to anyone for the consequences of using it or for - whether it serves any particular purpose or works at all, unless he - says so in writing. Refer to the GNU Emacs General Public License - for full details. + 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. - Everyone is granted permission to copy, modify and redistribute - Makeinfo, but only under the conditions described in the GNU Emacs - General Public License. A copy of this license is supposed to - have been given to you along with GNU Emacs so you can know your - rights and responsibilities. It should be in a file named COPYING. - Among other things, the copyright notice and this notice must be - preserved on all copies. */ - -/* This is Makeinfo version 1.64. If you change the version number of - Makeinfo, please change it here and at the lines reading: - - int major_version = 1; - int minor_version = 64; - - in the code below. + 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. Makeinfo is authored by Brian Fox (bfox@ai.mit.edu). */ +int major_version = 1; +int minor_version = 67; + /* You can change some of the behaviour of Makeinfo by changing the following defines: */ @@ -56,15 +49,10 @@ newlines in the input file (i.e., one or more blank lines). */ #define DEFAULT_PARAGRAPH_SPACING 1 -/* Define HAVE_MACROS to enable the macro facility of TeXinfo. Using this +/* Define HAVE_MACROS to enable the macro facility of Texinfo. Using this facility, users can create their own command procedures with arguments. */ #define HAVE_MACROS -/* **************************************************************** */ -/* */ -/* Include File Declarations */ -/* */ -/* **************************************************************** */ /* Indent #pragma so that older Cpp's don't try to parse it. */ #if defined (_AIX) @@ -135,9 +123,8 @@ int array_len (); void free_array (); static void isolate_nodename (); -#if !defined (HAVE_MEMMOVE) -# define memmove(dst, src, len) bcopy (src, dst, len) -#endif +#define COMPILING_MAKEINFO +#include "makeinfo.h" /* Non-zero means that we are currently hacking the insides of an insertion which would use a fixed width font. */ @@ -180,69 +167,6 @@ void maybe_write_itext (), me_execute_string (); /* Some systems don't declare this function in pwd.h. */ struct passwd *getpwnam (); - - -/* **************************************************************** */ -/* */ -/* Global Defines */ -/* */ -/* **************************************************************** */ - -/* Error levels */ -#define NO_ERROR 0 -#define SYNTAX 2 -#define FATAL 4 - -/* C's standard macros don't check to make sure that the characters being - changed are within range. So I have to check explicitly. */ - -/* GNU Library doesn't have toupper(). Until GNU gets this fixed, I will - have to do it. */ -#ifndef toupper -#define toupper(c) ((c) - 32) -#endif - -#define coerce_to_upper(c) ((islower(c) ? toupper(c) : (c))) -#define coerce_to_lower(c) ((isupper(c) ? tolower(c) : (c))) - -#define control_character_bit 0x40 /* %01000000, must be off. */ -#define meta_character_bit 0x080/* %10000000, must be on. */ -#define CTL(c) ((c) & (~control_character_bit)) -#define UNCTL(c) coerce_to_upper(((c)|control_character_bit)) -#define META(c) ((c) | (meta_character_bit)) -#define UNMETA(c) ((c) & (~meta_character_bit)) - -#define whitespace(c) (((c) == '\t') || ((c) == ' ')) -#define sentence_ender(c) ((c) == '.' || (c) == '?' || (c) == '!') -#define cr_or_whitespace(c) (((c) == '\t') || ((c) == ' ') || ((c) == '\n')) - -#ifndef isletter -#define isletter(c) (((c) >= 'A' && (c) <= 'Z') || ((c) >= 'a' && (c) <= 'z')) -#endif - -#ifndef isupper -#define isupper(c) ((c) >= 'A' && (c) <= 'Z') -#endif - -#ifndef isdigit -#define isdigit(c) ((c) >= '0' && (c) <= '9') -#endif - -#ifndef digit_value -#define digit_value(c) ((c) - '0') -#endif - -#define member(c, s) (strchr (s, c) != NULL) - -#define COMMAND_PREFIX '@' - -/* Stuff for splitting large files. */ -#define SPLIT_SIZE_THRESHOLD 70000 /* What's good enough for Stallman... */ -#define DEFAULT_SPLIT_SIZE 50000 /* Is probably good enough for me. */ -int splitting = 1; /* Always true for now. */ - -typedef void COMMAND_FUNCTION (); /* So I can say COMMAND_FUNCTION *foo; */ - /* **************************************************************** */ /* */ @@ -253,37 +177,6 @@ typedef void COMMAND_FUNCTION (); /* So I can say COMMAND_FUNCTION *foo; */ /* Global pointer to argv[0]. */ char *progname; -/* The current input file state. */ -char *input_filename; -char *input_text; -int size_of_input_text; -int input_text_offset; -int line_number; - -#define curchar() input_text[input_text_offset] - -#define command_char(c) ((!whitespace(c)) && \ - ((c) != '\n') && \ - ((c) != '{') && \ - ((c) != '}') && \ - ((c) != '=')) - -#define skip_whitespace() while (input_text_offset != size_of_input_text \ - && whitespace(curchar()))\ - input_text_offset++ - -#define skip_whitespace_and_newlines() \ - do { \ - while (input_text_offset != size_of_input_text \ - && (whitespace (curchar ()) \ - || (curchar () == '\n'))) \ - { \ - if (curchar () == '\n') \ - line_number++; \ - input_text_offset++; \ - } \ - } while (0) - /* Return non-zero if STRING is the text at input_text + input_text_offset, else zero. */ #define looking_at(string) \ @@ -309,18 +202,6 @@ FILE *output_stream; /* Position in the output file. */ int output_position; -/* Output paragraph buffer. */ -unsigned char *output_paragraph; - -/* Offset into OUTPUT_PARAGRAPH. */ -int output_paragraph_offset; - -/* The output paragraph "cursor" horizontal position. */ -int output_column = 0; - -/* Non-zero means output_paragraph contains text. */ -int paragraph_is_open = 0; - #define INITIAL_PARAGRAPH_SPACE 5000 int paragraph_buffer_len = INITIAL_PARAGRAPH_SPACE; @@ -335,12 +216,6 @@ int non_splitting_words = 0; /* Non-zero indicates that filling a line also indents the new line. */ int indented_fill = 0; -/* The column at which long lines are broken. */ -int fill_column = 72; - -/* The amount of indentation to apply at the start of each line. */ -int current_indent = 0; - /* The amount of indentation to add at the starts of paragraphs. 0 means don't change existing indentation at paragraph starts. > 0 is amount to indent new paragraphs by. @@ -500,6 +375,9 @@ NODE_REF *node_references = (NODE_REF *) NULL; /* Flag which tells us whether to examine menu lines or not. */ int in_menu = 0; +/* Flag which tells us how to examine menu lines. */ +int in_detailmenu = 0; + /* Non-zero means that we have seen "@top" once already. */ int top_node_seen = 0; @@ -548,6 +426,7 @@ typedef struct brace_element struct brace_element *next; COMMAND_FUNCTION *proc; int pos, line; + int in_fixed_width_font; } BRACE_ELEMENT; BRACE_ELEMENT *brace_stack = (BRACE_ELEMENT *) NULL; @@ -557,6 +436,8 @@ BRACE_ELEMENT *brace_stack = (BRACE_ELEMENT *) NULL; extern char *strdup (); #endif /* HAVE_STRDUP */ +extern void do_multitable (); + void print_version_info (); void usage (); void push_node_filename (), pop_node_filename (); @@ -578,20 +459,22 @@ void reader_loop (), read_command (); void remember_brace (), remember_brace_1 (); void pop_and_call_brace (), discard_braces (); void add_word_args (), add_word (), add_char (), insert (), flush_output (); +void insert_string (); void close_paragraph_with_lines (), close_paragraph (); void ignore_blank_line (); void do_flush_right_indentation (); void start_paragraph (), indent (); - -void insert_self (), cm_ignore_line (); + +void insert_self (), insert_space (), cm_ignore_line (); void - cm_asterisk (), cm_dots (), cm_bullet (), cm_TeX (), - cm_copyright (), cm_code (), cm_samp (), cm_file (), cm_kbd (), - cm_key (), cm_ctrl (), cm_var (), cm_dfn (), cm_emph (), cm_strong (), - cm_cite (), cm_italic (), cm_bold (), cm_roman (), cm_title (), cm_w (), - cm_refill (), cm_titlefont (); + cm_TeX (), cm_asterisk (), cm_bullet (), cm_cite (), + cm_code (), cm_copyright (), cm_ctrl (), cm_dfn (), cm_dircategory (), + cm_direntry (), cm_dots (), cm_emph (), cm_enddots (), + cm_kbd (), cm_angle_brackets (), cm_no_op (), cm_not_fixed_width (), + cm_strong (), cm_var (), cm_w (); +/* Sectioning. */ void cm_chapter (), cm_unnumbered (), cm_appendix (), cm_top (), cm_section (), cm_unnumberedsec (), cm_appendixsec (), @@ -600,23 +483,24 @@ void cm_heading (), cm_chapheading (), cm_subheading (), cm_subsubheading (), cm_majorheading (), cm_raisesections (), cm_lowersections (); -/* All @defxxx commands map to cm_defun (). */ -void cm_defun (); +/* All @defxxx commands map to cm_defun, most accent commands map to + cm_accent, most non-English letters map to cm_special_char. */ +void cm_defun (), cm_accent (), cm_special_char (), cm_dotless (); void cm_node (), cm_menu (), cm_xref (), cm_ftable (), cm_vtable (), cm_pxref (), cm_inforef (), cm_quotation (), cm_display (), cm_itemize (), - cm_enumerate (), cm_table (), cm_itemx (), cm_noindent (), cm_setfilename (), - cm_br (), cm_sp (), cm_page (), cm_group (), cm_center (), cm_include (), - cm_bye (), cm_item (), cm_end (), cm_infoinclude (), cm_ifinfo (), - cm_kindex (), cm_cindex (), cm_findex (), cm_pindex (), cm_vindex (), - cm_tindex (), cm_asis (), cm_synindex (), cm_printindex (), cm_minus (), - cm_footnote (), cm_force_abbreviated_whitespace (), cm_example (), - cm_smallexample (), cm_lisp (), cm_format (), cm_exdent (), cm_defindex (), - cm_defcodeindex (), cm_sc (), cm_result (), cm_expansion (), cm_equiv (), - cm_print (), cm_error (), cm_point (), cm_today (), cm_flushleft (), - cm_flushright (), cm_smalllisp (), cm_finalout (), cm_math (), - cm_cartouche (), cm_ignore_sentence_ender (); + cm_enumerate (), cm_tab (), cm_table (), cm_itemx (), cm_noindent (), + cm_setfilename (), cm_br (), cm_sp (), cm_page (), cm_group (), + cm_center (), cm_include (), cm_bye (), cm_item (), cm_end (), + cm_ifinfo (), cm_kindex (), cm_cindex (), + cm_findex (), cm_pindex (), cm_vindex (), cm_tindex (), + cm_synindex (), cm_printindex (), cm_minus (), cm_footnote (), + cm_example (), cm_smallexample (), cm_lisp (), cm_format (), cm_exdent (), + cm_defindex (), cm_defcodeindex (), cm_sc (), cm_result (), cm_expansion (), + cm_equiv (), cm_print (), cm_error (), cm_point (), cm_today (), + cm_flushleft (), cm_flushright (), cm_smalllisp (), cm_finalout (), + cm_cartouche (), cm_detailmenu (), cm_multitable (); /* Conditionals. */ void cm_set (), cm_clear (), cm_ifset (), cm_ifclear (); @@ -631,8 +515,8 @@ void cm_macro (), cm_unmacro (); void cm_paragraphindent (), cm_footnotestyle (); /* Internals. */ -void do_nothing (), command_name_condition (); -void misplaced_brace (), cm_obsolete (); +void command_name_condition (), misplaced_brace (), cm_obsolete (), + cm_ideprecated (); typedef struct { @@ -649,31 +533,48 @@ int user_command_array_len = 0; #define BRACE_ARGS 1 static COMMAND CommandTable[] = { - { "!", cm_ignore_sentence_ender, NO_BRACE_ARGS }, + { "\t", insert_space, NO_BRACE_ARGS }, + { "\n", insert_space, NO_BRACE_ARGS }, + { " ", insert_self, NO_BRACE_ARGS }, + { "!", insert_self, NO_BRACE_ARGS }, + { "\"", insert_self, NO_BRACE_ARGS }, { "'", insert_self, NO_BRACE_ARGS }, { "*", cm_asterisk, NO_BRACE_ARGS }, - { ".", cm_ignore_sentence_ender, NO_BRACE_ARGS }, - { ":", cm_force_abbreviated_whitespace, NO_BRACE_ARGS }, - { "?", cm_ignore_sentence_ender, NO_BRACE_ARGS }, - { "|", do_nothing, NO_BRACE_ARGS }, + { ",", cm_accent, BRACE_ARGS }, + { "-", cm_no_op, NO_BRACE_ARGS }, + { ".", insert_self, NO_BRACE_ARGS }, + { ":", cm_no_op, NO_BRACE_ARGS }, + { "=", insert_self, NO_BRACE_ARGS }, + { "?", insert_self, NO_BRACE_ARGS }, { "@", insert_self, NO_BRACE_ARGS }, - { " ", insert_self, NO_BRACE_ARGS }, - { "\n", insert_self, NO_BRACE_ARGS }, - { "TeX", cm_TeX, BRACE_ARGS }, + { "^", insert_self, NO_BRACE_ARGS }, { "`", insert_self, NO_BRACE_ARGS }, + { "{", insert_self, NO_BRACE_ARGS }, + { "|", cm_no_op, NO_BRACE_ARGS }, + { "}", insert_self, NO_BRACE_ARGS }, + { "~", insert_self, NO_BRACE_ARGS }, + { "AA", insert_self, BRACE_ARGS }, + { "AE", insert_self, BRACE_ARGS }, + { "H", cm_accent, BRACE_ARGS }, + { "L", cm_special_char, BRACE_ARGS }, + { "O", cm_special_char, BRACE_ARGS }, + { "OE", insert_self, BRACE_ARGS }, + { "TeX", cm_TeX, BRACE_ARGS }, + { "aa", insert_self, BRACE_ARGS }, + { "ae", insert_self, BRACE_ARGS }, { "appendix", cm_appendix, NO_BRACE_ARGS }, { "appendixsection", cm_appendixsec, NO_BRACE_ARGS }, { "appendixsec", cm_appendixsec, NO_BRACE_ARGS }, { "appendixsubsec", cm_appendixsubsec, NO_BRACE_ARGS }, { "appendixsubsubsec", cm_appendixsubsubsec, NO_BRACE_ARGS }, - { "asis", cm_asis, BRACE_ARGS }, - { "b", cm_bold, BRACE_ARGS }, - { "br", cm_br, NO_BRACE_ARGS }, + { "asis", cm_no_op, BRACE_ARGS }, + { "b", cm_not_fixed_width, BRACE_ARGS }, { "bullet", cm_bullet, BRACE_ARGS }, { "bye", cm_bye, NO_BRACE_ARGS }, { "c", cm_ignore_line, NO_BRACE_ARGS }, { "cartouche", cm_cartouche, NO_BRACE_ARGS }, { "center", cm_center, NO_BRACE_ARGS }, + { "centerchap", cm_unnumbered, NO_BRACE_ARGS }, { "chapheading", cm_chapheading, NO_BRACE_ARGS }, { "chapter", cm_chapter, NO_BRACE_ARGS }, { "cindex", cm_cindex, NO_BRACE_ARGS }, @@ -681,78 +582,81 @@ static COMMAND CommandTable[] = { { "clear", cm_clear, NO_BRACE_ARGS }, { "code", cm_code, BRACE_ARGS }, { "comment", cm_ignore_line, NO_BRACE_ARGS }, - { "contents", do_nothing, NO_BRACE_ARGS }, + { "contents", cm_no_op, NO_BRACE_ARGS }, { "copyright", cm_copyright, BRACE_ARGS }, - { "ctrl", cm_ctrl, BRACE_ARGS }, + { "ctrl", cm_obsolete, BRACE_ARGS }, { "defcodeindex", cm_defcodeindex, NO_BRACE_ARGS }, { "defindex", cm_defindex, NO_BRACE_ARGS }, - { "dfn", cm_dfn, BRACE_ARGS }, - /* The `def' commands. */ + { "defcv", cm_defun, NO_BRACE_ARGS }, + { "defcvx", cm_defun, NO_BRACE_ARGS }, { "deffn", cm_defun, NO_BRACE_ARGS }, { "deffnx", cm_defun, NO_BRACE_ARGS }, - { "defun", cm_defun, NO_BRACE_ARGS }, - { "defunx", cm_defun, NO_BRACE_ARGS }, + { "defivar", cm_defun, NO_BRACE_ARGS }, + { "defivarx", cm_defun, NO_BRACE_ARGS }, { "defmac", cm_defun, NO_BRACE_ARGS }, { "defmacx", cm_defun, NO_BRACE_ARGS }, - { "defspec", cm_defun, NO_BRACE_ARGS }, - { "defspecx", cm_defun, NO_BRACE_ARGS }, - { "defvr", cm_defun, NO_BRACE_ARGS }, - { "defvrx", cm_defun, NO_BRACE_ARGS }, - { "defvar", cm_defun, NO_BRACE_ARGS }, - { "defvarx", cm_defun, NO_BRACE_ARGS }, + { "defmethod", cm_defun, NO_BRACE_ARGS }, + { "defmethodx", cm_defun, NO_BRACE_ARGS }, + { "defop", cm_defun, NO_BRACE_ARGS }, { "defopt", cm_defun, NO_BRACE_ARGS }, { "defoptx", cm_defun, NO_BRACE_ARGS }, + { "defopx", cm_defun, NO_BRACE_ARGS }, + { "defspec", cm_defun, NO_BRACE_ARGS }, + { "defspecx", cm_defun, NO_BRACE_ARGS }, + { "deftp", cm_defun, NO_BRACE_ARGS }, + { "deftpx", cm_defun, NO_BRACE_ARGS }, { "deftypefn", cm_defun, NO_BRACE_ARGS }, { "deftypefnx", cm_defun, NO_BRACE_ARGS }, { "deftypefun", cm_defun, NO_BRACE_ARGS }, { "deftypefunx", cm_defun, NO_BRACE_ARGS }, - { "deftypevr", cm_defun, NO_BRACE_ARGS }, - { "deftypevrx", cm_defun, NO_BRACE_ARGS }, - { "deftypevar", cm_defun, NO_BRACE_ARGS }, - { "deftypevarx", cm_defun, NO_BRACE_ARGS }, - { "defcv", cm_defun, NO_BRACE_ARGS }, - { "defcvx", cm_defun, NO_BRACE_ARGS }, - { "defivar", cm_defun, NO_BRACE_ARGS }, - { "defivarx", cm_defun, NO_BRACE_ARGS }, - { "defop", cm_defun, NO_BRACE_ARGS }, - { "defopx", cm_defun, NO_BRACE_ARGS }, - { "defmethod", cm_defun, NO_BRACE_ARGS }, - { "defmethodx", cm_defun, NO_BRACE_ARGS }, { "deftypemethod", cm_defun, NO_BRACE_ARGS }, { "deftypemethodx", cm_defun, NO_BRACE_ARGS }, - { "deftp", cm_defun, NO_BRACE_ARGS }, - { "deftpx", cm_defun, NO_BRACE_ARGS }, + { "deftypevar", cm_defun, NO_BRACE_ARGS }, + { "deftypevarx", cm_defun, NO_BRACE_ARGS }, + { "deftypevr", cm_defun, NO_BRACE_ARGS }, + { "deftypevrx", cm_defun, NO_BRACE_ARGS }, + { "defun", cm_defun, NO_BRACE_ARGS }, + { "defunx", cm_defun, NO_BRACE_ARGS }, + { "defvar", cm_defun, NO_BRACE_ARGS }, + { "defvarx", cm_defun, NO_BRACE_ARGS }, + { "defvr", cm_defun, NO_BRACE_ARGS }, + { "defvrx", cm_defun, NO_BRACE_ARGS }, /* The end of the `def' commands. */ - + { "detailmenu", cm_detailmenu, NO_BRACE_ARGS }, + { "dfn", cm_dfn, BRACE_ARGS }, + { "dircategory", cm_dircategory, NO_BRACE_ARGS }, + { "direntry", cm_direntry, NO_BRACE_ARGS }, { "display", cm_display, NO_BRACE_ARGS }, + { "dmn", cm_no_op, BRACE_ARGS }, + { "dotaccent", cm_accent, BRACE_ARGS }, + { "dotless", cm_dotless, BRACE_ARGS }, { "dots", cm_dots, BRACE_ARGS }, - { "dmn", do_nothing, BRACE_ARGS }, + { "email", cm_angle_brackets, BRACE_ARGS }, { "emph", cm_emph, BRACE_ARGS }, { "end", cm_end, NO_BRACE_ARGS }, + { "enddots", cm_enddots, BRACE_ARGS }, { "enumerate", cm_enumerate, NO_BRACE_ARGS }, { "equiv", cm_equiv, BRACE_ARGS }, { "error", cm_error, BRACE_ARGS }, { "example", cm_example, NO_BRACE_ARGS }, + { "exclamdown", cm_special_char, BRACE_ARGS }, { "exdent", cm_exdent, NO_BRACE_ARGS }, { "expansion", cm_expansion, BRACE_ARGS }, - { "file", cm_file, BRACE_ARGS }, + { "file", cm_code, BRACE_ARGS }, + { "finalout", cm_no_op, NO_BRACE_ARGS }, { "findex", cm_findex, NO_BRACE_ARGS }, - { "finalout", do_nothing, NO_BRACE_ARGS }, { "flushleft", cm_flushleft, NO_BRACE_ARGS }, { "flushright", cm_flushright, NO_BRACE_ARGS }, + { "footnote", cm_footnote, NO_BRACE_ARGS}, /* self-arg eater */ + { "footnotestyle", cm_footnotestyle, NO_BRACE_ARGS }, { "format", cm_format, NO_BRACE_ARGS }, { "ftable", cm_ftable, NO_BRACE_ARGS }, { "group", cm_group, NO_BRACE_ARGS }, { "heading", cm_heading, NO_BRACE_ARGS }, { "headings", cm_ignore_line, NO_BRACE_ARGS }, - { "i", cm_italic, BRACE_ARGS }, - { "iappendix", cm_appendix, NO_BRACE_ARGS }, - { "iappendixsection", cm_appendixsec, NO_BRACE_ARGS }, - { "iappendixsec", cm_appendixsec, NO_BRACE_ARGS }, - { "iappendixsubsec", cm_appendixsubsec, NO_BRACE_ARGS }, - { "iappendixsubsubsec", cm_appendixsubsubsec, NO_BRACE_ARGS }, - { "ichapter", cm_chapter, NO_BRACE_ARGS }, + { "hyphenation", cm_no_op, BRACE_ARGS }, + { "i", cm_not_fixed_width, BRACE_ARGS }, { "ifclear", cm_ifclear, NO_BRACE_ARGS }, { "ifeq", cm_ifeq, NO_BRACE_ARGS }, { "ifhtml", command_name_condition, NO_BRACE_ARGS }, @@ -762,79 +666,81 @@ static COMMAND CommandTable[] = { { "ignore", command_name_condition, NO_BRACE_ARGS }, { "include", cm_include, NO_BRACE_ARGS }, { "inforef", cm_inforef, BRACE_ARGS }, - { "input", cm_include, NO_BRACE_ARGS }, - { "isection", cm_section, NO_BRACE_ARGS }, - { "isubsection", cm_subsection, NO_BRACE_ARGS }, - { "isubsubsection", cm_subsubsection, NO_BRACE_ARGS }, { "item", cm_item, NO_BRACE_ARGS }, { "itemize", cm_itemize, NO_BRACE_ARGS }, { "itemx", cm_itemx, NO_BRACE_ARGS }, - { "iunnumbered", cm_unnumbered, NO_BRACE_ARGS }, - { "iunnumberedsec", cm_unnumberedsec, NO_BRACE_ARGS }, - { "iunnumberedsubsec", cm_unnumberedsubsec, NO_BRACE_ARGS }, - { "iunnumberedsubsubsec", cm_unnumberedsubsubsec, NO_BRACE_ARGS }, { "kbd", cm_kbd, BRACE_ARGS }, - { "key", cm_key, BRACE_ARGS }, + { "key", cm_angle_brackets, BRACE_ARGS }, { "kindex", cm_kindex, NO_BRACE_ARGS }, - { "lowersections", cm_lowersections, NO_BRACE_ARGS }, + { "l", cm_special_char, BRACE_ARGS }, { "lisp", cm_lisp, NO_BRACE_ARGS }, + { "lowersections", cm_lowersections, NO_BRACE_ARGS }, #if defined (HAVE_MACROS) { "macro", cm_macro, NO_BRACE_ARGS }, #endif { "majorheading", cm_majorheading, NO_BRACE_ARGS }, - { "math", cm_math, BRACE_ARGS }, - { "medbreak", cm_br, NO_BRACE_ARGS }, + { "math", cm_no_op, BRACE_ARGS }, { "menu", cm_menu, NO_BRACE_ARGS }, { "minus", cm_minus, BRACE_ARGS }, + { "multitable", cm_multitable, NO_BRACE_ARGS }, { "need", cm_ignore_line, NO_BRACE_ARGS }, { "node", cm_node, NO_BRACE_ARGS }, { "noindent", cm_noindent, NO_BRACE_ARGS }, { "nwnode", cm_node, NO_BRACE_ARGS }, - { "overfullrule", cm_ignore_line, NO_BRACE_ARGS }, - { "page", do_nothing, NO_BRACE_ARGS }, + { "o", cm_special_char, BRACE_ARGS }, + { "oe", insert_self, BRACE_ARGS }, + { "page", cm_no_op, NO_BRACE_ARGS }, + { "paragraphindent", cm_paragraphindent, NO_BRACE_ARGS }, { "pindex", cm_pindex, NO_BRACE_ARGS }, { "point", cm_point, BRACE_ARGS }, + { "pounds", cm_special_char, BRACE_ARGS }, { "print", cm_print, BRACE_ARGS }, { "printindex", cm_printindex, NO_BRACE_ARGS }, { "pxref", cm_pxref, BRACE_ARGS }, + { "questiondown", cm_special_char, BRACE_ARGS }, { "quotation", cm_quotation, NO_BRACE_ARGS }, - { "r", cm_roman, BRACE_ARGS }, + { "r", cm_not_fixed_width, BRACE_ARGS }, { "raisesections", cm_raisesections, NO_BRACE_ARGS }, { "ref", cm_xref, BRACE_ARGS }, - { "refill", cm_refill, NO_BRACE_ARGS }, + { "refill", cm_no_op, NO_BRACE_ARGS }, { "result", cm_result, BRACE_ARGS }, - { "samp", cm_samp, BRACE_ARGS }, + { "ringaccent", cm_accent, BRACE_ARGS }, + { "samp", cm_code, BRACE_ARGS }, { "sc", cm_sc, BRACE_ARGS }, { "section", cm_section, NO_BRACE_ARGS }, { "set", cm_set, NO_BRACE_ARGS }, { "setchapternewpage", cm_ignore_line, NO_BRACE_ARGS }, - { "setchapterstyle", cm_ignore_line, NO_BRACE_ARGS }, + { "setchapterstyle", cm_obsolete, NO_BRACE_ARGS }, { "setfilename", cm_setfilename, NO_BRACE_ARGS }, { "settitle", cm_ignore_line, NO_BRACE_ARGS }, - { "shortcontents", do_nothing, NO_BRACE_ARGS }, + { "shortcontents", cm_no_op, NO_BRACE_ARGS }, { "shorttitlepage", cm_ignore_line, NO_BRACE_ARGS }, { "smallbook", cm_ignore_line, NO_BRACE_ARGS }, - { "smallbreak", cm_br, NO_BRACE_ARGS }, { "smallexample", cm_smallexample, NO_BRACE_ARGS }, { "smalllisp", cm_smalllisp, NO_BRACE_ARGS }, { "sp", cm_sp, NO_BRACE_ARGS }, + { "ss", insert_self, BRACE_ARGS }, { "strong", cm_strong, BRACE_ARGS }, { "subheading", cm_subheading, NO_BRACE_ARGS }, { "subsection", cm_subsection, NO_BRACE_ARGS }, { "subsubheading", cm_subsubheading, NO_BRACE_ARGS }, { "subsubsection", cm_subsubsection, NO_BRACE_ARGS }, - { "summarycontents", do_nothing, NO_BRACE_ARGS }, + { "summarycontents", cm_no_op, NO_BRACE_ARGS }, { "syncodeindex", cm_synindex, NO_BRACE_ARGS }, { "synindex", cm_synindex, NO_BRACE_ARGS }, - { "t", cm_title, BRACE_ARGS }, + { "t", cm_no_op, BRACE_ARGS }, + { "tab", cm_tab, NO_BRACE_ARGS }, { "table", cm_table, NO_BRACE_ARGS }, { "tex", command_name_condition, NO_BRACE_ARGS }, + { "tieaccent", cm_accent, BRACE_ARGS }, { "tindex", cm_tindex, NO_BRACE_ARGS }, - { "titlefont", cm_titlefont, BRACE_ARGS }, + { "titlefont", cm_not_fixed_width, BRACE_ARGS }, { "titlepage", command_name_condition, NO_BRACE_ARGS }, - { "titlespec", command_name_condition, NO_BRACE_ARGS }, { "today", cm_today, BRACE_ARGS }, { "top", cm_top, NO_BRACE_ARGS }, + { "u", cm_accent, BRACE_ARGS }, + { "ubaraccent", cm_accent, BRACE_ARGS }, + { "udotaccent", cm_accent, BRACE_ARGS }, #if defined (HAVE_MACROS) { "unmacro", cm_unmacro, NO_BRACE_ARGS }, #endif @@ -842,41 +748,36 @@ static COMMAND CommandTable[] = { { "unnumberedsec", cm_unnumberedsec, NO_BRACE_ARGS }, { "unnumberedsubsec", cm_unnumberedsubsec, NO_BRACE_ARGS }, { "unnumberedsubsubsec", cm_unnumberedsubsubsec, NO_BRACE_ARGS }, + { "url", cm_code, BRACE_ARGS }, + { "v", cm_accent, BRACE_ARGS }, { "value", cm_value, BRACE_ARGS }, { "var", cm_var, BRACE_ARGS }, { "vindex", cm_vindex, NO_BRACE_ARGS }, { "vtable", cm_vtable, NO_BRACE_ARGS }, { "w", cm_w, BRACE_ARGS }, { "xref", cm_xref, BRACE_ARGS }, - { "{", insert_self, NO_BRACE_ARGS }, - { "}", insert_self, NO_BRACE_ARGS }, - /* Some obsoleted commands. */ - { "infotop", cm_obsolete, NO_BRACE_ARGS }, - { "infounnumbered", cm_obsolete, NO_BRACE_ARGS }, - { "infounnumberedsec", cm_obsolete, NO_BRACE_ARGS }, - { "infounnumberedsubsec", cm_obsolete, NO_BRACE_ARGS }, - { "infounnumberedsubsubsec", cm_obsolete, NO_BRACE_ARGS }, - { "infoappendix", cm_obsolete, NO_BRACE_ARGS }, - { "infoappendixsec", cm_obsolete, NO_BRACE_ARGS }, - { "infoappendixsubsec", cm_obsolete, NO_BRACE_ARGS }, - { "infoappendixsubsubsec", cm_obsolete, NO_BRACE_ARGS }, - { "infochapter", cm_obsolete, NO_BRACE_ARGS }, - { "infosection", cm_obsolete, NO_BRACE_ARGS }, - { "infosubsection", cm_obsolete, NO_BRACE_ARGS }, - { "infosubsubsection", cm_obsolete, NO_BRACE_ARGS }, + /* Deprecated commands. These used to be for italics. */ + { "iappendix", cm_ideprecated, NO_BRACE_ARGS }, + { "iappendixsec", cm_ideprecated, NO_BRACE_ARGS }, + { "iappendixsection", cm_ideprecated, NO_BRACE_ARGS }, + { "iappendixsubsec", cm_ideprecated, NO_BRACE_ARGS }, + { "iappendixsubsubsec", cm_ideprecated, NO_BRACE_ARGS }, + { "ichapter", cm_ideprecated, NO_BRACE_ARGS }, + { "isection", cm_ideprecated, NO_BRACE_ARGS }, + { "isubsection", cm_ideprecated, NO_BRACE_ARGS }, + { "isubsubsection", cm_ideprecated, NO_BRACE_ARGS }, + { "iunnumbered", cm_ideprecated, NO_BRACE_ARGS }, + { "iunnumberedsec", cm_ideprecated, NO_BRACE_ARGS }, + { "iunnumberedsubsec", cm_ideprecated, NO_BRACE_ARGS }, + { "iunnumberedsubsubsec", cm_ideprecated, NO_BRACE_ARGS }, /* Now @include does what this was supposed to. */ - { "infoinclude", cm_infoinclude, NO_BRACE_ARGS }, - { "footnote", cm_footnote, NO_BRACE_ARGS}, /* self-arg eater */ - { "footnotestyle", cm_footnotestyle, NO_BRACE_ARGS }, - { "paragraphindent", cm_paragraphindent, NO_BRACE_ARGS }, + { "infoinclude", cm_obsolete, NO_BRACE_ARGS }, + { "titlespec", cm_obsolete, NO_BRACE_ARGS }, {(char *) NULL, (COMMAND_FUNCTION *) NULL}, NO_BRACE_ARGS}; -int major_version = 1; -int minor_version = 64; - struct option long_options[] = { { "error-limit", 1, 0, 'e' }, /* formerly -el */ @@ -900,7 +801,7 @@ struct option long_options[] = { "version", 0, 0, 'V' }, {NULL, 0, NULL, 0} }; - + /* Values for calling handle_variable_internal (). */ #define SET 1 #define CLEAR 2 @@ -914,7 +815,7 @@ struct option long_options[] = /* **************************************************************** */ /* For each file mentioned in the command line, process it, turning - texinfo commands into wonderfully formatted output text. */ + Texinfo commands into wonderfully formatted output text. */ int main (argc, argv) int argc; @@ -979,7 +880,12 @@ main (argc, argv) /* User specified fill_column? */ case 'f': if (sscanf (optarg, "%d", &fill_column) != 1) - usage (stderr, FATAL); + { + fprintf (stderr, + "%s: --fill-column arg must be numeric, not `%s'.\n", + progname, optarg); + usage (FATAL); + } break; /* User specified output file? */ @@ -990,40 +896,64 @@ main (argc, argv) /* User specified paragraph indent (paragraph_start_index)? */ case 'p': if (set_paragraph_indent (optarg) < 0) - usage (stderr, FATAL); + { + fprintf (stderr, + "%s: --paragraph-indent arg must be numeric/none/asis, not `%s'.\n", + progname, optarg); + usage (FATAL); + } break; /* User specified error level? */ case 'e': if (sscanf (optarg, "%d", &max_error_level) != 1) + { + fprintf (stderr, + "%s: --error-limit arg must be numeric, not `%s'.\n", + progname, optarg); + } usage (stderr, FATAL); break; /* User specified reference warning limit? */ case 'r': if (sscanf (optarg, "%d", &reference_warning_limit) != 1) - usage (stderr, FATAL); + { + fprintf (stderr, + "%s: --reference-limit arg must be numeric, not `%s'.\n", + progname, optarg); + usage (FATAL); + } break; /* User specified footnote style? */ case 's': if (set_footnote_style (optarg) < 0) - usage (stderr, FATAL); + { + fprintf (stderr, + "%s: --footnote-style arg must be `separate' or `end', not `%s'.\n", + progname, optarg); + usage (FATAL); + } footnote_style_preset = 1; break; case 'h': - usage (stdout, NO_ERROR); + usage (NO_ERROR); break; /* User requested version info? */ case 'V': print_version_info (); + puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU General Public License.\n\ +For more information about these matters, see the files named COPYING."); exit (NO_ERROR); break; case '?': - usage (stderr, FATAL); + usage (FATAL); break; } } @@ -1034,7 +964,10 @@ main (argc, argv) if (!isatty (fileno (stdin))) reading_from_stdin = 1; else - usage (stderr, FATAL); + { + fprintf (stderr, "%s: missing file argument.\n", progname); + usage (FATAL); + } } /* If the user has specified --no-headers, this should imply --no-split. @@ -1074,30 +1007,15 @@ main (argc, argv) void print_version_info () { - printf ("This is GNU Makeinfo version %d.%d, from texinfo-3.7.\n", - major_version, minor_version); + printf ("GNU Makeinfo (Texinfo 3.9) %d.%d\n", major_version, minor_version); } - + /* **************************************************************** */ /* */ /* Generic Utilities */ /* */ /* **************************************************************** */ -#if !defined (HAVE_STRDUP) -char * -strdup (string) - char *string; -{ - char *result; - - result = (char *)xmalloc (1 + strlen (string)); - strcpy (result, string); - - return (result); -} -#endif /* !HAVE_STRDUP */ - static void memory_error (callers_name, bytes_wanted) char *callers_name; @@ -1145,56 +1063,51 @@ xrealloc (pointer, nbytes) return (temp); } -/* Tell the user how to use this program. - Print the message to STREAM, and then exit with EXIT_VALUE. */ +/* If EXIT_VALUE is zero, print the full usage message to stdout. + Otherwise, just say to use --help for more info. + Then exit with EXIT_VALUE. */ void -usage (stream, exit_value) - FILE *stream; +usage (exit_value) int exit_value; { - fprintf (stream, "Usage: %s [options] texinfo-file...\n\ + if (exit_value != 0) + fprintf (stderr, "Try `%s --help' for more information.\n", progname); + else + printf ("Usage: %s [OPTION]... TEXINFO-FILE...\n\ \n\ -This program accepts as input files of texinfo commands and text\n\ -and outputs a file suitable for reading with GNU Info.\n\ +Translate Texinfo source documentation to a format suitable for reading\n\ +with GNU Info.\n\ \n\ Options:\n\ -`-I DIR' add DIR to the directory search list for including\n\ - files with the `@include' command.\n\ --D VAR define a variable, as with `@set'.\n\ --U VAR undefine a variable, as with `@clear'.\n\ --E MACRO-OFILE process macros, and output texinfo source code for TeX.\n\ ---no-validate suppress node cross reference validation.\n\ ---no-warn suppress warning messages (errors are still output).\n\ ---no-split suppress the splitting of large files.\n\ ---no-headers suppress the output of Node: Foo headers.\n\ ---verbose print information about what is being done.\n\ ---version print the version number of Makeinfo.\n\ ---output FILE or -o FILE\n\ - specify the output file. When you specify the\n\ - output file in this way, any `@setfilename' in the\n\ - input file is ignored.\n\ ---paragraph-indent NUM\n\ - set the paragraph indent to NUM (default %d).\n\ ---fill-column NUM set the filling column to NUM (default %d).\n\ ---error-limit NUM set the error limit to NUM (default %d).\n\ ---reference-limit NUM\n\ - set the reference warning limit to NUM (default %d).\n\ ---footnote-style STYLE\n\ - set the footnote style to STYLE. STYLE should\n\ - either be `separate' to place footnotes in their own\n\ - node, or `end', to place the footnotes at the end of\n\ - the node in which they are defined (the default).\n\ ---help print this message and exit.\n\n", +-D VAR define a variable, as with @set.\n\ +-E MACRO-OFILE process macros only, output texinfo source.\n\ +-I DIR add DIR to the directory search list for @include.\n\ +-U VAR undefine a variable, as with @clear.\n\ +--error-limit NUM quit after NUM errors (default %d).\n\ +--fill-column NUM break lines at NUM characters (default %d).\n\ +--footnote-style STYLE output footnotes according to STYLE:\n\ + `separate' to place footnotes in their own node,\n\ + `end' to place the footnotes at the end of\n\ + the node in which they are defined (the default).\n\ +--help display this help and exit.\n\ +--no-validate suppress node cross-reference validation.\n\ +--no-warn suppress warnings (but not errors).\n\ +--no-split suppress splitting of large files.\n\ +--no-headers suppress node separators and Node: Foo headers.\n\ +--output FILE, -o FILE output to FILE, and ignore any @setfilename.\n\ +--paragraph-indent NUM indent paragraphs with NUM spaces (default %d).\n\ +--reference-limit NUM complain about at most NUM references (default %d).\n\ +--verbose report about what is being done.\n\ +--version display version information and exit.\n\ +\n\ +Email bug reports to bug-texinfo@prep.ai.mit.edu.\n\ +", progname, paragraph_start_indent, fill_column, max_error_level, reference_warning_limit); exit (exit_value); } - -/* **************************************************************** */ -/* */ -/* Manipulating Lists */ -/* */ -/* **************************************************************** */ + +/* Manipulating Lists */ typedef struct generic_list { struct generic_list *next; @@ -1219,13 +1132,8 @@ reverse_list (list) } return (prev); } - - -/* **************************************************************** */ -/* */ -/* Pushing and Popping Files */ -/* */ -/* **************************************************************** */ + +/* Pushing and Popping Files */ /* Find and load the file named FILENAME. Return a pointer to the loaded file, or NULL if it can't be loaded. */ @@ -1370,17 +1278,8 @@ void push_node_filename () { if (node_filename_stack_index + 1 > node_filename_stack_size) - { - if (!node_filename_stack) - node_filename_stack = - (char **)xmalloc ((node_filename_stack_size += 10) - * sizeof (char *)); - else - node_filename_stack = - (char **)xrealloc (node_filename_stack, - (node_filename_stack_size + 10) - * sizeof (char *)); - } + node_filename_stack = (char **)xrealloc + (node_filename_stack, (node_filename_stack_size += 10) * sizeof (char *)); node_filename_stack[node_filename_stack_index] = node_filename; node_filename_stack_index++; @@ -1617,7 +1516,7 @@ output_name_from_input_name (name) { return (expand_filename ((char *)NULL, name)); } - + /* **************************************************************** */ /* */ /* Error Handling */ @@ -1652,7 +1551,7 @@ error (va_alist) format = va_arg (args, char *); vfprintf (stderr, format, args); va_end (args); - fprintf (stderr, "\n"); + putc ('\n', stderr); } /* Just like error (), but print the line number as well. */ @@ -1700,7 +1599,7 @@ error (format, arg1, arg2, arg3, arg4, arg5) { remember_error (); fprintf (stderr, format, arg1, arg2, arg3, arg4, arg5); - fprintf (stderr, "\n"); + putc ('\n', stderr); return ((int) 0); } @@ -1754,8 +1653,7 @@ remember_error () /* */ /* **************************************************************** */ -/* Return the next token as a string pointer. We cons the - string. */ +/* Return the next token as a string pointer. We cons the string. */ char * read_token () { @@ -1792,7 +1690,9 @@ int self_delimiting (character) int character; { - return (member (character, "{}:.@*'`,!?; \n\t")); + /* @; and @\ are not Texinfo commands, but they are listed here + anyway. I don't know why. --karl, 10aug96. */ + return member (character, "~{|}`^\\@?=;:.-,*\'\" !\n\t"); } /* Clear whitespace from the front and end of string. */ @@ -1998,7 +1898,7 @@ get_until_in_braces (match, string) input_text_offset = i; *string = temp; } - + /* **************************************************************** */ /* */ /* Converting the File */ @@ -2008,10 +1908,10 @@ get_until_in_braces (match, string) /* Convert the file named by NAME. The output is saved on the file named as the argument to the @setfilename command. */ static char *suffixes[] = { - "", ".texinfo", ".texi", ".txinfo", + "", (char *)NULL }; @@ -2022,11 +1922,17 @@ initialize_conversion () init_indices (); init_internals (); init_paragraph (); + + /* This is used for splitting the output file and for doing section + headings. It was previously initialized in `init_paragraph', but its + use there loses with the `init_paragraph' calls done by the + multitable code; the tag indices get reset to zero. */ + output_position = 0; } - /* We read in multiples of 4k, simply because it is a typical pipe size - on unix systems. */ -#define _READ_BUFFER_GROWTH (4 * 4096) +/* We read in multiples of 4k, simply because it is a typical pipe size + on unix systems. */ +#define READ_BUFFER_GROWTH (4 * 4096) /* Convert the texinfo file coming from the open stream STREAM. Assume the source of the stream is named NAME. */ @@ -2047,11 +1953,11 @@ convert_from_stream (stream, name) { int count; - if (buffer_offset + (_READ_BUFFER_GROWTH + 1) >= buffer_size) + if (buffer_offset + (READ_BUFFER_GROWTH + 1) >= buffer_size) buffer = (char *) - xrealloc (buffer, (buffer_size += _READ_BUFFER_GROWTH)); + xrealloc (buffer, (buffer_size += READ_BUFFER_GROWTH)); - count = fread (buffer + buffer_offset, 1, _READ_BUFFER_GROWTH, stream); + count = fread (buffer + buffer_offset, 1, READ_BUFFER_GROWTH, stream); if (count < 0) { @@ -2089,8 +1995,9 @@ convert_from_file (name) initialize_conversion (); - /* Try to load the file specified by NAME. If the file isn't found, and - there is no suffix in NAME, then try NAME.texinfo, and NAME.texi. */ + /* Try to load the file specified by NAME, concatenated with our + various suffixes. Prefer files like `makeinfo.texi' to + `makeinfo'. */ for (i = 0; suffixes[i]; i++) { strcpy (filename, name); @@ -2214,7 +2121,8 @@ convert_from_loaded_file (name) } if (output_stream != stdout) - printf ("Making info file `%s' from `%s'.\n", output_filename, name); + printf ("Making %s file `%s' from `%s'.\n", + no_headers ? "text" : "info", output_filename, input_filename); if (output_stream == NULL) { @@ -2243,9 +2151,9 @@ convert_from_loaded_file (name) if (!no_headers) { - add_word_args ("This is Info file %s, produced by Makeinfo-%d.%d from ", + add_word_args ("This is Info file %s, produced by Makeinfo version %d.%d", output_filename, major_version, minor_version); - add_word_args ("the input file %s.\n", input_filename); + add_word_args (" from the input file %s.\n", input_filename); } close_paragraph (); @@ -2310,6 +2218,7 @@ init_internals () init_brace_stack (); command_index = 0; in_menu = 0; + in_detailmenu = 0; top_node_seen = 0; non_top_node_seen = 0; } @@ -2319,7 +2228,6 @@ init_paragraph () { free_and_clear (&output_paragraph); output_paragraph = (unsigned char *)xmalloc (paragraph_buffer_len); - output_position = 0; output_paragraph[0] = '\0'; output_paragraph_offset = 0; output_column = 0; @@ -2392,7 +2300,7 @@ reader_loop () line_number++; /* Check for a menu entry here, since the "escape sequence" - that begins menu entrys is "\n* ". */ + that begins menu entries is "\n* ". */ if (in_menu && input_text_offset + 1 < size_of_input_text) { char *glean_node_from_menu (), *tem; @@ -2400,7 +2308,8 @@ reader_loop () /* Note that the value of TEM is discarded, since it is gauranteed to be NULL when glean_node_from_menu () is called with a non-zero argument. */ - tem = glean_node_from_menu (1); + if (!in_detailmenu) + tem = glean_node_from_menu (1); } } @@ -2505,7 +2414,7 @@ read_command () if (entry == (COMMAND *)-1) { - line_error ("Unknown info command `%s'", command); + line_error ("Unknown command `%s'", command); return; } @@ -2557,6 +2466,7 @@ remember_brace_1 (proc, position) new->proc = proc; new->pos = position; new->line = line_number; + new->in_fixed_width_font = in_fixed_width_font; brace_stack = new; } @@ -2571,12 +2481,13 @@ pop_and_call_brace () if (brace_stack == (BRACE_ELEMENT *) NULL) { - line_error ("Unmatched close brace"); + line_error ("Unmatched }"); return; } pos = brace_stack->pos; proc = brace_stack->proc; + in_fixed_width_font = brace_stack->in_fixed_width_font; temp = brace_stack->next; free (brace_stack); brace_stack = temp; @@ -2727,7 +2638,7 @@ add_char (character) { /* If we are avoiding outputting headers, and we are currently in a menu, then simply return. */ - if (no_headers && in_menu) + if (no_headers && (in_menu || in_detailmenu)) return; /* If we are adding a character now, then we don't have to @@ -2918,7 +2829,7 @@ add_char (character) } } -/* Insert CHARACTER into OUTPUT_PARAGRAPH. */ +/* Insert CHARACTER into `output_paragraph'. */ void insert (character) int character; @@ -2931,6 +2842,15 @@ insert (character) } } +/* Insert the null-terminated string STRING into `output_paragraph'. */ +void +insert_string (string) + char *string; +{ + while (*string) + insert (*string++); +} + /* Remove upto COUNT characters of whitespace from the the current output line. If COUNT is less than zero, then remove until none left. */ @@ -2987,8 +2907,14 @@ flush_output () for (i = 0; i < output_paragraph_offset; i++) { - if (output_paragraph[i] == (unsigned char)(' ' | 0x80)) - output_paragraph[i] &= 0x7f; + /* If we turned on the 8th bit for a space + inside @w, turn it back off for output. */ + if (output_paragraph[i] & meta_character_bit) + { + int temp = UNMETA (output_paragraph[i]); + if (temp == ' ') + output_paragraph[i] &= 0x7f; + } } fwrite (output_paragraph, 1, output_paragraph_offset, output_stream); @@ -3272,37 +3198,6 @@ strcasecmp (string1, string2) } #endif /* !HAVE_STRCASECMP */ -enum insertion_type { menu, quotation, lisp, smalllisp, example, - smallexample, display, itemize, format, enumerate, cartouche, table, - ftable, vtable, group, ifinfo, flushleft, flushright, ifset, ifclear, deffn, - defun, defmac, defspec, defvr, defvar, defopt, deftypefn, - deftypefun, deftypevr, deftypevar, defcv, defivar, defop, defmethod, - deftypemethod, deftp, bad_type }; - -char *insertion_type_names[] = { "menu", "quotation", "lisp", - "smalllisp", "example", "smallexample", "display", "itemize", - "format", "enumerate", "cartouche", "table", "ftable", "vtable", "group", - "ifinfo", "flushleft", "flushright", "ifset", "ifclear", "deffn", - "defun", "defmac", "defspec", "defvr", "defvar", "defopt", - "deftypefn", "deftypefun", "deftypevr", "deftypevar", "defcv", - "defivar", "defop", "defmethod", "deftypemethod", "deftp", - "bad_type" }; - -int insertion_level = 0; -typedef struct istack_elt -{ - struct istack_elt *next; - char *item_function; - char *filename; - int line_number; - int filling_enabled; - int indented_fill; - enum insertion_type insertion; - int inhibited; -} INSERTION_ELT; - -INSERTION_ELT *insertion_stack = (INSERTION_ELT *) NULL; - void init_insertion_stack () { @@ -3380,6 +3275,7 @@ push_insertion (type, item_function) new->line_number = line_number; new->filename = strdup (input_filename); new->inhibited = inhibit_paragraph_indentation; + new->in_fixed_width_font = in_fixed_width_font; new->next = insertion_stack; insertion_stack = new; insertion_level++; @@ -3395,6 +3291,7 @@ pop_insertion () if (temp == (INSERTION_ELT *) NULL) return; + in_fixed_width_font = temp->in_fixed_width_font; inhibit_paragraph_indentation = temp->inhibited; filling_enabled = temp->filling_enabled; indented_fill = temp->indented_fill; @@ -3433,11 +3330,6 @@ find_type_from_name (name) return (bad_type); } -void -do_nothing () -{ -} - int defun_insertion (type) enum insertion_type type; @@ -3562,8 +3454,31 @@ begin_insertion (type) no_discard++; break; + case detailmenu: + + if (!in_menu) + { + if (!no_headers) + close_paragraph (); + + filling_enabled = no_indent = 0; + inhibit_paragraph_indentation = 1; + + no_discard++; + } + + in_detailmenu++; + break; + + case direntry: + close_single_paragraph (); + filling_enabled = no_indent = 0; + inhibit_paragraph_indentation = 1; + insert_string ("START-INFO-DIR-ENTRY\n"); + break; + /* I think @quotation is meant to do filling. - If you don't want filling, then use @example. */ + If you don't want filling, then use @display. */ case quotation: close_single_paragraph (); last_char_was_newline = no_indent = 0; @@ -3591,6 +3506,10 @@ begin_insertion (type) break; + case multitable: + do_multitable (); + break; + case table: case ftable: case vtable: @@ -3735,12 +3654,30 @@ end_insertion (type) case ifclear: break; + case direntry: + insert_string ("END-INFO-DIR-ENTRY\n\n"); + close_insertion_paragraph (); + break; + + case detailmenu: + in_detailmenu--; /* No longer hacking menus. */ + if (!in_menu) + { + if (!no_headers) + close_insertion_paragraph (); + } + break; + case menu: in_menu--; /* No longer hacking menus. */ if (!no_headers) close_insertion_paragraph (); break; + case multitable: + end_multitable (); + break; + case enumerate: stop_enumerating (); close_insertion_paragraph (); @@ -3761,11 +3698,6 @@ end_insertion (type) case smalllisp: case quotation: - /* @quotation is the only one of the above without a fixed width - font. */ - if (type != quotation) - in_fixed_width_font--; - /* @format is the only fixed_width insertion without a change in indentation. */ if (type != format) @@ -3827,14 +3759,24 @@ discard_insertions () } line_number = real_line_number; } + +/* The Texinfo commands. */ -/* The actual commands themselves. */ +/* Commands which insert their own names. */ +void +insert_self (arg) + int arg; +{ + if (arg == START) + add_word (command); +} -/* Commands which insert themselves. */ void -insert_self () +insert_space (arg) + int arg; { - add_word (command); + if (arg == START) + add_char (' '); } /* Force a line break in the output. */ @@ -3856,6 +3798,15 @@ cm_dots (arg) add_word ("..."); } +/* Insert ellipsis for sentence end. */ +void +cm_enddots (arg) + int arg; +{ + if (arg == START) + add_word ("...."); +} + void cm_bullet (arg) int arg; @@ -3881,14 +3832,92 @@ cm_TeX (arg) add_word ("TeX"); } +/* Copyright symbol. */ void cm_copyright (arg) - int arg; + int arg; { if (arg == START) add_word ("(C)"); } +/* Accent commands that take explicit arguments. */ +void +cm_accent (arg) + int arg; +{ + if (arg == START) + { + if (strcmp (command, "dotaccent") == 0) /* overdot */ + add_char ('.'); + else if (strcmp (command, "H") == 0) /* Hungarian umlaut */ + add_word ("''"); + else if (strcmp (command, "ringaccent") == 0) + add_char ('*'); + else if (strcmp (command, "tieaccent") == 0) + add_char ('['); + else if (strcmp (command, "u") == 0) /* breve */ + add_char ('('); + else if (strcmp (command, "v") == 0) /* hacek/check */ + add_char ('<'); + } + else if (arg == END) + { + if (strcmp (command, "ubaraccent") == 0) /* underbar */ + add_char ('_'); + else if (strcmp (command, "udotaccent") == 0) /* underdot */ + add_word ("-."); + else if (strcmp (command, ",") == 0) /* cedilla */ + add_word (","); + } +} + +/* Non-English letters/characters that don't insert themselves. */ +void +cm_special_char (arg) +{ + if (arg == START) + { + if ((*command == 'L' || *command == 'l' + || *command == 'O' || *command == 'o') + && command[1] == 0) + { + /* Lslash lslash Oslash oslash */ + add_char (*command); + add_char ('/'); + } + else if (strcmp (command, "exclamdown") == 0) + add_char ('!'); + else if (strcmp (command, "pounds") == 0) + add_char ('#'); + else if (strcmp (command, "questiondown") == 0) + add_char ('?'); + else + fprintf (stderr, "How did @%s end up in cm_special_char?\n", command); + } +} + +/* Dotless i or j. */ +void +cm_dotless (arg, start, end) + int arg, start, end; +{ + if (arg == END) + { + if (output_paragraph[start] != 'i' && output_paragraph[start] != 'j') + /* This error message isn't perfect if the argument is multiple + characters, but it doesn't seem worth getting right. */ + line_error ("%c%s expects `i' or `j' as argument, not `%c'", + COMMAND_PREFIX, command, output_paragraph[start]); + + else if (end - start != 1) + line_error ("%c%s expects a single character `i' or `j' as argument", + COMMAND_PREFIX, command); + + /* We've already inserted the `i' or `j', so nothing to do. */ + } +} + #if defined (__osf__) #define LOCALTIME_CAST(x) (time_t *)(x) #else @@ -3920,49 +3949,38 @@ cm_code (arg) { extern int printing_index; - if (printing_index) - return; - if (arg == START) { in_fixed_width_font++; - add_char ('`'); + + if (!printing_index) + add_char ('`'); } else { - add_word ("'"); - in_fixed_width_font--; + if (!printing_index) + add_char ('\''); } } -void -cm_samp (arg) - int arg; -{ - cm_code (arg); -} - -void -cm_file (arg) - int arg; -{ - cm_code (arg); -} - void cm_kbd (arg) int arg; { - cm_code (arg); + /* People use @kbd in an example to get the "user input" font. + We don't want quotes in that case. */ + if (!in_fixed_width_font) + cm_code (arg); } void -cm_key (arg) +cm_angle_brackets (arg) int arg; { + add_char (arg == START ? '<' : '>'); } -/* Convert the character at position into CTL. */ +/* Convert the character at position into a true control character. */ void cm_ctrl (arg, start, end) int arg, start, end; @@ -3987,11 +4005,22 @@ cm_ctrl (arg, start, end) } } -/* Small Caps in makeinfo just does all caps. */ +/* Handle a command that switches to a non-fixed-width font. */ +void +not_fixed_width (arg) + int arg; +{ + if (arg == START) + in_fixed_width_font = 0; +} + +/* Small caps in makeinfo has to do just all caps. */ void cm_sc (arg, start_pos, end_pos) int arg, start_pos, end_pos; { + not_fixed_width (arg); + if (arg == END) { while (start_pos < end_pos) @@ -4008,6 +4037,8 @@ void cm_var (arg, start_pos, end_pos) int arg, start_pos, end_pos; { + not_fixed_width (arg); + if (arg == END) { while (start_pos < end_pos) @@ -4050,46 +4081,17 @@ cm_cite (arg, position) add_word ("'"); } -/* Current text is italicized. */ -void -cm_italic (arg, start, end) - int arg, start, end; -{ -} - -/* Current text is highlighted. */ +/* No highlighting, but argument switches fonts. */ void -cm_bold (arg, start, end) +cm_not_fixed_width (arg, start, end) int arg, start, end; { - cm_italic (arg); + not_fixed_width (arg); } -/* Current text is in roman font. */ +/* Various commands are NOP's. */ void -cm_roman (arg, start, end) - int arg, start, end; -{ -} - -/* Current text is in roman font. */ -void -cm_titlefont (arg, start, end) - int arg, start, end; -{ -} - -/* Italicize titles. */ -void -cm_title (arg, start, end) - int arg, start, end; -{ - cm_italic (arg); -} - -/* @refill is a NOP. */ -void -cm_refill () +cm_no_op () { } @@ -4387,6 +4389,16 @@ sectioning_underscore (command) insert_and_underscore (character); } +/* The command still works, but prints a warning message in addition. */ +void +cm_ideprecated (arg, start, end) + int arg, start, end; +{ + warning ("The command `%c%s' is obsolete; use `%c%s' instead", + COMMAND_PREFIX, command, COMMAND_PREFIX, command + 1); + sectioning_underscore (command + 1); +} + /* The remainder of the text on this line is a chapter heading. */ void cm_chapter () @@ -4504,8 +4516,7 @@ cm_subsubheading () { cm_subsubsection (); } - - + /* **************************************************************** */ /* */ /* Adding nodes, and making tags */ @@ -4978,7 +4989,7 @@ cm_node () } /* Validation of an info file. - Scan through the list of tag entrys touching the Prev, Next, and Up + Scan through the list of tag entries touching the Prev, Next, and Up elements of each. It is an error not to be able to touch one of them, except in the case of external node references, such as "(DIR)". @@ -5447,7 +5458,7 @@ remember_node_reference (node, line, type) temp->line_no = line; temp->section = current_section; temp->type = type; - temp->containing_node = strdup (current_node); + temp->containing_node = strdup (current_node ? current_node : ""); temp->filename = node_filename; node_references = temp; @@ -5625,6 +5636,18 @@ cm_menu () begin_insertion (menu); } +void +cm_detailmenu () +{ + if (current_node == (char *)NULL) + { + warning ("%cmenu seen before a node has been defined", COMMAND_PREFIX); + warning ("Creating `TOP' node."); + execute_string ("@node Top"); + } + begin_insertion (detailmenu); +} + /* **************************************************************** */ /* */ /* Cross Reference Hacking */ @@ -5769,7 +5792,7 @@ cm_inforef (arg) execute_string ("*note %s: (%s)%s", pname, file, node); } } - + /* **************************************************************** */ /* */ /* Insertion Command Stubs */ @@ -5826,6 +5849,15 @@ cm_display () begin_insertion (display); } +void +cm_direntry () +{ + if (no_headers) + command_name_condition (); + else + begin_insertion (direntry); +} + void cm_itemize () { @@ -5875,6 +5907,12 @@ cm_table () begin_insertion (table); } +void +cm_multitable () +{ + begin_insertion (multitable); /* @@ */ +} + void cm_ftable () { @@ -5913,8 +5951,7 @@ cm_flushright () { begin_insertion (flushright); } - - + /* **************************************************************** */ /* */ /* Conditional Handling */ @@ -5922,8 +5959,8 @@ cm_flushright () /* **************************************************************** */ /* A structure which contains `defined' variables. */ -typedef struct _defines { - struct _defines *next; +typedef struct defines { + struct defines *next; char *name; char *value; } DEFINE; @@ -6041,7 +6078,7 @@ cm_ifclear () /* This command takes braces, but we parse the contents specially, so we don't use the standard brace popping code. - The syntax @ifeq{arg1, arg2, texinfo commands} performs texinfo commands + The syntax @ifeq{arg1, arg2, texinfo-commands} performs texinfo-commands if ARG1 and ARG2 caselessly string compare to the same string, otherwise, it produces no output. */ void @@ -6252,13 +6289,8 @@ handle_variable_internal (action, name) } } } - - -/* **************************************************************** */ -/* */ -/* Execution of Random Text not in file */ -/* */ -/* **************************************************************** */ + +/* Execution of random text not in file. */ typedef struct { char *string; /* The string buffer. */ @@ -6369,11 +6401,40 @@ execute_string (format, arg1, arg2, arg3, arg4, arg5) es->in_use = 0; } -/* **************************************************************** */ -/* */ -/* @itemx, @item */ -/* */ -/* **************************************************************** */ + +/* Return what would be output for STR, i.e., expand Texinfo commands. + If IMPLICIT_CODE is set, expand @code{STR}. */ + +char * +expansion (str, implicit_code) + char *str; + int implicit_code; +{ + int length; + char *result; + + /* Inhibit any real output. */ + int start = output_paragraph_offset; + int saved_paragraph_is_open = paragraph_is_open; + + inhibit_output_flushing (); + execute_string (implicit_code ? "@code{%s}" : "%s", str); + uninhibit_output_flushing (); + + /* Copy the expansion from the buffer. */ + length = output_paragraph_offset - start; + result = xmalloc (1 + length); + memcpy (result, (char *) (output_paragraph + start), length); + result[length] = 0; + + /* Pretend it never happened. */ + output_paragraph_offset = start; + paragraph_is_open = saved_paragraph_is_open; + + return result; +} + +/* @itemx, @item. */ static int itemx_flag = 0; @@ -6409,6 +6470,19 @@ cm_item () switch_top: switch (stack->insertion) { + case multitable: + multitable_item (); + /* Ultra special hack. It appears that some people incorrectly + place text directly after the @item, instead of on a new line + by itself. This happens to work in TeX, so I make it work + here. */ + if (*rest_of_line) + { + line_number--; + input_text_offset = original_input_text_offset; + } + break; + case ifinfo: case ifset: case ifclear: @@ -6549,7 +6623,6 @@ cm_item () COMMAND_PREFIX, command); } } - /* **************************************************************** */ /* */ @@ -6737,15 +6810,17 @@ args_from_string (string) c = *scan_string++; - if (!c || - (whitespace (c) || DEFUN_SELF_DELIMITING (c) || - c == '{' || c == '}')) + /* Do not back up if we're looking at a }; since the only + valid }'s are those matched with {'s, we want to give + an error. If we back up, we go into an infinite loop. */ + if (!c || whitespace (c) || DEFUN_SELF_DELIMITING (c) + || c == '{') { scan_string--; break; } - /* If we encounter a command imbedded within a token, + /* If we encounter a command embedded within a token, then end the token. */ if (c == COMMAND_PREFIX) { @@ -6972,27 +7047,29 @@ defun_internal (type, x_p) current_indent -= default_indentation_increment; close_single_paragraph (); - /* Make an entry in the appropriate index. */ - switch (base_type) - { - case deffn: - case deftypefn: - execute_string ("%cfindex %s\n", COMMAND_PREFIX, defined_name); - break; - case defvr: - case deftypevr: - case defcv: - execute_string ("%cvindex %s\n", COMMAND_PREFIX, defined_name); - break; - case defop: - case deftypemethod: - execute_string ("%cfindex %s on %s\n", - COMMAND_PREFIX, defined_name, type_name); - break; - case deftp: - execute_string ("%ctindex %s\n", COMMAND_PREFIX, defined_name); - break; - } + if (!macro_expansion_output_stream) + /* Make an entry in the appropriate index unless we are just + expanding macros. */ + switch (base_type) + { + case deffn: + case deftypefn: + execute_string ("%cfindex %s\n", COMMAND_PREFIX, defined_name); + break; + case defvr: + case deftypevr: + case defcv: + execute_string ("%cvindex %s\n", COMMAND_PREFIX, defined_name); + break; + case defop: + case deftypemethod: + execute_string ("%cfindex %s on %s\n", + COMMAND_PREFIX, defined_name, type_name); + break; + case deftp: + execute_string ("%ctindex %s\n", COMMAND_PREFIX, defined_name); + break; + } /* Deallocate the token list. */ scan_args = defun_args; @@ -7067,7 +7144,6 @@ cm_end () end_insertion (type); free (temp); } - /* **************************************************************** */ /* */ @@ -7145,6 +7221,26 @@ cm_sp () free (line); } +/* @dircategory LINE outputs INFO-DIR-SECTION LINE, + but not if --no-headers. */ + +void +cm_dircategory () +{ + char *line, *p; + + get_rest_of_line (&line);; + + if (! no_headers) + { + insert_string ("INFO-DIR-SECTION "); + insert_string (line); + insert ('\n'); + } + + free (line); +} + /* Start a new line with just this text on it. Then center the line of text. This always ends the current paragraph. */ @@ -7267,12 +7363,6 @@ cm_exdent () close_single_paragraph (); } -void -cm_include () -{ - cm_infoinclude (); -} - #if !defined (HAVE_STRERROR) extern char *sys_errlist[]; extern int sys_nerr; @@ -7290,7 +7380,7 @@ strerror (num) /* Remember this file, and move onto the next. */ void -cm_infoinclude () +cm_include () { char *filename; @@ -7357,39 +7447,13 @@ misplaced_brace () line_error ("Misplaced `}'"); } -/* Don't let the filling algorithm insert extra whitespace here. */ -void -cm_force_abbreviated_whitespace () -{ -} - -/* Do not let this character signify the end of a sentence, though - if it was seen without the command prefix it normally would. We - do this by turning on the 8th bit of the character. */ -void -cm_ignore_sentence_ender () -{ - add_char (META ((*command))); -} - /* Signals end of processing. Easy to make this happen. */ void cm_bye () { input_text_offset = size_of_input_text; } - -void -cm_asis () -{ -} - -void -cm_math () -{ -} - - + /* **************************************************************** */ /* */ /* Indexing Stuff */ @@ -7817,7 +7881,6 @@ int index_element_compare (element1, element2) INDEX_ELT **element1, **element2; { - /* This needs to ignore leading non-text characters. */ return (strcasecmp ((*element1)->entry, (*element2)->entry)); } @@ -7837,7 +7900,7 @@ make_index_entries_unique (array, count) { if ((i == (count - 1)) || (array[i]->node != array[i + 1]->node) || - (strcasecmp (array[i]->entry, array[i + 1]->entry) != 0)) + (strcmp (array[i]->entry, array[i + 1]->entry) != 0)) copy[j++] = array[i]; else { @@ -7906,6 +7969,14 @@ sort_index (index) while (temp != (INDEX_ELT *) NULL) { array[count++] = temp; + + /* Maybe should set line number to the defining_line? Any errors + have already been given, though, I think. */ + + /* If this particular entry should be printed as a "code" index, + then wrap the entry with "@code{...}". */ + array[count - 1]->entry = expansion (temp->entry, index->code); + temp = temp->next; } array[count] = (INDEX_ELT *) NULL; /* terminate the array. */ @@ -7928,8 +7999,10 @@ cm_printindex () INDEX_ELT *index; INDEX_ELT **array; char *index_name; - int old_inhibitions = inhibit_paragraph_indentation; - int previous_filling_enabled_value = filling_enabled; + unsigned line_length; + char *line; + int saved_inhibit_paragraph_indentation = inhibit_paragraph_indentation; + int saved_filling_enabled = filling_enabled; close_paragraph (); get_rest_of_line (&index_name); @@ -7944,62 +8017,63 @@ cm_printindex () else free (index_name); - array = sort_index (index); - + /* Do this before sorting, so execute_string in index_element_compare + will give the same results as when we actually print. */ + printing_index = 1; filling_enabled = 0; inhibit_paragraph_indentation = 1; + array = sort_index (index); + close_paragraph (); add_word ("* Menu:\n\n"); - printing_index = 1; - #if defined (HAVE_MACROS) me_inhibit_expansion++; #endif /* HAVE_MACROS */ + /* This will probably be enough. */ + line_length = 100; + line = xmalloc (line_length); + for (item = 0; (index = array[item]); item++) { - int real_line_number = line_number; - - /* Let errors generated while making the index entry point back - at the line which contains the entry. */ - line_number = index->defining_line; - - /* If this particular entry should be printed as a "code" index, - then wrap the entry with "@code{...}". */ - if (index->code) - execute_string ("* %ccode{%s}: ", COMMAND_PREFIX, index->entry); - else - execute_string ("* %s: ", index->entry); - - /* Pad the front of the destination nodename so that - the output looks nice. */ - if (fill_column > 40 && output_column < 40) - indent (40 - output_column); - - execute_string ("%s.\n", index->node); - - line_number = real_line_number; + /* A pathological document might have an index entry outside of any + node. Don't crash. Perhaps should warn. */ + char *index_node = index->node ? index->node : "(none)"; + unsigned new_length = strlen (index->entry) + strlen (index_node); + + if (new_length > line_length) + { + line_length = new_length + 6; /* * : .\0 */ + line = xrealloc (line, line_length); + } + + /* Print the entry, nicely formatted. We've already expanded any + commands, including any implicit @code. Thus, can't call + execute_string, since @@ has turned into @. */ + sprintf (line, "* %-37s %s.\n", index->entry, index_node); + line[2 + strlen (index->entry)] = ':'; + insert_string (line); + + /* Previous `output_paragraph' from growing to the size of the + whole index. */ flush_output (); } + free (line); + #if defined (HAVE_MACROS) - me_inhibit_expansion--; + me_inhibit_expansion--; #endif /* HAVE_MACROS */ printing_index = 0; free (array); close_single_paragraph (); - filling_enabled = previous_filling_enabled_value; - inhibit_paragraph_indentation = old_inhibitions; + filling_enabled = saved_filling_enabled; + inhibit_paragraph_indentation = saved_inhibit_paragraph_indentation; } - -/* **************************************************************** */ -/* */ -/* Making User Defined Commands */ -/* */ -/* **************************************************************** */ +/* User-defined commands. */ void define_user_command (name, proc, needs_braces_p) @@ -8023,13 +8097,6 @@ define_user_command (name, proc, needs_braces_p) user_command_array[slot]->argument_in_braces = needs_braces_p; } -/* Make ALIAS run the named FUNCTION. Copies properties from FUNCTION. */ -void -define_alias (alias, function) - char *alias, *function; -{ -} - /* Set the paragraph indentation variable to the value specified in STRING. Values can be: `asis': Don't change existing indentation. @@ -8114,7 +8181,8 @@ cm_footnotestyle () get_rest_of_line (&arg); - if (set_footnote_style (arg) != 0) + /* If set on command line, do not change the footnote style. */ + if (!footnote_style_preset && set_footnote_style (arg) != 0) line_error ("Bad argument to %c%s", COMMAND_PREFIX, command); free (arg); @@ -8285,7 +8353,6 @@ output_pending_notes () switch (footnote_style) { - case SeparateNode: { char *old_current_node = current_node; @@ -8340,8 +8407,7 @@ output_pending_notes () free (array); } } - - + /* **************************************************************** */ /* */ /* User definable Macros (text substitution) */ @@ -9175,7 +9241,7 @@ get_brace_args (quote_single) } return (arglist); } - + /* **************************************************************** */ /* */ /* Looking For Include Files */ diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h new file mode 100644 index 00000000000..b70c3361df9 --- /dev/null +++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h @@ -0,0 +1,193 @@ +/* makeinfo.h -- Declarations for Makeinfo. + $Id: makeinfo.h,v 1.1.1.1 1996/12/15 21:39:27 downsj Exp $ + + Copyright (C) 1996 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, + 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. + + Written by Brian Fox (bfox@ai.mit.edu). */ + +/* Why, oh why, did I ever listen to rms when he said: + "Don't make lots of small files, just make one big one!" I've + regretted it ever since with this program, and with readline. + bfox@ai.mit.edu Thu Jul 11 07:54:32 1996 */ + +#if !defined (MAKEINFO_H) +#define MAKEINFO_H + +#if defined (COMPILING_MAKEINFO) +# define DECLARE(type, var, init) type var = init +#else +# define DECLARE(type, var, init) extern type var +#endif + +enum insertion_type +{ + menu, detailmenu, quotation, lisp, smalllisp, example, smallexample, + display, itemize, format, enumerate, cartouche, multitable, table, + ftable, vtable, group, ifinfo, flushleft, flushright, ifset, + ifclear, deffn, defun, defmac, defspec, defvr, defvar, defopt, + deftypefn, deftypefun, deftypevr, deftypevar, defcv, defivar, defop, + defmethod, deftypemethod, deftp, direntry, bad_type +}; + +DECLARE (int, insertion_level, 0); + +#if defined (COMPILING_MAKEINFO) +char *insertion_type_names[] = +{ + "menu", "detailmenu", "quotation", "lisp", "smalllisp", "example", + "smallexample", "display", "itemize", "format", "enumerate", + "cartouche", "multitable", "table", "ftable", "vtable", "group", + "ifinfo", "flushleft", "flushright", "ifset", "ifclear", "deffn", + "defun", "defmac", "defspec", "defvr", "defvar", "defopt", + "deftypefn", "deftypefun", "deftypevr", "deftypevar", "defcv", + "defivar", "defop", "defmethod", "deftypemethod", "deftp", "direntry", + "bad_type" +}; +#endif + +typedef struct istack_elt +{ + struct istack_elt *next; + char *item_function; + char *filename; + int line_number; + int filling_enabled; + int indented_fill; + enum insertion_type insertion; + int inhibited; + int in_fixed_width_font; +} INSERTION_ELT; + +DECLARE (INSERTION_ELT *, insertion_stack, (INSERTION_ELT *)NULL); + +/* Current output stream. */ +DECLARE (FILE *, output_stream, (FILE *)NULL); + +/* Output paragraph buffer. */ +DECLARE (unsigned char *, output_paragraph, (unsigned char *)NULL); + +/* Offset into OUTPUT_PARAGRAPH. */ +DECLARE (int, output_paragraph_offset, 0); + +/* The output paragraph "cursor" horizontal position. */ +DECLARE (int, output_column, 0); + +/* Non-zero means output_paragraph contains text. */ +DECLARE (int, paragraph_is_open, 0); + +/* The amount of indentation to apply at the start of each line. */ +DECLARE (int, current_indent, 0); + +/* nonzero if we are currently processing a multitable command */ +DECLARE (int, multitable_active, 0); + +/* The column at which long lines are broken. */ +DECLARE (int, fill_column, 72); + +/* The current input file state. */ +DECLARE (char *, input_filename, (char *)NULL); +DECLARE (char *, input_text, (char *)NULL); +DECLARE (int, size_of_input_text, 0); +DECLARE (int, input_text_offset, 0); +DECLARE (int, line_number, 0); + +#define curchar() input_text[input_text_offset] +/* **************************************************************** */ +/* */ +/* Global Defines */ +/* */ +/* **************************************************************** */ + +/* Error levels */ +#define NO_ERROR 0 +#define SYNTAX 2 +#define FATAL 4 + +/* C's standard macros don't check to make sure that the characters being + changed are within range. So I have to check explicitly. */ + +/* GNU Library doesn't have toupper(). Until GNU gets this fixed, I will + have to do it. */ +#ifndef toupper +#define toupper(c) ((c) - 32) +#endif + +#define coerce_to_upper(c) ((islower(c) ? toupper(c) : (c))) +#define coerce_to_lower(c) ((isupper(c) ? tolower(c) : (c))) + +#define control_character_bit 0x40 /* %01000000, must be off. */ +#define meta_character_bit 0x080/* %10000000, must be on. */ +#define CTL(c) ((c) & (~control_character_bit)) +#define UNCTL(c) coerce_to_upper(((c)|control_character_bit)) +#define META(c) ((c) | (meta_character_bit)) +#define UNMETA(c) ((c) & (~meta_character_bit)) + +#define whitespace(c) (((c) == '\t') || ((c) == ' ')) +#define sentence_ender(c) ((c) == '.' || (c) == '?' || (c) == '!') +#define cr_or_whitespace(c) (((c) == '\t') || ((c) == ' ') || ((c) == '\n')) + +#ifndef isletter +#define isletter(c) (((c) >= 'A' && (c) <= 'Z') || ((c) >= 'a' && (c) <= 'z')) +#endif + +#ifndef isupper +#define isupper(c) ((c) >= 'A' && (c) <= 'Z') +#endif + +#ifndef isdigit +#define isdigit(c) ((c) >= '0' && (c) <= '9') +#endif + +#ifndef digit_value +#define digit_value(c) ((c) - '0') +#endif + +#define member(c, s) (strchr (s, c) != NULL) + +#define COMMAND_PREFIX '@' + +/* Stuff for splitting large files. */ +#define SPLIT_SIZE_THRESHOLD 70000 /* What's good enough for Stallman... */ +#define DEFAULT_SPLIT_SIZE 50000 /* Is probably good enough for me. */ + +DECLARE (int, splitting, 1); /* Defaults to true for now. */ + +typedef void COMMAND_FUNCTION (); /* So I can say COMMAND_FUNCTION *foo; */ + +#define command_char(c) ((!whitespace(c)) && \ + ((c) != '\n') && \ + ((c) != '{') && \ + ((c) != '}') && \ + ((c) != '=')) + +#define skip_whitespace() \ + while ((input_text_offset != size_of_input_text) && \ + whitespace (curchar())) \ + input_text_offset++ + +#define skip_whitespace_and_newlines() \ + do { \ + while ((input_text_offset != size_of_input_text) && \ + (whitespace (curchar ()) || (curchar () == '\n'))) \ + { \ + if (curchar () == '\n') \ + line_number++; \ + input_text_offset++; \ + } \ + } while (0) + +#endif /* !MAKEINFO_H */ diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.texi b/gnu/usr.bin/texinfo/makeinfo/makeinfo.texi index 0299fea7398..db5065889e5 100644 --- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.texi +++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.texi @@ -4,13 +4,19 @@ @set VERSION 1.61 @paragraphindent none @comment %**start of header +@comment $Id: makeinfo.texi,v 1.1.1.2 1996/12/15 21:39:28 downsj Exp $ + +@dircategory Texinfo documentation system +@direntry +* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII. +@end direntry @ifinfo This file is an extract from the @cite{Texinfo} manual.@* -It documents @code{makeinfo}, a program that converts Texinfo +It documents Makeinfo, a program that converts Texinfo files into Info files. -Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -57,27 +63,27 @@ except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end titlepage -@node Top, ,(dir), (dir) +@node Top @chapter What is @code{makeinfo}? @iftex This file documents the use of the @code{makeinfo} program, versions -@value{VERSION} and later. It is an extract from the @cite{TeXinfo} manual. +@value{VERSION} and later. It is an extract from the @cite{Texinfo} manual. @end iftex -@code{makeinfo} is a program for converting @dfn{TeXinfo} files into @dfn{Info} -files. TeXinfo is a documentation system that uses a single source file to +@code{makeinfo} is a program for converting @dfn{Texinfo} files into @dfn{Info} +files. Texinfo is a documentation system that uses a single source file to produce both on-line information and printed output. You can read the on-line information using Info; type @code{info} to learn about Info. @ifinfo -@xref{Top, Texinfo, Overview of Texinfo, texinfo, Texinfo}, +@xref{Top, Texinfo, Overview of Texinfo, Texinfo, Texinfo}, @end ifinfo @iftex -See the @cite{TeXinfo} manual, +See the @cite{Texinfo} manual, @end iftex -to learn about the TeXinfo documentation system. +to learn about the Texinfo documentation system. @menu * Formatting Control:: Controlling the width of lines, paragraph @@ -89,11 +95,12 @@ to learn about the TeXinfo documentation system. * Pointer Validation:: How Makeinfo can help you to track node references through complex Texinfo files. -* The Macro Facility:: Makeinfo allows the use of @dfn{macros}. - * Index:: Index of Concepts. @end menu +@c Removed this for 3.8 until it's time to rewrite it. +@c * The Macro Facility:: Makeinfo allows the use of @dfn{macros}. + @node Formatting Control @section Controlling Paragraph Formats @@ -281,9 +288,10 @@ This rule allows the last node in a section to point to the first node of the next chapter.@refill @end enumerate -@lowersections -@include macro.texi -@raisesections +@c We don't want to advertise redefining commands. +@c lowersections +@c include macro.texi +@c raisesections @lowersections @node Index diff --git a/gnu/usr.bin/texinfo/makeinfo/multi.c b/gnu/usr.bin/texinfo/makeinfo/multi.c new file mode 100644 index 00000000000..4d86de17ae3 --- /dev/null +++ b/gnu/usr.bin/texinfo/makeinfo/multi.c @@ -0,0 +1,418 @@ +/* multi.c -- Multitable stuff for makeinfo. + $Id: multi.c,v 1.1.1.1 1996/12/15 21:39:29 downsj Exp $ + + Copyright (C) 1996 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, + 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. */ + +#include +#include "makeinfo.h" + +#define MAXCOLS 100 /* remove this limit later @@ */ + + +/* + * Output environments. This is a hack grafted onto existing + * structure. The "output environment" used to consist of the + * global variables `output_paragraph', `fill_column', etc. + * Routines like add_char would manipulate these variables. + * + * Now, when formatting a multitable, we maintain separate environments + * for each column. That way we can build up the columns separately + * and write them all out at once. The "current" output environment" + * is still kept in those global variables, so that the old output + * routines don't have to change. But we provide routines to save + * and restore these variables in an "environment table". The + * `select_output_environment' function switches from one output + * environment to another. + * + * Environment #0 (i.e. element #0 of the table) is the regular + * 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 + * the table, when a multitable is active. + */ + +/* contents of an output environment */ +/* some more vars may end up being needed here later @@ */ +struct env +{ + unsigned char *output_paragraph; + int output_paragraph_offset; + int output_column; + int paragraph_is_open; + int current_indent; + int fill_column; +} envs[MAXCOLS]; /* the environment table */ + +/* index in environment table of currently selected environment */ +static int current_env_no; + +/* column number of last column in current multitable */ +static int last_column; + +/* flags indicating whether horizontal and vertical separators need + to be drawn, separating rows and columns in the current multitable. */ +static int hsep, vsep; + +void +do_multitable () +{ + int ncolumns; + + /* + * multitable strategy: + * for each item { + * for each column in an item { + * initialize a new paragraph + * do ordinary formatting into the new paragraph + * save the paragraph away + * repeat if there are more paragraphs in the column + * } + * dump out the saved paragraphs and free the storage + * } + */ + + if (multitable_active) + { + line_error ("Multitables cannot be nested"); + return; + } + + /* scan the current item function to get the field widths + and number of columns, and set up the output environment list + accordingly. */ + ncolumns = setup_multitable_parameters (); + if (hsep) + draw_horizontal_separator (); + + /* The next @item command will direct stdout into the first column + and start processing. @tab will then switch to the next column, + and @item will flush out the saved output and return to the first + column. Environment #1 is the first column. (Environment #0 is + the normal output) */ + + ++multitable_active; +} + +/* Read the parameters for a multitable from the current command + line, save the parameters away, and return the + number of columns. */ +int +setup_multitable_parameters () +{ + char *params = insertion_stack->item_function; + int nchars; + float columnfrac; + char command[200]; + int i = 1; + + /* We implement @hsep and @vsep even though TeX doesn't. + We don't get mixing of @columnfractions and templates right, + but TeX doesn't either. */ + hsep = vsep = 0; + + while (*params) { + while (whitespace (*params)) + params++; + + if (*params == '@') { + sscanf (params, "%s%n", command, &nchars); + params += nchars; + if (strcmp (command, "@hsep") == 0) + hsep++; + else if (strcmp (command, "@vsep") == 0) + vsep++; + else if (strcmp (command, "@columnfractions") == 0) { + /* Clobber old environments and create new ones, + starting at #1. Environment #0 is the normal standard output, + so we don't mess with it. */ + for ( ; i <= MAXCOLS; i++) { + if (sscanf (params, "%f%n", &columnfrac, &nchars) < 1) + goto done; + params += nchars; + setup_output_environment (i, (int) (columnfrac * fill_column + .5)); + } + } + + } else if (*params == '{') { + char *start = params; + while ((*params != '}' || params[-1] == '@') && *params) { + params++; + } + /* This gives us two spaces between columns. Seems reasonable. + Really should expand the text, though, so a template of + `@code{foo}' has a width of three, not ten. Also have to match + braces, then. */ + setup_output_environment (i++, params++ - start); + + } else { + warning ("ignoring stray text `%s' after @multitable", params); + break; + } + } + +done: + + flush_output (); + inhibit_output_flushing (); + + last_column = i - 1; + return last_column; +} + +/* Initialize environment number ENV_NO, of width WIDTH. + The idea is that we're going to use one environment for each column of + a multitable, so we can build them up separately and print them + all out at the end. */ +int +setup_output_environment (env_no, width) + int env_no; + int width; +{ + int old_env = select_output_environment (env_no); + + /* clobber old environment and set width of new one */ + init_paragraph (); + + /* make our change */ + fill_column = width; + + /* Save new environment and restore previous one. */ + select_output_environment (old_env); + + return env_no; +} + +/* Direct current output to environment number N. Used when + switching work from one column of a multitable to the next. + Returns previous environment number. */ +int +select_output_environment (n) + int n; +{ + struct env *e = &envs[current_env_no]; + int old_env_no = current_env_no; + + /* stash current env info from global vars into the old environment */ + e->output_paragraph = output_paragraph; + e->output_paragraph_offset = output_paragraph_offset; + e->output_column = output_column; + e->paragraph_is_open = paragraph_is_open; + e->current_indent = current_indent; + e->fill_column = fill_column; + + /* now copy new environment into global vars */ + current_env_no = n; + e = &envs[current_env_no]; + output_paragraph = e->output_paragraph; + output_paragraph_offset = e->output_paragraph_offset; + output_column = e->output_column; + paragraph_is_open = e->paragraph_is_open; + current_indent = e->current_indent; + fill_column = e->fill_column; + return old_env_no; +} + +/* advance to the next environment number */ +int +nselect_next_environment () +{ + if (current_env_no >= last_column) { + line_error ("Too many columns in multitable item (max %d)", last_column); + return 1; + } + select_output_environment (current_env_no + 1); +} + + +static void output_multitable_row (); + +/* start a new item (row) of a multitable */ +multitable_item () +{ + if (!multitable_active) { + /* impossible, I think. */ + error ("multitable item not in active multitable"); + exit (1); + } + if (current_env_no > 0) { + output_multitable_row (); + } + /* start at column 1 */ + select_output_environment (1); + if (!output_paragraph) { + line_error ("Cannot select column #%d in multitable", current_env_no); + exit (FATAL); + } + + init_column (); + + 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 +output_multitable_row () +{ + int i, j, remaining; + + /* offset in the output paragraph of the next char needing + to be output for that column. */ + int offset[MAXCOLS]; + + for (i = 0; i <= last_column; i++) + offset[i] = 0; + + /* select the current environment, to make sure the env variables + get updated */ + select_output_environment (current_env_no); + +#define CHAR_ADDR(n) (offset[i] + (n)) +#define CHAR_AT(n) (envs[i].output_paragraph[CHAR_ADDR(n)]) + + /* remove trailing whitespace from each column */ + for (i = 1; i <= last_column; i++) { + while (cr_or_whitespace (CHAR_AT (envs[i].output_paragraph_offset - 1))) { + envs[i].output_paragraph_offset--; + } + } + + /* read the current line from each column, outputting them all + pasted together. Do this til all lines are output from all + columns. */ + for (;;) { + remaining = 0; + /* first, see if there is any work to do */ + for (i = 1; i <= last_column; i++) { + if (CHAR_ADDR (0) < envs[i].output_paragraph_offset) { + remaining = 1; + break; + } + } + if (!remaining) + break; + + if (vsep) + out_char ('|'); + + for (i = 1; i <= last_column; i++) { + for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) { + if (CHAR_AT (j) == '\n') + break; + out_char (CHAR_AT (j)); + } + offset[i] += j + 1; /* skip last text plus skip the newline */ + for (; j <= envs[i].fill_column; j++) + out_char (' '); + if (vsep) + out_char ('|'); /* draw column separator */ + } + out_char ('\n'); /* end of line */ + } + + if (hsep) + draw_horizontal_separator (); + + /* Now dispose of the buffered output. */ + for (i = 1; i <= last_column; i++) { + select_output_environment (i); + init_paragraph (); + } +} + +#undef CHAR_AT +#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 */ +void +cm_tab () +{ + if (!multitable_active) + error ("ignoring @tab outside of multitable"); + + nselect_next_environment (); + init_column (); +} + +/* close a multitable, flushing its output and resetting + whatever needs resetting */ +void +end_multitable () +{ + int i; + + output_multitable_row (); + + /* Multitables cannot be nested. Otherwise, we'd have to save the + previous output environment number on a stack somewhere, and then + restore to that environment. */ + select_output_environment (0); + close_paragraph (); + insert ('\n'); /* we swallow newlines, so insert one of our own */ + + multitable_active = 0; + uninhibit_output_flushing (); + +#if 0 + printf ("** Multicolumn output from last row:\n"); + for (i = 1; i <= last_column; i++) { + select_output_environment (i); + printf ("* column #%d: output = %s\n", i, output_paragraph); + } +#endif +} diff --git a/gnu/usr.bin/texinfo/texinfo.tex b/gnu/usr.bin/texinfo/texinfo.tex index c928b92abf5..8bca4953fa2 100644 --- a/gnu/usr.bin/texinfo/texinfo.tex +++ b/gnu/usr.bin/texinfo/texinfo.tex @@ -1,6 +1,7 @@ %% TeX macros to handle texinfo files -% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 1994 Free Software Foundation, Inc. +% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, +% 94, 95, 1996 Free Software Foundation, Inc. %This texinfo.tex file is free software; you can redistribute it and/or %modify it under the terms of the GNU General Public License as @@ -14,8 +15,8 @@ %You should have received a copy of the GNU General Public License %along with this texinfo.tex file; see the file COPYING. If not, write -%to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, -%USA. +%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +%Boston, MA 02111-1307, USA. %In other words, you are welcome to use, share and improve this program. @@ -34,7 +35,7 @@ % This automatically updates the version number based on RCS. \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} -\deftexinfoversion$Revision: 1.1.1.2 $ +\deftexinfoversion$Revision: 1.1.1.3 $ \message{Loading texinfo package [Version \texinfoversion]:} % If in a .fmt file, print the version number @@ -45,20 +46,20 @@ % Save some parts of plain tex whose names we will redefine. -\let\ptextilde=\~ -\let\ptexlbrace=\{ -\let\ptexrbrace=\} -\let\ptexdots=\dots -\let\ptexdot=\. -\let\ptexstar=\* -\let\ptexend=\end -\let\ptexbullet=\bullet \let\ptexb=\b +\let\ptexbullet=\bullet \let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv = \equiv \let\ptexi=\i +\let\ptexlbrace=\{ +\let\ptexrbrace=\} +\let\ptexstar=\* \let\ptext=\t -\let\ptexl=\l -\let\ptexL=\L +\let\ptextilde=\~ % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space @@ -73,6 +74,7 @@ } \let\~ = \tie % And make it available as @~. + \message{Basics,} \chardef\other=12 @@ -102,10 +104,9 @@ \hyphenation{eshell} % Margin to add to right of even pages, to left of odd pages. -\newdimen \bindingoffset \bindingoffset=0pt -\newdimen \normaloffset \normaloffset=\hoffset +\newdimen \bindingoffset +\newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight -\pagewidth=\hsize \pageheight=\vsize % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, @@ -126,7 +127,7 @@ \newdimen\cornerlong \newdimen\cornerthick \newdimen \topandbottommargin \newdimen \outerhsize \newdimen \outervsize -\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks +\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks \outerhsize=7in %\outervsize=9.5in % Alternative @smallbook page size is 9.25in @@ -136,15 +137,24 @@ %---------------------End change----------------------- % \onepageout takes a vbox as an argument. Note that \pagecontents -% does insertions itself, but you have to call it yourself. +% does insertions, but you have to call it yourself. \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} -\def\onepageout#1{\hoffset=\normaloffset -\ifodd\pageno \advance\hoffset by \bindingoffset -\else \advance\hoffset by -\bindingoffset\fi -{\escapechar=`\\\relax % makes sure backslash is used in output files. -\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% -{\let\hsize=\pagewidth \makefootline}}}% -\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} +\def\onepageout#1{% + \hoffset=\normaloffset + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + {% + \escapechar = `\\ % use backslash in output files. + \indexdummies + \shipout\vbox{% + {\let\hsize=\pagewidth \makeheadline}% + \pagebody{#1}% + {\let\hsize=\pagewidth \makefootline}% + }% + }% + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} %%%% For @cropmarks command %%%% @@ -156,8 +166,8 @@ % \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up {\escapechar=`\\\relax % makes sure backslash is used in output files. - \shipout - \vbox to \outervsize{\hsize=\outerhsize + \shipout + \vbox to \outervsize{\hsize=\outerhsize \vbox{\line{\ewtop\hfill\ewtop}} \nointerlineskip \line{\vbox{\moveleft\cornerthick\nstop} @@ -165,19 +175,19 @@ \vbox{\moveright\cornerthick\nstop}} \vskip \topandbottommargin \centerline{\ifodd\pageno\hskip\bindingoffset\fi - \vbox{ - {\let\hsize=\pagewidth \makeheadline} - \pagebody{#1} - {\let\hsize=\pagewidth \makefootline}} - \ifodd\pageno\else\hskip\bindingoffset\fi} - \vskip \topandbottommargin plus1fill minus1fill + \vbox{ + {\let\hsize=\pagewidth \makeheadline} + \pagebody{#1} + {\let\hsize=\pagewidth \makefootline}} + \ifodd\pageno\else\hskip\bindingoffset\fi} + \vskip \topandbottommargin plus1fill minus1fill \boxmaxdepth\cornerthick \line{\vbox{\moveleft\cornerthick\nsbot} \hfill \vbox{\moveright\cornerthick\nsbot}} \nointerlineskip \vbox{\line{\ewbot\hfill\ewbot}} - }} + }} \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} % @@ -365,11 +375,43 @@ %\def\'{{'}} % Used to generate quoted braces. - \def\mylbrace {{\tt \char '173}} \def\myrbrace {{\tt \char '175}} \let\{=\mylbrace \let\}=\myrbrace +\begingroup + % Definitions to produce actual \{ & \} command in an index. + \catcode`\{ = 12 \catcode`\} = 12 + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\@ = 0 \catcode`\\ = 12 + @gdef@lbracecmd[\{]% + @gdef@rbracecmd[\}]% +@endgroup + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. +\let\, = \c +\let\dotaccent = \. +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \t +\let\ubaraccent = \b +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown +% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ptexi + \else\ifx\temp\jmacro \j + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } @@ -536,17 +578,34 @@ where each line of input produces a line of output.} \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} +% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph. + +\def\inmargin#1{% +\strut\vadjust{\nobreak\kern-\strutdepth + \vtop to \strutdepth{\baselineskip\strutdepth\vss + \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}} +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} + %\hbox{{\rm#1}}\hfil\break}} % @include file insert text of that file as input. - -\def\include{\parsearg\includezzz} -%Use \input\thisfile to avoid blank after \input, which may be an active -%char (in which case the blank would become the \input argument). -%The grouping keeps the value of \thisfile correct even when @include -%is nested. -\def\includezzz #1{\begingroup -\def\thisfile{#1}\input\thisfile +% Allow normal characters that we make active in the argument (a file name). +\def\include{\begingroup + \catcode`\\=12 + \catcode`~=12 + \catcode`^=12 + \catcode`_=12 + \catcode`|=12 + \catcode`<=12 + \catcode`>=12 + \catcode`+=12 + \parsearg\includezzz} +% Restore active chars for included file. +\def\includezzz#1{\endgroup\begingroup + % Read the included file in a group so nested @include's work. + \def\thisfile{#1}% + \input\thisfile \endgroup} \def\thisfile{} @@ -561,7 +620,7 @@ where each line of input produces a line of output.} % @sp n outputs n lines of vertical space \def\sp{\parsearg\spxxx} -\def\spxxx #1{\par \vskip #1\baselineskip} +\def\spxxx #1{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment @@ -574,6 +633,9 @@ where each line of input produces a line of output.} \let\c=\comment +% @paragraphindent is defined for the Info formatting commands only. +\let\paragraphindent=\comment + % Prevent errors for section commands. % Used in @ignore and in failing conditionals. \def\ignoresections{% @@ -608,6 +670,7 @@ where each line of input produces a line of output.} % incorrectly. % \def\ignoremorecommands{% + \let\defcodeindex = \relax \let\defcv = \relax \let\deffn = \relax \let\deffnx = \relax @@ -631,6 +694,15 @@ where each line of input produces a line of output.} \let\printindex = \relax \let\pxref = \relax \let\settitle = \relax + \let\setchapternewpage = \relax + \let\setchapterstyle = \relax + \let\everyheading = \relax + \let\evenheading = \relax + \let\oddheading = \relax + \let\everyfooting = \relax + \let\evenfooting = \relax + \let\oddfooting = \relax + \let\headings = \relax \let\include = \relax \let\lowersections = \relax \let\down = \relax @@ -639,7 +711,6 @@ where each line of input produces a line of output.} \let\set = \relax \let\clear = \relax \let\item = \relax - \let\message = \relax } % Ignore @ignore ... @end ignore. @@ -654,6 +725,16 @@ where each line of input produces a line of output.} \def\menu{\doignore{menu}} \def\direntry{\doignore{direntry}} +% Also ignore @macro ... @end macro. The user must run texi2dvi, +% which runs makeinfo to do macro expansion. Ignore @unmacro, too. +\def\macro{\doignore{macro}} +\let\unmacro = \comment + + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory = \comment + % Ignore text until a line `@end #1'. % \def\doignore#1{\begingroup @@ -685,11 +766,12 @@ where each line of input produces a line of output.} \immediate\write16{If you are running another version of TeX, relax.} \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} \immediate\write16{ Then upgrade your TeX installation if you can.} + \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)} \immediate\write16{If you are stuck with version 3.0, run the} \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} \immediate\write16{ to use a workaround.} \immediate\write16{} - \warnedobstrue + \global\warnedobstrue \fi } @@ -765,15 +847,17 @@ where each line of input produces a line of output.} % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we -% didn't need it. +% didn't need it. Make sure the catcode of space is correct to avoid +% losing inside @example, for instance. % -\def\set{\parsearg\setxxx} +\def\set{\begingroup\catcode` =10 \parsearg\setxxx} \def\setxxx#1{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% \def\temp{#2}% \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. \fi + \endgroup } % Can't use \xdef to pre-expand #2 and save some time, since \temp or % \next or other control sequences that we've defined might get us into @@ -788,9 +872,9 @@ where each line of input produces a line of output.} % @value{foo} gets the text saved in variable foo. % \def\value#1{\expandafter - \ifx\csname SET#1\endcsname\relax - {\{No value for ``#1''\}} - \else \csname SET#1\endcsname \fi} + \ifx\csname SET#1\endcsname\relax + {\{No value for ``#1''\}} + \else \csname SET#1\endcsname \fi} % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. @@ -890,6 +974,7 @@ where each line of input produces a line of output.} \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi \global\let\lastnode=\relax} +% @refill is a no-op. \let\refill=\relax % @setfilename is done at the beginning of every texinfo file. @@ -904,11 +989,24 @@ where each line of input produces a line of output.} \comment % Ignore the actual filename. } +% @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} -\def\inforef #1{\inforefzzz #1,,,,**} -\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, - node \samp{\ignorespaces#1{}}} +% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx} +% \def\macroxxx#1#2 \end macro{% +% \expandafter\gdef\macrotemp#1{#2}% +% \endgroup} + +%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx} +%\def\linemacroxxx#1#2 \end linemacro{% +%\let\parsearg=\relax +%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}% +%\expandafter\xdef\macrotemp{\parsearg\macrotempx}% +%\expandafter\gdef\macrotempx#1{#2}% +%\endgroup} + +%\def\butfirst#1{} + \message{fonts,} @@ -920,12 +1018,16 @@ where each line of input produces a line of output.} \def\sf{\fam=\sffam \tensf} \let\li = \sf % Sometimes we call it \li, not \sf. +% We don't need math for this one. +\def\ttsl{\tenttsl} + %% Try out Computer Modern fonts at \magstephalf \let\mainmagstep=\magstephalf % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). -\def\setfont#1#2{\font#1=\fontprefix#2} +% #3 is the font's design size, #4 is a scale factor +\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix @@ -933,96 +1035,119 @@ where each line of input produces a line of output.} \ifx\fontprefix\undefined \def\fontprefix{cm} \fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} %where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} \ifx\bigger\relax \let\mainmagstep=\magstep1 -\setfont\textrm{r12} -\setfont\texttt{tt12} +\setfont\textrm\rmshape{12}{1000} +\setfont\texttt\ttshape{12}{1000} \else -\setfont\textrm{r10 scaled \mainmagstep} -\setfont\texttt{tt10 scaled \mainmagstep} +\setfont\textrm\rmshape{10}{\mainmagstep} +\setfont\texttt\ttshape{10}{\mainmagstep} \fi % Instead of cmb10, you many want to use cmbx10. % cmbx10 is a prettier font on its own, but cmb10 % looks better when embedded in a line with cmr10. -\setfont\textbf{b10 scaled \mainmagstep} -\setfont\textit{ti10 scaled \mainmagstep} -\setfont\textsl{sl10 scaled \mainmagstep} -\setfont\textsf{ss10 scaled \mainmagstep} -\setfont\textsc{csc10 scaled \mainmagstep} +\setfont\textbf\bfshape{10}{\mainmagstep} +\setfont\textit\itshape{10}{\mainmagstep} +\setfont\textsl\slshape{10}{\mainmagstep} +\setfont\textsf\sfshape{10}{\mainmagstep} +\setfont\textsc\scshape{10}{\mainmagstep} +\setfont\textttsl\ttslshape{10}{\mainmagstep} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep % A few fonts for @defun, etc. -\setfont\defbf{bx10 scaled \magstep1} %was 1314 -\setfont\deftt{tt10 scaled \magstep1} +\setfont\defbf\bxshape{10}{\magstep1} %was 1314 +\setfont\deftt\ttshape{10}{\magstep1} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} -% Fonts for indices and small examples. +% Fonts for indices and small examples (9pt). % We actually use the slanted font rather than the italic, % because texinfo normally uses the slanted fonts for that. % Do not make many font distinctions in general in the index, since they % aren't very useful. -\setfont\ninett{tt9} -\setfont\indrm{r9} -\setfont\indit{sl9} +\setfont\ninett\ttshape{9}{1000} +\setfont\indrm\rmshape{9}{1000} +\setfont\indit\slshape{9}{1000} \let\indsl=\indit \let\indtt=\ninett +\let\indttsl=\ninett \let\indsf=\indrm \let\indbf=\indrm -\setfont\indsc{csc10 at 9pt} +\setfont\indsc\scshape{10}{900} \font\indi=cmmi9 \font\indsy=cmsy9 -% Fonts for headings -\setfont\chaprm{bx12 scaled \magstep2} -\setfont\chapit{ti12 scaled \magstep2} -\setfont\chapsl{sl12 scaled \magstep2} -\setfont\chaptt{tt12 scaled \magstep2} -\setfont\chapsf{ss12 scaled \magstep2} +% Chapter (and unnumbered) fonts (17.28pt). +\setfont\chaprm\rmbshape{12}{\magstep2} +\setfont\chapit\itbshape{10}{\magstep3} +\setfont\chapsl\slbshape{10}{\magstep3} +\setfont\chaptt\ttbshape{12}{\magstep2} +\setfont\chapttsl\ttslshape{10}{\magstep3} +\setfont\chapsf\sfbshape{12}{\magstep2} \let\chapbf=\chaprm -\setfont\chapsc{csc10 scaled\magstep3} +\setfont\chapsc\scbshape{10}{\magstep3} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 -\setfont\secrm{bx12 scaled \magstep1} -\setfont\secit{ti12 scaled \magstep1} -\setfont\secsl{sl12 scaled \magstep1} -\setfont\sectt{tt12 scaled \magstep1} -\setfont\secsf{ss12 scaled \magstep1} -\setfont\secbf{bx12 scaled \magstep1} -\setfont\secsc{csc10 scaled\magstep2} +% Section fonts (14.4pt). +\setfont\secrm\rmbshape{12}{\magstep1} +\setfont\secit\itbshape{10}{\magstep2} +\setfont\secsl\slbshape{10}{\magstep2} +\setfont\sectt\ttbshape{12}{\magstep1} +\setfont\secttsl\ttslshape{10}{\magstep2} +\setfont\secsf\sfbshape{12}{\magstep1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 -% \setfont\ssecrm{bx10 scaled \magstep1} % This size an font looked bad. -% \setfont\ssecit{cmti10 scaled \magstep1} % The letters were too crowded. -% \setfont\ssecsl{sl10 scaled \magstep1} -% \setfont\ssectt{tt10 scaled \magstep1} -% \setfont\ssecsf{ss10 scaled \magstep1} +% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. +% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. +% \setfont\ssecsl\slshape{10}{\magstep1} +% \setfont\ssectt\ttshape{10}{\magstep1} +% \setfont\ssecsf\sfshape{10}{\magstep1} -%\setfont\ssecrm{b10 scaled 1315} % Note the use of cmb rather than cmbx. -%\setfont\ssecit{ti10 scaled 1315} % Also, the size is a little larger than -%\setfont\ssecsl{sl10 scaled 1315} % being scaled magstep1. -%\setfont\ssectt{tt10 scaled 1315} -%\setfont\ssecsf{ss10 scaled 1315} +%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. +%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than +%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. +%\setfont\ssectt\ttshape{10}{1315} +%\setfont\ssecsf\sfshape{10}{1315} %\let\ssecbf=\ssecrm -\setfont\ssecrm{bx12 scaled \magstephalf} -\setfont\ssecit{ti12 scaled \magstephalf} -\setfont\ssecsl{sl12 scaled \magstephalf} -\setfont\ssectt{tt12 scaled \magstephalf} -\setfont\ssecsf{ss12 scaled \magstephalf} -\setfont\ssecbf{bx12 scaled \magstephalf} -\setfont\ssecsc{csc10 scaled \magstep1} +% Subsection fonts (13.15pt). +\setfont\ssecrm\rmbshape{12}{\magstephalf} +\setfont\ssecit\itbshape{10}{1315} +\setfont\ssecsl\slbshape{10}{1315} +\setfont\ssectt\ttbshape{12}{\magstephalf} +\setfont\ssecttsl\ttslshape{10}{\magstep1} +\setfont\ssecsf\sfbshape{12}{\magstephalf} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{\magstep1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled \magstep1 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, % but that is not a standard magnification. % Fonts for title page: -\setfont\titlerm{bx12 scaled \magstep3} +\setfont\titlerm\rmbshape{12}{\magstep3} \let\authorrm = \secrm % In order for the font changes to affect most math symbols and letters, @@ -1041,34 +1166,35 @@ where each line of input produces a line of output.} % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this so that font changes will continue to work % in math mode, where it is the current \fam that is relevant in most -% cases, not the current. Plain TeX does, for example, -% \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need -% to redefine \bf itself. +% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam +% \tenbf}, for example. By redefining \tenbf, we obviate the need to +% redefine \bf itself. \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \resetmathfonts} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy - \resetmathfonts} + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl + \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy - \resetmathfonts} + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl + \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy - \resetmathfonts} + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? \def\indexfonts{% \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc - \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy - \resetmathfonts} + \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl + \resetmathfonts \setleading{12pt}} % Set up the default fonts, so we can use them for creating boxes. % @@ -1078,9 +1204,9 @@ where each line of input produces a line of output.} \newcount\fontdepth \fontdepth=0 % Fonts for short table of contents. -\setfont\shortcontrm{r12} -\setfont\shortcontbf{bx12} -\setfont\shortcontsl{sl12} +\setfont\shortcontrm\rmshape{12}{1000} +\setfont\shortcontbf\bxshape{12}{1000} +\setfont\shortcontsl\slshape{12}{1000} %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic @@ -1112,10 +1238,21 @@ where each line of input produces a line of output.} } \let\ttfont=\t \def\samp #1{`\tclose{#1}'\null} -\def\key #1{{\tt \nohyphenation \uppercase{#1}}\null} +\setfont\smallrm\rmshape{8}{1000} +\font\smallsy=cmsy9 +\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% + \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{% + \vbox{\hrule\kern-0.4pt + \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}% + \kern-0.4pt\hrule}% + \kern-.06em\raise0.4pt\hbox{$\rangle$}}}} +% The old definition, with no lozenge: +%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} \let\file=\samp +\let\url=\samp % perhaps include a hypertex \special eventually +\def\email#1{$\langle${\tt #1}$\rangle$} % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. @@ -1141,13 +1278,13 @@ where each line of input produces a line of output.} } % We *must* turn on hyphenation at `-' and `_' in \code. -% Otherwise, it is too hard to avoid overful hboxes +% Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) -% and arrange explicitly to hyphenate an a dash. +% and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active @@ -1170,12 +1307,19 @@ where each line of input produces a line of output.} % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. - +% \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% -\else\tclose{\look}\fi -\else\tclose{\look}\fi} +\else{\tclose{\ttsl\look}}\fi +\else{\tclose{\ttsl\look}}\fi} + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @@ -1185,12 +1329,19 @@ where each line of input produces a line of output.} \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} -\def\l#1{{\li #1}\null} % +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} -\def\r#1{{\rm #1}} % roman font +\def\r#1{{\rm #1}} % roman font % Use of \lowercase was suggested. -\def\sc#1{{\smallcaps#1}} % smallcaps font -\def\ii#1{{\it #1}} % italic font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @pounds{} is a sterling sign. +\def\pounds{{\it\$}} + \message{page headings,} @@ -1205,7 +1356,7 @@ where each line of input produces a line of output.} \def\shorttitlepage{\parsearg\shorttitlepagezzz} \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% - \endgroup\page\hbox{}\page} + \endgroup\page\hbox{}\page} \def\titlepage{\begingroup \parindent=0pt \textfonts \let\subtitlerm=\tenrm @@ -1222,9 +1373,9 @@ where each line of input produces a line of output.} % Now you can print the title using @title. \def\title{\parsearg\titlezzz}% \def\titlezzz##1{\leftline{\titlefont{##1}} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % @@ -1242,7 +1393,7 @@ where each line of input produces a line of output.} \let\oldpage = \page \def\page{% \iffinishedtitlepage\else - \finishtitlepage + \finishtitlepage \fi \oldpage \let\page = \oldpage @@ -1330,14 +1481,15 @@ where each line of input produces a line of output.} % }% unbind the catcode of @. -% @headings double turns headings on for double-sided printing. -% @headings single turns headings on for single-sided printing. -% @headings off turns them off. -% @headings on same as @headings double, retained for compatibility. -% @headings after turns on double-sided headings after this page. -% @headings doubleafter turns on double-sided headings after this page. +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. -% By default, they are off. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} @@ -1351,22 +1503,24 @@ where each line of input produces a line of output.} % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{ -%\pagealignmacro \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage } +\let\contentsalignmacro = \chappager + % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{ -%\pagealignmacro \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} @@ -1377,6 +1531,7 @@ where each line of input produces a line of output.} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} @@ -1385,6 +1540,7 @@ where each line of input produces a line of output.} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings @@ -1408,6 +1564,7 @@ July\or August\or September\or October\or November\or December\fi \def\settitle{\parsearg\settitlezzz} \def\settitlezzz #1{\gdef\thistitle{#1}} + \message{tables,} % @tabs -- simple alignment @@ -1440,7 +1597,7 @@ July\or August\or September\or October\or November\or December\fi \newif\ifitemxneedsnegativevskip -\def\itemxpar{\par\ifitemxneedsnegativevskip\vskip-\parskip\nobreak\fi} +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} @@ -1711,10 +1868,10 @@ July\or August\or September\or October\or November\or December\fi \flushcr} % @multitable macros -% Amy Hendrickson, 8/18/94 +% Amy Hendrickson, 8/18/94, 3/6/96 % -% @multitable ... @endmultitable will make as many columns as desired. -% Contents of each column will wrap at width given in preamble. Width +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. @@ -1723,25 +1880,35 @@ July\or August\or September\or October\or November\or December\fi % To make preamble: % % Either define widths of columns in terms of percent of \hsize: -% @multitable @percentofhsize .2 .3 .5 +% @multitable @columnfractions .25 .3 .45 % @item ... % -% Numbers following @percentofhsize are the percent of the total +% Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. + % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. - +% +% For those who want to use more than one line's worth of words in +% the preamble, break the line within one argument and it +% will parse correctly, i.e., +% +% @multitable {Column 1 template} {Column 2 template} {Column 3 +% template} +% Not: +% @multitable {Column 1 template} {Column 2 template} +% {Column 3 template} % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. -% @item, @tab, @multicolumn or @endmulticolumn do not need to be on their +% @item, @tab, @multitable or @end multitable do not need to be on their % own lines, but it will not hurt if they are. % Sample multitable: @@ -1759,71 +1926,86 @@ July\or August\or September\or October\or November\or December\fi % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. -% @endmultitable +% @end multitable % Default dimensions may be reset by user. -% @intableparskip will set vertical space between paragraphs in table. -% @intableparindent will set paragraph indent in table. -% @spacebetweencols will set horizontal space to be left between columns. -% @spacebetweenlines will set vertical space to be left between lines. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. %%%% % Dimensions -\newdimen\intableparskip -\newdimen\intableparindent -\newdimen\spacebetweencols -\newdimen\spacebetweenlines -\intableparskip=0pt -\intableparindent=6pt -\spacebetweencols=12pt -\spacebetweenlines=12pt +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt %%%% % Macros used to set up halign preamble: \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} -\let\percentofhsize\relax -\def\xpercentofhsize{\percentofhsize} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} \newif\ifsetpercent +%% 2/1/96, to allow fractions to be given with more than one digit. +\def\pickupwholefraction#1 {\global\advance\colcount by1 % +\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% +\setuptable} + \newcount\colcount \def\setuptable#1{\def\firstarg{#1}% \ifx\firstarg\xendsetuptable\let\go\relax% \else - \ifx\firstarg\xpercentofhsize\global\setpercenttrue% + \ifx\firstarg\xcolumnfractions\global\setpercenttrue% \else \ifsetpercent - \if#1.\else% - \global\advance\colcount by1 % - \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% - \fi + \let\go\pickupwholefraction % In this case arg of setuptable + % is the decimal point before the + % number given in percent of hsize. + % We don't need this so we don't use it. \else \global\advance\colcount by1 - \setbox0=\hbox{#1}% + \setbox0=\hbox{#1 }% Add a normal word space as a separator; + % typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi% \fi% - \let\go\setuptable% +\ifx\go\pickupwholefraction\else\let\go\setuptable\fi% \fi\go} + %%%% % multitable syntax -\def\tab{&} +\def\tab{&\hskip1sp\relax} % 2/2/96 + % tiny skip here makes sure this column space is + % maintained, even if it is never used. + %%%% -% @multitable ... @endmultitable definitions: +% @multitable ... @end multitable definitions: -\def\multitable#1\item{\bgroup +\def\multitable{\parsearg\dotable} + +\def\dotable#1{\bgroup \let\item\cr \tolerance=9500 \hbadness=9500 -\parskip=\intableparskip -\parindent=\intableparindent +\setmultitablespacing +\parskip=\multitableparskip +\parindent=\multitableparindent \overfullrule=0pt \global\colcount=0\relax% \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% % To parse everything between @multitable and @item : -\def\one{#1}\expandafter\setuptable\one\endsetuptable +\setuptable#1 \endsetuptable % Need to reset this to 0 after \setuptable. \global\colcount=0\relax% % @@ -1832,11 +2014,11 @@ July\or August\or September\or October\or November\or December\fi % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup&\global\advance\colcount by 1\relax% -\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname +\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname % In order to keep entries from bumping into each other - % we will add a \leftskip of \spacebetweencols to all columns after + % we will add a \leftskip of \multitablecolspace to all columns after % the first one. - % If a template has been used, we will add \spacebetweencols + % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % If user has set preamble in terms of percent of \hsize % we will use that dimension as the width of the column, and @@ -1848,20 +2030,46 @@ July\or August\or September\or October\or November\or December\fi \ifsetpercent \else % If user has set preamble in terms of percent of \hsize - % we will advance \hsize by \spacebetweencols - \advance\hsize by \spacebetweencols + % we will advance \hsize by \multitablecolspace + \advance\hsize by \multitablecolspace \fi - % In either case we will make \leftskip=\spacebetweencols: -\leftskip=\spacebetweencols + % In either case we will make \leftskip=\multitablecolspace: +\leftskip=\multitablecolspace \fi -\noindent##}\cr% +\noindent##\multistrut}\cr% % \everycr will reset column counter, \colcount, at the end of % each line. Every column entry will cause \colcount to advance by one. % The table preamble % looks at the current \colcount to find the correct column width. -\global\everycr{\noalign{\nointerlineskip\vskip\spacebetweenlines +\global\everycr{\noalign{% \filbreak%% keeps underfull box messages off when table breaks over pages. -\global\colcount=0\relax}}} +\global\colcount=0\relax}} +} + +\def\setmultitablespacing{% test to see if user has set \multitablelinespace. +% If so, do nothing. If not, give it an appropriate dimension based on +% current baselineskip. +\ifdim\multitablelinespace=0pt +%% strut to put in table in case some entry doesn't have descenders, +%% to keep lines equally spaced +\let\multistrut = \strut +%% Test to see if parskip is larger than space between lines of +%% table. If not, do nothing. +%% If so, set to same dimension as multitablelinespace. +\else +\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 +width0pt\relax} \fi +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi} + \message{indexing,} % Index generation facilities @@ -1875,14 +2083,14 @@ July\or August\or September\or October\or November\or December\fi % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is foo. +% the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. \def\newindex #1{ \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\openout \csname#1indfile\endcsname \jobname.#1 % Open the file +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex \noexpand\doindex {#1}} } @@ -1894,8 +2102,8 @@ July\or August\or September\or October\or November\or December\fi \def\newcodeindex #1{ \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file -\openout \csname#1indfile\endcsname \jobname.#1 % Open the file -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\openout \csname#1indfile\endcsname \jobname.#1 % Open the file +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex \noexpand\docodeindex {#1}} } @@ -1906,7 +2114,7 @@ July\or August\or September\or October\or November\or December\fi \def\synindex #1 #2 {% \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname \expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex \noexpand\doindex {#2}}% } @@ -1915,7 +2123,7 @@ July\or August\or September\or October\or November\or December\fi \def\syncodeindex #1 #2 {% \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname \expandafter\let\csname#1indfile\endcsname=\synindexfoo -\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex +\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex \noexpand\docodeindex {#2}}% } @@ -1963,24 +2171,31 @@ July\or August\or September\or October\or November\or December\fi \def\L{\realbackslash L}% \def\ss{\realbackslash ss}% % Take care of texinfo commands likely to appear in an index entry. +% (Must be a way to avoid doing expansion at all, and thus not have to +% laboriously list every single command here.) +\def\@{@}% will be @@ when we switch to @ as escape char. +%\let\{ = \lbracecmd +%\let\} = \rbracecmd \def\_{{\realbackslash _}}% \def\w{\realbackslash w }% \def\bf{\realbackslash bf }% -\def\rm{\realbackslash rm }% +%\def\rm{\realbackslash rm }% \def\sl{\realbackslash sl }% \def\sf{\realbackslash sf}% \def\tt{\realbackslash tt}% \def\gtr{\realbackslash gtr}% \def\less{\realbackslash less}% \def\hat{\realbackslash hat}% -\def\char{\realbackslash char}% +%\def\char{\realbackslash char}% \def\TeX{\realbackslash TeX}% \def\dots{\realbackslash dots }% \def\copyright{\realbackslash copyright }% \def\tclose##1{\realbackslash tclose {##1}}% \def\code##1{\realbackslash code {##1}}% +\def\dotless##1{\realbackslash dotless {##1}}% \def\samp##1{\realbackslash samp {##1}}% -\def\t##1{\realbackslash r {##1}}% +\def\,##1{\realbackslash ,{##1}}% +\def\t##1{\realbackslash t {##1}}% \def\r##1{\realbackslash r {##1}}% \def\i##1{\realbackslash i {##1}}% \def\b##1{\realbackslash b {##1}}% @@ -2008,6 +2223,7 @@ July\or August\or September\or October\or November\or December\fi \def\indexnofonts{% % Just ignore accents. +\let\,=\indexdummyfont \let\"=\indexdummyfont \let\`=\indexdummyfont \let\'=\indexdummyfont @@ -2020,6 +2236,7 @@ July\or August\or September\or October\or November\or December\fi \let\u=\indexdummyfont \let\v=\indexdummyfont \let\H=\indexdummyfont +\let\dotless=\indexdummyfont % Take care of the plain tex special European modified letters. \def\oe{oe}% \def\ae{ae}% @@ -2053,6 +2270,7 @@ July\or August\or September\or October\or November\or December\fi \let\var=\indexdummyfont \let\TeX=\indexdummytex \let\dots=\indexdummydots +\def\@{@}% } % To define \realbackslash, we must make \ not be an escape. @@ -2068,29 +2286,37 @@ July\or August\or September\or October\or November\or December\fi % workhorse for all \fooindexes % #1 is name of index, #2 is stuff to put there \def\doind #1#2{% -% Put the index entry in the margin if desired. -\ifx\SETmarginindex\relax\else% -\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% -\fi% -{\count10=\lastpenalty % -{\indexdummies % Must do this here, since \bf, etc expand at this stage -\escapechar=`\\% -{\let\folio=0% Expand all macros now EXCEPT \folio -\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now -% so it will be output as is; and it will print as backslash in the indx. -% -% Now process the index-string once, with all font commands turned off, -% to get the string to sort the index by. -{\indexnofonts -\xdef\temp1{#2}% -}% -% Now produce the complete index entry. We process the index-string again, -% this time with font commands expanded, to get what to print in the index. -\edef\temp{% -\write \csname#1indfile\endcsname{% -\realbackslash entry {\temp1}{\folio}{#2}}}% -\temp }% -}\penalty\count10}} + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% + \fi + {% + \count255=\lastpenalty + {% + \indexdummies % Must do this here, since \bf, etc expand at this stage + \escapechar=`\\ + {% + \let\folio=0 % We will expand all macros now EXCEPT \folio. + \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % First process the index-string with all font commands turned off + % to get the string to sort by. + {\indexnofonts \xdef\indexsorttmp{#2}}% + % + % Now produce the complete index entry, with both the sort key and the + % original text, including any font commands. + \toks0 = {#2}% + \edef\temp{% + \write\csname#1indfile\endcsname{% + \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% + }% + \temp + }% + }% + \penalty\count255 + }% +} \def\dosubind #1#2#3{% {\count10=\lastpenalty % @@ -2151,26 +2377,19 @@ July\or August\or September\or October\or November\or December\fi \def\printindex{\parsearg\doprintindex} -\def\doprintindex#1{% - \tex - \dobreak \chapheadingskip {10000} - \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other - \catcode`\$=\other - \catcode`\~=\other - \indexbreaks +\def\doprintindex#1{\begingroup + \dobreak \chapheadingskip{10000}% % - % The following don't help, since the chars were translated - % when the raw index was written, and their fonts were discarded - % due to \indexnofonts. - %\catcode`\"=\active - %\catcode`\^=\active - %\catcode`\_=\active - %\catcode`\|=\active - %\catcode`\<=\active - %\catcode`\>=\active - % % - \def\indexbackslash{\rawbackslashxx} - \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt + \indexfonts \rm + \tolerance = 9500 + \indexbreaks + \def\indexbackslash{\rawbackslashxx}% + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \catcode`\\ = 0 + \catcode`\@ = 11 + \escapechar = `\\ \begindoublecolumns % % See if the index file exists and is nonempty. @@ -2181,7 +2400,7 @@ July\or August\or September\or October\or November\or December\fi % index. The easiest way to prevent this problem is to make sure % there is some text. (Index is nonexistent) - \else + \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so @@ -2195,8 +2414,7 @@ July\or August\or September\or October\or November\or December\fi \fi \closein 1 \enddoublecolumns - \Etex -} +\endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. @@ -2287,15 +2505,15 @@ July\or August\or September\or October\or November\or December\fi \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par }} -%% Define two-column mode, which is used in indexes. -%% Adapted from the TeXbook, page 416. -\catcode `\@=11 +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 \newbox\partialpage - \newdimen\doublecolumnhsize -\def\begindoublecolumns{\begingroup +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {\global\setbox\partialpage =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% @@ -2328,51 +2546,51 @@ July\or August\or September\or October\or November\or December\fi % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize - \doublecolumnpagegoal } - -\def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage} - -\def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth - \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage - \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1} - \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3} - \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi - \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage + % box0 will be the left-hand column, box1 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 \penalty\outputpenalty } -\def\doublecolumnpagegoal{% - \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@ +\def\pagesofar{% + % The contents of the output page -- any previous material, + % followed by the two boxes we just split. + \unvbox\partialpage + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } -\def\pagesofar{\unvbox\partialpage % - \hsize=\doublecolumnhsize % have to restore this since output routine - \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} -\def\doublecolumnout{% - \setbox5=\copy255 - {\vbadness=10000 \doublecolumnsplit} - \ifvbox255 - \setbox0=\vtop to\dimen@{\unvbox0} - \setbox2=\vtop to\dimen@{\unvbox2} - \onepageout\pagesofar \unvbox255 \penalty\outputpenalty - \else - \setbox0=\vbox{\unvbox5} - \ifvbox0 - \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth - {\vbadness=10000 - \loop \global\setbox5=\copy0 - \setbox1=\vsplit5 to\dimen@ - \setbox3=\vsplit5 to\dimen@ - \ifvbox5 \global\advance\dimen@ by1pt \repeat - \setbox0=\vbox to\dimen@{\unvbox1} - \setbox2=\vbox to\dimen@{\unvbox3} - \global\setbox\partialpage=\vbox{\pagesofar} - \doublecolumnpagegoal - } - \fi - \fi +\def\enddoublecolumns{% + \output={\balancecolumns}\eject % split what we have + \endgroup + % Back to normal single-column typesetting, but take account of the + % fact that we just accumulated some stuff on the output page. + \pagegoal=\vsize +} +\def\balancecolumns{% + % Called on the last page of the double column material. + \setbox0=\vbox{\unvbox255}% + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {\vbadness=10000 \loop \global\setbox3=\copy0 + \global\setbox1=\vsplit3 to\dimen@ + \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + \pagesofar } - \catcode `\@=\other + + \message{sectioning,} % Define chapters, sections, etc. @@ -2544,6 +2762,10 @@ July\or August\or September\or October\or November\or December\fi \global\let\subsubsection = \appendixsubsubsec }} +% @centerchap is like @unnumbered, but the heading is centered. +\outer\def\centerchap{\parsearg\centerchapyyy} +\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} + \outer\def\top{\parsearg\unnumberedyyy} \outer\def\unnumbered{\parsearg\unnumberedyyy} \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz @@ -2646,7 +2868,7 @@ July\or August\or September\or October\or November\or December\fi \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% -\plainsecheading {#1}\gdef\thissection{#1}% +\plainsubsecheading {#1}\gdef\thissection{#1}% {\chapternofonts% \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% \escapechar=`\\% @@ -2691,7 +2913,7 @@ July\or August\or September\or October\or November\or December\fi \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% -\plainsecheading {#1}\gdef\thissection{#1}% +\plainsubsubsecheading {#1}\gdef\thissection{#1}% {\chapternofonts% \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% \escapechar=`\\% @@ -2729,10 +2951,10 @@ July\or August\or September\or October\or November\or December\fi % NOTE on use of \vbox for chapter headings, section headings, and % such: -% 1) We use \vbox rather than the earlier \line to permit -% overlong headings to fold. -% 2) \hyphenpenalty is set to 10000 because hyphenation in a -% heading is obnoxious; this forbids it. +% 1) We use \vbox rather than the earlier \line to permit +% overlong headings to fold. +% 2) \hyphenpenalty is set to 10000 because hyphenation in a +% heading is obnoxious; this forbids it. % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. @@ -2750,11 +2972,10 @@ July\or August\or September\or October\or November\or December\fi \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\penalty 200} -\def\heading{\parsearg\secheadingi} - -\def\subheading{\parsearg\subsecheadingi} - -\def\subsubheading{\parsearg\subsubsecheadingi} +% @heading, @subheading, @subsubheading. +\def\heading{\parsearg\plainsecheading} +\def\subheading{\parsearg\plainsubsecheading} +\def\subsubheading{\parsearg\plainsubsubsecheading} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), @@ -2768,7 +2989,7 @@ July\or August\or September\or October\or November\or December\fi %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) -\newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt +\newskip\chapheadingskip \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} @@ -2777,15 +2998,18 @@ July\or August\or September\or October\or November\or December\fi \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{ +\global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{ +\global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{ +\global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} @@ -2794,25 +3018,39 @@ July\or August\or September\or October\or November\or December\fi \def\CHAPFplain{ \global\let\chapmacro=\chfplain -\global\let\unnumbchapmacro=\unnchfplain} +\global\let\unnumbchapmacro=\unnchfplain +\global\let\centerchapmacro=\centerchfplain} -\def\chfplain #1#2{% +% Plain chapter opening. +% #1 is the text, #2 the chapter number or empty if unnumbered. +\def\chfplain#1#2{% \pchapsepmacro {% - \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #2\enspace #1}% + \chapfonts \rm + \def\chapnum{#2}% + \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent = \wd0 \centerparametersmaybe + \unhbox0 #1\par}% }% - \bigskip - \penalty5000 + \nobreak\bigskip % no page break after a chapter title + \nobreak } -\def\unnchfplain #1{% -\pchapsepmacro % -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 10000 % -} +% Plain opening for unnumbered. +\def\unnchfplain#1{\chfplain{#1}{}} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerchfplain#1{{% + \def\centerparametersmaybe{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt + }% + \chfplain{#1}{}% +}} + \CHAPFplain % The default \def\unnchfopen #1{% @@ -2826,73 +3064,81 @@ July\or August\or September\or October\or November\or December\fi \par\penalty 5000 % } +\def\centerchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt + \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 % +} + \def\CHAPFopen{ \global\let\chapmacro=\chfopen -\global\let\unnumbchapmacro=\unnchfopen} +\global\let\unnumbchapmacro=\unnchfopen +\global\let\centerchapmacro=\centerchfopen} + -% Parameter controlling skip before section headings. +% Section titles. +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip {-1000}} +\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} +\def\plainsecheading#1{\sectionheading{sec}{}{#1}} -\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt +% Subsection titles. +\newskip \subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} +\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} +\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} -\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt -\def\secheadingbreak{\dobreak \secheadingskip {-1000}} +% Subsubsection titles. +\let\subsubsecheadingskip = \subsecheadingskip +\let\subsubsecheadingbreak = \subsecheadingbreak +\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} +\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} -% @paragraphindent is defined for the Info formatting commands only. -\let\paragraphindent=\comment -% Section fonts are the base font at magstep2, which produces -% a size a bit more than 14 points in the default situation. - -\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} -\def\plainsecheading #1{\secheadingi {#1}} -\def\secheadingi #1{{\advance \secheadingskip by \parskip % -\secheadingbreak}% -{\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - - -% Subsection fonts are the base font at magstep1, -% which produces a size of 12 points. - -\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} -\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % -\subsecheadingbreak}% -{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } - -\def\subsubsecfonts{\subsecfonts} % Maybe this should change: - % Perhaps make sssec fonts scaled - % magstep half -\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} -\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % -\subsecheadingbreak}% -{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}% -\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} +% Print any size section title. +% +% #1 is the section type (sec/subsec/subsubsec), #2 is the section +% number (maybe empty), #3 the text. +\def\sectionheading#1#2#3{% + {% + \expandafter\advance\csname #1headingskip\endcsname by \parskip + \csname #1headingbreak\endcsname + }% + {% + % Switch to the right set of fonts. + \csname #1fonts\endcsname \rm + % + % Only insert the separating space if we have a section number. + \def\secnum{#2}% + \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% + % + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent = \wd0 % zero if no section number + \unhbox0 #3}% + }% + \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak +} \message{toc printing,} - % Finish up the main text and prepare to read what we've written % to \contentsfile. \newskip\contentsrightmargin \contentsrightmargin=1in \def\startcontents#1{% - \pagealignmacro + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro \immediate\closeout \contentsfile \ifnum \pageno>0 - \pageno = -1 % Request roman numbered pages. + \pageno = -1 % Request roman numbered pages. \fi % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \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`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi \raggedbottom % Worry more about breakpoints than the bottom. @@ -2918,6 +3164,7 @@ July\or August\or September\or October\or November\or December\fi \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \rm + \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\secentry ##1##2##3##4{} \def\unnumbsecentry ##1##2{} @@ -2961,7 +3208,7 @@ July\or August\or September\or October\or November\or December\fi % This space should be plenty, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % (This space doesn't include the extra space that gets added after - % the label; that gets put in in \shortchapentry above.) + % the label; that gets put in by \shortchapentry above.) \advance\dimen0 by 1.1em \hbox to \dimen0{#1\hfil}% } @@ -2982,22 +3229,21 @@ July\or August\or September\or October\or November\or December\fi \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} - % This parameter controls the indentation of the various levels. \newdimen\tocindent \tocindent = 3pc % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % -% If the toc has to be broken over pages, we would want to be at chapters +% If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% - \penalty-300 \vskip\baselineskip + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno{#2}}% \endgroup - \nobreak\vskip .25\baselineskip + \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup @@ -3022,7 +3268,7 @@ July\or August\or September\or October\or November\or December\fi % % \turnoffactive is for the sake of @" used for umlauts. \def\tocentry#1#2{\begingroup - \hyphenpenalty = 10000 + \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks \entry{\turnoffactive #1}{\turnoffactive #2}% \endgroup} @@ -3047,8 +3293,6 @@ July\or August\or September\or October\or November\or December\fi \newbox\pushcharbox \newbox\bullbox \newbox\equivbox \newbox\errorbox -\let\ptexequiv = \equiv - %{\tentt %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} @@ -3059,12 +3303,11 @@ July\or August\or September\or October\or November\or December\fi % depth .1ex\hfil} %} +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. \def\point{$\star$} - \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} - \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} % Adapted from the TeXbook's \boxit. @@ -3096,7 +3339,7 @@ July\or August\or September\or October\or November\or December\fi \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie \catcode `\%=14 -\catcode 43=12 +\catcode 43=12 % plus \catcode`\"=12 \catcode`\==12 \catcode`\|=12 @@ -3104,16 +3347,18 @@ July\or August\or September\or October\or November\or December\fi \catcode`\>=12 \escapechar=`\\ % +\let\,=\ptexcomma \let\~=\ptextilde \let\{=\ptexlbrace \let\}=\ptexrbrace \let\.=\ptexdot \let\*=\ptexstar \let\dots=\ptexdots +\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}} +\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi} \def\@{@}% \let\bullet=\ptexbullet -\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl -\let\L=\ptexL +\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext % \let\Etex=\endgroup} @@ -3172,50 +3417,50 @@ July\or August\or September\or October\or November\or December\fi \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip - \ctl\leaders\hrule height\circthick\hfil\ctr - \hskip\rskip}} + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip - \cbl\leaders\hrule height\circthick\hfil\cbr - \hskip\rskip}} + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} % \newskip\lskip\newskip\rskip \long\def\cartouche{% \begingroup - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt %we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18pt % allow for 3pt kerns on either -% side, and for 6pt waste from -% each corner char - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \hsize=\cartinner - \kern3pt - \begingroup - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt %we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18pt % allow for 3pt kerns on either +% side, and for 6pt waste from +% each corner char + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing=\comment + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \hsize=\cartinner + \kern3pt + \begingroup + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip \def\Ecartouche{% - \endgroup - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup + \endgroup + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup \endgroup }} @@ -3278,8 +3523,7 @@ July\or August\or September\or October\or November\or December\fi \let\Esmalllisp = \nonfillfinish \let\Esmallexample = \nonfillfinish % - % Smaller interline space and fonts for small examples. - \setleading{10pt}% + % Smaller fonts for small examples. \indexfonts \tt \rawbackslash % make \ output the \ character from the current font (tt) \gobble @@ -3807,6 +4051,7 @@ July\or August\or September\or October\or November\or December\fi \def\deftpx #1 {\errmessage{@deftpx in invalid context}} + \message{cross reference,} % Define cross-reference macros \newwrite \auxfile @@ -3814,6 +4059,11 @@ July\or August\or September\or October\or November\or December\fi \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. +% @inforef is simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + % \setref{foo} defines a cross-reference point named foo. \def\setref#1{% @@ -3847,7 +4097,7 @@ July\or August\or September\or October\or November\or December\fi \setbox0=\hbox{\printednodename}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. - \ifx\SETxref-automatic-section-title\thisisundefined + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. \def\printednodename{\ignorespaces #1}% \else @@ -4049,7 +4299,8 @@ July\or August\or September\or October\or November\or December\fi % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is -% removed. +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for info output only.. @@ -4174,13 +4425,18 @@ July\or August\or September\or October\or November\or December\fi % Set some numeric style parameters, for 8.5 x 11 format. -%\hsize = 6.5in +\hsize = 6in +\hoffset = .25in \newdimen\defaultparindent \defaultparindent = 15pt \parindent = \defaultparindent -\parskip 18pt plus 1pt -\setleading{15pt} +\parskip 3pt plus 2pt minus 1pt +\setleading{13.2pt} \advance\topskip by 1.2cm +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + % Prevent underfull vbox error messages. \vbadness=10000 @@ -4203,30 +4459,28 @@ July\or August\or September\or October\or November\or December\fi % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) \def\smallbook{ - -% These values for secheadingskip and subsecheadingskip are -% experiments. RJC 7 Aug 1992 -\global\secheadingskip = 17pt plus 6pt minus 3pt -\global\subsecheadingskip = 14pt plus 6pt minus 3pt - -\global\lispnarrowing = 0.3in -\setleading{12pt} -\advance\topskip by -1cm -\global\parskip 3pt plus 1pt -\global\hsize = 5in -\global\vsize=7.5in -\global\tolerance=700 -\global\hfuzz=1pt -\global\contentsrightmargin=0pt -\global\deftypemargin=0pt -\global\defbodyindent=.5cm - -\global\pagewidth=\hsize -\global\pageheight=\vsize - -\global\let\smalllisp=\smalllispx -\global\let\smallexample=\smalllispx -\global\def\Esmallexample{\Esmalllisp} + \global\chapheadingskip = 15pt plus 4pt minus 2pt + \global\secheadingskip = 12pt plus 3pt minus 2pt + \global\subsecheadingskip = 9pt plus 2pt minus 2pt + % + \global\lispnarrowing = 0.3in + \setleading{12pt} + \advance\topskip by -1cm + \global\parskip 2pt plus 1pt + \global\hsize = 5in + \global\vsize=7.5in + \global\tolerance=700 + \global\hfuzz=1pt + \global\contentsrightmargin=0pt + \global\deftypemargin=0pt + \global\defbodyindent=.5cm + % + \global\pagewidth=\hsize + \global\pageheight=\vsize + % + \global\let\smalllisp=\smalllispx + \global\let\smallexample=\smalllispx + \global\def\Esmallexample{\Esmalllisp} } % Use @afourpaper to print on European A4 paper. @@ -4249,12 +4503,19 @@ July\or August\or September\or October\or November\or December\fi \global\pageheight=\vsize } +\bindingoffset=0pt +\normaloffset=\hoffset +\pagewidth=\hsize +\pageheight=\vsize + % Allow control of the text dimensions. Parameters in order: textheight; -% textwidth; \voffset; \hoffset (!); binding offset. All require a dimension; +% textwidth; voffset; hoffset; binding offset; topskip. +% All require a dimension; % header is additional; added length extends the bottom of the page. -\def\changepagesizes#1#2#3#4#5{ +\def\changepagesizes#1#2#3#4#5#6{ \global\vsize= #1 + \global\topskip= #6 \advance\vsize by \topskip \global\voffset= #3 \global\hsize= #2 @@ -4267,13 +4528,20 @@ July\or August\or September\or October\or November\or December\fi \global\normaloffset= #4 \global\bindingoffset= #5} -% This layout is compatible with Latex on A4 paper. - -\def\afourlatex{\changepagesizes{22cm}{15cm}{7mm}{4.6mm}{5mm}} +% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin +% 29mm, hence bottom margin 28mm, nominal side margin 3cm. +\def\afourlatex + {\global\tolerance=700 + \global\hfuzz=1pt + \setleading{12pt} + \global\parskip 15pt plus 1pt + \advance\baselineskip by 1.6pt + \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm} + } % Use @afourwide to print on European A4 paper in wide format. \def\afourwide{\afourpaper -\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}} +\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}} % Define macros to output various characters with catcode for normal text. \catcode`\"=\other diff --git a/gnu/usr.bin/texinfo/texinfo.texi b/gnu/usr.bin/texinfo/texinfo.texi index eaf26f4fbd5..975bb498c18 100644 --- a/gnu/usr.bin/texinfo/texinfo.texi +++ b/gnu/usr.bin/texinfo/texinfo.texi @@ -2,59 +2,50 @@ @comment %**start of header @setfilename texinfo @settitle Texinfo @value{edition} -@syncodeindex vr fn +@c Define a new index for options. +@defcodeindex op +@c Put everything except function (command, in this case) names in one +index (arbitrarily chosen to be the concept index). +@syncodeindex op cp +@syncodeindex vr cp +@syncodeindex pg cp @footnotestyle separate @paragraphindent 2 -@smallbook +@finalout @comment %**end of header +@comment $Id: texinfo.texi,v 1.1.1.3 1996/12/15 21:38:04 downsj Exp $ + +@c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with a +@c prefix arg). This updates the node pointers, which texinfmt.el needs. + +@dircategory Texinfo documentation system +@direntry +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +@end direntry @c Set smallbook if printing in smallbook format so the example of the @c smallbook font is actually written using smallbook; in bigbook, a kludge @c is used for TeX output. +@smallbook @set smallbook @c @@clear smallbook -@ignore -@ifinfo -@format -START-INFO-DIR-ENTRY -* Texinfo: (texinfo). The documentation format for the GNU Project. -END-INFO-DIR-ENTRY -@end format -@end ifinfo -@end ignore - -@set edition 2.21 -@set update-date 7 June 1995 -@set update-month June 1995 - -@c Experiment with smaller amounts of whitespace between chapters -@c and sections. -@tex -\global\chapheadingskip = 15pt plus 4pt minus 2pt -\global\secheadingskip = 12pt plus 3pt minus 2pt -\global\subsecheadingskip = 9pt plus 2pt minus 2pt -@end tex - -@c Experiment with smaller amounts of whitespace between paragraphs in -@c the 8.5 by 11 inch format. -@ifclear smallbook -@tex -\global\parskip 6pt plus 1pt -@end tex -@end ifclear - -@finalout +@set edition 2.23 +@set update-month October 1996 +@set update-date 1 @value{update-month} @c Currently undocumented command, 5 December 1993: @c @c nwnode (Same as node, but no warnings; for `makeinfo'.) @ifinfo -This file documents Texinfo, a documentation system that uses a single -source file to produce both on-line information and a printed manual. +This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. -Copyright (C) 1988, 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc. +Copyright (C) 1988, 90, 91, 92, 93, 95, 1996 Free Software Foundation, Inc. This is the second edition of the Texinfo documentation,@* and is consistent with version 2 of @file{texinfo.tex}. @@ -92,14 +83,15 @@ by the Free Software Foundation. @subtitle Edition @value{edition}, for Texinfo Version Three @subtitle @value{update-month} -@author by Robert J. Chassell and Richard M. Stallman +@author Robert J.@: Chassell +@author Richard M.@: Stallman -@comment Include the Distribution inside the titlepage so -@c that headings are turned off. +@c Include the Distribution inside the titlepage so +@c that headings are turned off. @page @vskip 0pt plus 1filll -Copyright @copyright{} 1988, 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc. +Copyright @copyright{} 1988, 1990, 1991, 1992, 1993, 1995, 1996 Free Software Foundation, Inc. @sp 2 This is the second edition of the Texinfo documentation,@* @@ -110,8 +102,9 @@ Published by the Free Software Foundation @* 59 Temple Place Suite 330, @* Boston, MA 02111-1307 USA @* Printed copies are available for $15 each.@* -ISBN 1-882114-63-9 -@c ISBN number 1-882114-63-9 is for edition 2.20 of 28 February 1995 +ISBN 1-882114-64-7 +@c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995 +@c ISBN 1-882114-64-7 is for edition 2.23 of 1 October 1996. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -141,12 +134,12 @@ The first part of this master menu lists the major nodes in this Info document, including the @@-command and concept indices. The rest of the menu lists all the lower level nodes in the document.@refill -This is Edition @value{edition} of the Texinfo documentation, +This is Edition @value{edition} of the Texinfo documentation, @w{@value{update-date},} for Texinfo Version Three. @end ifinfo @c Here is a spare copy of the chapter menu entry descriptions, -@c in case they are accidently deleted +@c in case they are accidently deleted @ignore Your rights. Texinfo in brief. @@ -191,7 +184,7 @@ A menu covering many topics. @end ignore @menu -* Copying:: Your rights. +* Copying:: Your rights. * Overview:: Texinfo in brief. * Texinfo Mode:: How to use Texinfo mode. * Beginning a File:: What is at the beginning of a Texinfo file? @@ -211,10 +204,11 @@ A menu covering many topics. * Glyphs:: How to indicate results of evaluation, expansion of macros, errors, etc. * Breaks:: How to force and prevent line and page breaks. -* Definition Commands:: How to describe functions and the like +* Definition Commands:: How to describe functions and the like in a uniform manner. * Footnotes:: How to write footnotes. * Conditionals:: How to specify text for either @TeX{} or Info. +* Macros:: Defining new Texinfo commands. * Format/Print Hardcopy:: How to convert a Texinfo file to a file for printing and how to print that file. * Create an Info File:: Convert a Texinfo file into an Info file. @@ -234,11 +228,13 @@ A menu covering many topics. * Command and Variable Index:: A menu containing commands and variables. * Concept Index:: A menu covering many topics. +@detailmenu + --- The Detailed Node Listing --- Overview of Texinfo -* Using Texinfo:: Create a conventional printed book +* Using Texinfo:: Create a conventional printed book or an Info file. * Info Files:: What is an Info file? * Printed Books:: Characteristics of a printed book or manual. @@ -256,7 +252,7 @@ Using Texinfo Mode * Texinfo Mode Overview:: How Texinfo mode can help you. * Emacs Editing:: Texinfo mode adds to GNU Emacs' general purpose editing features. -* Inserting:: How to insert frequently used @@-commands. +* Inserting:: How to insert frequently used @@-commands. * Showing the Structure:: How to show the structure of a file. * Updating Nodes and Menus:: How to update or create new nodes and menus. * Info Formatting:: How to format for Info. @@ -285,7 +281,7 @@ Beginning a Texinfo File The Texinfo File Header -* First Line:: The first line of a Texinfo file. +* First Line:: The first line of a Texinfo file. * Start of Header:: Formatting a region requires this. * setfilename:: Tell Info the name of the Info file. * settitle:: Create a title for the printed work. @@ -314,7 +310,7 @@ The `Top' Node and Master Menu Ending a Texinfo File -* Printing Indices & Menus:: How to print an index in hardcopy and +* Printing Indices & Menus:: How to print an index in hardcopy and generate index menus in Info. * Contents:: How to create a table of contents. * File End:: How to mark the end of a file. @@ -336,7 +332,7 @@ Chapter Structuring Nodes -* Two Paths:: Different commands to structure +* Two Paths:: Different commands to structure Info output and printed output. * Node Menu Illustration:: A diagram, and sample nodes and menus. * node:: How to write a node, in detail. @@ -349,7 +345,7 @@ The @code{@@node} Command * Node Line Tips:: Keep names short. * Node Line Requirements:: Keep names unique, without @@-commands. * First Node:: How to write a `Top' node. -* makeinfo top command:: How to use the @code{@@top} command. +* makeinfo top command:: How to use the @code{@@top} command. * Top Node Summary:: Write a brief description for readers. Menus @@ -396,6 +392,8 @@ Indicating Definitions, Commands, etc. * file:: How to indicate the name of a file. * dfn:: How to specify a definition. * cite:: How to refer to a book that is not in Info. +* url:: How to indicate a world wide web reference. +* email:: How to indicate an electronic mail address. Emphasizing Text @@ -406,7 +404,7 @@ Emphasizing Text Quotations and Examples -* Block Enclosing Commands:: Use different constructs for +* Block Enclosing Commands:: Use different constructs for different purposes. * quotation:: How to write a quotation. * example:: How to write an example in a fixed-width font. @@ -426,6 +424,7 @@ Making Lists and Tables * itemize:: How to construct a simple list. * enumerate:: How to construct a numbered list. * Two-column Tables:: How to construct a two-column table. +* Multi-column Tables:: How to construct generalized tables. Making a Two-column Table @@ -434,6 +433,11 @@ Making a Two-column Table with automatic indexing. * itemx:: How to put more entries in the first column. +Multi-column Tables + +* Multitable Column Widths:: Defining multitable column widths. +* Multitable Rows:: Defining multitable rows, with examples. + Creating Indices * Index Entries:: Choose different words for index entries. @@ -452,20 +456,28 @@ Combining Indices Special Insertions -* Braces Atsigns Periods:: How to insert braces, @samp{@@} and periods. -* dmn:: How to format a dimension. +* Braces Atsigns:: How to insert braces, @samp{@@}. +* Inserting Space:: How to insert the right amount of space + within a sentence. +* Inserting Accents:: How to insert accents and special characters. * Dots Bullets:: How to insert dots and bullets. -* TeX and copyright:: How to insert the @TeX{} logo +* TeX and copyright:: How to insert the @TeX{} logo and the copyright symbol. +* pounds:: How to insert the pounds currency symbol. * minus:: How to insert a minus sign. * math:: How to format a mathematical expression. -Inserting @samp{@@}, Braces, and Periods +Inserting @@ and Braces -* Inserting An Atsign:: -* Inserting Braces:: How to insert @samp{@{} and @samp{@}} -* Controlling Spacing:: How to insert the right amount of space - after punctuation within a sentence. +* Inserting An Atsign:: How to insert @samp{@@}. +* Inserting Braces:: How to insert @samp{@{} and @samp{@}}. + +Inserting Space + +* Not Ending a Sentence:: Sometimes a . doesn't end a sentence. +* Ending a Sentence:: Sometimes it does. +* Multiple Spaces:: Inserting multiple spaces. +* dmn:: How to format a dimension. Inserting Ellipsis, Dots, and Bullets @@ -477,7 +489,7 @@ Inserting @TeX{} and the Copyright Symbol * tex:: How to insert the @TeX{} logo. * copyright symbol:: How to use @code{@@copyright}@{@}. -Glyphs for Examples +Glyphs for Examples * Glyphs Summary:: * result:: How to show the result of expression. @@ -491,7 +503,8 @@ Making and Preventing Breaks * Break Commands:: Cause and prevent splits. * Line Breaks:: How to force a single line to use two lines. -* w:: How to prevent unwanted line breaks. +* - and hyphenation:: How to tell TeX about hyphenation points. +* w:: How to prevent unwanted line breaks. * sp:: How to insert blank lines. * page:: How to force the start of a new page. * group:: How to prevent unwanted page breaks. @@ -523,7 +536,7 @@ Footnotes Conditionally Visible Text -* Conditional Commands:: How to specify text for Info or @TeX{}. +* Conditional Commands:: How to specify text for HTML, Info, or @TeX{}. * Using Ordinary TeX Commands:: You can use any and all @TeX{} commands. * set clear value:: How to designate which text to format (for both Info and @TeX{}); and how to set a @@ -532,9 +545,14 @@ Conditionally Visible Text @code{@@set}, @code{@@clear}, and @code{@@value} * ifset ifclear:: Format a region if a flag is set. -* value:: Replace a flag with a string. +* value:: Replace a flag with a string. * value Example:: An easy way to update edition information. +Macros: Defining New Texinfo Commands + +* Defining Macros:: Both defining and undefining new commands. +* Invoking Macros:: Using a macro, once you've defined it. + Format and Print Hardcopy * Use TeX:: Use @TeX{} to format for hardcopy. @@ -560,18 +578,21 @@ Creating an Info File * Pointer Validation:: How to check that pointers point somewhere. * makeinfo in Emacs:: How to run @code{makeinfo} from Emacs. * texinfo-format commands:: Two Info formatting commands written - in Emacs Lisp are an alternative + in Emacs Lisp are an alternative to @code{makeinfo}. * Batch Formatting:: How to format for Info in Emacs Batch mode. -* Tag and Split Files:: How tagged and split files help Info +* Tag and Split Files:: How tagged and split files help Info to run better. Installing an Info File * Directory file:: The top level menu for all Info files. * New Info File:: Listing a new info file. -* Other Info Directories:: How to specify Info files that are +* Other Info Directories:: How to specify Info files that are located in other directories. +* Installing Dir Entries:: How to specify what menu entry to add + to the Info directory. +* Invoking install-info:: @code{install-info} options. Sample Permissions @@ -617,6 +638,7 @@ Second Edition Features * New Texinfo Mode Commands:: The updating commands are especially useful. * New Commands:: Many newly described @@-commands. +@end detailmenu @end menu @node Copying, Overview, Top, Top @@ -673,7 +695,7 @@ the word @TeX{}, the @samp{X} is actually the Greek letter ``chi'' rather than the English letter ``ex''. Pronounce @TeX{} as if the @samp{X} were the last sound in the name `Bach'; but pronounce Texinfo as if the @samp{x} were a `k'. Spell ``Texinfo'' with a capital ``T'' -and write the other letters in lower case.} +and write the other letters in lower case.} is a documentation system that uses a single source file to produce both on-line information and printed output. This means that instead of writing two different documents, one for the on-line help or other on-line @@ -683,7 +705,7 @@ only one document. (You can read the on-line information, known as an @dfn{Info file}, with an Info documentation-reading program.)@refill @menu -* Using Texinfo:: Create a conventional printed book +* Using Texinfo:: Create a conventional printed book or an Info file. * Info Files:: What is an Info file? * Printed Books:: Characteristics of a printed book or manual. @@ -714,11 +736,10 @@ Emacs Manual} is a good example of a Texinfo file, as is this manual.@refill To make a printed document, you process a Texinfo source file with the @TeX{} typesetting program. This creates a @sc{dvi} file that you can -typeset and print as a book or report. (Note that the Texinfo language is -completely different from @TeX{}'s usual language, Plain@TeX{}, which -Texinfo replaces.) If you do not have @TeX{}, but do have -@code{troff} or @code{nroff}, you can use the @code{texi2roff} program -instead.@refill +typeset and print as a book or report. (Note that the Texinfo language +is completely different from @TeX{}'s usual language, plain @TeX{}.) If +you do not have @TeX{}, but do have @code{troff} or @code{nroff}, you +can use the @code{texi2roff} program instead.@refill To make an Info file, you process a Texinfo source file with the @code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command; @@ -778,7 +799,7 @@ nodes. Generally, an Info file is organized like a book. If a node is at the logical level of a chapter, its child nodes are at the level of sections; likewise, the child nodes of sections are at the level of subsections.@refill - + All the children of any one parent are linked together in a bidirectional chain of `Next' and `Previous' pointers. The `Next' pointer provides a link to the next section, and the `Previous' pointer @@ -820,7 +841,7 @@ systematically by going from node to node, or you can go to a specific node listed in the main menu, or you can search the index menus and then go directly to the node that has the information you want.@refill @c !!! With the standalone Info system you may go to specific nodes -@c directly.. +@c directly.. If you want to read through an Info file in sequence, as if it were a printed manual, you can get the whole file with the advanced Info @@ -832,7 +853,7 @@ info}.)@refill @c /usr/local/lib/emacs/info mentioned in info.c DEFAULT_INFOPATH @c /usr/gnu/info mentioned in info.c DEFAULT_INFOPATH @c /usr/local/info -@c /usr/local/lib/info +@c /usr/local/lib/info The @file{dir} file in the @file{info} directory serves as the departure point for the whole Info system. From it, you can reach the `Top' nodes of each of the documents in a complete Info system.@refill @@ -846,6 +867,7 @@ departure point for the whole Info system. From it, you can reach the @cindex Texinfo printed book characteristics @cindex Characteristics, printed books or manuals +@cindex Knuth, Donald A Texinfo file can be formatted and typeset as a printed book or manual. To do this, you need @TeX{}, a powerful, sophisticated typesetting program written by Donald Knuth.@footnote{You can also use the @@ -870,7 +892,7 @@ file called @file{texinfo.tex} that contains information (definitions or (@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commands to @TeX{} commands, which @TeX{} can then process to create the typeset document.) @file{texinfo.tex} contains the specifications for printing -a document.@refill +a document.@refill Most often, documents are printed on 8.5 inch by 11 inch pages (216@dmn{mm} by 280@dmn{mm}; this is the default size), but you @@ -992,7 +1014,7 @@ syntax, see @ref{Command Syntax, , @@-Command Syntax}.)@refill @cindex Syntactic conventions @cindex Conventions, syntactic -All @sc{ascii} printing characters except @samp{@@}, @samp{@{} and +All printable @sc{ascii} characters except @samp{@@}, @samp{@{} and @samp{@}} can appear in a Texinfo file and stand for themselves. @samp{@@} is the escape character which introduces commands. @samp{@{} and @samp{@}} should be used only to surround arguments to @@ -1014,7 +1036,7 @@ begin and end quotations: @w{@tt{ `` }} and @w{@tt{ '' }}. This convention should be followed in Texinfo files. @TeX{} converts doubled single-quote characters to left- and right-hand doubled quotation marks, ``like this'', and Info converts doubled single-quote -characters to @sc{ascii} double-quotes: @w{@tt{ `` }} and +characters to @sc{ascii} double-quotes: @w{@tt{ `` }} and @w{@tt{ '' }} to @w{@tt{ " }}.@refill @end iftex @@ -1030,11 +1052,12 @@ paragraph.@refill If you mark off a region of the Texinfo file with the @code{@@iftex} and @w{@code{@@end iftex}} commands, that region will appear only in the printed copy; in that region, you can use certain commands -borrowed from Plain@TeX{} that you cannot use in Info. Likewise, if +borrowed from plain @TeX{} that you cannot use in Info. Likewise, if you mark off a region with the @code{@@ifinfo} and @code{@@end ifinfo} commands, that region will appear only in the Info file; in that region, you can use Info commands that you cannot use in @TeX{}. -(@xref{Conditionals}.) +Similarly for @code{@@ifhtml} and @code{@@end ifhtml}. +@xref{Conditionals}. @cindex Tabs; don't use! @quotation @@ -1062,7 +1085,7 @@ either the Info file or the printed manual by using the Such comments are for the person who reads the Texinfo file. All the text on a line that follows either @code{@@comment} or @code{@@c} is a comment; the rest of the line does not appear in either the Info file -or the printed manual. (Often, you can write the @code{@@comment} or +or the printed manual. (Often, you can write the @code{@@comment} or @code{@@c} in the middle of a line, and only the text that follows after the @code{@@comment} or @code{@@c} command does not appear; but some commands, such as @code{@@settitle} and @code{@@setfilename}, work on a @@ -1110,8 +1133,8 @@ extension is preferred since it describes more clearly to a human reader the nature of the file. The shorter extensions are for operating systems that cannot handle long file names.@refill -In order to be made into a printed manual and an Info file, a -Texinfo file @strong{must} begin with lines like this:@refill +In order to be made into a printed manual and an Info file, a Texinfo +file @strong{must} begin with lines like this:@refill @example @group @@ -1135,9 +1158,9 @@ The @samp{\input texinfo} line tells @TeX{} to use the @file{texinfo.tex} file, which tells @TeX{} how to translate the Texinfo @@-commands into @TeX{} typesetting commands. (Note the use of the backslash, @samp{\}; this is correct for @TeX{}.) The -@samp{@@setfilename} line provides a name for the Info file and the -@samp{@@settitle} line specifies a title for the page headers (or -footers) of the printed manual.@refill +@samp{@@setfilename} line provides a name for the Info file and tells +@TeX{} to open auxiliary files. The @samp{@@settitle} line specifies a +title for the page headers (or footers) of the printed manual.@refill The @code{@@bye} line at the end of the file on a line of its own tells the formatters that the file is ended and to stop formatting.@refill @@ -1158,7 +1181,7 @@ beginning of a Texinfo file, like this:@refill @noindent In the first line, @samp{-*-texinfo-*-} causes Emacs to switch into -Texinfo mode when you edit the file. +Texinfo mode when you edit the file. The @code{@@c} lines which surround the @samp{@@setfilename} and @samp{@@settitle} lines are optional, but you need them in order to @@ -1189,7 +1212,7 @@ file. The segment must be enclosed between @code{@@ifinfo} and @code{@@end ifinfo} commands so that the formatters place it only in the Info file.@refill -@item 3. Title and Copyright +@item 3. Title and Copyright The @dfn{Title and Copyright} segment contains the title and copyright pages and copying permissions for the printed manual. The segment must be enclosed between @code{@@titlepage} and @code{@@end titlepage} commands. @@ -1223,8 +1246,8 @@ File}.)@refill @noindent In the following, the sample text is @emph{indented}; comments on it are -not. The complete file, without any comments, is shown in -@ref{Sample Texinfo File}. +not. The complete file, without any comments, is shown in +@ref{Sample Texinfo File}. @subheading Part 1: Header @@ -1235,7 +1258,7 @@ name of the Info file and the title used in the header. @example @group -\input texinfo @@c -*-texinfo-*- +\input texinfo @@c -*-texinfo-*- @@c %**start of header @@setfilename sample.info @@settitle Sample Document @@ -1300,7 +1323,7 @@ a menu, the master menu appears only in the Info file. @example @group @@menu -* First Chapter:: The first chapter is the +* First Chapter:: The first chapter is the only chapter in this sample. * Concept Index:: This index has two entries. @@end menu @@ -1323,7 +1346,7 @@ chapter containing an enumerated list.@refill @end group @group -This is the contents of the first chapter. +This is the contents of the first chapter. @@cindex Another sample index entry @end group @@ -1341,8 +1364,8 @@ This is the second item. @group The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@} -commands transform a Texinfo file such as this into -an Info file; and @@TeX@{@} typesets it for a printed +commands transform a Texinfo file such as this into +an Info file; and @@TeX@{@} typesets it for a printed manual. @end group @end example @@ -1377,7 +1400,7 @@ Here is what the contents of the first chapter of the sample look like: @sp 1 @need 700 @quotation -This is the contents of the first chapter. +This is the contents of the first chapter. Here is a numbered list. @@ -1389,25 +1412,32 @@ This is the first item. This is the second item. @end enumerate -The @code{makeinfo} and @code{texinfo-format-buffer} -commands transform a Texinfo file such as this into -an Info file; and @TeX{} typesets it for a printed +The @code{makeinfo} and @code{texinfo-format-buffer} +commands transform a Texinfo file such as this into +an Info file; and @TeX{} typesets it for a printed manual. @end quotation -@node Acknowledgements, , Short Sample, Overview +@node Acknowledgements, , Short Sample, Overview @comment node-name, next, previous, up @section Acknowledgements -Richard M.@: Stallman wrote Edition 1.0 of this manual. -@w{Robert J.@: Chassell} revised and extended it, -starting with Edition 1.1. - +@cindex Stallman, Richard M. +@cindex Chassell, Robert J. +@cindex Berry, Karl +Richard M.@: Stallman wrote Edition 1.0 of this manual. @w{Robert J.@: +Chassell} revised and extended it, starting with Edition 1.1. Karl +Berry made updates for the Texinfo 3.8 and subsequent releases, starting +with Edition 2.22. + +@cindex Pinard, Fran@,{c}ois +@cindex Zuhn, David D. +@cindex Weisshaus, Melissa Our thanks go out to all who helped improve this work, particularly to -@w{Francois Pinard} and @w{David D.@: Zuhn}, who tirelessly recorded -and reported mistakes and obscurities; our special thanks go to -@w{Melissa Weisshaus} for her frequent and often tedious reviews of -nearly similar editions. Our mistakes are our own. +Fran@,{c}ois Pinard and @w{David D.@: Zuhn}, who tirelessly recorded and +reported mistakes and obscurities; our special thanks go to Melissa +Weisshaus for her frequent and often tedious reviews of nearly similar +editions. Our mistakes are our own. Please send suggestions and corrections to: @@ -1419,7 +1449,7 @@ Please send suggestions and corrections to: @end example @noindent -Please include the manual's edition number in your messages. +Please include the manual's edition number and update date in your messages. @node Texinfo Mode, Beginning a File, Overview, Top @comment node-name, next, previous, up @@ -1445,7 +1475,7 @@ detail.@refill * Texinfo Mode Overview:: How Texinfo mode can help you. * Emacs Editing:: Texinfo mode adds to GNU Emacs' general purpose editing features. -* Inserting:: How to insert frequently used @@-commands. +* Inserting:: How to insert frequently used @@-commands. * Showing the Structure:: How to show the structure of a file. * Updating Nodes and Menus:: How to update or create new nodes and menus. * Info Formatting:: How to format for Info. @@ -1454,7 +1484,7 @@ detail.@refill @end menu @node Texinfo Mode Overview, Emacs Editing, Texinfo Mode, Texinfo Mode -@ifinfo +@ifinfo @heading Texinfo Mode Overview @end ifinfo @@ -1462,7 +1492,7 @@ Texinfo mode provides special features for working with Texinfo files:@refill @itemize @bullet -@item +@item Insert frequently used @@-commands. @refill @item @@ -1481,7 +1511,7 @@ Automatically create or update menus.@refill @item Automatically create a master menu.@refill -@item +@item Format a part or all of a file for Info.@refill @item @@ -1492,7 +1522,7 @@ Perhaps the two most helpful features are those for inserting frequently used @@-commands and for creating node pointers and menus.@refill @node Emacs Editing, Inserting, Texinfo Mode Overview, Texinfo Mode -@section The Usual GNU Emacs Editing Commands +@section The Usual GNU Emacs Editing Commands In most cases, the usual Text mode commands work the same in Texinfo mode as they do in Text mode. Texinfo mode adds new editing commands @@ -1520,9 +1550,9 @@ end a Texinfo file name with one of the three extensions preferred, since it is explicit, but a shorter extension may be necessary for operating systems that limit the length of file names. GNU Emacs automatically enters Texinfo mode when you visit a file with -a @file{.texinfo} or @file{.texi} -extension. Also, Emacs switches to Texinfo mode -when you visit a +a @file{.texinfo} or @file{.texi} +extension. Also, Emacs switches to Texinfo mode +when you visit a file that has @samp{-*-texinfo-*-} in its first line. If ever you are in another mode and wish to switch to Texinfo mode, type @code{M-x texinfo-mode}.@refill @@ -1553,13 +1583,13 @@ first letter of the @@-command:@refill Insert @code{@@code@{@}} and put the cursor between the braces.@refill -@item C-c C-c d +@item C-c C-c d @itemx M-x texinfo-insert-@@dfn @findex texinfo-insert-@@dfn Insert @code{@@dfn@{@}} and put the cursor between the braces.@refill -@item C-c C-c e +@item C-c C-c e @itemx M-x texinfo-insert-@@end @findex texinfo-insert-@@end Insert @code{@@end} and attempt to insert the correct following word, @@ -1567,7 +1597,7 @@ such as @samp{example} or @samp{table}. (This command does not handle nested lists correctly, but inserts the word appropriate to the immediately preceding list.)@refill -@item C-c C-c i +@item C-c C-c i @itemx M-x texinfo-insert-@@item @findex texinfo-insert-@@item Insert @code{@@item} and put the @@ -1579,11 +1609,11 @@ cursor at the beginning of the next line.@refill Insert @code{@@kbd@{@}} and put the cursor between the braces.@refill -@item C-c C-c n +@item C-c C-c n @itemx M-x texinfo-insert-@@node @findex texinfo-insert-@@node Insert @code{@@node} and a comment line -listing the sequence for the `Next', +listing the sequence for the `Next', `Previous', and `Up' nodes. Leave point after the @code{@@node}.@refill @@ -1602,7 +1632,7 @@ cursor between the braces.@refill @item C-c C-c t @itemx M-x texinfo-insert-@@table @findex texinfo-insert-@@table -Insert @code{@@table} followed by a @key{SPC} +Insert @code{@@table} followed by a @key{SPC} and leave the cursor after the @key{SPC}.@refill @item C-c C-c v @@ -1617,7 +1647,7 @@ cursor between the braces.@refill Insert @code{@@example} and put the cursor at the beginning of the next line.@refill -@c M-@{ was the binding for texinfo-insert-braces; +@c M-@{ was the binding for texinfo-insert-braces; @c in Emacs 19, backward-paragraph will take this binding. @item C-c C-c @{ @itemx M-x texinfo-insert-braces @@ -1697,7 +1727,7 @@ the cursor over one of the lines and use the @kbd{C-c C-c} command in the Texinfo file.@refill @table @kbd -@item C-c C-s +@item C-c C-s @itemx M-x texinfo-show-structure @findex texinfo-show-structure Show the @code{@@chapter}, @code{@@section}, and such lines of a @@ -1730,7 +1760,7 @@ the whole buffer again, use @w{@kbd{C-x n w}} (@code{widen}). (@xref{Narrowing, , , emacs, The GNU Emacs Manual}, for more information about the narrowing commands.)@refill -@vindex page-delimiter +@vindex page-delimiter @cindex Page delimiter in Texinfo mode In addition to providing the @code{texinfo-show-structure} command, Texinfo mode sets the value of the page delimiter variable to match @@ -1747,7 +1777,7 @@ about the page commands.@refill @cindex Updating nodes and menus @cindex Create nodes, menus automatically @cindex Insert nodes, menus automatically -@cindex Automatically insert nodes, menus +@cindex Automatically insert nodes, menus Texinfo mode provides commands for automatically creating or updating menus and node pointers. The commands are called ``update'' commands @@ -1899,7 +1929,7 @@ node in the buffer.@refill @itemx M-x texinfo-all-menus-update @findex texinfo-all-menus-update Create or update all the menus in the buffer. With an argument -(@kbd{C-u} as prefix argument, if interactive), first insert +(@kbd{C-u} as prefix argument, if interactive), first insert or update all the node pointers before working on the menus.@refill @@ -1913,7 +1943,7 @@ type the following: @example C-u C-c C-u C-a -@exdent or +@exdent or C-u M-x texinfo-all-menus-update @end example @@ -1943,7 +1973,7 @@ Commands}, for more information.)@refill @cindex Requirements for updating commands To use the updating commands, you must organize the Texinfo file -hierarchically with chapters, sections, subsections, and the like. +hierarchically with chapters, sections, subsections, and the like. When you construct the hierarchy of the manual, do not `jump down' more than one level at a time: you can follow the `Top' node with a chapter, but not with a section; you can follow a chapter with a @@ -1999,7 +2029,7 @@ Info File}, for more information about @code{makeinfo}.) However, both @code{makeinfo} and the @code{texinfo-format-@dots{}} commands require that you insert menus in the file.@refill -@node Other Updating Commands, , Updating Requirements, Updating Nodes and Menus +@node Other Updating Commands, , Updating Requirements, Updating Nodes and Menus @comment node-name, next, previous, up @subsection Other Updating Commands @@ -2129,10 +2159,8 @@ C-c C-m C-b M-x makeinfo-buffer @end example -For the Info formatting commands to work, the file @emph{must} include -a line that has @code{@@setfilename} in its header.@refill - -Not all systems support the @code{makeinfo}-based formatting commands.@refill +For @TeX{} or the Info formatting commands to work, the file @emph{must} +include a line that has @code{@@setfilename} in its header.@refill @xref{Create an Info File}, for details about Info formatting.@refill @@ -2200,13 +2228,13 @@ end-of-header lines.)@refill @xref{Format/Print Hardcopy}, for a description of the other @TeX{} related commands, such as @code{tex-show-print-queue}.@refill -@node Texinfo Mode Summary, , Printing, Texinfo Mode +@node Texinfo Mode Summary, , Printing, Texinfo Mode @comment node-name, next, previous, up @section Texinfo Mode Summary In Texinfo mode, each set of commands has default keybindings that begin with the same keys. All the commands that are custom-created -for Texinfo mode begin with @kbd{C-c}. The keys are somewhat +for Texinfo mode begin with @kbd{C-c}. The keys are somewhat mnemonic.@refill @subheading Insert Commands @@ -2287,7 +2315,7 @@ C-c C-u C-m @r{Make or update a menu.} @group C-c C-u C-a @r{Make or update all} - @r{menus in a buffer.} + @r{menus in a buffer.} @end group @group @@ -2410,18 +2438,18 @@ document.@refill Generally, the beginning of a Texinfo file has four parts:@refill @enumerate -@item +@item The header, delimited by special comment lines, that includes the commands for naming the Texinfo file and telling @TeX{} what definitions' file to use when processing the Texinfo file.@refill -@item +@item A short statement of what the file is about, with a copyright notice and copying permissions. This is enclosed in @code{@@ifinfo} and @code{@@end ifinfo} commands so that the formatters place it only in the Info file.@refill -@item +@item A title page and copyright page, with a copyright notice and copying permissions. This is enclosed between @code{@@titlepage} and @code{@@end titlepage} commands. The title and copyright page appear @@ -2479,7 +2507,7 @@ Permission is granted to @dots{} @end group @group -@@c The following two commands +@@c The following two commands @@c start the copyright page. @@page @@vskip 0pt plus 1filll @@ -2494,9 +2522,9 @@ Permission is granted to @dots{} @@node Top, Overview, (dir), (dir) @@ifinfo -This document describes @dots{} +This document describes @dots{} -This document applies to version @dots{} +This document applies to version @dots{} of the program named @dots{} @@end ifinfo @@ -2536,7 +2564,7 @@ Thus, the beginning of a Texinfo file looks like this: @example @group -\input texinfo @@c -*-texinfo-*- +\input texinfo @@c -*-texinfo-*- @@setfilename sample.info @@settitle Sample Document @end group @@ -2547,7 +2575,7 @@ or else like this: @example @group -\input texinfo @@c -*-texinfo-*- +\input texinfo @@c -*-texinfo-*- @@c %**start of header @@setfilename sample.info @@settitle Sample Document @@ -2556,7 +2584,7 @@ or else like this: @end example @menu -* First Line:: The first line of a Texinfo file. +* First Line:: The first line of a Texinfo file. * Start of Header:: Formatting a region requires this. * setfilename:: Tell Info the name of the Info file. * settitle:: Create a title for the printed work. @@ -2583,7 +2611,7 @@ with a line that looks like this:@refill This line serves two functions: @enumerate -@item +@item When the file is processed by @TeX{}, the @code{\input texinfo} command tells @TeX{} to load the macros needed for processing a Texinfo file. These are in a file called @file{texinfo.tex}, which is usually located @@ -2593,7 +2621,7 @@ in the @file{/usr/lib/tex/macros} directory. @TeX{} uses the backslash, to @samp{@@}; before the switch occurs, @TeX{} requires @samp{\}, which is why it appears at the beginning of the file.@refill -@item +@item When the file is edited in GNU Emacs, the @samp{-*-texinfo-*-} mode specification tells Emacs to use Texinfo mode.@refill @end enumerate @@ -2627,8 +2655,8 @@ comment is accidentally taken for a start-of-header line.@refill @cindex Info file requires @code{@@setfilename} @findex setfilename -In order to be made into an Info file, a Texinfo file must contain a line -that looks like this:@refill +In order to serve as the primary input file for either @code{makeinfo} +or @TeX{}, a Texinfo file must contain a line that looks like this: @example @@setfilename @var{info-file-name} @@ -2641,8 +2669,9 @@ considered part of the file name, including a comment.@refill The @code{@@setfilename} line specifies the name of the Info file to be generated. This name should be different from the name of the Texinfo -file. The convention is to write a name with a @samp{.info} extension, -to produce an Info file name such as @file{texinfo.info}.@refill +file. There are two conventions for choosing the name: you can either +remove the @samp{.tex} extension from the input file name, or replace it +with the @samp{.info} extension. Some operating systems cannot handle long file names. You can run into a problem even when the file name you specify is itself short enough. @@ -2651,14 +2680,16 @@ short indirect subfiles, and name them by appending `-1', `-2', @dots{}, `-10', `-11', and so on, to the original file name. (@xref{Tag and Split Files, , Tag Files and Split Files}.) The subfile name @file{texinfo.info-10}, for example, is too long for some systems; so -the Info file name for this document is actually @file{texinfo} rather than +the Info file name for this document is @file{texinfo} rather than @file{texinfo.info}.@refill The Info formatting commands ignore everything written before the -@code{@@setfilename} line, which is why the very first line of +@code{@@setfilename} line, which is why the very first line of the file (the @code{\input} line) does not need to be commented out. -The @code{@@setfilename} line is ignored when you typeset a printed -manual.@refill + +The @code{@@setfilename} line produces no output when you typeset a +printed manual, but is does an essential job: it opens the index, +cross-reference, and other auxiliary files used by Texinfo. @node settitle, setchapternewpage, setfilename, Header @comment node-name, next, previous, up @@ -2843,9 +2874,9 @@ fill) paragraphs that contain @code{@@w} or @code{@@*} commands. @xref{Refilling Paragraphs}, for a detailed description of what goes on.@refill -@node End of Header, , paragraphindent, Header +@node End of Header, , paragraphindent, Header @comment node-name, next, previous, up -@subsection End of Header +@subsection End of Header @cindex End of header line Follow the header lines with an @w{end-of-header} line. @@ -2945,8 +2976,8 @@ with @code{@@titlepage} on a line by itself and end it with @code{@@end titlepage} on a line by itself.@refill The @code{@@end titlepage} command starts a new page and turns on page -numbering. (@xref{Headings, , Page Headings}, for details about how to -generate of page headings.) All the material that you want to +numbering. (@xref{Headings, , Page Headings}, for details about how to +generate page headings.) All the material that you want to appear on unnumbered pages should be put between the @code{@@titlepage} and @code{@@end titlepage} commands. By using the @code{@@page} command you can force a page break within the region @@ -2971,7 +3002,7 @@ is for which version of the program. (The `Top' node should also contain this information; see @ref{makeinfo top, , @code{@@top}}.)@refill -Texinfo provides two methods for creating a title page. One method +Texinfo provides two main methods for creating a title page. One method uses the @code{@@titlefont}, @code{@@sp}, and @code{@@center} commands to generate a title page in which the words on the page are centered.@refill @@ -2984,6 +3015,13 @@ of the actual formatting of the title page. You specify the text you want, and Texinfo does the formatting. You may use either method.@refill +@findex shorttitlepage +For extremely simple applications, Texinfo also provides a command +@code{@@shorttitlepage} which takes a single argument as the title. +The argument is typeset on a page by itself and followed by a blank +page. + + @node titlefont center sp, title subtitle author, titlepage, Titlepage & Copyright Page @comment node-name, next, previous, up @subsection @code{@@titlefont}, @code{@@center}, and @code{@@sp} @@ -3054,7 +3092,7 @@ The spacing of the example fits an 8 1/2 by 11 inch manual.@refill You can use the @code{@@title}, @code{@@subtitle}, and @code{@@author} commands to create a title page in which the vertical and horizontal -spacing is done for you automatically. This contrasts with the method +spacing is done for you automatically. This contrasts with the method described in the previous section, in which the @code{@@sp} command is needed to adjust vertical spacing.@refill @@ -3200,7 +3238,7 @@ file.@refill @subsection Heading Generation @findex end titlepage @cindex Headings, page, begin to appear -@cindex Titlepage end starts headings +@cindex Titlepage end starts headings @cindex End titlepage starts headings An @code{@@end titlepage} command on a line by itself not only marks @@ -3210,7 +3248,7 @@ generating page headings and page numbers. To repeat what is said elsewhere, Texinfo has two standard page heading formats, one for documents which are printed on one side of each sheet of paper (single-sided printing), and the other for documents which are printed on both -sides of each sheet (double-sided printing). +sides of each sheet (double-sided printing). (@xref{setchapternewpage, ,@code{@@setchapternewpage}}.) You can specify these formats in different ways:@refill @@ -3239,7 +3277,7 @@ double-sided format, using @code{@@setchapternewpage odd} for double-sided printing and no @code{@@setchapternewpage} command for single-sided printing.@refill -@node headings on off, , end titlepage, Titlepage & Copyright Page +@node headings on off, , end titlepage, Titlepage & Copyright Page @comment node-name, next, previous, up @subsection The @code{@@headings} Command @findex headings @@ -3252,7 +3290,7 @@ does not do what you want, or if you want to turn off pre-defined page headings prior to defining your own. Write an @code{@@headings} command immediately after the @code{@@end titlepage} command.@refill -There are four ways to use the @code{@@headings} command:@refill +You can use @code{@@headings} as follows:@refill @table @code @item @@headings off @@ -3263,10 +3301,18 @@ Turn on page headings appropriate for single-sided printing. @refill @item @@headings double -@itemx @@headings on Turn on page headings appropriate for double-sided printing. The two commands, @code{@@headings on} and @code{@@headings double}, are synonymous.@refill + +@item @@headings singleafter +@itemx @@headings doubleafter +Turn on @code{single} or @code{double} headings, respectively, after the +current page is output. + +@item @@headings on +Turn on page headings: @code{single} if @samp{@@setchapternewpage +on}, @code{double} otherwise. @end table For example, suppose you write @code{@@setchapternewpage off} before the @@ -3303,7 +3349,7 @@ You can also specify your own style of page heading and footing. The `Top' node is the node from which you enter an Info file.@refill A `Top' node should contain a brief description of the Info file and an -extensive, master menu for the whole Info file. +extensive, master menu for the whole Info file. This helps the reader understand what the Info file is about. Also, you should write the version number of the program to which the Info file applies; or, at least, the edition number.@refill @@ -3355,7 +3401,7 @@ This is edition@dots{} @group @@menu -* Copying:: Texinfo is freely +* Copying:: Texinfo is freely redistributable. * Overview:: What is Texinfo? @dots{} @@ -3369,7 +3415,7 @@ The `Next' node refers to the first node that follows the main or master menu, which is usually the copying permissions, introduction, or first chapter.@refill -@node Master Menu Parts, , Title of Top Node, The Top Node +@node Master Menu Parts, , Title of Top Node, The Top Node @subsection Parts of a Master Menu @cindex Master menu parts @cindex Parts of a master menu @@ -3396,7 +3442,9 @@ level nodes, often ordered by chapter. This way, rather than go through an intermediary menu, an inquirer can go directly to a particular node when searching for specific information. These menu items are not required; add them if you think they are a -convenience.@refill +convenience. If you do use them, put @code{@@detailmenu} before the +first one, and @code{@@end detailmenu} after the last; otherwise, +@code{makeinfo} will get confused. @end itemize Each section in the menu can be introduced by a descriptive line. So @@ -3410,7 +3458,7 @@ For example, the master menu for this manual looks like the following @example @group @@menu -* Copying:: Texinfo is freely +* Copying:: Texinfo is freely redistributable. * Overview:: What is Texinfo? * Texinfo Mode:: Special features in GNU Emacs. @@ -3418,18 +3466,19 @@ For example, the master menu for this manual looks like the following @dots{} @end group @group -* Command and Variable Index:: +* Command and Variable Index:: An entry for each @@-command. * Concept Index:: An entry for each concept. @end group @group +@@detailmenu --- The Detailed Node Listing --- Overview of Texinfo * Info Files:: What is an Info file? -* Printed Manuals:: Characteristics of +* Printed Manuals:: Characteristics of a printed manual. @dots{} @dots{} @@ -3438,15 +3487,16 @@ Overview of Texinfo @group Using Texinfo Mode -* Info on a Region:: Formatting part of a file +* Info on a Region:: Formatting part of a file for Info. @dots{} @dots{} +@@end detailmenu @@end menu @end group @end example -@node Software Copying Permissions, , The Top Node, Beginning a File +@node Software Copying Permissions, , The Top Node, Beginning a File @comment node-name, next, previous, up @section Software Copying Permissions @cindex Software copying permissions @@ -3503,7 +3553,7 @@ For example: @end example @menu -* Printing Indices & Menus:: How to print an index in hardcopy and +* Printing Indices & Menus:: How to print an index in hardcopy and generate index menus in Info. * Contents:: How to create a table of contents. * File End:: How to mark the end of a file. @@ -3605,11 +3655,11 @@ deficiency. @TeX{} writes output files of raw index data; use the @code{texindex} program to convert these files to sorted index files. (@xref{Format/Print Hardcopy}, for more information.)@refill @end ignore -@node Contents, File End, Printing Indices & Menus, Ending a File +@node Contents, File End, Printing Indices & Menus, Ending a File @comment node-name, next, previous, up @section Generating a Table of Contents @cindex Table of contents -@cindex Contents, Table of +@cindex Contents, Table of @findex contents @findex summarycontents @findex shortcontents @@ -3673,7 +3723,7 @@ Since an Info file uses menus instead of tables of contents, the Info formatting commands ignore the @code{@@contents} and @code{@@shortcontents} commands.@refill -@node File End, , Contents, Ending a File +@node File End, , Contents, Ending a File @comment node-name, next, previous, up @section @code{@@bye} File Ending @findex bye @@ -3752,7 +3802,7 @@ each of which has two sections.@refill Chapter 1 Chapter 2 Chapter 3 | | | -------- -------- -------- - | | | | | | + | | | | | | Section Section Section Section Section Section 1.1 1.2 2.1 2.2 3.1 3.2 @@ -3873,7 +3923,7 @@ Here are the four groups of chapter structuring commands:@refill @r{No new pages} @r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered} @r{In contents} @r{In contents} @r{In contents} @r{Not in contents} - + @@top @@majorheading @@chapter @@unnumbered @@appendix @@chapheading @@section @@unnumberedsec @@appendixsec @@heading @@ -3893,7 +3943,7 @@ Here are the four groups of chapter structuring commands:@refill @r{No new pages} @r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered} @r{In contents} @r{In contents} @r{In contents} @r{Not in contents} - + @@top @@majorheading @@chapter @@unnumbered @@appendix @@chapheading @@section @@unnumberedsec @@appendixsec @@heading @@ -3910,7 +3960,7 @@ Here are the four groups of chapter structuring commands:@refill @r{No new pages} @r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered} @r{In contents} @r{In contents} @r{In contents} @r{Not in contents} - + @@top @@majorheading @@chapter @@unnumbered @@appendix @@chapheading @@section @@unnumberedsec @@appendixsec @@heading @@ -3923,11 +3973,11 @@ Here are the four groups of chapter structuring commands:@refill @node makeinfo top, chapter, Structuring Command Types, Structuring @comment node-name, next, previous, up -@section @code{@@top} +@section @code{@@top} The @code{@@top} command is a special sectioning command that you use only after an @code{@@node Top} line at the beginning of a Texinfo file. -The @code{@@top} command tells the @code{makeinfo} formatter +The @code{@@top} command tells the @code{makeinfo} formatter which node is the `Top' node. It has the same typesetting effect as @code{@@unnumbered} (@pxref{unnumbered & appendix, , @code{@@unnumbered}, @code{@@appendix}}). @@ -3963,6 +4013,13 @@ Chapter Structuring ******************* @end example +@findex centerchap +Texinfo also provides a command @code{@@centerchap}, which is analogous +to @code{@@unnumbered}, but centers its argument in the printed output. +This kind of stylistic choice is not usually offered by Texinfo. +@c but the Hacker's Dictionary wanted it ... + + @node unnumbered & appendix, majorheading & chapheading, chapter, Structuring @comment node-name, next, previous, up @section @code{@@unnumbered}, @code{@@appendix} @@ -3984,6 +4041,7 @@ To create an appendix or an unnumbered chapter, write an line and follow it on the same line by the title, as you would if you were creating a chapter.@refill + @node majorheading & chapheading, section, unnumbered & appendix, Structuring @section @code{@@majorheading}, @code{@@chapheading} @findex majorheading @@ -4106,8 +4164,8 @@ and are numbered three levels deep.@refill @node unnumberedsubsec appendixsubsec subheading, subsubsection, subsection, Structuring @comment node-name, next, previous, up -@section The @code{@@subsection}-like Commands -@cindex Subsection-like commands +@section The @code{@@subsection}-like Commands +@cindex Subsection-like commands @findex unnumberedsubsec @findex appendixsubsec @findex subheading @@ -4130,7 +4188,7 @@ contents.@refill @node subsubsection, Raise/lower sections, unnumberedsubsec appendixsubsec subheading, Structuring @comment node-name, next, previous, up @section The `subsub' Commands -@cindex Subsub commands +@cindex Subsub commands @findex subsubsection @findex unnumberedsubsubsec @findex appendixsubsubsec @@ -4165,7 +4223,7 @@ Info, subsubheadings look exactly like ordinary subsubsection headings.@refill @end table -In Info, `subsub' titles are underlined with periods. +In Info, `subsub' titles are underlined with periods. For example,@refill @example @@ -4182,13 +4240,13 @@ This is a subsubsection @end group @end example -@node Raise/lower sections, , subsubsection, Structuring +@node Raise/lower sections, , subsubsection, Structuring @comment node-name, next, previous, up @section @code{@@raisesections} and @code{@@lowersections} -@findex @@raisesections -@findex @@lowersections +@findex raisesections +@findex lowersections @cindex Raising and lowering sections -@cindex Sections, raising and lowering +@cindex Sections, raising and lowering The @code{@@raisesections} and @code{@@lowersections} commands raise and lower the hierarchical level of chapters, sections, subsections and the @@ -4263,7 +4321,7 @@ sections, subsections, and the like, provide structure for printed books.@refill @menu -* Two Paths:: Different commands to structure +* Two Paths:: Different commands to structure Info output and printed output. * Node Menu Illustration:: A diagram, and sample nodes and menus. * node:: How to write a node, in detail. @@ -4325,7 +4383,7 @@ root.@refill Chapter 1 Chapter 2 Chapter 3 | | | -------- -------- -------- - | | | | | | + | | | | | | Section Section Section Section Section Section 1.1 1.2 2.1 2.2 3.1 3.2 @@ -4367,7 +4425,7 @@ before the beginning of Section 2.1, like this:@refill @group @@menu * Sect. 2.1:: Description of this section. - * Sect. 2.2:: + * Sect. 2.2:: @@end menu @end group @end example @@ -4461,7 +4519,7 @@ commands; see @ref{Cross References}.)@refill * Node Line Tips:: Keep names short. * Node Line Requirements:: Keep names unique, without @@-commands. * First Node:: How to write a `Top' node. -* makeinfo top command:: How to use the @code{@@top} command. +* makeinfo top command:: How to use the @code{@@top} command. * Top Node Summary:: Write a brief description for readers. @end menu @@ -4527,8 +4585,8 @@ looks like this:@refill If you wish, you can ignore @code{@@node} lines altogether in your first draft and then use the @code{texinfo-insert-node-lines} command to -create @code{@@node} lines for you. However, we do not -recommend this practice. It is better to name the node itself +create @code{@@node} lines for you. However, we do not +recommend this practice. It is better to name the node itself at the same time that you write a segment so you can easily make cross references. A large number of cross references are an especially important feature of a good Info @@ -4623,7 +4681,7 @@ confuse @TeX{} or the Info formatters.@refill For example, the following is a section title: @smallexample -@@code@{@@@@unnumberedsec@}, @@code@{@@@@appendixsec@}, @@code@{@@@@heading@} +@@code@{@@@@unnumberedsec@}, @@code@{@@@@appendixsec@}, @@code@{@@@@heading@} @end smallexample @noindent @@ -4640,7 +4698,7 @@ Case is significant. @node First Node, makeinfo top command, Node Line Requirements, node @comment node-name, next, previous, up -@subsection The First Node +@subsection The First Node @cindex @samp{@r{Top}} node is first @cindex First node @@ -4696,7 +4754,7 @@ these formatters. Also, you can use @code{@@chapter} or @code{@@unnumbered} when you use the Texinfo updating commands to create or update pointers and menus.@refill -@node Top Node Summary, , makeinfo top command, node +@node Top Node Summary, , makeinfo top command, node @subsection The `Top' Node Summary @cindex @samp{@r{Top}} node summary @@ -4725,7 +4783,7 @@ include an edition number for the manual. (The title page should also contain this information: see @ref{titlepage, , @code{@@titlepage}}.)@refill -@node makeinfo Pointer Creation, , node, Nodes +@node makeinfo Pointer Creation, , node, Nodes @section Creating Pointers with @code{makeinfo} @cindex Creating pointers with @code{makeinfo} @cindex Pointer creation with @code{makeinfo} @@ -4833,11 +4891,11 @@ For example, the preceding two paragraphs follow an Info-only menu, * Menu Parts:: A menu entry has three parts. * Less Cluttered Menu Entry:: Two part menu entry. * Menu Example:: Two and three part entries. -* Other Info Files:: How to refer to a different +* Other Info Files:: How to refer to a different Info file. @@end menu -@@node Menu Location, Writing a Menu, , Menus +@@node Menu Location, Writing a Menu, , Menus @@ifinfo @@heading Menus Need Short Nodes @@end ifinfo @@ -4866,7 +4924,7 @@ A menu looks like this:@refill Larger Units of Text * Files:: All about handling files. -* Multiples: Buffers. Multiple buffers; editing +* Multiples: Buffers. Multiple buffers; editing several files at once. @@end menu @end group @@ -4991,7 +5049,7 @@ Here is an example as you might see it in a Texinfo file:@refill Larger Units of Text * Files:: All about handling files. -* Multiples: Buffers. Multiple buffers; editing +* Multiples: Buffers. Multiple buffers; editing several files at once. @@end menu @end group @@ -5007,7 +5065,7 @@ This produces: Larger Units of Text * Files:: All about handling files. -* Multiples: Buffers. Multiple buffers; editing +* Multiples: Buffers. Multiple buffers; editing several files at once. @end group @end example @@ -5022,7 +5080,7 @@ Since no file name is specified with either @samp{Files} or @samp{Buffers}, they must be the names of nodes in the same Info file (@pxref{Other Info Files, , Referring to Other Info Files}).@refill -@node Other Info Files, , Menu Example, Menus +@node Other Info Files, , Menu Example, Menus @comment node-name, next, previous, up @section Referring to Other Info Files @cindex Referring to other Info files @@ -5056,9 +5114,9 @@ menu like this:@refill @example @group @@menu -* Outlining: (emacs)Outline Mode. The major mode for +* Outlining: (emacs)Outline Mode. The major mode for editing outlines. -* Rebinding: (emacs)Rebinding. How to redefine the +* Rebinding: (emacs)Rebinding. How to redefine the meaning of a key. @@end menu @end group @@ -5077,7 +5135,7 @@ For example: @example @group * Info: (info). Documentation browsing system. -* Emacs: (emacs). The extensible, self-documenting +* Emacs: (emacs). The extensible, self-documenting text editor. @end group @end example @@ -5222,7 +5280,7 @@ Here is an example of a full five-part cross reference:@refill @example @group -@@xref@{Node name, Cross Reference Name, Particular Topic, +@@xref@{Node name, Cross Reference Name, Particular Topic, info-file-name, A Printed Manual@}, for details. @end group @end example @@ -5463,7 +5521,7 @@ produces: @end example @noindent -and +and @quotation See Section 5.2 [Electrical Effects], page 57. @@ -5486,7 +5544,7 @@ which produces @end example @noindent -and +and @quotation See Section 5.2 [Electrical Effects], page 57, for more info. @@ -5589,12 +5647,12 @@ Here are several examples from @cite{The GAWK Manual}:@refill @@xref@{Sample Program@}. @@xref@{Glossary@}. @@xref@{Case-sensitivity, ,Case-sensitivity in Matching@}. -@@xref@{Close Output, , Closing Output Files and Pipes@}, +@@xref@{Close Output, , Closing Output Files and Pipes@}, for more information. @@xref@{Regexp, , Regular Expressions as Patterns@}. @end smallexample -@node Four and Five Arguments, , Three Arguments, xref +@node Four and Five Arguments, , Three Arguments, xref @subsection @code{@@xref} with Four and Five Arguments In a cross reference, a fourth argument specifies the name of another @@ -5621,7 +5679,7 @@ The template is: For example, @example -@@xref@{Electrical Effects, Lightning, Thunder and Lightning, +@@xref@{Electrical Effects, Lightning, Thunder and Lightning, weather, An Introduction to Meteorology@}, for details. @end example @@ -5680,7 +5738,7 @@ See section @var{title-or-topic} in @var{printed-manual-title}, for details. For example, @example -@@xref@{Electrical Effects, , Thunder and Lightning, +@@xref@{Electrical Effects, , Thunder and Lightning, weather, An Introduction to Meteorology@}, for details. @end example @@ -5920,7 +5978,7 @@ Although you may write them in the middle of a sentence, that location breaks up the flow of text.@refill @end quotation -@node inforef, , pxref, Cross References +@node inforef, , pxref, Cross References @comment node-name, next, previous, up @section @code{@@inforef} @cindex Cross references using @code{@@inforef} @@ -6052,7 +6110,7 @@ to change the way the Texinfo formatters prepare such text. (Texinfo is an @emph{intentional} formatting language rather than a @emph{typesetting} formatting language.)@refill -For example, in a printed manual, +For example, in a printed manual, code is usually illustrated in a typewriter font; @code{@@code} tells @TeX{} to typeset this text in this font. But it would be easy to change the way @TeX{} highlights code to use another @@ -6072,6 +6130,8 @@ not something else that should not be changed.@refill * file:: How to indicate the name of a file. * dfn:: How to specify a definition. * cite:: How to refer to a book that is not in Info. +* url:: How to indicate a world wide web reference. +* email:: How to indicate an electronic mail address. @end menu @node Useful Highlighting, code, Indicating, Indicating @@ -6105,9 +6165,15 @@ Indicate text that is a literal example of a sequence of characters.@refill @item @@var@{@var{metasyntactic-variable}@} Indicate a metasyntactic variable.@refill +@item @@url@{@var{uniform-resource-locator}@} +Indicate a uniform resource locator for the World Wide Web. + @item @@file@{@var{file-name}@} Indicate the name of a file.@refill +@item @@email@{@var{email-address}@} +Indicate an electronic mail address. + @item @@dfn@{@var{term}@} Indicate the introductory or defining use of a term.@refill @@ -6140,7 +6206,7 @@ Use @code{@@code} for environment variables such as @code{TEXINPUTS}, and other variables.@refill Use @code{@@code} for command names in command languages that -resemble programming languages, such as Texinfo or the shell. +resemble programming languages, such as Texinfo or the shell. For example, @code{@@code} and @code{@@samp} are produced by writing @samp{@@code@{@@@@code@}} and @samp{@@code@{@@@@samp@}} in the Texinfo source, respectively.@refill @@ -6233,7 +6299,7 @@ would be described more verbosely as ``press an @samp{r} and then press the @key{RET} key'':@refill @example -@@kbd@{r @@key@{RET@}@} +@@kbd@{r @@key@{RET@}@} @end example @noindent @@ -6243,7 +6309,7 @@ You also use the @code{@@kbd} command if you are spelling out the letters you type; for example:@refill @example -To give the @@code@{logout@} command, +To give the @@code@{logout@} command, type the characters @@kbd@{l o g o u t @@key@{RET@}@}. @end example @@ -6251,7 +6317,7 @@ type the characters @@kbd@{l o g o u t @@key@{RET@}@}. This produces: @quotation -To give the @code{logout} command, +To give the @code{logout} command, type the characters @kbd{l o g o u t @key{RET}}. @end quotation @@ -6282,10 +6348,7 @@ For example, to produce @kbd{C-x @key{ESC}} you would type:@refill @@kbd@{C-x @@key@{ESC@}@} @end example -@c bob: this next sentence looks weird, having a semi-colon followed by -@c a colon that ends the "sentence".. --mew -Here is a list of the recommended names for keys; they are all in -upper case:@refill +Here is a list of the recommended names for keys: @cindex Recommended names for keys @cindex Keys, recommended names @cindex Names recommended for keys @@ -6298,7 +6361,8 @@ Space @item RET Return @item LFD -Linefeed +Linefeed (however, since most keyboards nowadays do not have a Linefeed key, +it might be better to call this character @kbd{C-j}. @item TAB Tab @item BS @@ -6307,29 +6371,30 @@ Backspace Escape @item DEL Delete -@item SFT +@item SHIFT Shift -@item CTL +@item CTRL Control @item META Meta @end table @end quotation -There are subtleties to handling words like `meta' or `ctl' that are -names of shift keys. When mentioning a character in which the shift -key is used, such as @kbd{Meta-a}, use the @code{@@kbd} command alone; -do not use the @code{@@key} command; but when you are referring to the +@cindex META key +There are subtleties to handling words like `meta' or `ctrl' that are +names of shift keys. When mentioning a character in which the shift key +is used, such as @kbd{Meta-a}, use the @code{@@kbd} command alone; do +not use the @code{@@key} command; but when you are referring to the shift key in isolation, use the @code{@@key} command. For example, write @samp{@@kbd@{Meta-a@}} to produce @kbd{Meta-a} and -@samp{@@key@{META@}} to produce @key{META}. This is because -@kbd{Meta-a} refers to keys that you press on a keyboard, but -@key{META} refers to a key without implying that you press it. In -short, use @code{@@kbd} for what you do, and use @code{@@key} for what -you talk about: ``Press @code{@@kbd@{M-a@}} to move point to the -beginning of the sentence. The @code{@@key@{META@}} key is often in the -lower left of the keyboard.''@refill -@cindex META key +@samp{@@key@{META@}} to produce @key{META}. + +@c I don't think this is a good explanation. +@c I think it will puzzle readers more than it clarifies matters. -- rms. +@c In other words, use @code{@@kbd} for what you do, and use @code{@@key} +@c for what you talk about: ``Press @code{@@kbd@{M-a@}} to move point to +@c the beginning of the sentence. The @code{@@key@{META@}} key is often in +@c the lower left of the keyboard.''@refill @node samp, var, key, Indicating @comment node-name, next, previous, up @@ -6343,7 +6408,7 @@ quotation marks in both the Info file and the printed manual; in addition, it is printed in a fixed-width font.@refill @example -To match @@samp@{foo@} at the end of the line, +To match @@samp@{foo@} at the end of the line, use the regexp @@samp@{foo$@}. @end example @@ -6371,8 +6436,8 @@ period are outside of the braces:@refill @example @group -In English, the vowels are @@samp@{a@}, @@samp@{e@}, -@@samp@{i@}, @@samp@{o@}, @@samp@{u@}, and sometimes +In English, the vowels are @@samp@{a@}, @@samp@{e@}, +@@samp@{i@}, @@samp@{o@}, @@samp@{u@}, and sometimes @@samp@{y@}. @end group @end example @@ -6382,7 +6447,7 @@ This produces: @quotation In English, the vowels are @samp{a}, @samp{e}, -@samp{i}, @samp{o}, @samp{u}, and sometimes +@samp{i}, @samp{o}, @samp{u}, and sometimes @samp{y}. @end quotation @@ -6404,13 +6469,13 @@ programming languages. These are specific names from a program, so properly formatted using @code{@@code}.@refill The effect of @code{@@var} in the Info file is to change the case of -the argument to all upper case; in the printed manual, to italicize it. +the argument to all upper case; in the printed manual, to italicize it. @need 700 For example, @example -To delete file @@var@{filename@}, +To delete file @@var@{filename@}, type @@code@{rm @@var@{filename@}@}. @end example @@ -6475,7 +6540,7 @@ Currently, @code{@@file} is equivalent to @code{@@samp} in its effects. For example,@refill @example -The @@file@{.el@} files are in +The @@file@{.el@} files are in the @@file@{/usr/local/emacs/lisp@} directory. @end example @@ -6483,7 +6548,7 @@ the @@file@{/usr/local/emacs/lisp@} directory. produces @quotation -The @file{.el} files are in +The @file{.el} files are in the @file{/usr/local/emacs/lisp} directory. @end quotation @@ -6516,7 +6581,7 @@ term should be a definition of the term. The sentence does not need to say explicitly that it is a definition, but it should contain the information of a definition---it should make the meaning clear. -@node cite, , dfn, Indicating +@node cite, url, dfn, Indicating @comment node-name, next, previous, up @subsection @code{@@cite}@{@var{reference}@} @findex cite @@ -6528,16 +6593,16 @@ manual, and quotation marks in the Info file.@refill (If a book is written in Texinfo, it is better to use a cross reference command since a reader can easily follow such a reference in Info. @xref{xref, , @code{@@xref}}.)@refill -@ignore -@c node ctrl, , cite, Indicating +@ignore +@c node ctrl, , cite, Indicating @comment node-name, next, previous, up @c subsection @code{@@ctrl}@{@var{ctrl-char}@} @findex ctrl The @code{@@ctrl} command is seldom used. It describes an @sc{ascii} control character by inserting the actual character into the Info -file. +file. Usually, in Texinfo, you talk what you type as keyboard entry by describing it with @code{@@kbd}: thus, @samp{@@kbd@{C-a@}} for @@ -6578,7 +6643,39 @@ identify that control character: an uparrow followed by the character @var{ch}.@refill @end ignore -@node Emphasis, , Indicating, Marking Text +@node url, email, cite, Indicating +@subsection @code{@@url}@{@var{uniform-resource-locator}@} +@findex url + +Use the @code{@@url} command to indicate a uniform resource locator on +the World Wide Web. For example: + +@c Two lines because one is too long for smallbook format. +@example +The official GNU ftp site is +@@url@{ftp://ftp.gnu.ai.mit.edu/pub/gnu@}. +@end example + +In Info and @TeX{}, this acts like @code{@@samp}. When +Texinfo is converted to HTML, this produces a link you can follow. + +@node email, , url, Indicating +@subsection @code{@@email}@{@var{email-address}@} +@findex email + +Use the @code{@@email} command to indicate an electronic mail address. +For example: + +@example +Send bug reports to @email{bug-texinfo@@prep.ai.mit.edu}. +@end example + +In Info and @TeX{}, this acts like @code{@@samp}. When we have support +for conversion of Texinfo to HTML, this will produce a link you can +follow to bring up a mail composition window initialized with +@var{email-address}. + +@node Emphasis, , Indicating, Marking Text @comment node-name, next, previous, up @section Emphasizing Text @cindex Emphasizing text @@ -6628,7 +6725,7 @@ files in the directory. produces the following in printed output: @quotation -@strong{Caution}: @code{rm * .[^.]*} removes @emph{all} +@strong{Caution}: @code{rm * .[^.]*} removes @emph{all} files in the directory. @end quotation @@ -6641,7 +6738,7 @@ produces: @end ifinfo @example - *Caution*: `rm * .[^.]*' removes *all* + *Caution*: `rm * .[^.]*' removes *all* files in the directory. @end example @@ -6757,20 +6854,22 @@ If possible, you should avoid using the other three font commands. If you need to use one, it probably indicates a gap in the Texinfo language.@refill -@node Customized Highlighting, , Fonts, Emphasis +@node Customized Highlighting, , Fonts, Emphasis @comment node-name, next, previous, up @subsection Customized Highlighting -@findex @@definfoenclose -@cindex `Enclosure' command for Info @cindex Highlighting, customized @cindex Customized highlighting +@c I think this whole section is obsolete with the advent of macros +@c --karl, 15sep96. You can use regular @TeX{} commands inside of @code{@@iftex} @dots{} @code{@@end iftex} to create your own customized highlighting commands for Texinfo. The easiest way to do this is to equate your customized commands with pre-existing commands, such as those for italics. Such new commands work only with @TeX{}.@refill +@findex definfoenclose +@cindex Enclosure command for Info You can use the @code{@@definfoenclose} command inside of @code{@@ifinfo} @dots{} @code{@@end ifinfo} to define commands for Info with the same names as new commands for @TeX{}. @@ -6800,7 +6899,7 @@ the existing @code{@@i} italics command:@refill This defines @code{@@phoo} as a command that causes @TeX{} to typeset the argument to @code{@@phoo} in italics. @code{@@global@@let} tells @TeX{} to equate the next argument with the argument that follows the -equals sign. +equals sign. @need 1300 For Info, write the following to tell the Info formatters to enclose the @@ -6817,7 +6916,7 @@ argument between @samp{//} and @samp{\\}: @noindent Write the @code{@@definfoenclose} command on a line and follow it with three arguments separated by commas (commas are used as separators in an -@code{@@node} line in the same way).@refill +@code{@@node} line in the same way).@refill @itemize @bullet @item @@ -6828,7 +6927,7 @@ The first argument to @code{@@definfoenclose} is the @@-command name the second argument is the Info start delimiter string; and, @item -the third argument is the Info end delimiter string. +the third argument is the Info end delimiter string. @end itemize @noindent @@ -6853,7 +6952,7 @@ Note that each definition applies to its own formatter: one for @TeX{}, the other for Info. @need 1200 -Here is another example: +Here is another example: @example @group @@ -6889,7 +6988,7 @@ line.@refill @findex end @menu -* Block Enclosing Commands:: Use different constructs for +* Block Enclosing Commands:: Use different constructs for different purposes. * quotation:: How to write a quotation. * example:: How to write an example in a fixed-width font. @@ -6919,7 +7018,7 @@ Illustrate code, commands, and the like. The text is printed in a fixed-width font, and indented but not filled.@refill @item @@lisp -Illustrate Lisp code. The text is printed in a fixed-width font, +Illustrate Lisp code. The text is printed in a fixed-width font, and indented but not filled.@refill @item @@smallexample @@ -6943,7 +7042,7 @@ and no font is specified (so, by default, the font is roman).@refill @end table The @code{@@exdent} command is used within the above constructs to -undo the indentation of a line. +undo the indentation of a line. The @code{@@flushleft} and @code{@@flushright} commands are used to line up the left or right margins of unfilled text.@refill @@ -7020,7 +7119,7 @@ not part of the running text, such as computer input or output.@refill @example @group This is an example of text written between an -@code{@@example} command +@code{@@example} command and an @code{@@end example} command. The text is indented but not filled. @end group @@ -7102,7 +7201,7 @@ For example: This is an example @@end example -@@noindent +@@noindent This line is not indented. As you can see, the beginning of the line is fully flush left with the line that follows after it. (This whole example is between @@ -7167,7 +7266,7 @@ itself.@refill @node smallexample & smalllisp, display, Lisp Example, Quotations and Examples @comment node-name, next, previous, up @section @code{@@smallexample} and @code{@@smalllisp} -@cindex Small book example +@cindex Small book example @cindex Example for a small book @cindex Lisp example for a small book @findex smallexample @@ -7207,12 +7306,12 @@ Here is an example written in the small font used by the @tex % Remove extra vskip; this is a kludge to counter the effect of display \vskip-3\baselineskip -{\ninett +{\ninett \dots{} to make sure that you have the freedom to -distribute copies of free software (and charge for -this service if you wish), that you receive source -code or can get it if you want it, that you can -change the software or use pieces of it in new free +distribute copies of free software (and charge for +this service if you wish), that you receive source +code or can get it if you want it, that you can +change the software or use pieces of it in new free programs; and that you know you can do these things.} @end tex @end display @@ -7281,7 +7380,7 @@ fixed-width font and does not narrow the margins.@refill @format This is an example of text written between an @code{@@format} command and an @code{@@end format} command. As you can see -from this example, +from this example, the @code{@@format} command does not fill the text. @end format @@ -7343,7 +7442,7 @@ For example, @example @group @@flushleft -This text is +This text is written flushleft. @@end flushleft @end group @@ -7354,7 +7453,7 @@ produces @quotation @flushleft -This text is +This text is written flushleft. @end flushleft @end quotation @@ -7371,7 +7470,7 @@ For example, @group @@flushright Here is an example of text written -flushright. The @@code@{@@flushright@} command +flushright. The @@code@{@@flushright@} command right justifies every line but leaves the left end ragged. @@end flushright @@ -7388,7 +7487,7 @@ right justifies every line but leaves the left end ragged. @end flushright -@node cartouche, , flushleft & flushright, Quotations and Examples +@node cartouche, , flushleft & flushright, Quotations and Examples @section Drawing Cartouches Around Examples @findex cartouche @cindex Box with rounded corners @@ -7403,7 +7502,7 @@ The @code{@@cartouche} command affects only the printed manual; it has no effect in the Info file.@refill @need 1500 -For example, +For example, @example @group @@ -7449,6 +7548,7 @@ the first column.@refill * itemize:: How to construct a simple list. * enumerate:: How to construct a numbered list. * Two-column Tables:: How to construct a two-column table. +* Multi-column Tables:: How to construct generalized tables. @end menu @ifinfo @@ -7481,13 +7581,13 @@ command.@refill Here is an itemized list of the different kinds of table and lists:@refill @itemize @bullet -@item +@item Itemized lists with and without bullets. -@item +@item Enumerated lists, using numbers or letters. -@item +@item Two-column tables with highlighting. @end itemize @@ -7496,13 +7596,13 @@ Two-column tables with highlighting. Here is an enumerated list with the same items:@refill @enumerate -@item +@item Itemized lists with and without bullets. -@item +@item Enumerated lists, using numbers or letters. -@item +@item Two-column tables with highlighting. @end enumerate @@ -7521,7 +7621,7 @@ Enumerated lists, using numbers or letters. @item @@table @itemx @@ftable @itemx @@vtable -Two-column tables with highlighting. +Two-column tables with indexing. @end table @node itemize, enumerate, Introducing Lists, Lists and Tables @@ -7531,7 +7631,7 @@ Two-column tables with highlighting. @findex itemize The @code{@@itemize} command produces sequences of indented -paragraphs, with a bullet or other mark inside the left margin +paragraphs, with a bullet or other mark inside the left margin at the beginning of each paragraph for which such a mark is desired.@refill Begin an itemized list by writing @code{@@itemize} at the beginning of @@ -7642,13 +7742,13 @@ Second outer item. the left margin contain successive integers or letters. (@xref{itemize, , @code{@@itemize}}.)@refill -Write the @code{@@enumerate} command at the beginning of a line. +Write the @code{@@enumerate} command at the beginning of a line. The command does not require an argument, but accepts either a number or a letter as an option. -Without an argument, @code{@@enumerate} starts the list +Without an argument, @code{@@enumerate} starts the list with the number 1. With a numeric argument, such as 3, the command starts the list with that number. -With an upper or lower case letter, such as @kbd{a} or @kbd{A}, +With an upper or lower case letter, such as @kbd{a} or @kbd{A}, the command starts the list with that letter.@refill Write the text of the enumerated list in the same way you write an @@ -7720,38 +7820,37 @@ Here is a brief summary of the alternatives. The summary is constructed using @code{@@enumerate} with an argument of @kbd{a}.@refill @sp 1 @enumerate a -@item +@item @code{@@enumerate} Without an argument, produce a numbered list, starting with the number 1.@refill -@item +@item @code{@@enumerate @var{positive-integer}} With a (positive) numeric argument, start a numbered list with that number. You can use this to continue a list that you interrupted with other text.@refill -@item +@item @code{@@enumerate @var{upper-case-letter}} -With an upper case letter as argument, start a list +With an upper case letter as argument, start a list in which each item is marked by a letter, beginning with that upper case letter.@refill -@item +@item @code{@@enumerate @var{lower-case-letter}} -With a lower case letter as argument, start a list +With a lower case letter as argument, start a list in which each item is marked by a letter, beginning with that lower case letter.@refill @end enumerate You can also nest enumerated lists, as in an outline.@refill -@node Two-column Tables, , enumerate, Lists and Tables -@comment node-name, next, previous, up +@node Two-column Tables, Multi-column Tables, enumerate, Lists and Tables @section Making a Two-column Table @cindex Tables, making two-column @findex table @@ -7778,7 +7877,7 @@ Use the @code{@@table} command to produce two-column tables.@refill Write the @code{@@table} command at the beginning of a line and follow it on the same line with an argument that is a Texinfo command such as -@code{@@code}, @code{@@samp}, @code{@@var}, or @code{@@kbd}. +@code{@@code}, @code{@@samp}, @code{@@var}, or @code{@@kbd}. Although these commands are usually followed by arguments in braces, in this case you use the command name without an argument because @code{@@item} will supply the argument. This command will be applied @@ -7845,7 +7944,7 @@ text, use the @code{@@itemx} command. (@xref{itemx, , @node ftable vtable, itemx, table, Two-column Tables @comment node-name, next, previous, up -@subsection @code{@@ftable} and @code{@@vtable} +@subsection @code{@@ftable} and @code{@@vtable} @cindex Tables with indexes @cindex Indexing table entries automatically @findex ftable @@ -7868,7 +7967,9 @@ exactly as you would for an @code{@@table} command; and end the table with an @code{@@end ftable} or @code{@@end vtable} command on a line by itself. -@node itemx, , ftable vtable, Two-column Tables +See the example for @code{@@table} in the previous section. + +@node itemx, , ftable vtable, Two-column Tables @comment node-name, next, previous, up @subsection @code{@@itemx} @cindex Two named items for @code{@@table} @@ -7911,6 +8012,127 @@ case) character or string.@refill (Note also that this example illustrates multi-line supporting text in a two-column table.)@refill + +@node Multi-column Tables, , Two-column Tables, Lists and Tables +@section Multi-column Tables +@cindex Tables, making multi-column +@findex multitable + +@code{@@multitable} allows you to construct tables with any number of +columns, with each column having any width you like. + +You define the column widths on the @code{@@multitable} line itself, and +write each row of the actual table following an @code{@@item} command, +with columns separated by an @code{@@tab} command. Finally, @code{@@end +multitable} completes the table. Details in the sections below. + +@menu +* Multitable Column Widths:: Defining multitable column widths. +* Multitable Rows:: Defining multitable rows, with examples. +@end menu + +@node Multitable Column Widths, Multitable Rows, Multi-column Tables, Multi-column Tables +@subsection Multitable Column Widths +@cindex Multitable column widths +@cindex Column widths, defining for multitables +@cindex Widths, defining multitable column + +You can define the column widths for a multitable in two ways: as +fractions of the line length; or with a prototype row. Mixing the two +methods is not supported. In either case, the widths are defined +entirely on the same line as the @code{@@multitable} command. + +@enumerate +@item +@findex columnfractions +@cindex Line length, column widths as fraction of +To specify column widths as fractions of the line length, write +@code{@@columnfractions} and the decimal numbers (presumably less than +1) after the @code{@@multitable} command, as in: + +@example +@@multitable @@columnfractions .33 .33 .33 +@end example + +@noindent The fractions need not add up exactly to 1.0, as these do +not. This allows you to produce tables that do not need the full line +length. + +@item +@cindex Prototype row, column widths defined by +To specify a prototype row, write the longest entry for each column +enclosed in braces after the @code{@@multitable} command. For example: + +@example +@@multitable @{some text for column one@} @{for column two@} +@end example + +@noindent +The first column will then have the width of the typeset `some text for +column one', and the second column the width of `for column two'. + +The prototype entries need not appear in the table itself. + +Although we used simple text in this example, the prototype entries can +contain Texinfo commands; markup commands such as @code{@@code} are +particularly likely to be useful. + +@end enumerate + + +@node Multitable Rows, , Multitable Column Widths, Multi-column Tables +@subsection Multitable Rows +@cindex Multitable rows +@cindex Rows, of a multitable + +@findex item +@cindex tab +After the @code{@@multitable} command defining the column widths (see +the previous section), you begin each row in the body of a multitable +with @code{@@item}, and separate the column entries with @code{@@tab}. +Line breaks are not special within the table body, and you may break +input lines in your source file as necessary. + +Here is a complete example of a multi-column table (the text is from +the GNU Emacs manual): + +@example +@@multitable @@columnfractions .15 .45 .4 +@@item Key @@tab Command @@tab Description +@@item C-x 2 +@@tab @@code@{split-window-vertically@} +@@tab Split the selected window into two windows, +with one above the other. +@@item C-x 3 +@@tab @@code@{split-window-horizontally@} +@@tab Split the selected window into two windows +positioned side by side. +@@item C-Mouse-2 +@@tab +@@tab In the mode line or scroll bar of a window, +split that window. +@@end multitable +@end example + +@noindent produces: + +@multitable @columnfractions .15 .45 .4 +@item Key @tab Command @tab Description +@item C-x 2 +@tab @code{split-window-vertically} +@tab Split the selected window into two windows, +with one above the other. +@item C-x 3 +@tab @code{split-window-horizontally} +@tab Split the selected window into two windows +positioned side by side. +@item C-Mouse-2 +@tab +@tab In the mode line or scroll bar of a window, +split that window. +@end multitable + + @node Indices, Insertions, Lists and Tables, Top @comment node-name, next, previous, up @chapter Creating Indices @@ -8074,8 +8296,8 @@ file names and @code{@@emph} for emphasis (@pxref{Marking Text}).@refill @cindex Index font types -@cindex Predefined indexing commands -@cindex Indexing commands, predefined +@cindex Predefined indexing commands +@cindex Indexing commands, predefined The six indexing commands for predefined indices are: @table @code @@ -8235,7 +8457,7 @@ now directed. This way, if you direct function names from a function index into a concept index, all the function names are printed in the @code{@@code} font as you would expect.@refill -@node synindex, , syncodeindex, Combining Indices +@node synindex, , syncodeindex, Combining Indices @subsection @code{@@synindex} @findex synindex @@ -8248,10 +8470,10 @@ merge a concept index into a function index.@refill @xref{Printing Indices & Menus}, for information about printing an index at the end of a book or creating an index menu in an Info file.@refill -@node New Indices, , Combining Indices, Indices -@section Defining New Indices -@cindex Defining new indices -@cindex Indices, defining new +@node New Indices, , Combining Indices, Indices +@section Defining New Indices +@cindex Defining new indices +@cindex Indices, defining new @cindex New index defining @findex defindex @findex defcodeindex @@ -8348,84 +8570,101 @@ A minus sign. @end iftex @menu -* Braces Atsigns Periods:: How to insert braces, @samp{@@} and periods. -* dmn:: How to format a dimension. +* Braces Atsigns:: How to insert braces, @samp{@@}. +* Inserting Space:: How to insert the right amount of space + within a sentence. +* Inserting Accents:: How to insert accents and special characters. * Dots Bullets:: How to insert dots and bullets. -* TeX and copyright:: How to insert the @TeX{} logo +* TeX and copyright:: How to insert the @TeX{} logo and the copyright symbol. +* pounds:: How to insert the pounds currency symbol. * minus:: How to insert a minus sign. * math:: How to format a mathematical expression. @end menu -@node Braces Atsigns Periods, dmn, Insertions, Insertions -@comment node-name, next, previous, up -@section Inserting @samp{@@}, Braces, and Periods -@cindex Inserting @@, braces, and periods + +@node Braces Atsigns, Inserting Space, Insertions, Insertions +@section Inserting @@ and Braces +@cindex Inserting @@, braces @cindex Braces, inserting -@cindex Periods, inserting -@cindex Single characters, commands to insert -@cindex Commands to insert single characters +@cindex Special characters, commands to insert +@cindex Commands to insert special characters -@samp{@@} and curly braces are special characters in Texinfo. To -insert these characters so they appear in text, you must put an @samp{@@} in front -of these characters to prevent Texinfo from misinterpreting them.@refill - -Periods are also special. Depending on whether the period is inside -or at the end of a sentence, less or more space is inserted after a -period in a typeset manual. Since it is not always possible for -Texinfo to determine when a period ends a sentence and when it is used -in an abbreviation, special commands are needed in some circumstances. -(Usually, Texinfo can guess how to handle periods, so you do not need -to use the special commands; you just enter a period as you would if -you were using a typewriter, which means you put two spaces after the -period, question mark, or exclamation mark that ends a -sentence.)@refill +@samp{@@} and curly braces are special characters in Texinfo. To insert +these characters so they appear in text, you must put an @samp{@@} in +front of these characters to prevent Texinfo from misinterpreting +them. Do not put braces after any of these commands; they are not -necessary.@refill +necessary. @menu -* Inserting An Atsign:: -* Inserting Braces:: How to insert @samp{@{} and @samp{@}} -* Controlling Spacing:: How to insert the right amount of space - after punctuation within a sentence. +* Inserting An Atsign:: How to insert @samp{@@}. +* Inserting Braces:: How to insert @samp{@{} and @samp{@}}. @end menu -@node Inserting An Atsign, Inserting Braces, Braces Atsigns Periods, Braces Atsigns Periods -@comment node-name, next, previous, up +@node Inserting An Atsign, Inserting Braces, Braces Atsigns, Braces Atsigns @subsection Inserting @samp{@@} with @@@@ @findex @@ @r{(single @samp{@@})} @code{@@@@} stands for a single @samp{@@} in either printed or Info -output.@refill +output. -Do not put braces after an @code{@@@@} command.@refill +Do not put braces after an @code{@@@@} command. -@node Inserting Braces, Controlling Spacing, Inserting An Atsign, Braces Atsigns Periods -@comment node-name, next, previous, up +@node Inserting Braces, , Inserting An Atsign, Braces Atsigns @subsection Inserting @samp{@{} and @samp{@}}with @@@{ and @@@} @findex @{ @r{(single @samp{@{})} @findex @} @r{(single @samp{@}})} @code{@@@{} stands for a single @samp{@{} in either printed or Info -output.@refill +output. @code{@@@}} stands for a single @samp{@}} in either printed or Info -output.@refill +output. -Do not put braces after either an @code{@@@{} or an @code{@@@}} -command.@refill +Do not put braces after either an @code{@@@{} or an @code{@@@}} +command. -@node Controlling Spacing, , Inserting Braces, Braces Atsigns Periods -@comment node-name, next, previous, up -@subsection Spacing After Colons and Periods -@findex : @r{(suppress widening)} +@node Inserting Space, Inserting Accents, Braces Atsigns, Insertions +@section Inserting Space + +@cindex Inserting space +@cindex Spacing, inserting +@cindex Whitespace, inserting +The following sections describe commands that control spacing of various +kinds within and after sentences. + +@menu +* Not Ending a Sentence:: Sometimes a . doesn't end a sentence. +* Ending a Sentence:: Sometimes it does. +* Multiple Spaces:: Inserting multiple spaces. +* dmn:: How to format a dimension. +@end menu + +@node Not Ending a Sentence, Ending a Sentence, Inserting Space, Inserting Space +@subsection Not Ending a Sentence + +@cindex Not ending a sentence +@cindex Sentence non-ending punctuation +@cindex Periods, inserting +Depending on whether a period or exclamation point or question mark is +inside or at the end of a sentence, less or more space is inserted after +a period in a typeset manual. Since it is not always possible for +Texinfo to determine when a period ends a sentence and when it is used +in an abbreviation, special commands are needed in some circumstances. +(Usually, Texinfo can guess how to handle periods, so you do not need to +use the special commands; you just enter a period as you would if you +were using a typewriter, which means you put two spaces after the +period, question mark, or exclamation mark that ends a sentence.) + +@findex : @r{(suppress widening)} Use the @code{@@:}@: command after a period, question mark, exclamation mark, or colon that should not be followed by extra space. For example, use @code{@@:}@: after periods that end abbreviations which are not at the ends of sentences. @code{@@:}@: has no effect on -the Info file output.@refill +the Info file output. @need 700 For example, @@ -8451,14 +8690,26 @@ The s.o.p. has three parts @dots{} @end quotation @noindent -@kbd{@@:} has no effect on the Info output. (@samp{s.o.p} is an acronym -for ``Standard Operating Procedure''.) +@kbd{@@:} has no effect on the Info output. (@samp{s.o.p.} is an +abbreviation for ``Standard Operating Procedure''.) + +Do not put braces after @code{@@:}. -@findex . @r{(true end of sentence)} -Use @code{@@.}@: instead of a period at the end of a sentence that -ends with a single capital letter. Otherwise, @TeX{} will think the -letter is an abbreviation and will not insert the correct -end-of-sentence spacing. Here is an example:@refill + +@node Ending a Sentence, Multiple Spaces, Not Ending a Sentence, Inserting Space +@subsection Ending a Sentence + +@cindex Ending a Sentence +@cindex Sentence ending punctuation + +@findex . @r{(end of sentence)} +@findex ! @r{(end of sentence)} +@findex ? @r{(end of sentence)} +Use @code{@@.}@: instead of a period, @code{@@!}@: instead of an +exclamation point, and @code{@@?}@: instead of a question mark at the end +of a sentence that ends with a single capital letter. Otherwise, @TeX{} +will think the letter is an abbreviation and will not insert the correct +end-of-sentence spacing. Here is an example: @example Give it to M.I.B. and to M.E.W@@. Also, give it to R.J.C@@. @@ -8472,7 +8723,7 @@ produces @iftex produces the following. If you look carefully at this printed output, you will see a little more whitespace after the @samp{W} in the first -line.@refill +line. @end iftex @quotation @@ -8481,17 +8732,61 @@ Give it to M.I.B. and to M.E.W. Also, give it to R.J.C. @end quotation In the Info file output, @code{@@.}@: is equivalent to a simple -@samp{.}.@refill +@samp{.}; likewise for @code{@@!}@: and @code{@@?}@:. + +The meanings of @code{@@:} and @code{@@.}@: in Texinfo are designed to +work well with the Emacs sentence motion commands (@pxref{Sentences,,, +emacs, GNU Emacs}). This made it necessary for them to be incompatible +with some other formatting systems that use @@-commands. + +Do not put braces after any of these commands. + -The meanings of @code{@@:}@: and @code{@@.}@: in Texinfo are designed -to work well with the Emacs sentence motion commands. This made it -necessary for them to be incompatible with some other formatting -systems that use @@-commands.@refill +@node Multiple Spaces, dmn, Ending a Sentence, Inserting Space +@subsection Multiple Spaces -Do not put braces after either an @code{@@:} or an @code{@@.} command.@refill +@cindex Multiple spaces +@cindex Whitespace, inserting +@findex (space) +@findex (tab) +@findex (newline) -@node dmn, Dots Bullets, Braces Atsigns Periods, Insertions -@section @code{@@dmn}@{@var{dimension}@}: Format a Dimension +Ordinarily, @TeX{} collapses multiple whitespace characters (space, tab, +and newline) into a single space. (Info output, on the other hand, +preserves whitespace as you type it, except for changing a newline into +a space; this is why it is important to put two spaces at the end of +sentences in Texinfo documents.) + +Occasionally, you may want to actually insert several consecutive +spaces, either for purposes of example (what your program does with +multiple spaces as input), or merely for purposes of appearance in +headings or lists. Texinfo supports three commands: @code{@@ }, +@code{@@@kbd{TAB}}, and @code{@@@kbd{NL}}, all of which insert a single +space into the output. (Here, @kbd{TAB} and @kbd{NL} represent the tab +character and end-of-line, i.e., when @samp{@@} is the last character on +a line.) + +For example, +@example +Spacey@@ @@ @@ @@ +example. +@end example + +@noindent produces + +@example +Spacey@ @ @ @ +example. +@end example + +Other possible uses of @code{@@ } have been subsumed by @code{@@multitable} +(@pxref{Multi-column Tables}). + +Do not follow any of these commands with braces. + + +@node dmn, , Multiple Spaces, Inserting Space +@subsection @code{@@dmn}@{@var{dimension}@}: Format a Dimension @cindex Thin space between number, dimension @cindex Dimension formatting @cindex Format a dimension @@ -8529,11 +8824,123 @@ Not everyone uses this style. Instead of writing formatters may insert a line break between the number and the dimension. Also, if you write a period after an abbreviation within a sentence, you should write @samp{@@:} after the period to prevent -@TeX{} from inserting extra whitespace. @xref{Controlling Spacing, , -Spacing After Colons and Periods}.)@refill - -@node Dots Bullets, TeX and copyright, dmn, Insertions -@comment node-name, next, previous, up +@TeX{} from inserting extra whitespace. @xref{Inserting Space}. + + +@node Inserting Accents, Dots Bullets, Inserting Space, Insertions +@section Inserting Accents + +@cindex Inserting accents +@cindex Accents, inserting +@cindex Floating accents, inserting + +Here is a table with the commands Texinfo provides for inserting +floating accents. The commands with non-alphabetic names do not take +braces around their argument (which is taken to be the next character). +(Exception: @code{@@,} @emph{does} take braces around its argument.) +This is so as to make the source as convenient to type and read as +possible, since accented characters are very common in some languages. + +@findex " +@cindex Umlaut accent +@findex ' +@cindex Acute accent +@findex = +@cindex Macron accent +@findex ^ +@cindex Circumflex accent +@findex ` +@cindex Grave accent +@findex ~ +@cindex Tilde accent +@findex , +@cindex Cedilla accent +@findex dotaccent +@cindex Dot accent +@findex H +@cindex Hungariam umlaut accent +@findex ringaccent +@cindex Ring accent +@findex tieaccent +@cindex Tie-after accent +@findex u +@cindex Breve accent +@findex ubaraccent +@cindex Underbar accent +@findex udotaccent +@cindex Underdot accent +@findex v +@cindex Check accent +@multitable {@@questiondown@{@}} {Output} {macron/overbar accent} +@item Command @tab Output @tab What +@item @t{@@"o} @tab @"o @tab umlaut accent +@item @t{@@'o} @tab @'o @tab acute accent +@item @t{@@,@{c@}} @tab @,{c} @tab cedilla accent +@item @t{@@=o} @tab @=o @tab macron/overbar accent +@item @t{@@^o} @tab @^o @tab circumflex accent +@item @t{@@`o} @tab @`o @tab grave accent +@item @t{@@~o} @tab @~o @tab tilde accent +@item @t{@@dotaccent@{o@}} @tab @dotaccent{o} @tab overdot accent +@item @t{@@H@{o@}} @tab @H{o} @tab long Hungarian umlaut +@item @t{@@ringaccent@{o@}} @tab @ringaccent{o} @tab ring accent +@item @t{@@tieaccent@{oo@}} @tab @tieaccent{oo} @tab tie-after accent +@item @t{@@u@{o@}} @tab @u{o} @tab breve accent +@item @t{@@ubaraccent@{o@}} @tab @ubaraccent{o} @tab underbar accent +@item @t{@@udotaccent@{o@}} @tab @udotaccent{o} @tab underdot accent +@item @t{@@v@{o@}} @tab @v{o} @tab hacek or check accent +@end multitable + +This table lists the Texinfo commands for inserting other characters +commonly used in languages other than English. + +@findex questiondown +@cindex @questiondown{} +@findex exclamdown +@cindex @exclamdown{} +@findex aa +@cindex @aa{} +@findex AA +@cindex @AA{} +@findex ae +@cindex @ae{} +@findex AE +@cindex @AE{} +@findex dotless +@cindex @dotless{i} +@cindex @dotless{j} +@cindex Dotless i, j +@findex l +@cindex @l{} +@findex L +@cindex @L{} +@findex o +@cindex @o{} +@findex O +@cindex @O{} +@findex oe +@cindex @oe{} +@findex OE +@cindex @OE{} +@findex ss +@cindex @ss{} +@cindex Es-zet +@cindex Sharp S +@cindex German S +@multitable {@@questiondown@{@}} {oe,OE} {es-zet or sharp S} +@item @t{@@exclamdown@{@}} @tab @exclamdown{} @tab upside-down ! +@item @t{@@questiondown@{@}} @tab @questiondown{} @tab upside-down ? +@item @t{@@aa@{@},@@AA@{@}} @tab @aa{},@AA{} @tab A,a with circle +@item @t{@@ae@{@},@@AE@{@}} @tab @ae{},@AE{} @tab ae,AE ligatures +@item @t{@@dotless@{i@}} @tab @dotless{i} @tab dotless i +@item @t{@@dotless@{j@}} @tab @dotless{j} @tab dotless j +@item @t{@@l@{@},@@L@{@}} @tab @l{},@L{} @tab suppressed-L,l +@item @t{@@o@{@},@@O@{@}} @tab @o{},@O{} @tab O,o with slash +@item @t{@@oe@{@},@@OE@{@}} @tab @oe{},@OE{} @tab OE,oe ligatures +@item @t{@@ss@{@}} @tab @ss{} @tab es-zet or sharp S +@end multitable + + +@node Dots Bullets, TeX and copyright, Inserting Accents, Insertions @section Inserting Ellipsis, Dots, and Bullets @cindex Dots, inserting @cindex Bullets, inserting @@ -8568,21 +8975,20 @@ Use the @code{@@dots@{@}} command to generate an ellipsis, which is three dots in a row, appropriately spaced, like this: `@dots{}'. Do not simply write three periods in the input file; that would work for the Info file output, but would produce the wrong amount of space -between the periods in the printed manual.@refill +between the periods in the printed manual. -Similarly, the @code{@@enddots@{@}} command helps you correctly set an -end-of-sentence ellipsis (four dots). +Similarly, the @code{@@enddots@{@}} command generates an +end-of-sentence ellipsis (four dots) @enddots{} @iftex Here is an ellipsis: @dots{} - Here are three periods in a row: ... In printed output, the three periods in a row are closer together than the dots in the ellipsis. @end iftex -@node bullet, , dots, Dots Bullets +@node bullet, , dots, Dots Bullets @comment node-name, next, previous, up @subsection @code{@@bullet}@{@} @findex bullet @@ -8593,10 +8999,10 @@ the closest possible thing to one. In Info, an asterisk is used.@refill Here is a bullet: @bullet{} When you use @code{@@bullet} in @code{@@itemize}, you do not need to -type the braces, because @code{@@itemize} supplies them. +type the braces, because @code{@@itemize} supplies them. (@xref{itemize, , @code{@@itemize}}.)@refill -@node TeX and copyright, minus, Dots Bullets, Insertions +@node TeX and copyright, pounds, Dots Bullets, Insertions @comment node-name, next, previous, up @section Inserting @TeX{} and the Copyright Symbol @@ -8620,9 +9026,9 @@ Use the @code{@@TeX@{@}} command to generate `@TeX{}'. In a printed manual, this is a special logo that is different from three ordinary letters. In Info, it just looks like @samp{TeX}. The @code{@@TeX@{@}} command is unique among Texinfo commands in that the -@key{T} and the @key{X} are in upper case.@refill +@kbd{T} and the @kbd{X} are in upper case.@refill -@node copyright symbol, , tex, TeX and copyright +@node copyright symbol, , tex, TeX and copyright @comment node-name, next, previous, up @subsection @code{@@copyright}@{@} @findex copyright @@ -8631,7 +9037,16 @@ Use the @code{@@copyright@{@}} command to generate `@copyright{}'. In a printed manual, this is a @samp{c} inside a circle, and in Info, this is @samp{(C)}.@refill -@node minus, math, TeX and copyright, Insertions +@node pounds, minus, TeX and copyright, Insertions +@section @code{@@pounds}@{@} +@findex pounds + +Use the @code{@@pounds@{@}} command to generate `@pounds{}'. In a +printed manual, this is the symbol for the currency pounds sterling. +In Info, it is a @samp{#}. Other currency symbols are unfortunately not +available. + +@node minus, math, pounds, Insertions @section @code{@@minus}@{@}: Inserting a Minus Sign @findex minus @@ -8660,7 +9075,7 @@ When you use @code{@@minus} to specify the mark beginning each entry in an itemized list, you do not need to type the braces (@pxref{itemize, , @code{@@itemize}}.)@refill -@node math, , minus, Insertions +@node math, , minus, Insertions @comment node-name, next, previous, up @section @code{@@math}: Inserting Mathematical Expressions @findex math @@ -8707,14 +9122,14 @@ appropriate. @node Glyphs, Breaks, Insertions, Top @comment node-name, next, previous, up -@chapter Glyphs for Examples +@chapter Glyphs for Examples @cindex Glyphs In Texinfo, code is often illustrated in examples that are delimited by @code{@@example} and @code{@@end example}, or by @code{@@lisp} and @code{@@end lisp}. In such examples, you can indicate the results of evaluation or an expansion using @samp{@result{}} or -@samp{@expansion{}}. Likewise, there are commands to insert glyphs +@samp{@expansion{}}. Likewise, there are commands to insert glyphs to indicate printed output, error messages, equivalence of expressions, and the location of point.@refill @@ -8832,7 +9247,7 @@ produces @end lisp @noindent -which may be read as: +which may be read as: @quotation @code{(third '(a b c))} expands to @code{(car (cdr (cdr '(a b c))))}; @@ -8969,7 +9384,7 @@ This indicates that evaluating @code{(make-sparse-keymap)} produces identical results to evaluating @code{(list 'keymap)}. @c Cannot write point command here because it causes trouble with TOC. -@node Point Glyph, , Equivalence, Glyphs +@node Point Glyph, , Equivalence, Glyphs @section Indicating Point in a Buffer @cindex Point, indicating it in a buffer @@ -9054,7 +9469,8 @@ commands.@refill @menu * Break Commands:: Cause and prevent splits. * Line Breaks:: How to force a single line to use two lines. -* w:: How to prevent unwanted line breaks. +* - and hyphenation:: How to tell TeX about hyphenation points. +* w:: How to prevent unwanted line breaks. * sp:: How to insert blank lines. * page:: How to force the start of a new page. * group:: How to prevent unwanted page breaks. @@ -9069,7 +9485,7 @@ commands.@refill @sp 1 @end iftex -The break commands create line and paragraph breaks:@refill +The break commands create or allow line and paragraph breaks:@refill @table @code @item @@* @@ -9077,10 +9493,13 @@ Force a line break. @item @@sp @var{n} Skip @var{n} blank lines.@refill + +@item @@- +Insert a discretionary hyphen. + +@item @@hyphenation@{@var{hy-phen-a-ted words}@} +Define hyphen points in @var{hy-phen-a-ted words}. @end table -@iftex -@sp 1 -@end iftex The line-break-prevention command holds text together all on one line:@refill @@ -9107,7 +9526,7 @@ Hold text together that must appear on one printed page.@refill Start a new printed page if not enough space on this one.@refill @end table -@node Line Breaks, w, Break Commands, Breaks +@node Line Breaks, - and hyphenation, Break Commands, Breaks @comment node-name, next, previous, up @section @code{@@*}: Generate Line Breaks @findex * @r{(force line break)} @@ -9163,11 +9582,46 @@ refilled after the line break occurs, negating the effect of the line break.@refill @end quotation -@node w, sp, Line Breaks, Breaks +@node - and hyphenation, w, Line Breaks, Breaks +@section @code{@@-} and @code{@@hyphenation}: Helping @TeX{} hyphenate + +@findex - +@findex hyphenation +@cindex Hyphenation, helping @TeX{} do +@cindex Fine-tuning, and hyphenation + +Although @TeX{}'s hyphenation algorithm is generally pretty good, it +does miss useful hyphenation points from time to time. (Or, far more +rarely, insert an incorrect hyphenation.) So, for documents with an +unusual vocabulary or when fine-tuning for a printed edition, you may +wish to help @TeX{} out. Texinfo supports two commands for this: + +@table @code +@item @@- +Insert a discretionary hyphen, i.e., a place where @TeX{} can (but does +not have to) hyphenate. This is especially useful when you notice +an overfull hbox is due to @TeX{} missing a hyphenation (@pxref{Overfull +hboxes}). @TeX{} will not insert any hyphenation points in a word +containing @code{@@-}. + +@item @@hyphenation@{@var{hy-phen-a-ted words}@} +Tell @TeX{} how to hyphenate @var{hy-phen-a-ted words}. As shown, you +put a @samp{-} at each hyphenation point. For example: +@example +@@hyphenation@{man-u-script man-u-scripts@} +@end example +@noindent @TeX{} only uses the specified hyphenation points when the +words match exactly, so give all necessary variants. +@end table + +Info output is not hyphenated, so these commands have no effect there. + +@node w, sp, - and hyphenation, Breaks @comment node-name, next, previous, up @section @code{@@w}@{@var{text}@}: Prevent Line Breaks @findex w @r{(prevent line break)} @cindex Line breaks, preventing +@cindex Hyphenation, preventing @code{@@w@{@var{text}@}} outputs @var{text} and prohibits line breaks within @var{text}.@refill @@ -9187,9 +9641,6 @@ produces You can copy GNU software from @w{@file{prep.ai.mit.edu}}. @end quotation -In the Texinfo file, you must write the @code{@@w} command and its -argument (all the affected text) all on one line.@refill - @quotation @strong{Caution:} Do not write an @code{@@refill} command at the end of a paragraph containing an @code{@@w} command; it will cause the @@ -9215,7 +9666,7 @@ example,@refill @end example @noindent -generates two blank lines. +generates two blank lines. The @code{@@sp} command is most often used in the title page.@refill @@ -9248,7 +9699,7 @@ produces @example @group -This line +This line contains and is ended by paragraph breaks @@ -9327,7 +9778,7 @@ considerable text. It is a good rule of thumb to look for a missing @code{@@end group} if you get incomprehensible error messages in @TeX{}.@refill -@node need, , group, Breaks +@node need, , group, Breaks @comment node-name, next, previous, up @section @code{@@need @var{mils}}: Prevent Page Breaks @cindex Need space at page bottom @@ -9421,7 +9872,7 @@ For example, @example @group @@deffn Command forward-word count -This command moves point forward @@var@{count@} words +This command moves point forward @@var@{count@} words (or backward if @@var@{count@} is negative). @dots{} @@end deffn @end group @@ -9443,8 +9894,8 @@ write braces around it. For example:@refill @example @group -@@deffn @{Interactive Command@} isearch-forward -@dots{} +@@deffn @{Interactive Command@} isearch-forward +@dots{} @@end deffn @end group @end example @@ -9470,7 +9921,7 @@ do not need to specify the category:@refill @example @group -@@defun @var{name} @var{arguments}@dots{} +@@defun @var{name} @var{arguments}@dots{} @var{body-of-definition} @@end defun @end group @@ -9481,10 +9932,10 @@ Thus, @example @group -@@defun buffer-end flag +@@defun buffer-end flag This function returns @@code@{(point-min)@} if @@var@{flag@} is less than 1, @@code@{(point-max)@} otherwise. -@dots{} +@dots{} @@end defun @end group @end example @@ -9525,22 +9976,22 @@ straightforward function.@refill An argument enclosed within square brackets is optional. Thus, the phrase @samp{@code{@r{[}@var{optional-arg}@r{]}}} means that -@var{optional-arg} is optional. +@var{optional-arg} is optional. An argument followed by an ellipsis is optional -and may be repeated more than once. +and may be repeated more than once. @c This is consistent with Emacs Lisp Reference manual -Thus, @samp{@var{repeated-args}@dots{}} stands for zero or more arguments. +Thus, @samp{@var{repeated-args}@dots{}} stands for zero or more arguments. Parentheses are used when several arguments are grouped -into additional levels of list structure in Lisp. +into additional levels of list structure in Lisp. @end iftex @c The following looks better in Info (no `r', `samp' and `code'): @ifinfo -An argument enclosed within square brackets is optional. -Thus, [@var{optional-arg}] means that @var{optional-arg} is optional. -An argument followed by an ellipsis is optional -and may be repeated more than once. +An argument enclosed within square brackets is optional. +Thus, [@var{optional-arg}] means that @var{optional-arg} is optional. +An argument followed by an ellipsis is optional +and may be repeated more than once. @c This is consistent with Emacs Lisp Reference manual -Thus, @var{repeated-args}@dots{} stands for zero or more arguments. +Thus, @var{repeated-args}@dots{} stands for zero or more arguments. Parentheses are used when several arguments are grouped into additional levels of list structure in Lisp. @end ifinfo @@ -9597,9 +10048,9 @@ For example, @example @group -@@deffn @{Interactive Command@} isearch-forward +@@deffn @{Interactive Command@} isearch-forward @@deffnx @{Interactive Command@} isearch-backward -These two search commands are similar except @dots{} +These two search commands are similar except @dots{} @@end deffn @end group @end example @@ -9607,9 +10058,9 @@ These two search commands are similar except @dots{} @noindent produces -@deffn {Interactive Command} isearch-forward +@deffn {Interactive Command} isearch-forward @deffnx {Interactive Command} isearch-backward -These two search commands are similar except @dots{} +These two search commands are similar except @dots{} @end deffn Each of the other definition commands has an `x' form: @code{@@defunx}, @@ -9665,7 +10116,7 @@ For example, here is a definition: @example @group -@@deffn Command forward-char nchars +@@deffn Command forward-char nchars Move point forward @@var@{nchars@} characters. @@end deffn @end group @@ -9687,7 +10138,7 @@ The template for @code{@@deffn} is: @example @group @@deffn @var{category} @var{name} @var{arguments}@dots{} -@var{body-of-definition} +@var{body-of-definition} @@end deffn @end group @end example @@ -9722,7 +10173,7 @@ The template is: @example @group -@@defun @var{function-name} @var{arguments}@dots{} +@@defun @var{function-name} @var{arguments}@dots{} @var{body-of-definition} @@end defun @end group @@ -9768,10 +10219,10 @@ of the entity, for example: @example @group -@@defvr @{User Option@} fill-column -This buffer-local variable specifies -the maximum width of filled lines. -@dots{} +@@defvr @{User Option@} fill-column +This buffer-local variable specifies +the maximum width of filled lines. +@dots{} @@end defvr @end group @end example @@ -9783,8 +10234,8 @@ The template is: @example @group -@@defvr @var{category} @var{name} -@var{body-of-definition} +@@defvr @var{category} @var{name} +@var{body-of-definition} @@end defvr @end group @end example @@ -9802,8 +10253,8 @@ For example: @example @group -@@defvar kill-ring -@dots{} +@@defvar kill-ring +@dots{} @@end defvar @end group @end example @@ -9812,8 +10263,8 @@ The template is: @example @group -@@defvar @var{name} -@var{body-of-definition} +@@defvar @var{name} +@var{body-of-definition} @@end defvar @end group @end example @@ -9851,7 +10302,7 @@ For example, @example @group -@@deftypefn @{Library Function@} int foobar +@@deftypefn @{Library Function@} int foobar (int @@var@{foo@}, float @@var@{bar@}) @dots{} @@end deftypefn @@ -9917,8 +10368,8 @@ For example: @example @group -@@deftypefn stacks private push - (@@var@{s@}:in out stack; +@@deftypefn stacks private push + (@@var@{s@}:in out stack; @@var@{n@}:in integer) @dots{} @@end deftypefn @@ -10184,7 +10635,7 @@ The template is: @findex defop @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{} The @code{@@defop} command is the general definition command for -entities that may resemble methods in object-oriented programming. +entities that may resemble methods in object-oriented programming. These entities take arguments, as functions do, but are associated with particular classes of objects.@refill @@ -10276,7 +10727,7 @@ The template is: @code{bar-class}', in the index of functions.@refill @end table -@node Data Types, , Abstract Objects, Def Cmds in Detail +@node Data Types, , Abstract Objects, Def Cmds in Detail @subsection Data Types Here is the command for data types:@refill @@ -10333,7 +10784,7 @@ to the @code{forward-word} function. Also, if the name of an argument contains the name of a type, such as @var{integer}, take care that the argument actually is of that type.@refill -@node Sample Function Definition, , Def Cmd Conventions, Definition Commands +@node Sample Function Definition, , Def Cmd Conventions, Definition Commands @section A Sample Function Definition @cindex Function definitions @cindex Command definitions @@ -10452,13 +10903,13 @@ University of Chicago Press.}@refill * Footnote Styles:: Controlling how footnotes appear in Info. @end menu -@node Footnote Commands +@node Footnote Commands, Footnote Styles, Footnotes, Footnotes @section Footnote Commands In Texinfo, footnotes are created with the @code{@@footnote} command. This command is followed immediately by a left brace, then by the text of the footnote, and then by a terminating right brace. The template -is: +is: @example @@footnote@{@var{text}@} @@ -10471,7 +10922,7 @@ footnote@footnote{Here is the sample footnote.}; in the Texinfo source, it looks like this:@refill @example -@dots{}a sample footnote @@footnote@{Here is the sample +@dots{}a sample footnote @@footnote@{Here is the sample footnote.@}; in the Texinfo source@dots{} @end example @@ -10487,7 +10938,7 @@ bottom of the page, below a horizontal line.@refill In Info, the reference mark for a footnote is a pair of parentheses with the footnote number between them, like this: @samp{(1)}.@refill -@node Footnote Styles +@node Footnote Styles, , Footnote Commands, Footnotes @section Footnote Styles Info has two footnote styles, which determine where the text of the @@ -10495,7 +10946,7 @@ footnote is located:@refill @itemize @bullet @cindex @samp{@r{End}} node footnote style -@item +@item In the `End' node style, all the footnotes for a single node are placed at the end of that node. The footnotes are separated from the rest of the node by a line of dashes with the word @@ -10515,7 +10966,7 @@ Here is an example of a single footnote in the end of node style:@refill @end example @cindex @samp{@r{Separate}} footnote style -@item +@item In the `Separate' node style, all the footnotes for a single node are placed in an automatically constructed node of their own. In this style, a ``footnote reference'' follows @@ -10538,7 +10989,7 @@ formatted for Info in the separate node style:@refill @group File: texinfo.info Node: Overview-Footnotes, Up: Overview -(1) Note that the first syllable of "Texinfo" is +(1) Note that the first syllable of "Texinfo" is pronounced like "speck", not "hex". @dots{} @end group @end smallexample @@ -10551,7 +11002,7 @@ style.@refill Use the @code{@@footnotestyle} command to specify an Info file's footnote style. Write this command at the beginning of a line followed by an argument, either @samp{end} for the end node style or -@samp{separate} for the separate node style. +@samp{separate} for the separate node style. @need 700 For example, @@ -10613,13 +11064,14 @@ command in Emacs.@refill @end ignore This chapter contains two footnotes.@refill -@node Conditionals, Format/Print Hardcopy, Footnotes, Top +@node Conditionals, Macros, Footnotes, Top @comment node-name, next, previous, up @chapter Conditionally Visible Text @cindex Conditionally visible text @cindex Text, conditionally visible @cindex Visibility of conditional text @cindex If text conditionally visible +@findex ifhtml @findex ifinfo @findex iftex @@ -10629,7 +11081,7 @@ its corresponding Info file. In this case, you can use the and which is for the Info file.@refill @menu -* Conditional Commands:: How to specify text for Info or @TeX{}. +* Conditional Commands:: How to specify text for HTML, Info, or @TeX{}. * Using Ordinary TeX Commands:: You can use any and all @TeX{} commands. * set clear value:: How to designate which text to format (for both Info and @TeX{}); and how to set a @@ -10641,9 +11093,9 @@ and which is for the Info file.@refill @heading Using @code{@@ifinfo} and @code{@@iftex} @end ifinfo -@code{@@ifinfo} begins segments of text that should be ignored +@code{@@ifinfo} begins segments of text that should be ignored by @TeX{} when it -typesets the printed manual. The segment of text appears only +typesets the printed manual. The segment of text appears only in the Info file. The @code{@@ifinfo} command should appear on a line by itself; end the Info-only text with a line containing @code{@@end ifinfo} by @@ -10654,7 +11106,8 @@ ifinfo}. (@xref{Info Summary and Permissions}.)@refill The @code{@@iftex} and @code{@@end iftex} commands are similar to the @code{@@ifinfo} and @code{@@end ifinfo} commands, except that they specify text that will appear in the printed manual but not in the Info -file.@refill +file. Likewise for @code{@@ifhtml} and @code{@@end ifhtml}, which +specify text to appear only in HTML output.@refill @need 700 For example, @@ -10695,10 +11148,10 @@ manual. (@xref{titlepage, , @code{@@titlepage}}.) @refill @cindex @TeX{} commands, using ordinary @cindex Ordinary @TeX{} commands, using @cindex Commands using ordinary @TeX{} -@cindex Plain@TeX{} +@cindex plain @TeX{} Inside a region delineated by @code{@@iftex} and @code{@@end iftex}, -you can embed some Plain@TeX{} commands. Info will ignore these +you can embed some plain @TeX{} commands. Info will ignore these commands since they are only in that part of the file which is seen by @TeX{}. You can write the @TeX{} commands as you would write them in a normal @TeX{} file, except that you must replace the @samp{\} used @@ -10708,11 +11161,11 @@ section of a Texinfo file, you can use the @TeX{} command command causes Info to ignore the region automatically, as it does with the @code{@@iftex} command.)@refill -However, many features of Plain@TeX{} will not work, as they are +However, many features of plain @TeX{} will not work, as they are overridden by features of Texinfo. @findex tex -You can enter Plain@TeX{} completely, and use @samp{\} in the @TeX{} +You can enter plain @TeX{} completely, and use @samp{\} in the @TeX{} commands, by delineating a region with the @code{@@tex} and @code{@@end tex} commands. (The @code{@@tex} command also causes Info to ignore the region, like the @code{@@iftex} @@ -10720,12 +11173,12 @@ command.)@refill @cindex Mathematical expressions For example, here is a mathematical expression written in -Plain@TeX{}:@refill +plain @TeX{}:@refill @example @@tex -$$ \chi^2 = \sum_@{i=1@}^N - \left (y_i - (a + b x_i) +$$ \chi^2 = \sum_@{i=1@}^N + \left (y_i - (a + b x_i) \over \sigma_i\right)^2 $$ @@end tex @end example @@ -10740,12 +11193,12 @@ this: @end iftex @tex -$$ \chi^2 = \sum_{i=1}^N - \left(y_i - (a + b x_i) +$$ \chi^2 = \sum_{i=1}^N + \left(y_i - (a + b x_i) \over \sigma_i\right)^2 $$ @end tex -@node set clear value, , Using Ordinary TeX Commands, Conditionals +@node set clear value, , Using Ordinary TeX Commands, Conditionals @comment node-name, next, previous, up @section @code{@@set}, @code{@@clear}, and @code{@@value} @@ -10761,7 +11214,7 @@ insert the date in several places in the Texinfo file.@refill @menu * ifset ifclear:: Format a region if a flag is set. -* value:: Replace a flag with a string. +* value:: Replace a flag with a string. * value Example:: An easy way to update edition information. @end menu @@ -10778,7 +11231,7 @@ Use the @code{@@set @var{flag}} command to turn on, or @dfn{set}, a @var{flag}; a @dfn{flag} can be any single word. The format for the command looks like this:@refill @findex set - + @example @@set @var{flag} @end example @@ -10798,7 +11251,7 @@ For example, you can create one document that has two variants, such as a manual for a `large' and `small' model:@refill @example -You can use this machine to dig up shrubs +You can use this machine to dig up shrubs without hurting them. @@set large @@ -10871,7 +11324,7 @@ the text up to the following @code{@@end ifset} command.@refill If @var{flag} is cleared, tell the Texinfo formatting commands to ignore text up to the following @code{@@end ifset} command.@refill -@item @@ifclear @var{flag} +@item @@ifclear @var{flag} If @var{flag} is set, tell the Texinfo formatting commands to ignore the text up to the following @code{@@end ifclear} command.@refill @@ -10961,11 +11414,11 @@ It is a @{No value for "how-much"@} wet day. @end group @end example -@node value Example, , value, set clear value +@node value Example, , value, set clear value @subsection @code{@@value} Example You can use the @code{@@value} command to limit the number of places you -need to change when you record an update to a manual. +need to change when you record an update to a manual. Here is how it is done in @cite{The GNU Make Manual}: @need 1000 @@ -10988,9 +11441,9 @@ Texinfo file: @example @group -This is Edition @@value@{EDITION@}, +This is Edition @@value@{EDITION@}, last updated @@value@{UPDATED@}, -of @@cite@{The GNU Make Manual@}, +of @@cite@{The GNU Make Manual@}, for @@code@{make@}, Version @@value@{VERSION@}. @end group @end example @@ -11020,7 +11473,7 @@ Write text for the Top node, for people reading the Info file: @example @group -This is Edition @@value@{EDITION@} +This is Edition @@value@{EDITION@} of the @@cite@{GNU Make Manual@}, last updated @@value@{UPDATED@} for @@code@{make@} Version @@value@{VERSION@}. @@ -11033,7 +11486,7 @@ section looks like this: @example @group -This is Edition 0.35 Beta, last updated 14 August 1992, +This is Edition 0.35 Beta, last updated 14 August 1992, of `The GNU Make Manual', for `make', Version 3.63 Beta. @end group @end example @@ -11041,7 +11494,133 @@ of `The GNU Make Manual', for `make', Version 3.63 Beta. When you update the manual, change only the values of the flags; you do not need to rewrite the three sections. -@node Format/Print Hardcopy, Create an Info File, Conditionals, Top + +@node Macros, Format/Print Hardcopy, Conditionals, Top +@chapter Macros: Defining New Texinfo Commands +@cindex Macros +@cindex Defining new Texinfo commands +@cindex New Texinfo commands, defining +@cindex Texinfo commands, defining new +@cindex User-defined Texinfo commands + +A Texinfo @dfn{macro} allows you to define a new Texinfo command as any +sequence of text and/or existing commands (including other macros). The +macro can have any number of @dfn{parameters}---text you supply each +time you use the macro. (This has nothing to do with the +@code{@@defmac} command, which is for documenting macros in the subject +of the manual; @pxref{Def Cmd Template}.) + +@menu +* Defining Macros:: Both defining and undefining new commands. +* Invoking Macros:: Using a macro, once you've defined it. +@end menu + + +@node Defining Macros, Invoking Macros, Macros, Macros +@section Defining Macros +@cindex Defining macros +@cindex Macro definitions + +@findex macro +You use the Texinfo @code{@@macro} command to define a macro. For example: + +@example +@@macro @var{macro-name}@{@var{param1}, @var{param2}, @dots{}@} +@var{text} @dots{} \@var{param1}\ @dots{} +@@end macro +@end example + +The @dfn{parameters} @var{param1}, @var{param2}, @dots{} correspond to +arguments supplied when the macro is subsequently used in the document +(see the next section). + +If a macro needs no parameters, you can define it either with an empty +list (@samp{@@macro foo @{@}}) or with no braces at all (@samp{@@macro +foo}). + +@cindex Body of a macro +@cindex Mutually recursive macros +@cindex Recursion, mutual +The definition or @dfn{body} of the macro can contain any Texinfo +commands, including previously-defined macros. (It is not possible to +have mutually recursive Texinfo macros.) In the body, instances of a +parameter name surrounded by backslashes, as in @samp{\@var{param1}\} in +the example above, are replaced by the corresponding argument from the +macro invocation. + +@findex unmacro +@cindex Macros, undefining +@cindex Undefining macros +You can undefine a macro @var{foo} with @code{@@unmacro @var{foo}}. +It is not an error to undefine a macro that is already undefined. +For example: + +@example +@@unmacro foo +@end example + + +@node Invoking Macros, , Defining Macros, Macros +@section Invoking Macros +@cindex Invoking macros +@cindex Macro invocation + +After a macro is defined (see the previous section), you can use +(@dfn{invoke}) it in your document like this: + +@example +@@@var{macro-name} @{@var{arg1}, @var{arg2}, @dots{}@} +@end example + +@noindent and the result will be just as if you typed the body of +@var{macro-name} at that spot. For example: + +@example +@@macro foo @{p, q@} +Together: \p\ & \q\. +@@end macro +@@foo@{a, b@} +@end example + +@noindent produces: + +@display +Together: a & b. +@end display + +@cindex Backslash, and macros +Thus, the arguments and parameters are separated by commas and delimited +by braces; any whitespace after (but not before) a comma is ignored. To +insert a comma, brace, or backslash in an argument, prepend a backslash, +as in + +@example +@@@var{macro-name} @{\\\@{\@}\,@} +@end example + +@noindent +which will pass the (almost certainly error-producing) argument +@samp{\@{@},} to @var{macro-name}. + +If the macro is defined to take a single argument, and is invoked +without any braces, the entire rest of the line after the macro name is +supplied as the argument. For example: + +@example +@@macro bar @{p@} +Twice: \p\, \p\. +@@end macro +@@bar aah +@end example + +@noindent produces: + +@display +Twice: aah, aah. +@end display + + +@node Format/Print Hardcopy, Create an Info File, Macros, Top @comment node-name, next, previous, up @chapter Format and Print Hardcopy @cindex Format and print hardcopy @@ -11050,7 +11629,7 @@ not need to rewrite the three sections. @cindex Sorting indices @cindex Indices, sorting @cindex @TeX{} index sorting -@findex texindex +@pindex texindex There are three major shell commands for making a printed manual from a Texinfo file: one for converting the Texinfo file into a file that will be @@ -11119,7 +11698,7 @@ need a sorted index to work from. The @code{texindex} command sorts indices. (The source file @file{texindex.c} comes as part of the standard GNU distribution and is usually installed when Emacs is installed.)@refill -@findex texindex +@pindex texindex @ignore Usage: texindex [-k] [-T tempdir] infile [-o outfile] ... @@ -11173,21 +11752,21 @@ third time to output correct page numbers in cross references to them. However, cross references to indices are rare.}@refill To summarize, this is a three step process: - + @enumerate -@item +@item Run the @code{tex} formatting command on the Texinfo file. This generates the formatted @sc{dvi} file as well as the raw index files with two letter extensions.@refill -@item +@item Run the shell command @code{texindex} on the raw index files to sort them. This creates the corresponding sorted index files.@refill -@item +@item Rerun the @code{tex} formatting command on the Texinfo file. This regenerates a formatted @sc{dvi} file with the index entries in the -correct order. This second run also corrects the page numbers for +correct order. This second run also corrects the page numbers for the cross references. (The tables of contents are always correct.)@refill @end enumerate @@ -11200,26 +11779,26 @@ exist from the previous use of @code{texindex}. This is usually @node Format with texi2dvi, Print with lpr, Format with tex/texindex, Format/Print Hardcopy @comment node-name, next, previous, up @section Format using @code{texi2dvi} -@findex texi2dvi @r{(shell script)} +@pindex texi2dvi @r{(shell script)} The @code{texi2dvi} command is a shell script that automatically runs -both @code{tex} and @code{texindex} as needed to produce a @sc{dvi} file -with up-to-date, sorted indices. It simplifies the -@code{tex}---@code{texindex}---@code{tex} sequence described in the +both @code{tex} and @code{texindex} as many times as necessary to +produce a @sc{dvi} file with up-to-date, sorted indices. It simplifies +the @code{tex}---@code{texindex}---@code{tex} sequence described in the previous section. @need 1000 -The syntax for @code{texi2dvi} is like this (where @samp{%} is the +The syntax for @code{texi2dvi} is like this (where @samp{prompt$} is the shell prompt):@refill @example -% texi2dvi @var{filename}@dots{} +prompt$ @kbd{texi2dvi @var{filename}@dots{}} @end example @node Print with lpr, Within Emacs, Format with texi2dvi, Format/Print Hardcopy @comment node-name, next, previous, up @section Shell Print Using @code{lpr -d} -@findex lpr @r{(@sc{dvi} print command)} +@pindex lpr @r{(@sc{dvi} print command)} You can print a @sc{dvi} file with the @sc{dvi} print command. The precise printing command to use depends on your system; @samp{lpr -d} is @@ -11306,7 +11885,7 @@ occur.@refill @itemx M-x texinfo-tex-buffer Run @code{texi2dvi} on the current buffer.@refill -@item C-c C-t C-r +@item C-c C-t C-r @itemx M-x texinfo-tex-region Run @TeX{} on the current region.@refill @@ -11363,7 +11942,7 @@ C-c C-t C-q @r{Display the printer queue.} The Texinfo mode @TeX{} formatting commands start a subshell in Emacs called the @file{*tex-shell*}. The @code{texinfo-tex-command}, @code{texinfo-texindex-command}, and @code{tex-dvi-print-command} -commands are all run in this shell. +commands are all run in this shell. You can watch the commands operate in the @samp{*tex-shell*} buffer, and you can switch to and from and use the @samp{*tex-shell*} buffer @@ -11427,21 +12006,23 @@ this way; see @ref{Compilation, , , emacs, The GNU Emacs Manual}.@refill @node Requirements Summary, Preparing for TeX, Compile-Command, Format/Print Hardcopy @comment node-name, next, previous, up @section @TeX{} Formatting Requirements Summary -@cindex Requirements for formatting +@cindex Requirements for formatting @cindex Formatting requirements Every Texinfo file that is to be input to @TeX{} must begin with a -@code{\input} command and contain an @code{@@settitle} command:@refill +@code{\input} command and must contain an @code{@@setfilename} command and +an @code{@@settitle} command:@refill @example \input texinfo +@@setfilename @var{arg-not-used-by-@TeX{}} @@settitle @var{name-of-manual} @end example @noindent The first command instructs @TeX{} to load the macros it needs to -process a Texinfo file and the second command specifies the title of -printed manual.@refill +process a Texinfo file, the second command opens auxiliary files, and +the third specifies the title of printed manual. @need 1000 Every Texinfo file must end with a line that terminates @TeX{} @@ -11451,17 +12032,16 @@ processing and forces out unfinished pages:@refill @@bye @end example -Strictly speaking, these three lines are all a Texinfo file needs for +Strictly speaking, these four lines are all a Texinfo file needs for @TeX{}, besides the body. (The @code{@@setfilename} line is the only line that a Texinfo file needs for Info formatting.)@refill Usually, the file's first line contains an @samp{@@c -*-texinfo-*-} comment that causes Emacs to switch to Texinfo mode when you edit the file. In addition, the beginning usually includes an -@code{@@setfilename} for Info formatting, an @code{@@setchapternewpage} -command, a title page, a copyright page, and permissions. Besides an -@code{@@bye}, the end of a file usually includes indices and a table of -contents.@refill +@code{@@setchapternewpage} command, a title page, a copyright page, and +permissions. Besides an @code{@@bye}, the end of a file usually +includes indices and a table of contents.@refill @iftex For more information, see @@ -11499,8 +12079,8 @@ at the beginning of the first line. The @file{texinfo.tex} file tells included in the standard GNU distributions.)@refill Usually, the @file{texinfo.tex} file is put in the default directory -that contains @TeX{} macros (the @file{/usr/lib/tex/macros} -directory) when GNU Emacs or other GNU software is installed. +that contains @TeX{} macros (the @file{/usr/lib/tex/macros} +directory) when GNU Emacs or other GNU software is installed. In this case, @TeX{} will find the file and you do not need to do anything special. Alternatively, you can put @file{texinfo.tex} in the directory in @@ -11568,7 +12148,7 @@ The backslash, @samp{\}, is the @TeX{} equivalent of @samp{@@}.)@refill @TeX{} also provides the line number in the Texinfo source file and the text of the offending line, which is marked at all the places that -@TeX{} knows how to hyphenate words. +@TeX{} knows how to hyphenate words. @xref{Debugging with TeX, , Catching Errors with @TeX{} Formatting}, for more information about typesetting errors.@refill @@ -11580,7 +12160,7 @@ even be noticeable.@refill @cindex Black rectangle in hardcopy @cindex Rectangle, ugly, black in hardcopy However, unless told otherwise, @TeX{} will print a large, ugly, black -rectangle beside the line that contains the overful hbox. This is so +rectangle beside the line that contains the overfull hbox. This is so you will notice the location of the problem if you are correcting a draft.@refill @@ -11659,11 +12239,11 @@ For example, this is how you would write the header for this manual:@refill @end group @end example -@node Cropmarks and Magnification, , A4 Paper, Format/Print Hardcopy +@node Cropmarks and Magnification, , A4 Paper, Format/Print Hardcopy @comment node-name, next, previous, up @section Cropmarks and Magnification -@findex cropmarks +@findex cropmarks @cindex Cropmarks for printing @cindex Printing cropmarks You can attempt to direct @TeX{} to print cropmarks at the corners of @@ -11696,7 +12276,7 @@ You can attempt to direct @TeX{} to typeset pages larger or smaller than usual with the @code{\mag} @TeX{} command. Everything that is typeset is scaled proportionally larger or smaller. (@code{\mag} stands for ``magnification''.) This is @emph{not} a Texinfo @@-command, but is a -Plain@TeX{} command that is prefixed with a backslash. You have to +plain @TeX{} command that is prefixed with a backslash. You have to write this command between @code{@@tex} and @code{@@end tex} (@pxref{Using Ordinary TeX Commands, , Using Ordinary @TeX{} Commands}).@refill @@ -11744,10 +12324,10 @@ For information on installing the Info file in the Info system, see * Pointer Validation:: How to check that pointers point somewhere. * makeinfo in Emacs:: How to run @code{makeinfo} from Emacs. * texinfo-format commands:: Two Info formatting commands written - in Emacs Lisp are an alternative + in Emacs Lisp are an alternative to @code{makeinfo}. * Batch Formatting:: How to format for Info in Emacs Batch mode. -* Tag and Split Files:: How tagged and split files help Info +* Tag and Split Files:: How tagged and split files help Info to run better. @end menu @@ -11844,7 +12424,7 @@ The options are:@refill @need 100 @table @code @item -D @var{var} -Cause @var{var} to be defined. This is equivalent to +Cause @var{var} to be defined. This is equivalent to @code{@@set @var{var}} in the Texinfo file. @need 150 @@ -11954,7 +12534,7 @@ references but also report a warning.@refill @need 150 @item -U @var{var} -Cause @var{var} to be undefined. This is equivalent to +Cause @var{var} to be undefined. This is equivalent to @code{@@clear @var{var}} in the Texinfo file. @need 100 @@ -11985,7 +12565,7 @@ node in the current file and is not an external reference such as to @file{(dir)}, then the referenced node must exist.@refill @item -In every node, if the `Previous' node is different from the `Up' node, +In every node, if the `Previous' node is different from the `Up' node, then the `Previous' node must also be pointed to by a `Next' node.@refill @item @@ -12080,8 +12660,8 @@ For example, you could write the following in your @file{.emacs} file:@refill @example @group -(setq makeinfo-options - "--paragraph-indent=0 --no-split +(setq makeinfo-options + "--paragraph-indent=0 --no-split --fill-column=70 --verbose") @end group @end example @@ -12172,7 +12752,7 @@ you can continue working in it. (When you run @code{texinfo-format-region} or @code{texinfo-format-buffer}, you cannot use that Emacs for anything else until the command finishes.)@refill -@node Tag and Split Files, , Batch Formatting, Create an Info File +@node Tag and Split Files, , Batch Formatting, Create an Info File @comment node-name, next, previous, up @section Tag Files and Split Files @cindex Making a tag table automatically @@ -12261,6 +12841,7 @@ information on how to prevent files from being split and how to validate the structure of the nodes, see @ref{Using Info-validate}.@refill + @node Install an Info File, Command List, Create an Info File, Top @comment node-name, next, previous, up @chapter Installing an Info File @@ -12275,8 +12856,11 @@ into Emacs. (@inforef{Top, info, info}, for an introduction to Info.) @menu * Directory file:: The top level menu for all Info files. * New Info File:: Listing a new info file. -* Other Info Directories:: How to specify Info files that are +* Other Info Directories:: How to specify Info files that are located in other directories. +* Installing Dir Entries:: How to specify what menu entry to add + to the Info directory. +* Invoking install-info:: @code{install-info} options. @end menu @node Directory file, New Info File, Install an Info File, Install an Info File @@ -12301,8 +12885,8 @@ this:@refill * Info: (info). Documentation browsing system. * Emacs: (emacs). The extensible, self-documenting text editor. -* Texinfo: (texinfo). With one source file, make - either a printed manual using +* Texinfo: (texinfo). With one source file, make + either a printed manual using TeX or an Info file. @dots{} @end group @@ -12331,11 +12915,11 @@ File: emacs Node: Top, Up: (DIR), Next: Distrib case letters---it can be written in either upper or lower case. Info has a feature that it will change the case of the file name to lower case if it cannot find the name as written.)@refill - -@c !!! Can any file name be written in upper or lower case, +@c !!! Can any file name be written in upper or lower case, @c or is dir a special case? @c Yes, apparently so, at least with Gillespie's Info. --rjc 24mar92 -@c + + @node New Info File, Other Info Directories, Directory file, Install an Info File @section Listing a New Info File @cindex Adding a new info file @@ -12344,11 +12928,10 @@ case if it cannot find the name as written.)@refill @cindex Info file, listing new one @cindex @file{dir} file listing -To add a new Info file to your system, write a menu entry for it in the -menu in the @file{dir} file in the @file{info} directory. Also, move -the new Info file itself to the @file{info} directory. For example, if -you were adding documentation for GDB, you would write the following new -entry:@refill +To add a new Info file to your system, you must write a menu entry to +add to the menu in the @file{dir} file in the @file{info} directory. +For example, if you were adding documentation for GDB, you would write +the following new entry:@refill @example * GDB: (gdb). The source-level C debugger. @@ -12357,22 +12940,17 @@ entry:@refill @noindent The first part of the menu entry is the menu entry name, followed by a colon. The second part is the name of the Info file, in parentheses, -followed by a period. The third part is the description.@refill - -Conventionally, the name of an Info file has a @file{.info} extension. -Thus, you might list the name of the file like this: +followed by a period. The third part is the description. -@example -* GDB: (gdb.info). The source-level C debugger. -@end example +The name of an Info file often has a @file{.info} extension. Thus, the +Info file for GDB might be called either @file{gdb} or @file{gdb.info}. +The Info reader programs automatically try the file name both with and +without @file{.info}; so it is better to avoid clutter and not to write +@samp{.info} explicitly in the menu entry. For example, the GDB menu +entry should use just @samp{gdb} for the file name, not @samp{gdb.info}. -@noindent -However, Info will look for a file with a @file{.info} extension if it -does not find the file under the name given in the menu. This means -that you can refer to the file @file{gdb.info} as @file{gdb}, as shown -in the first example. This looks better. -@node Other Info Directories, , New Info File, Install an Info File +@node Other Info Directories, Installing Dir Entries, New Info File, Install an Info File @comment node-name, next, previous, up @section Info Files in Other Directories @cindex Installing Info in another directory @@ -12393,17 +12971,18 @@ file, in its directory; and then add the name of that directory to the @code{Info-directory-list} variable in your personal or site initialization file. -This tells Emacs's Info reader reader where to look for @file{dir} +This tells Emacs's Info reader where to look for @file{dir} files. Emacs merges the files named @file{dir} from each of the listed directories. (In Emacs Version 18, you can set the @code{Info-directory} variable to the name of only one directory.)@refill @item -Specify the @file{info} directory name in an environment variable in -your @file{.profile} or @file{.cshrc} initialization file. (Only you -and others who set this environment variable will be able to find Info -files whose location is specified this way.)@refill +Specify the @file{info} directory name in the @code{INFOPATH} +environment variable in your @file{.profile} or @file{.cshrc} +initialization file. (Only you and others who set this environment +variable will be able to find Info files whose location is specified +this way.)@refill @end itemize For example, to reach a test file in the @file{~bob/manuals} @@ -12411,31 +12990,31 @@ directory, you could add an entry like this to the menu in the @file{dir} file:@refill @example -* Test: (/usr/bob/manuals/info-test). Bob's own test file. +* Test: (/home/bob/manuals/info-test). Bob's own test file. @end example @noindent In this case, the absolute file name of the @file{info-test} file is written as the second part of the menu entry.@refill -@vindex Info-directory-list +@vindex Info-directory-list Alternatively, you could write the following in your @file{.emacs} file:@refill @example @group (setq Info-directory-list - '("/usr/bob/manuals" + '("/home/bob/manuals" "/usr/local/emacs/info")) @end group @end example @c reworded to avoid overfill hbox This tells Emacs to merge the @file{dir} file from the -@file{/usr/bob/manuals} directory with the @file{dir} file from the +@file{/home/bob/manuals} directory with the @file{dir} file from the @file{"/usr/local/emacs/info}" directory. Info will list the -@file{/usr/bob/manuals/info-test} file as a menu entry in the -@file{/usr/bob/manuals/dir} file.@refill +@file{/home/bob/manuals/info-test} file as a menu entry in the +@file{/home/bob/manuals/dir} file.@refill @vindex INFOPATH Finally, you can tell Info where to look by setting the @@ -12446,7 +13025,7 @@ If you use @code{sh} or @code{bash} for your shell command interpreter, you must set the @code{INFOPATH} environment variable in the @file{.profile} initialization file; but if you use @code{csh}, you must set the variable in the @file{.cshrc} initialization file. The two -files require slightly different command formats.@refill +files use slightly different command formats.@refill @itemize @bullet @item @@ -12472,6 +13051,145 @@ The @samp{.} indicates the current directory. Emacs uses the @code{INFOPATH} environment variable to initialize the value of Emacs's own @code{Info-directory-list} variable. + +@node Installing Dir Entries, Invoking install-info, Other Info Directories, Install an Info File +@section Installing Info Directory Files + +When you install an Info file onto your system, you can use the program +@code{install-info} to update the Info directory file @file{dir}. +Normally the makefile for the package runs @code{install-info}, just +after copying the Info file into its proper installed location. + +@findex dircategory +@findex direntry +In order for the Info file to work with @code{install-info}, you should +use the commands @code{@@dircategory} and @code{@@direntry} in the +Texinfo source file. Use @code{@@direntry} to specify the menu entry to +add to the Info directory file, and use @code{@@dircategory} to specify +which part of the Info directory to put it in. Here is how these +commands are used in this manual: + +@smallexample +@@dircategory Texinfo documentation system +@@direntry +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. @dots{} +@dots{} +@@end direntry +@end smallexample + +Here's what this produces in the Info file: + +@smallexample +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. @dots{} +@dots{} +END-INFO-DIR-ENTRY +@end smallexample + +@noindent +The @code{install-info} program sees these lines in the Info file, and +that is how it knows what to do. + +Always use the @code{@@direntry} and @code{@@dircategory} commands near +the beginning of the Texinfo input, before the first @code{@@node} +command. If you use them later on in the input, @code{install-info} +will not notice them. + +If you use @code{@@dircategory} more than once in the Texinfo source, +each usage specifies one category; the new menu entry is added to the +Info directory file in each of the categories you specify. If you use +@code{@@direntry} more than once, each usage specifies one menu entry; +each of these menu entries is added to the directory in each of the +specified categories. + + +@node Invoking install-info, , Installing Dir Entries, Install an Info File +@section Invoking install-info + +@pindex install-info + +@code{install-info} inserts menu entries from an Info file into the +top-level @file{dir} file in the Info system (see the previous sections +for an explanation of how the @file{dir} file works). It's most often +run as part of software installation, or when constructing a dir file +for all manuals on a system. Synopsis: + +@example +install-info [@var{option}]@dots{} [@var{info-file} [@var{dir-file}]] +@end example + +If @var{info-file} or @var{dir-file} are not specified, the various +options (described below) that define them must be. There are no +compile-time defaults, and standard input is never used. +@code{install-info} can read only one info file and write only one dir +file per invocation. + +Options: + +@table @samp +@item --delete +@opindex --delete +Only delete existing entries in @var{info-file}; don't insert any new +entries. + +@item --dir-file=@var{name} +@opindex --dir-file=@var{name} +Specify file name of the Info directory file. This is equivalent to +using the @var{dir-file} argument. + +@item --entry=@var{text} +@opindex --entry=@var{text} +Insert @var{text} as an Info directory entry; @var{text} should have the +form of an Info menu item line plus zero or more extra lines starting +with whitespace. If you specify more than one entry, they are all +added. If you don't specify any entries, they are determined from +information in the Info file itself. + +@item --help +@opindex --help +Display a usage message listing basic usage and all available options, +then exit successfully. + +@item --info-file=@var{file} +@opindex --info-file=@var{file} +Specify Info file to install in the directory. +This is equivalent to using the @var{info-file} argument. + +@item --info-dir=@var{dir} +@opindex --info-dir=@var{dir} +Equivalent to @samp{--dir-file=@var{dir}/dir}. + +@item --item=@var{text} +@opindex --item=@var{text} +Same as --entry=@var{text}. An Info directory entry is actually a menu +item. + +@item --quiet +@opindex --quiet +Suppress warnings. + +@item --remove +@opindex --remove +Same as --delete. + +@item --section=@var{sec} +@opindex --section=@var{sec} +Put this file's entries in section @var{sec} of the directory. If you +specify more than one section, all the entries are added in each of the +sections. If you don't specify any sections, they are determined from +information in the Info file itself. + +@item --version +@opindex --version +@cindex version number, finding +Display version information and exit successfully. + +@end table + + @c ================ Appendix starts here ================ @node Command List, Tips, Install an Info File, Top @@ -12486,32 +13204,80 @@ brackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis, @sp 1 @table @code +@item @@@var{whitespace} +An @code{@@} followed by a space, tab, or newline produces a normal, +stretchable, interword space. @xref{Multiple Spaces}. + +@item @@! +Generate an exclamation point that really does end a sentence (usually +after an end-of-sentence capital letter). @xref{Ending a Sentence}. + +@item @@" +@itemx @@' +Generate an umlaut or acute accent, respectively, over the next +character, as in @"o and @'o. @xref{Inserting Accents}. + @item @@* Force a line break. Do not end a paragraph that uses @code{@@*} with an @code{@@refill} command. @xref{Line Breaks}.@refill +@item @@,@{@var{c}@} +Generate a cedilla accent under @var{c}, as in @,{c}. @xref{Inserting +Accents}. + +@item @@- +Insert a discretionary hyphenation point. @xref{- and hyphenation}. + @item @@. -Stands for a period that really does end a sentence (usually after an -end-of-sentence capital letter). @xref{Controlling Spacing}.@refill +Produce a period that really does end a sentence (usually after an +end-of-sentence capital letter). @xref{Ending a Sentence}. @item @@: Indicate to @TeX{} that an immediately preceding period, question mark, exclamation mark, or colon does not end a sentence. Prevent @TeX{} from inserting extra whitespace as it does at the end of a sentence. The command has no effect on the Info file output. -@xref{Controlling Spacing}.@refill +@xref{Not Ending a Sentence}.@refill + +@item @@= +Generate a macro (bar) accent over the next character, as in @=o. +@xref{Inserting Accents}. + +@item @@? +Generate a question mark that really does end a sentence (usually after +an end-of-sentence capital letter). @xref{Ending a Sentence}. @item @@@@ -Stands for @samp{@@}. @xref{Braces Atsigns Periods, , Inserting -@samp{@@}}.@refill +Stands for an at sign, @samp{@@}.@* +@xref{Braces Atsigns, , Inserting @@ and braces}. + +@item @@^ +@itemx @@` +Generate a circumflex (hat) or grave accent, respectively, over the next +character, as in @^o. +@xref{Inserting Accents}. @item @@@{ -Stands for a left-hand brace, @samp{@{}.@* -@xref{Braces Atsigns Periods, , Inserting @@ braces and periods}.@refill +Stands for a left brace, @samp{@{}.@* +@xref{Braces Atsigns, , Inserting @@ and braces}. @item @@@} Stands for a right-hand brace, @samp{@}}.@* -@xref{Braces Atsigns Periods, , Inserting @@ braces and periods}.@refill +@xref{Braces Atsigns, , Inserting @@ and braces}. + +@item @@= +Generate a tilde accent over the next character, as in @~N. +@xref{Inserting Accents}. + +@item @@AA@{@} +@itemx @@aa@{@} +Generate the uppercase and lowercase Scandinavian A-ring letters, +respectively: @AA{}, @aa{}. @xref{Inserting Accents}. + +@item @@AE@{@} +@itemx @@ae@{@} +Generate the uppercase and lowercase AE ligatures, respectively: +@AE{}, @ae{}. @xref{Inserting Accents}. @item @@appendix @var{title} Begin an appendix. The title appears in the table @@ -12580,10 +13346,9 @@ Info. @xref{cartouche, , Drawing Cartouches Around Examples}.)@refill Center the line of text following the command. @xref{titlefont center sp, , @code{@@center}}.@refill -@item @@lowersections -Change subsequent chapters to sections, sections to subsections, and so -on. @xref{Raise/lower sections, , @code{@@raisesections} and -@code{@@lowersections}}.@refill +@item @@centerchap @var{line-of-text} +Like @code{@@chapter}, but centers the chapter title. @xref{chapter,, +@code{@@chapter}}. @item @@chapheading @var{title} Print a chapter-like heading in the text, but not in the table of @@ -12609,7 +13374,7 @@ Unset @var{flag}, preventing the Texinfo formatting commands from formatting text between subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end ifset} commands, and preventing @code{@@value@{@var{flag}@}} from expanding to the value to which -@var{flag} is set. +@var{flag} is set. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill @item @@code@{@var{sample-code}@} @@ -12642,12 +13407,14 @@ Define a new index and its indexing command. Print entries in an Indices}.@refill @item @@defcv @var{category} @var{class} @var{name} +@itemx @@defcvx @var{category} @var{class} @var{name} Format a description for a variable associated with a class in object-oriented programming. Takes three arguments: the category of thing being defined, the class to which it belongs, and its name. -@xref{Definition Commands}.@refill +@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}. @item @@deffn @var{category} @var{name} @var{arguments}@dots{} +@itemx @@deffnx @var{category} @var{name} @var{arguments}@dots{} Format a description for a function, interactive command, or similar entity that may take arguments. @code{@@deffn} takes as arguments the category of entity being described, the name of this particular @@ -12657,6 +13424,7 @@ entity, and its arguments, if any. @xref{Definition Commands}.@refill Define a new index and its indexing command. Print entries in a roman font. @xref{New Indices, , Defining New Indices}.@refill +@c Unused so far as I can see and unsupported by makeinfo -- karl, 15sep96. @item @@definfoenclose @var{new-command}, @var{before}, @var{after}, Create new @@-command for Info that marks text by enclosing it in strings that precede and follow the text. Write definition inside of @@ -12664,110 +13432,150 @@ strings that precede and follow the text. Write definition inside of Highlighting}.@refill @item @@defivar @var{class} @var{instance-variable-name} +@itemx @@defivarx @var{class} @var{instance-variable-name} This command formats a description for an instance variable in object-oriented programming. The command is equivalent to @samp{@@defcv -@{Instance Variable@} @dots{}}. @xref{Definition Commands}.@refill +@{Instance Variable@} @dots{}}. @xref{Definition Commands}, and +@ref{deffnx,, Def Cmds in Detail}. @item @@defmac @var{macro-name} @var{arguments}@dots{} +@itemx @@defmacx @var{macro-name} @var{arguments}@dots{} Format a description for a macro. The command is equivalent to -@samp{@@deffn Macro @dots{}}. @xref{Definition Commands}.@refill +@samp{@@deffn Macro @dots{}}. @xref{Definition Commands}, and +@ref{deffnx,, Def Cmds in Detail}. @item @@defmethod @var{class} @var{method-name} @var{arguments}@dots{} +@itemx @@defmethodx @var{class} @var{method-name} @var{arguments}@dots{} Format a description for a method in object-oriented programming. The command is equivalent to @samp{@@defop Method @dots{}}. Takes as arguments the name of the class of the method, the name of the -method, and its arguments, if any. @xref{Definition Commands}.@refill +method, and its arguments, if any. @xref{Definition Commands}, and +@ref{deffnx,, Def Cmds in Detail}. @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{} +@itemx @@defopx @var{category} @var{class} @var{name} @var{arguments}@dots{} Format a description for an operation in object-oriented programming. @code{@@defop} takes as arguments the overall name of the category of operation, the name of the class of the operation, the name of the operation, and its arguments, if any. @xref{Definition -Commands}.@refill +Commands}, and @ref{deffnx,, Def Cmds in Detail}. -@need 100 @item @@defopt @var{option-name} +@itemx @@defoptx @var{option-name} Format a description for a user option. The command is equivalent to -@samp{@@defvr @{User Option@} @dots{}}. @xref{Definition Commands}.@refill +@samp{@@defvr @{User Option@} @dots{}}. @xref{Definition Commands}, and +@ref{deffnx,, Def Cmds in Detail}. -@need 100 @item @@defspec @var{special-form-name} @var{arguments}@dots{} +@itemx @@defspecx @var{special-form-name} @var{arguments}@dots{} Format a description for a special form. The command is equivalent to -@samp{@@deffn @{Special Form@} @dots{}}. @xref{Definition Commands}.@refill +@samp{@@deffn @{Special Form@} @dots{}}. @xref{Definition Commands}, +and @ref{deffnx,, Def Cmds in Detail}. -@need 200 @item @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{} -Format a description for a data type. @code{@@deftp} takes as -arguments the category, the name of the type (which is a word like -@samp{int} or @samp{float}), and then the names of attributes of -objects of that -type. @xref{Definition Commands}.@refill +@itemx @@deftpx @var{category} @var{name-of-type} @var{attributes}@dots{} +Format a description for a data type. @code{@@deftp} takes as arguments +the category, the name of the type (which is a word like @samp{int} or +@samp{float}), and then the names of attributes of objects of that type. +@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}. @item @@deftypefn @var{classification} @var{data-type} @var{name} @var{arguments}@dots{} +@itemx @@deftypefnx @var{classification} @var{data-type} @var{name} @var{arguments}@dots{} Format a description for a function or similar entity that may take -arguments and that is typed. @code{@@deftypefn} takes as arguments -the classification of entity being described, the type, the name of -the entity, and its arguments, if any. @xref{Definition -Commands}.@refill +arguments and that is typed. @code{@@deftypefn} takes as arguments the +classification of entity being described, the type, the name of the +entity, and its arguments, if any. @xref{Definition Commands}, and +@ref{deffnx,, Def Cmds in Detail}. @item @@deftypefun @var{data-type} @var{function-name} @var{arguments}@dots{} +@itemx @@deftypefunx @var{data-type} @var{function-name} @var{arguments}@dots{} Format a description for a function in a typed language. The command is equivalent to @samp{@@deftypefn Function @dots{}}. -@xref{Definition Commands}.@refill +@xref{Definition Commands}, +and @ref{deffnx,, Def Cmds in Detail}. @item @@deftypevr @var{classification} @var{data-type} @var{name} +@itemx @@deftypevrx @var{classification} @var{data-type} @var{name} Format a description for something like a variable in a typed language---an entity that records a value. Takes as arguments the -classification of entity being described, the type, and the name of -the entity. @xref{Definition Commands}.@refill +classification of entity being described, the type, and the name of the +entity. @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in +Detail}. @item @@deftypevar @var{data-type} @var{variable-name} +@itemx @@deftypevarx @var{data-type} @var{variable-name} Format a description for a variable in a typed language. The command is equivalent to @samp{@@deftypevr Variable @dots{}}. @xref{Definition -Commands}.@refill +Commands}, and @ref{deffnx,, Def Cmds in Detail}. @item @@defun @var{function-name} @var{arguments}@dots{} +@itemx @@defunx @var{function-name} @var{arguments}@dots{} Format a description for functions. The command is equivalent to -@samp{@@deffn Function @dots{}}. @xref{Definition Commands}.@refill +@samp{@@deffn Function @dots{}}. @xref{Definition Commands}, and +@ref{deffnx,, Def Cmds in Detail}. @item @@defvar @var{variable-name} +@itemx @@defvarx @var{variable-name} Format a description for variables. The command is equivalent to -@samp{@@defvr Variable @dots{}}. @xref{Definition Commands}.@refill +@samp{@@defvr Variable @dots{}}. @xref{Definition Commands}, and +@ref{deffnx,, Def Cmds in Detail}. @item @@defvr @var{category} @var{name} +@itemx @@defvrx @var{category} @var{name} Format a description for any kind of variable. @code{@@defvr} takes as arguments the category of the entity and the name of the entity. -@xref{Definition Commands}.@refill +@xref{Definition Commands}, +and @ref{deffnx,, Def Cmds in Detail}. + +@item @@detailmenu@{@} +Use to avoid Makeinfo confusion stemming from the detailed node listing +in a master menu. @xref{Master Menu Parts}. @item @@dfn@{@var{term}@} Highlight the introductory or defining use of a term. @xref{dfn, , @code{@@dfn}}.@refill +@item @@dircategory @var{dirpart} +Specify a part of the Info directory menu where this file's entry should +go. @xref{Installing Dir Entries}. + +@item @@direntry +Begin the Info directory menu entry for this file. +@xref{Installing Dir Entries}. + @need 100 @item @@display Begin a kind of example. Indent text, do not fill, do not select a new font. Pair with @code{@@end display}. @xref{display, , @code{@@display}}.@refill -@need 100 @item @@dmn@{@var{dimension}@} -Format a dimension. Cause @TeX{} to insert a narrow space before -@var{dimension}. No effect in Info. Use for writing a number -followed by an abbreviation of a dimension name, such as -@samp{12@dmn{pt}}, written as @samp{12@@dmn@{pt@}}, with no space -between the number and the @code{@@dmn} command. @xref{dmn, , -@code{@@dmn}}.@refill +Format a unit of measure, as in 12@dmn{pt}. Causes @TeX{} to insert a +thin space before @var{dimension}. No effect in Info. +@xref{dmn, , @code{@@dmn}}.@refill @need 100 @item @@dots@{@} Insert an ellipsis: @samp{@dots{}}. @xref{dots, , @code{@@dots}}.@refill +@item @@email@{@var{address}@} +Indicate an electronic mail address. +@xref{email, , @code{@@email}}.@refill + @need 100 @item @@emph@{@var{text}@} Highlight @var{text}; text is displayed in @emph{italics} in printed output, and surrounded by asterisks in Info. @xref{Emphasis, , Emphasizing Text}.@refill +@item @@end @var{environment} +Ends @var{environment}, as in @samp{@@end example}. @xref{Formatting +Commands,,@@-commands}. + +@item @@enddots@{@} +Generate an end-of-sentence of ellipsis, like this @enddots{} +@xref{dots,,@code{@@dots@{@}}}. + @need 100 @item @@enumerate [@var{number-or-letter}] Begin a numbered list, using @code{@@item} for each entry. @@ -12789,29 +13597,30 @@ Specify page footings for even-numbered (left-hand) pages. Not relevant to Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill @item @@evenheading [@var{left}] @@| [@var{center}] @@| [@var{right}] -Specify page headings for even-numbered (left-hand) pages. Not relevant to -Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill +Specify page headings for even-numbered (left-hand) pages. Only +supported within @code{@@iftex}. @xref{Custom Headings, , How to Make +Your Own Headings}.@refill @item @@everyfooting [@var{left}] @@| [@var{center}] @@| [@var{right}] -Specify page footings for every page. Not relevant to Info. @xref{Custom -Headings, , How to Make Your Own Headings}.@refill - -@item @@everyheading [@var{left}] @@| [@var{center}] @@| [@var{right}] -Specify page headings for every page. Not relevant to Info. @xref{Custom -Headings, , How to Make Your Own Headings}.@refill +@itemx @@everyheading [@var{left}] @@| [@var{center}] @@| [@var{right}] +Specify page footings resp.@: headings for every page. Not relevant to +Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill @item @@example Begin an example. Indent text, do not fill, and select fixed-width font. Pair with @code{@@end example}. @xref{example, , @code{@@example}}.@refill +@item @@exclamdown@{@} +Generate an upside-down exclamation point. @xref{Inserting Accents}. + @item @@exdent @var{line-of-text} Remove any indentation a line might have. @xref{exdent, , Undoing the Indentation of a Line}.@refill @item @@expansion@{@} Indicate the result of a macro expansion to the reader with a special -glyph: @samp{@expansion{}}. +glyph: @samp{@expansion{}}. @xref{expansion, , @expansion{} Indicating an Expansion}.@refill @item @@file@{@var{filename}@} @@ -12829,15 +13638,10 @@ Defining the Entries of an Index}.@refill @need 200 @item @@flushleft +@itemx @@flushright Left justify every line but leave the right end ragged. Leave font as is. Pair with @code{@@end flushleft}. -@xref{flushleft & flushright, , @code{@@flushleft} and -@code{@@flushright}}.@refill - -@need 200 -@item @@flushright -Right justify every line but leave the left end ragged. -Leave font as is. Pair with @code{@@end flushright}. +@code{@@flushright} analogous. @xref{flushleft & flushright, , @code{@@flushleft} and @code{@@flushright}}.@refill @@ -12870,6 +13674,9 @@ Hold text together that must appear on one printed page. Pair with @code{@@end group}. Not relevant to Info. @xref{group, , @code{@@group}}.@refill +@item @@H@{@var{c}@} +Generate the long Hungarian umlaut accent over @var{c}, as in @H{o}. + @item @@heading @var{title} Print an unnumbered section-like heading in the text, but not in the table of contents of a printed manual. In Info, the title is @@ -12877,10 +13684,9 @@ underlined with equal signs. @xref{unnumberedsec appendixsec heading, , Section Commands}.@refill @item @@headings @var{on-off-single-double} -Turn page headings on or off, or specify single-sided or double-sided -page headings for printing. @code{@@headings on} is synonymous with -@code{@@headings double}. @xref{headings on off, , The -@code{@@headings} Command}.@refill +Turn page headings on or off, and/or specify single-sided or double-sided +page headings for printing. @xref{headings on off, , The +@code{@@headings} Command}. @item @@i@{@var{text}@} Print @var{text} in @i{italic} font. No effect in Info. @@ -12892,11 +13698,12 @@ between @code{@@ifclear @var{flag}} and the following @code{@@end ifclear} command. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill -@item @@ifinfo -Begin a stretch of text that will be ignored by @TeX{} when it -typesets the printed manual. The text appears only in the Info file. -Pair with @code{@@end ifinfo}. @xref{Conditionals, , Conditionally -Visible Text}.@refill +@item @@ifhtml +@itemx @@ifinfo +Begin a stretch of text that will be ignored by @TeX{} when it typesets +the printed manual. The text appears only in the HTML resp.@: Info +file. Pair with @code{@@end ifhtml} resp.@: @code{@@end ifinfo}. +@xref{Conditionals, , Conditionally Visible Text}.@refill @item @@ifset @var{flag} If @var{flag} is set, the Texinfo formatting commands format text @@ -12927,7 +13734,7 @@ manual. @xref{inforef, , Cross references using Use the specified macro definitions file. This command is used only in the first line of a Texinfo file to cause @TeX{} to make use of the @file{texinfo} macro definitions file. The backslash in @code{\input} -is used instead of an @code{@@} because @TeX{} does not properly +is used instead of an @code{@@} because @TeX{} does not recognize @code{@@} until after it has read the definitions file. @xref{Header, , The Texinfo File Header}.@refill @@ -12947,17 +13754,23 @@ Like @code{@@item} but do not generate extra vertical space above the item text. @xref{itemx, , @code{@@itemx}}.@refill @item @@kbd@{@var{keyboard-characters}@} -Indicate text that consists of characters of input to be typed by +Indicate text that is characters of input to be typed by users. @xref{kbd, , @code{@@kbd}}.@refill @item @@key@{@var{key-name}@} -Highlight @var{key-name}, a conventional name for a key on a keyboard. +Highlight @var{key-name}, a name for a key on a keyboard. @xref{key, , @code{@@key}}.@refill @item @@kindex @var{entry} Add @var{entry} to the index of keys. @xref{Index Entries, , Defining the Entries of an Index}.@refill +@item @@L@{@} +@itemx @@l@{@} +Generate the uppercase and lowercase Polish suppressed-L letters, +respectively: @L{}, @l{}. + +@c Possibly this can be tossed now that we have macros. --karl, 16sep96. @item @@global@@let@var{new-command}=@var{existing-command} Equate a new highlighting command with an existing one. Only for @TeX{}. Write definition inside of @code{@@iftex} @dots{} @code{@@end @@ -12968,7 +13781,16 @@ Begin an example of Lisp code. Indent text, do not fill, and select fixed-width font. Pair with @code{@@end lisp}. @xref{Lisp Example, , @code{@@lisp}}.@refill -@item @@majorheading @var{title} +@item @@lowersections +Change subsequent chapters to sections, sections to subsections, and so +on. @xref{Raise/lower sections, , @code{@@raisesections} and +@code{@@lowersections}}.@refill + +@item @@macro @var{macro-name} @{@var{params}@} +Define a new Texinfo command @code{@@@var{macro-name}@{@var{params}@}}. +Only supported by Makeinfo and Texi2dvi. @xref{Defining Macros}. + +@item @@majorheading @var{title} Print a chapter-like heading in the text, but not in the table of contents of a printed manual. Generate more vertical whitespace before the heading than the @code{@@chapheading} command. In Info, the chapter @@ -12984,7 +13806,11 @@ Mark the beginning of a menu of nodes in Info. No effect in a printed manual. Pair with @code{@@end menu}. @xref{Menus}.@refill @item @@minus@{@} -Generate a minus sign. @xref{minus, , @code{@@minus}}.@refill +Generate a minus sign, `@minus{}'. @xref{minus, , @code{@@minus}}.@refill + +@item @@multitable @var{column-width-spec} +Begin a multi-column table. Pair with @code{@@end multitable}. +@xref{Multitable Column Widths}. @item @@need @var{n} Start a new page in a printed manual if fewer than @var{n} mils @@ -12995,18 +13821,25 @@ Start a new page in a printed manual if fewer than @var{n} mils Define the beginning of a new node in Info, and serve as a locator for references for @TeX{}. @xref{node, , @code{@@node}}.@refill -@need 200 @item @@noindent Prevent text from being indented as if it were a new paragraph. @xref{noindent, , @code{@@noindent}}.@refill +@item @@O@{@} +@itemx @@o@{@} +Generate the uppercase and lowercase Owith-slash letters, respectively: +@O{}, @o{}. + @item @@oddfooting [@var{left}] @@| [@var{center}] @@| [@var{right}] -Specify page footings for odd-numbered (right-hand) pages. Not relevant to -Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill +@itemx @@oddheading [@var{left}] @@| [@var{center}] @@| [@var{right}] +Specify page footings resp.@: headings for odd-numbered (right-hand) +pages. Only allowed inside @code{@@iftex}. @xref{Custom Headings, , +How to Make Your Own Headings}.@refill -@item @@oddheading [@var{left}] @@| [@var{center}] @@| [@var{right}] -Specify page headings for odd-numbered (right-hand) pages. Not relevant to -Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill +@item @@OE@{@} +@itemx @@oe@{@} +Generate the uppercase and lowercase OE ligatures, respectively: +@OE{}, @oe{}. @xref{Inserting Accents}. @item @@page Start a new page in a printed manual. No effect in Info. @@ -13027,6 +13860,10 @@ Indicate the position of point in a buffer to the reader with a glyph: @samp{@point{}}. @xref{Point Glyph, , Indicating Point in a Buffer}.@refill +@item @@pounds@{@} +Generate the pounds sterling currency sign. +@xref{pounds,,@code{@@pounds@{@}}}. + @item @@print@{@} Indicate printed output to the reader with a glyph: @samp{@print{}}. @xref{Print Glyph}.@refill @@ -13039,11 +13876,13 @@ Indices & Menus}.@refill @item @@pxref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@} Make a reference that starts with a lower case `see' in a printed manual. Use within parentheses only. Do not follow command with a -punctuation mark. The Info formatting commands automatically insert -terminating punctuation as needed, which is why you do not need to -insert punctuation. Only the first argument is mandatory. +punctuation mark---the Info formatting commands automatically insert +terminating punctuation as needed. Only the first argument is mandatory. @xref{pxref, , @code{@@pxref}}.@refill +@item @@questiondown@{@} +Generate an upside-down question mark. @xref{Inserting Accents}. + @item @@quotation Narrow the margins to indicate text that is quoted from another real or imaginary work. Write command on a line of its own. Pair with @@ -13078,6 +13917,10 @@ is no longer needed, since all formatters now automatically refill. Indicate the result of an expression to the reader with a special glyph: @samp{@result{}}. @xref{result, , @code{@@result}}.@refill +@item @@ringaccent@{@var{c}@} +Generate a ring accent over the next character, as in @ringaccent{o}. +@xref{Inserting Accents}. + @item @@samp@{@var{text}@} Highlight @var{text} that is a literal example of a sequence of characters. Used for single characters, for statements, and often for @@ -13106,10 +13949,10 @@ Specify whether chapters start on new pages, and if so, whether on odd-numbered (right-hand) new pages. @xref{setchapternewpage, , @code{@@setchapternewpage}}.@refill -@c awkward wording prevents overfull hbox @item @@setfilename @var{info-file-name} -Provide a name to be used by the Info file. @xref{setfilename, , -@code{@@setfilename}}.@refill +Provide a name to be used by the Info file. This command is essential +for @TeX{} formatting as well, even though it produces no output. +@xref{setfilename, , @code{@@setfilename}}.@refill @item @@settitle @var{title} Provide a title for page headers in a printed manual. @@ -13121,6 +13964,9 @@ menus rather than tables of contents. A synonym for @code{@@summarycontents}. @xref{Contents, , Generating a Table of Contents}.@refill +@item @@shorttitlepage@{@var{title}@} +Generate a minimal title page. @xref{titlepage,,@code{@@titlepage}}. + @need 400 @item @@smallbook Cause @TeX{} to produce a printed manual in a 7 by 9.25 inch format @@ -13147,8 +13993,11 @@ smalllisp, , @code{@@smallexample} and @code{@@smalllisp}}.@refill @item @@sp @var{n} Skip @var{n} blank lines. @xref{sp, , @code{@@sp}}.@refill +@item @@ss@{@} +Generate the German sharp-S es-zet letter, @ss{}. @xref{Inserting Accents}. + @need 700 -@item @@strong @var{text} +@item @@strong @var{text} Emphasize @var{text} by typesetting it in a @strong{bold} font for the printed manual and by surrounding it with asterisks for Info. @xref{emph & strong, , Emphasizing Text}.@refill @@ -13207,6 +14056,9 @@ entries. @xref{Combining Indices}.@refill Print @var{text} in a @t{fixed-width}, typewriter-like font. No effect in Info. @xref{Fonts}.@refill +@item @@tab +Separate columns in a multitable. @xref{Multitable Rows}. + @need 400 @item @@table @var{formatting-command} Begin a two-column table, using @code{@@item} for each entry. Write @@ -13214,7 +14066,7 @@ each first column entry on the same line as @code{@@item}. First column entries are printed in the font resulting from @var{formatting-command}. Pair with @code{@@end table}. @xref{Two-column Tables, , Making a Two-column Table}. -Also see @ref{ftable vtable, , @code{@@ftable} and @code{@@vtable}}, +Also see @ref{ftable vtable, , @code{@@ftable} and @code{@@vtable}}, and @ref{itemx, , @code{@@itemx}}.@refill @item @@TeX@{@} @@ -13226,35 +14078,16 @@ Enter @TeX{} completely. Pair with @code{@@end tex}. @xref{Using Ordinary TeX Commands, , Using Ordinary @TeX{} Commands}.@refill @item @@thischapter -In a heading or footing, stands for the number and name of the current -chapter, in the format `Chapter 1: Title'. @xref{Custom -Headings, , How to Make Your Own Headings}.@refill - -@item @@thischaptername -In a heading or footing, stands for the name of the current chapter. -@xref{Custom Headings, , How to Make Your Own Headings}.@refill - -@item @@thisfile -In a heading or footing, stands for the name of the current -@code{@@include} file. Does not insert anything if not within an -@code{@@include} file. @xref{Custom Headings, , How to Make Your Own +@itemx @@thischaptername +@itemx @@thisfile +@itemx @@thispage +@itemx @@thistitle +Only allowed in a heading or footing. Stands for the number and name of +the current chapter (in the format `Chapter 1: Title'), the chapter name +only, the filename, the current page number, and the title of the +document, respectively. @xref{Custom Headings, , How to Make Your Own Headings}.@refill -@item @@thispage -In a heading or footing, stands for the current page number. -@xref{Custom Headings, , How to Make Your Own Headings}.@refill - -@ignore -@item @@thissection -In a heading or footing, stands for the title of the current section. -@xref{Custom Headings, , How to Make Your Own Headings}.@refill -@end ignore - -@item @@thistitle -In a heading or footing, stands for the name of the document, as specified -by the @code{@@settitle} command. @xref{Custom Headings, , How to -Make Your Own Headings}.@refill - @item @@tindex @var{entry} Add @var{entry} to the index of data types. @xref{Index Entries, , Defining the Entries of an Index}.@refill @@ -13296,6 +14129,13 @@ ifinfo}. In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top} command is merely a synonym for @code{@@unnumbered}. @xref{makeinfo Pointer Creation, , Creating Pointers with @code{makeinfo}}. +@item @@u@var{c} +@itemx @@ubaraccent@var{c} +@itemx @@udotaccent@var{c} +Generate a breve, underbar, or underdot accent, respectively, over or +under the character @var{c}, as in @u{o}, @ubaraccent{o}, +@udotaccent{o}. @xref{Inserting Accents}. + @item @@unnumbered @var{title} In a printed manual, begin a chapter that appears without chapter numbers of any kind. The title appears in the table of contents of a @@ -13323,6 +14163,14 @@ chapter. The title appears in the table of contents of a printed manual. In Info, the title is underlined with periods. @xref{subsubsection, , The `subsub' Commands}.@refill +@item @@url@{@var{url}@} +Highlight text that is a uniform resource locator for the World Wide +Web. @xref{url, , @code{@@url}}.@refill + +@item @@v@var{c} +Generate check accent over the character @var{c}, as in @v{o}. +@xref{Inserting Accents}. + @item @@value@{@var{flag}@} Replace @var{flag} with the value to which it is set by @code{@@set @var{flag}}. @@ -13359,7 +14207,6 @@ index of variables. Pair with @code{@@end vtable}. The same as @item @@w@{@var{text}@} Prevent @var{text} from being split across two lines. Do not end a paragraph that uses @code{@@w} with an @code{@@refill} command. -In the Texinfo file, keep @var{text} on one line. @xref{w, , @code{@@w}}.@refill @need 400 @@ -13393,7 +14240,7 @@ Use 70 or 72 as your fill column. Longer lines are hard to read. Include a copyright notice and copying permissions. @end itemize -@subsubheading Index, index, index! +@subsubheading Index, index, index! Write many index entries, in different ways. Readers like indices; they are helpful and convenient. @@ -13409,8 +14256,7 @@ Here are more hints we have found valuable: @itemize @bullet @item Write each index entry differently, so each entry refers to a different -place in the document. The index of an Info file lists only one -location for each entry. +place in the document. @item Write index entries only where a topic is discussed significantly. For @@ -13431,7 +14277,7 @@ which this is proper, such as names of countries or acronyms. Always use the appropriate case for case-sensitive names, such as those in C or Lisp. -@item +@item Write the indexing commands that refer to a whole section immediately after the section command, and write the indexing commands that refer to the paragraph before the paragraph. @@ -13473,7 +14319,7 @@ paragraph together. @item Always insert a blank line before an @code{@@table} command and after an @code{@@end table} command; but never insert a blank line after an -@code{@@table} command or before an @code{@@end table} command. +@code{@@table} command or before an @code{@@end table} command. @need 1000 For example, @@ -13547,8 +14393,8 @@ For example: @example @group @@c ===> NOTE! <== -@@c Specify the edition and version numbers and date -@@c in *three* places: +@@c Specify the edition and version numbers and date +@@c in *three* places: @@c 1. First ifinfo section 2. title page 3. top node @@c To find the locations, search for !!set @end group @@ -13556,14 +14402,14 @@ For example: @group @@ifinfo @@c !!set edition, date, version -This is Edition 4.03, January 1992, +This is Edition 4.03, January 1992, of the @@cite@{GDB Manual@} for GDB Version 4.3. @dots{} @end group @end example @noindent ----or use @code{@@set} and @code{@@value} +---or use @code{@@set} and @code{@@value} (@pxref{value Example, , @code{@@value} Example}). @subsubheading Definition Commands @@ -13576,7 +14422,7 @@ a uniform format.@refill @item Write just one definition command for each entity you define with a definition command. The automatic indexing feature creates an index -entry that leads the reader to the definition. +entry that leads the reader to the definition. @item Use @code{@@table} @dots{} @code{@@end table} in an appendix that @@ -13613,7 +14459,7 @@ For example, @TeX{} fills the following: @group @@kbd@{C-x v@} @@kbd@{M-x vc-next-action@} - Perform the next logical operation + Perform the next logical operation on the version-controlled file corresponding to the current buffer. @end group @@ -13648,7 +14494,7 @@ In this case, the text should be formatted with @item Use @code{@@code} around Lisp symbols, including command names. For example, - + @example The main function is @@code@{vc-next-action@}, @dots{} @end example @@ -13664,15 +14510,16 @@ around them. @item Use three hyphens in a row, @samp{---}, to indicate a long dash. @TeX{} typesets these as a long dash and the Info formatters reduce three -hyphens to two. +hyphens to two. @end itemize @subsubheading Periods Outside of Quotes Place periods and other punctuation marks @emph{outside} of quotations, -unless the punctuation is part of the quotation. This practice goes against -convention, but enables the reader to distinguish between the contents -of the quotation and the whole passage. +unless the punctuation is part of the quotation. This practice goes +against publishing conventions in the United States, but enables the +reader to distinguish between the contents of the quotation and the +whole passage. For example, you should write the following sentence with the period outside the end quotation marks: @@ -13689,8 +14536,8 @@ since @samp{au} does @emph{not} serve as an abbreviation for @itemize @bullet @item -Introduce new terms so that a user who does not know them can understand -them from context; or write a definition for the term. +Introduce new terms so that a reader who does not know them can +understand them from context; or write a definition for the term. For example, in the following, the terms ``check in'', ``register'' and ``delta'' are all appearing for the first time; the example sentence should be @@ -13704,8 +14551,8 @@ it as deltas. @item Use the @code{@@dfn} command around a word being introduced, to indicate -that the user should not expect to know the meaning already, and should -expect to learn the meaning from this passage. +that the reader should not expect to know the meaning already, and +should expect to learn the meaning from this passage. @end itemize @subsubheading @@pxref @@ -13714,7 +14561,7 @@ expect to learn the meaning from this passage. @ignore By the way, it is okay to use pxref with something else in front of it within the parens, as long as the pxref is followed by the close -paren, and the material inside the parents is not part of a larger +paren, and the material inside the parens is not part of a larger sentence. Also, you can use xref inside parens as part of a complete sentence so long as you terminate the cross reference with punctuation. @end ignore @@ -13733,8 +14580,8 @@ describes this. Unfortunately, if the node names and titles for these sections are all different, readers find it hard to search for the section.@refill -Name such sections with a phrase beginning with the word -@w{`Invoking @dots{}'}, as in `Invoking Emacs'; this way +Name such sections with a phrase beginning with the word +@w{`Invoking @dots{}'}, as in `Invoking Emacs'; this way users can find the section easily. @subsubheading @sc{ansi c} Syntax @@ -13777,7 +14624,7 @@ In this example, say, `` @dots{} you must @code{@@dfn}@{check in@} the new version.'' That flows better. @quotation -When you are done editing the file, you must perform a +When you are done editing the file, you must perform a @code{@@dfn}@{check in@}. @end quotation @@ -13823,7 +14670,7 @@ You can see this file, with comments, in the first chapter. @sp 1 @example -\input texinfo @@c -*-texinfo-*- +\input texinfo @@c -*-texinfo-*- @@c %**start of header @@setfilename sample.info @@settitle Sample Document @@ -13852,7 +14699,7 @@ Copyright @@copyright@{@} 1990 Free Software Foundation, Inc. @@comment node-name, next, previous, up @@menu -* First Chapter:: The first chapter is the +* First Chapter:: The first chapter is the only chapter in this sample. * Concept Index:: This index has two entries. @@end menu @@ -13862,7 +14709,7 @@ Copyright @@copyright@{@} 1990 Free Software Foundation, Inc. @@chapter First Chapter @@cindex Sample index entry -This is the contents of the first chapter. +This is the contents of the first chapter. @@cindex Another sample index entry Here is a numbered list. @@ -13876,8 +14723,8 @@ This is the second item. @@end enumerate The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@} -commands transform a Texinfo file such as this into -an Info file; and @@TeX@{@} typesets it for a printed +commands transform a Texinfo file such as this into +an Info file; and @@TeX@{@} typesets it for a printed manual. @@node Concept Index, , First Chapter, Top @@ -13976,7 +14823,7 @@ Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. -@@ignore +@@ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries a copying permission notice identical to this @@ -13994,13 +14841,13 @@ under the terms of a permission notice identical to this one. Permission is granted to copy and distribute -translations of this manual into another language, -under the above conditions for modified versions, +translations of this manual into another language, +under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end example -@node Titlepage Permissions, , ifinfo Permissions, Sample Permissions +@node Titlepage Permissions, , ifinfo Permissions, Sample Permissions @comment node-name, next, previous, up @appendixsec Titlepage Copying Permissions @cindex Titlepage permissions @@ -14025,8 +14872,8 @@ under the terms of a permission notice identical to this one. Permission is granted to copy and distribute -translations of this manual into another language, -under the above conditions for modified versions, +translations of this manual into another language, +under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end example @@ -14057,7 +14904,7 @@ conveniently small parts.@refill @end menu @node Using Include Files, texinfo-multiple-files-update, Include Files, Include Files -@appendixsec How to Use Include Files +@appendixsec How to Use Include Files @findex include To include another file within a Texinfo file, write the @@ -14283,7 +15130,7 @@ Manual} is named @file{elisp.texi}. This outer file contains a master menu with 417 entries and a list of 41 @code{@@include} files.@refill -@node Include Files Evolution, , Sample Include File, Include Files +@node Include Files Evolution, , Sample Include File, Include Files @comment node-name, next, previous, up @appendixsec Evolution of Include Files @@ -14297,7 +15144,7 @@ information sought. This way, Emacs could avoid wasting memory.@refill References from one file to another were made by referring to the file name as well as the node name. (@xref{Other Info Files, , Referring to -Other Info Files}. Also, see @ref{Four and Five Arguments, , +Other Info Files}. Also, see @ref{Four and Five Arguments, , @code{@@xref} with Four and Five Arguments}.)@refill Include files were designed primarily as a way to create a single, @@ -14466,28 +15313,28 @@ according to a standard format specified by the There are four possibilities:@refill @table @asis -@item No @code{@@setchapternewpage} command +@item No @code{@@setchapternewpage} command Cause @TeX{} to specify the single-sided heading format, with chapters on new pages. This is the same as @code{@@setchapternewpage on}.@refill -@item @code{@@setchapternewpage on} +@item @code{@@setchapternewpage on} Specify the single-sided heading format, with chapters on new pages.@refill -@item @code{@@setchapternewpage off} +@item @code{@@setchapternewpage off} Cause @TeX{} to start a new chapter on the same page as the last page of the preceding chapter, after skipping some vertical whitespace. Also cause @TeX{} to typeset for single-sided printing. (You can override the headers format with the @code{@@headings double} command; see @ref{headings on off, , The @code{@@headings} Command}.)@refill -@item @code{@@setchapternewpage odd} +@item @code{@@setchapternewpage odd} Specify the double-sided heading format, with chapters on new pages.@refill @end table @noindent Texinfo lacks an @code{@@setchapternewpage even} command.@refill -@node Custom Headings, , Heading Choice, Headings +@node Custom Headings, , Heading Choice, Headings @comment node-name, next, previous, up @appendixsec How to Make Your Own Headings @@ -14598,12 +15445,12 @@ Expands to the number and name of the current chapter, in the format `Chapter 1: Title'.@refill @findex thistitle -@item @@thistitle +@item @@thistitle Expands to the name of the document, as specified by the @code{@@settitle} command.@refill @findex thisfile -@item @@thisfile +@item @@thisfile For @code{@@include} files only: expands to the name of the current @code{@@include} file. If the current Texinfo source file is not an @code{@@include} file, this command has no effect. This command does @@ -14729,10 +15576,10 @@ occurs, or not long after it. The buffer will look like this:@refill ---------- Buffer: *Info Region* ---------- * Menu: -* Using texinfo-show-structure:: How to use +* Using texinfo-show-structure:: How to use `texinfo-show-structure' to catch mistakes. -* Running Info-Validate:: How to check for +* Running Info-Validate:: How to check for unreferenced nodes. @@end menus @point{} @@ -14807,7 +15654,7 @@ then. In this case, you will need to backtrack.@refill @c appendixsubsec Using the Emacs Lisp Debugger @c index Using the Emacs Lisp debugger @c index Emacs Lisp debugger -@c index Debugger, using the Emacs Lisp +@c index Debugger, using the Emacs Lisp If an error is especially elusive, you can turn on the Emacs Lisp debugger and look at the backtrace; this tells you where in the @@ -14910,19 +15757,19 @@ indices.)@@refill @example ---------- Buffer: *tex-shell* ---------- Runaway argument? -@{sorting indices, for more information about sorting +@{sorting indices, for more information about sorting indices.) @@refill @@ETC. ! Paragraph ended before @@xref was complete. - - @@par -l.27 - -? + + @@par +l.27 + +? ---------- Buffer: *tex-shell* ---------- @end example In this case, @TeX{} produced an accurate and -understandable error message: +understandable error message: @example Paragraph ended before @@xref was complete. @@ -14945,7 +15792,7 @@ things.@refill You can tell @TeX{} to continue running and ignore just this error by typing @key{RET} at the @samp{?} prompt.@refill -@item +@item You can tell @TeX{} to continue running and to ignore all errors as best it can by typing @kbd{r @key{RET}} at the @samp{?} prompt.@refill @@ -14955,8 +15802,8 @@ are felt through the rest of the file. (To stop @TeX{} when it is producing such an avalanche of error messages, type @kbd{C-d} (or @kbd{C-c C-d}, if you are running a shell inside Emacs.))@refill -@item -You can tell @TeX{} to stop this run by typing @kbd{x @key{RET}} +@item +You can tell @TeX{} to stop this run by typing @kbd{x @key{RET}} at the @samp{?} prompt.@refill @end enumerate @@ -14994,8 +15841,7 @@ beginning of its run and display output that looks like the following. The @samp{*} indicates that @TeX{} is waiting for input.@refill @example -This is TeX, Version 2.0 for Berkeley UNIX -(preloaded format=plain-cm 87.10.25) +This is TeX, Version 3.14159 (Web2c 7.0) (test.texinfo [1]) * @end example @@ -15021,7 +15867,7 @@ In GNU Emacs, in Texinfo mode, the @code{texinfo-show-structure} command lists all the lines that begin with the @@-commands that specify the structure: @code{@@chapter}, @code{@@section}, @code{@@appendix}, and so on. With an argument (@w{@kbd{C-u}} -as prefix argument, if interactive), +as prefix argument, if interactive), the command also shows the @code{@@node} lines. The @code{texinfo-show-structure} command is bound to @kbd{C-c C-s} in Texinfo mode, by default.@refill @@ -15033,7 +15879,7 @@ produced by running @code{texinfo-show-structure} on this manual:@refill @example @group Lines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\| - unnum\\|major\\|chapheading \\|heading \\|appendix\\)" + unnum\\|major\\|chapheading \\|heading \\|appendix\\)" in buffer texinfo.texi. @dots{} 4177:@@chapter Nodes @@ -15082,7 +15928,7 @@ or left out a section, you can correct the mistake.@refill @node Using occur, Running Info-Validate, Using texinfo-show-structure, Catching Mistakes @comment node-name, next, previous, up @appendixsec Using @code{occur} -@cindex Occurrences, listing with @code{@@occur} +@cindex Occurrences, listing with @code{@@occur} @findex occur Sometimes the @code{texinfo-show-structure} command produces too much @@ -15095,7 +15941,7 @@ command directly. To do this, type@refill @kbd{M-x occur} @end example -@noindent +@noindent and then, when prompted, type a @dfn{regexp}, a regular expression for the pattern you want to match. (@xref{Regexps, , Regular Expressions, emacs, The GNU Emacs Manual}.) The @code{occur} command works from @@ -15119,7 +15965,7 @@ therefore have the same `Up' pointer.@refill @xref{Other Repeating Search, , Using Occur, emacs , The GNU Emacs Manual}, for more information.@refill -@node Running Info-Validate, , Using occur, Catching Mistakes +@node Running Info-Validate, , Using occur, Catching Mistakes @comment node-name, next, previous, up @appendixsec Finding Badly Referenced Nodes @findex Info-validate @@ -15127,7 +15973,7 @@ for more information.@refill @cindex Checking for badly referenced nodes @cindex Looking for badly referenced nodes @cindex Finding badly referenced nodes -@cindex Badly referenced nodes +@cindex Badly referenced nodes You can use the @code{Info-validate} command to check whether any of the `Next', `Previous', `Up' or other node pointers fail to point to a @@ -15256,7 +16102,7 @@ M-x Info-tagify @end example @noindent -(Note the upper case @key{I} in @code{Info-tagify}.) This creates an +(Note the upper case @samp{I} in @code{Info-tagify}.) This creates an Info file with a tag table that you can validate.@refill The third step is to validate the Info file:@refill @@ -15266,7 +16112,7 @@ M-x Info-validate @end example @noindent -(Note the upper case @key{I} in @code{Info-validate}.) +(Note the upper case @samp{I} in @code{Info-validate}.) In brief, the steps are:@refill @example @@ -15282,7 +16128,7 @@ After you have validated the node structure, you can rerun tag table and split the file automatically, or you can make the tag table and split the file manually.@refill -@node Splitting, , Tagifying, Running Info-Validate +@node Splitting, , Tagifying, Running Info-Validate @comment node-name, next, previous, up @appendixsubsec Splitting a File Manually @cindex Splitting an Info file manually @@ -15336,8 +16182,8 @@ the tag table and a directory of subfiles.@refill @node Refilling Paragraphs, Command Syntax, Catching Mistakes, Top @comment node-name, next, previous, up @appendix Refilling Paragraphs -@cindex Refilling paragraphs -@cindex Filling paragraphs +@cindex Refilling paragraphs +@cindex Filling paragraphs @findex refill The @code{@@refill} command refills and, optionally, indents the first @@ -15378,7 +16224,7 @@ and therefore do not refill or indent them.@refill @cindex @@-command syntax The character @samp{@@} is used to start special Texinfo commands. -(It has the same meaning that @samp{\} has in Plain@TeX{}.) Texinfo +(It has the same meaning that @samp{\} has in plain @TeX{}.) Texinfo has four types of @@-command:@refill @table @asis @@ -15440,17 +16286,23 @@ a line.@refill @cindex @TeX{}, how to obtain @c !!! Here is information about obtaining TeX. Update it whenever. -@c Last updated by RJC on 1 March 1995, conversation with Mackay. +@c !!! Also consider updating TeX.README on prep. +@c Updated by RJC on 1 March 1995, conversation with MacKay. +@c Updated by kb@cs.umb.edu on 29 July 1996. @TeX{} is freely redistributable. You can obtain @TeX{} for Unix systems via anonymous ftp or on tape or CD-ROM. The core material -consists of Karl Berry's @code{web2c} @TeX{} package. +consists of Karl Berry's Web2c @TeX{} distribution. -On-line retrieval instructions are in @code{ftp.cs.umb.edu} -@t{[158.121.104.33]} in @file{pub/tex/unixtex.ftp} +On-line retrieval instructions are available from either: +@example +@url{ftp://ftp.tug.org/tex/unixtex.ftp} +@url{http://www.tug.org/unixtex.ftp} +@end example -The Free Software Foundation provides a core distribution on its -Source Code CD-ROM; the University of Washington maintains and -supports a tape distribution. +The Free Software Foundation provides a core distribution on its Source +Code CD-ROM suitable for printing Texinfo manuals; the University of +Washington maintains and supports a tape distribution; the @TeX{} Users +Group co-sponsors a complete CD-ROM @TeX{} distribution. For the FSF Source Code CD-ROM, please contact: @@ -15459,7 +16311,7 @@ For the FSF Source Code CD-ROM, please contact: @group Free Software Foundation, Inc. 59 Temple Place Suite 330 -Boston, MA @w{ } 02111-1307 +Boston, MA w{ } 02111-1307 USA Telephone: @w{@t{+}1--617--542--5942} @@ -15467,7 +16319,7 @@ Fax: (including Japan) @w{@t{+}1--617--542--2652} Free Dial Fax (in Japan): @w{ } @w{ } @w{ } 0031--13--2473 (KDD) @w{ } @w{ } @w{ } 0066--3382--0158 (IDC) -Electronic mail: @code{gnu@@prep.ai.mit.edu} +Electronic mail: @code{gnu@@prep.ai.mit.edu} @end group @end display @end iftex @@ -15484,21 +16336,27 @@ Fax: (including Japan) @w{@t{+}1-617-542-2652} Free Dial Fax (in Japan): @w{ } @w{ } @w{ } 0031-13-2473 (KDD) @w{ } @w{ } @w{ } 0066-3382-0158 (IDC) -Electronic mail: @code{gnu@@prep.ai.mit.edu} +Electronic mail: @code{gnu@@prep.ai.mit.edu} @end group @end display @end ifinfo +To order a full distribution on CD-ROM, please see: +@display +@url{http://www.tug.org/tex-live.html} +@end display + +@noindent +(The distribution is also available by FTP; see the URL's above.) + To order a full distribution from the University of Washington on either a -1/4@dmn{inch} 4-track QIC-24 cartridge or a 4@dmn{mm} DAT cartridge, send -$210.00 to: +1/4@dmn{in} 4-track QIC-24 cartridge or a 4@dmn{mm} DAT cartridge, send +$210 to: -@iftex @display @group Pierre A. MacKay -Department of Classics -DH-10, Denny Hall 218 +Denny Hall, Mail Stop DH-10 University of Washington Seattle, WA @w{ } 98195 USA @@ -15507,22 +16365,6 @@ Telephone: @t{+}1--206--543--2268 Electronic mail: @code{mackay@@cs.washington.edu} @end group @end display -@end iftex -@ifinfo -@display -@group -Pierre A. MacKay -Department of Classics -DH-10, Denny Hall 218 -University of Washington -Seattle, WA @w{ } 98195 -USA - -Telephone: @t{+}1-206-543-2268 -Electronic mail: @code{mackay@@cs.washington.edu} -@end group -@end display -@end ifinfo Please make checks payable to the University of Washington. Checks must be in U.S.@: dollars, drawn on a U.S.@: bank. @@ -15533,7 +16375,8 @@ via air parcel post, or $30.00 for shipment via courier. Please check with the above for current prices and formats. -@node New Features, Command and Variable Index, Obtaining TeX, Top + +@node New Features, Command and Variable Index, Obtaining TeX, Top @appendix Second Edition Features @tex @@ -15741,7 +16584,7 @@ Indent descriptions in menus. Insert node pointers in strict sequence. @end table -@node New Commands, , New Texinfo Mode Commands, New Features +@node New Commands, , New Texinfo Mode Commands, New Features @appendixsec New Texinfo @@-Commands The second edition of the Texinfo manual describes more than 50 @@ -15763,7 +16606,7 @@ Create your own index, and merge indices.@refill Define a new index and its indexing command. See also the @code{@@defcodeindex} command. -@c written verbosely to avoid overful hbox +@c written verbosely to avoid overfull hbox @item @@synindex @var{from-index} @var{into-index} Merge the @var{from-index} index into the @var{into-index} index. See also the @code{@@syncodeindex} command. @@ -15799,11 +16642,11 @@ location of point.@refill @xref{Glyphs}. @table @kbd -@item @@equiv@{@} +@item @@equiv@{@} @itemx @equiv{} Equivalence: -@item @@error@{@} +@item @@error@{@} @itemx @error{} Error message @@ -15811,15 +16654,15 @@ Error message @itemx @expansion{} Macro expansion -@item @@point@{@} +@item @@point@{@} @itemx @point{} Position of point -@item @@print@{@} +@item @@print@{@} @itemx @print{} Printed output -@item @@result@{@} +@item @@result@{@} @itemx @result{} Result of an expression @end table @@ -15842,7 +16685,7 @@ Footings for even-numbered (left-hand) pages. @item @@evenheading, @@everyheading, @@oddheading, @dots{} Five other related commands. -@item @@thischapter +@item @@thischapter Insert name of chapter and chapter number. @item @@thischaptername, @@thisfile, @@thistitle, @@thispage @@ -15868,13 +16711,13 @@ Enumerate a list with letters or numbers. @item @@exdent @var{line-of-text} Remove indentation. -@item @@flushleft +@item @@flushleft Left justify. @item @@flushright Right justify. -@item @@format +@item @@format Do not narrow nor change font. @item @@ftable @var{formatting-command} @@ -15884,7 +16727,7 @@ Two-column table with indexing. @item @@lisp For an example of Lisp code. -@item @@smallexample +@item @@smallexample @itemx @@smalllisp Like @@table and @@lisp @r{but for} @@smallbook. @end table @@ -15898,7 +16741,7 @@ Conditionally format text. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill @table @kbd -@item @@set @var{flag} [@var{string}] +@item @@set @var{flag} [@var{string}] Set a flag. Optionally, set value of @var{flag} to @var{string}. @@ -15943,7 +16786,7 @@ Related commands. @table @kbd @item @@r@{@var{text}@} Print in roman font. - + @item @@sc@{@var{text}@} Print in @sc{small caps} font. @end table @@ -15964,13 +16807,14 @@ see @ref{Cross Reference Commands},@* see @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author}}, and@* see @ref{Custom Headings, , How to Make Your Own Headings}. -@need 700 @table @kbd @item @@author @var{author} Typeset author's name. +@ignore @item @@definfoenclose @var{new-command}, @var{before}, @var{after}, Define a highlighting command for Info. (Info only.) +@end ignore @item @@finalout Produce cleaner printed output. @@ -16003,7 +16847,7 @@ Raise hierarchical level of sectioning commands. Make a reference. In the printed manual, the reference does not start with the word `see'. -@item @@title @var{title} +@item @@title @var{title} Typeset @var{title} in the alternative title page format. @@ -16019,22 +16863,24 @@ Insert the current date. \global\tableindent=.8in @end tex + @node Command and Variable Index, Concept Index, New Features, Top @comment node-name, next, previous, up @unnumbered Command and Variable Index -This is an alphabetical list of all the @@-commands and several -variables. To make the list easier to use, the commands are listed -without their preceding @samp{@@}.@refill +This is an alphabetical list of all the @@-commands, assorted Emacs Lisp +functions, and several variables. To make the list easier to use, the +commands are listed without their preceding @samp{@@}.@refill @printindex fn -@node Concept Index, , Command and Variable Index, Top -@comment node-name, next, previous, up + +@node Concept Index, , Command and Variable Index, Top @unnumbered Concept Index @printindex cp + @summarycontents @contents @bye diff --git a/gnu/usr.bin/texinfo/util/Makefile.in b/gnu/usr.bin/texinfo/util/Makefile.in index e603505b0bf..fde11b93bd8 100644 --- a/gnu/usr.bin/texinfo/util/Makefile.in +++ b/gnu/usr.bin/texinfo/util/Makefile.in @@ -1,5 +1,7 @@ -# Makefile for GNU Texindex. -# Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc. +# Makefile for GNU Texindex and other utilities. +# $Id: Makefile.in,v 1.1.1.2 1996/12/15 21:39:29 downsj Exp $ +# +# Copyright (C) 1990, 91, 92, 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 @@ -29,7 +31,6 @@ INSTALL_DATA = @INSTALL_DATA@ LN = ln RM = rm -f -TAR = tar MKDIR = mkdir DEFS = @DEFS@ @@ -46,7 +47,6 @@ exec_prefix = @exec_prefix@ bindir = $(exec_prefix)/bin # Prefix for each installed program, normally empty or `g'. binprefix = -libdir = $(prefix)/lib # Prefix for each installed man page, normally empty or `g'. manprefix = mandir = $(prefix)/man/man1 @@ -55,7 +55,7 @@ infodir = $(prefix)/info #### End of system configuration section. #### -all: texindex +all: texindex install-info sub-all: all .c.o: @@ -65,9 +65,10 @@ sub-all: all install: all $(INSTALL_PROGRAM) texindex $(bindir)/texindex $(INSTALL_PROGRAM) $(srcdir)/texi2dvi $(bindir)/texi2dvi + $(INSTALL_PROGRAM) install-info $(bindir)/install-info uninstall: - rm -f $(bindir)/texindex $(bindir)/texi2dvi + rm -f $(bindir)/texindex $(bindir)/texi2dvi $(bindir)/install-info Makefile: Makefile.in ../config.status cd ..; sh config.status @@ -76,7 +77,7 @@ TAGS: etags *.c *.h $(common)/getopt*.c $(common)/getopt.h clean: - rm -f *.o a.out core core.* texindex + rm -f *.o a.out core core.* texindex install-info mostlyclean: clean @@ -91,5 +92,10 @@ texindex: texindex.o ../libtxi/libtxi.a texindex.o: texindex.c $(common)/getopt.h +install-info: install-info.o + $(CC) $(LDFLAGS) -o install-info install-info.o $(LOADLIBES) + +install-info.o: install-info.c $(common)/getopt.h + # Prevent GNU make v3 from overflowing arg limit on SysV. .NOEXPORT: diff --git a/gnu/usr.bin/texinfo/util/gen-dir-node b/gnu/usr.bin/texinfo/util/gen-dir-node index 09574f83a00..1cadf56c8be 100644 --- a/gnu/usr.bin/texinfo/util/gen-dir-node +++ b/gnu/usr.bin/texinfo/util/gen-dir-node @@ -1,8 +1,8 @@ #!/bin/sh - +# $Id: gen-dir-node,v 1.1.1.2 1996/12/15 21:39:31 downsj Exp $ # Generate the top-level Info node, given a directory of Info files # and (optionally) a skeleton file. The output will be suitable for a -# dir.info file. The skeleton file contains info topic names in the +# top-level dir file. The skeleton file contains info topic names in the # order they should appear in the output. There are three special # lines that alter the behavior: a line consisting of just "--" causes # the next line to be echoed verbatim to the output. A line @@ -42,9 +42,9 @@ if [ ! -d ${INFODIR} ] ; then exit 1 fi -### output the dir.info header +### output the dir header echo "-*- Text -*-" -echo "This file was generated automatically by the gen-dir-node script." +echo "This file was generated automatically by $0." echo "This version was generated on `date`" echo "by `whoami`@`hostname` for `(cd ${INFODIR}; pwd)`" @@ -174,4 +174,3 @@ for file in ${infofiles}; do echo "* ${infoname}: (${file})." fi done - diff --git a/gnu/usr.bin/texinfo/util/install-info.c b/gnu/usr.bin/texinfo/util/install-info.c new file mode 100644 index 00000000000..74aa30e4300 --- /dev/null +++ b/gnu/usr.bin/texinfo/util/install-info.c @@ -0,0 +1,1111 @@ +/* install-info -- create Info directory entry(ies) for an Info file. + Copyright (C) 1996 Free Software Foundation, Inc. + +$Id: install-info.c,v 1.1.1.1 1996/12/15 21:39:32 downsj 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 of the License, 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. */ + +#define INSTALL_INFO_VERSION_STRING "GNU install-info (Texinfo 3.9) 1.2" + +#include +#include +#include +#include + +/* Get O_RDONLY. */ +#ifdef HAVE_SYS_FCNTL_H +#include +#else +#include +#endif /* !HAVE_SYS_FCNTL_H */ +#ifdef HAVE_SYS_FILE_H +#include +#endif + +/* Name this program was invoked with. */ +char *progname; + +char *readfile (); +struct line_data *findlines (); +char *my_strerror (); +void fatal (); +void insert_entry_here (); +int compare_section_names (); + +struct spec_entry; + +/* Data structures. */ + +/* Record info about a single line from a file + as read into core. */ + +struct line_data +{ + /* The start of the line. */ + char *start; + /* The number of characters in the line, + excluding the terminating newline. */ + int size; + /* Vector containing pointers to the entries to add before this line. + The vector is null-terminated. */ + struct spec_entry **add_entries_before; + /* 1 means output any needed new sections before this line. */ + int add_sections_before; + /* 1 means don't output this line. */ + int delete; +}; + +/* This is used for a list of the specified menu section names + in which entries should be added. */ + +struct spec_section +{ + struct spec_section *next; + char *name; + /* 1 means we have not yet found an existing section with this name + in the dir file--so we will need to add a new section. */ + int missing; +}; + +/* This is used for a list of the entries specified to be added. */ + +struct spec_entry +{ + struct spec_entry *next; + char *text; +}; + +/* This is used for a list of nodes found by parsing the dir file. */ + +struct node +{ + struct node *next; + /* The node name. */ + char *name; + /* The line number of the line where the node starts. + This is the line that contains control-underscore. */ + int start_line; + /* The line number of the line where the node ends, + which is the end of the file or where the next line starts. */ + int end_line; + /* Start of first line in this node's menu + (the line after the * Menu: line). */ + char *menu_start; + /* The start of the chain of sections in this node's menu. */ + struct menu_section *sections; + /* The last menu section in the chain. */ + struct menu_section *last_section; +}; + +/* This is used for a list of sections found in a node's menu. + Each struct node has such a list in the sections field. */ + +struct menu_section +{ + struct menu_section *next; + char *name; + /* Line number of start of section. */ + int start_line; + /* Line number of end of section. */ + int end_line; +}; + +/* Memory allocation and string operations. */ + +/* Like malloc but get fatal error if memory is exhausted. */ + +void * +xmalloc (size) + unsigned int size; +{ + extern void *malloc (); + void *result = malloc (size); + if (result == NULL) + fatal ("virtual memory exhausted", 0); + return result; +} + +/* Like malloc but get fatal error if memory is exhausted. */ + +void * +xrealloc (obj, size) + void *obj; + unsigned int size; +{ + extern void *realloc (); + void *result = realloc (obj, size); + if (result == NULL) + fatal ("virtual memory exhausted", 0); + return result; +} + +/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ + +char * +concat (s1, s2, s3) + char *s1, *s2, *s3; +{ + int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); + char *result = (char *) xmalloc (len1 + len2 + len3 + 1); + + strcpy (result, s1); + strcpy (result + len1, s2); + strcpy (result + len1 + len2, s3); + *(result + len1 + len2 + len3) = 0; + + return result; +} + +/* Return a string containing SIZE characters + copied from starting at STRING. */ + +char * +copy_string (string, size) + char *string; + int size; +{ + int i; + char *copy = (char *) xmalloc (size + 1); + for (i = 0; i < size; i++) + copy[i] = string[i]; + copy[size] = 0; + return copy; +} + +/* Error message functions. */ + +/* Print error message. `s1' is printf control string, `s2' is arg for it. */ + +/* VARARGS1 */ +void +error (s1, s2, s3) + char *s1, *s2, *s3; +{ + fprintf (stderr, "%s: ", progname); + fprintf (stderr, s1, s2, s3); + fprintf (stderr, "\n"); +} + +/* VARARGS1 */ +void +warning (s1, s2, s3) + char *s1, *s2, *s3; +{ + fprintf (stderr, "%s: Warning: ", progname); + fprintf (stderr, s1, s2, s3); + fprintf (stderr, "\n"); +} + +/* Print error message and exit. */ + +void +fatal (s1, s2, s3) + char *s1, *s2, *s3; +{ + error (s1, s2, s3); + exit (1); +} + +/* Print fatal error message based on errno, with file name NAME. */ + +void +pfatal_with_name (name) + char *name; +{ + char *s = concat ("", my_strerror (errno), " for %s"); + fatal (s, name); +} + +/* Given the full text of a menu entry, null terminated, + return just the menu item name (copied). */ + +char * +extract_menu_item_name (item_text) + char *item_text; +{ + char *p; + + if (*item_text == '*') + item_text++; + while (*item_text == ' ') + item_text++; + + p = item_text; + while (*p && *p != ':') p++; + return copy_string (item_text, p - item_text); +} + +/* Given the full text of a menu entry, terminated by null or newline, + return just the menu item file (copied). */ + +char * +extract_menu_file_name (item_text) + char *item_text; +{ + char *p = item_text; + + /* If we have text that looks like * ITEM: (FILE)NODE..., + extract just FILE. Otherwise return "(none)". */ + + if (*p == '*') + p++; + while (*p == ' ') + p++; + + /* Skip to and past the colon. */ + while (*p && *p != '\n' && *p != ':') p++; + if (*p == ':') p++; + + /* Skip past the open-paren. */ + while (1) + { + if (*p == '(') + break; + else if (*p == ' ' || *p == '\t') + p++; + else + return "(none)"; + } + p++; + + item_text = p; + + /* File name ends just before the close-paren. */ + while (*p && *p != '\n' && *p != ')') p++; + if (*p != ')') + return "(none)"; + + return copy_string (item_text, p - item_text); +} + +void +suggest_asking_for_help () +{ + fprintf (stderr, "\tTry `%s --help' for a complete list of options.\n", + progname); + exit (1); +} + +void +print_help () +{ + printf ("%s [OPTION]... [INFO-FILE [DIR-FILE]]\n\ + Install INFO-FILE in the Info directory file DIR-FILE.\n\ +\n\ +Options:\n\ +--delete Delete existing entries in INFO-FILE;\n\ + don't insert any new entries.\n\ +--dir-file=NAME Specify file name of Info directory file.\n\ + This is equivalent to using the DIR-FILE argument.\n\ +--entry=TEXT Insert TEXT as an Info directory entry.\n\ + TEXT should have the form of an Info menu item line\n\ + plus zero or more extra lines starting with whitespace.\n\ + If you specify more than one entry, they are all added.\n\ + If you don't specify any entries, they are determined\n\ + from information in the Info file itself.\n\ +--help Display this help and exit.\n\ +--info-file=FILE Specify Info file to install in the directory.\n\ + This is equivalent to using the INFO-FILE argument.\n\ +--info-dir=DIR Same as --dir-file=DIR/dir.\n\ +--item=TEXT Same as --entry TEXT.\n\ + An Info directory entry is actually a menu item.\n\ +--quiet Suppress warnings.\n\ +--remove Same as --delete.\n\ +--section=SEC Put this file's entries in section SEC of the directory.\n\ + If you specify more than one section, all the entries\n\ + are added in each of the sections.\n\ + If you don't specify any sections, they are determined\n\ + from information in the Info file itself.\n\ +--version Display version information and exit.\n\ +\n\ +Email bug reports to bug-texinfo@prep.ai.mit.edu.\n\ +", progname); +} + +/* Convert an errno value into a string describing the error. + We define this function here rather than using strerror + because not all systems have strerror. */ + +char * +my_strerror (errnum) + int errnum; +{ + extern char *sys_errlist[]; + extern int sys_nerr; + + if (errnum >= 0 && errnum < sys_nerr) + return sys_errlist[errnum]; + return (char *) "Unknown error"; +} + +/* This table defines all the long-named options, says whether they + use an argument, and maps them into equivalent single-letter options. */ + +struct option longopts[] = +{ + { "delete", no_argument, NULL, 'r' }, + { "dir-file", required_argument, NULL, 'd' }, + { "entry", required_argument, NULL, 'e' }, + { "help", no_argument, NULL, 'h' }, + { "info-dir", required_argument, NULL, 'D' }, + { "info-file", required_argument, NULL, 'i' }, + { "item", required_argument, NULL, 'e' }, + { "quiet", no_argument, NULL, 'q' }, + { "remove", no_argument, NULL, 'r' }, + { "section", required_argument, NULL, 's' }, + { "version", no_argument, NULL, 'V' }, + { 0 } +}; + +main (argc, argv) + int argc; + char **argv; +{ + char *infile = 0, *dirfile = 0; + char *infile_sans_info; + unsigned infilelen_sans_info; + FILE *output; + + /* Record the text of the Info file, as a sequence of characters + and as a sequence of lines. */ + char *input_data; + int input_size; + struct line_data *input_lines; + int input_nlines; + + /* Record here the specified section names and directory entries. */ + struct spec_section *input_sections = NULL; + struct spec_entry *entries_to_add = NULL; + int n_entries_to_add = 0; + + /* Record the old text of the dir file, as plain characters, + as lines, and as nodes. */ + char *dir_data; + int dir_size; + int dir_nlines; + struct line_data *dir_lines; + struct node *dir_nodes; + + /* Nonzero means --delete was specified (just delete existing entries). */ + int delete_flag = 0; + int something_deleted = 0; + /* Nonzero means -q was specified. */ + int quiet_flag = 0; + + int node_header_flag; + int prefix_length; + int i; + + progname = argv[0]; + + while (1) + { + int opt = getopt_long (argc, argv, "i:d:e:s:hHr", longopts, 0); + + if (opt == EOF) + break; + + switch (opt) + { + case 0: + /* If getopt returns 0, then it has already processed a + long-named option. We should do nothing. */ + break; + + case 1: + abort (); + + case 'd': + if (dirfile) + { + fprintf (stderr, "%s: Specify the Info directory only once.\n", + progname); + suggest_asking_for_help (); + } + dirfile = optarg; + break; + + case 'D': + if (dirfile) + { + fprintf (stderr, "%s: Specify the Info directory only once.\n", + progname); + suggest_asking_for_help (); + } + dirfile = concat (optarg, "", "/dir"); + break; + + case 'e': + { + struct spec_entry *next + = (struct spec_entry *) xmalloc (sizeof (struct spec_entry)); + if (! (*optarg != 0 && optarg[strlen (optarg) - 1] == '\n')) + optarg = concat (optarg, "\n", ""); + next->text = optarg; + next->next = entries_to_add; + entries_to_add = next; + n_entries_to_add++; + } + break; + + case 'h': + case 'H': + print_help (); + exit (0); + + case 'i': + if (infile) + { + fprintf (stderr, "%s: Specify the Info file only once.\n", + progname); + suggest_asking_for_help (); + } + infile = optarg; + break; + + case 'q': + quiet_flag = 1; + break; + + case 'r': + delete_flag = 1; + break; + + case 's': + { + struct spec_section *next + = (struct spec_section *) xmalloc (sizeof (struct spec_section)); + next->name = optarg; + next->next = input_sections; + next->missing = 1; + input_sections = next; + } + break; + + case 'V': + puts (INSTALL_INFO_VERSION_STRING); +puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU General Public License.\n\ +For more information about these matters, see the files named COPYING."); + exit (0); + + default: + suggest_asking_for_help (); + } + } + + /* Interpret the non-option arguments as file names. */ + for (; optind < argc; ++optind) + { + if (infile == 0) + infile = argv[optind]; + else if (dirfile == 0) + dirfile = argv[optind]; + else + error ("excess command line argument `%s'", argv[optind]); + } + + if (!infile) + fatal ("No input file specified"); + if (!dirfile) + fatal ("No dir file specified"); + + /* Read the Info file and parse it into lines. */ + + input_data = readfile (infile, &input_size); + input_lines = findlines (input_data, input_size, &input_nlines); + + /* Parse the input file to find the section names it specifies. */ + + if (input_sections == 0) + { + prefix_length = strlen ("INFO-DIR-SECTION "); + for (i = 0; i < input_nlines; i++) + { + if (!strncmp ("INFO-DIR-SECTION ", input_lines[i].start, + prefix_length)) + { + struct spec_section *next + = (struct spec_section *) xmalloc (sizeof (struct spec_section)); + next->name = copy_string (input_lines[i].start + prefix_length, + input_lines[i].size - prefix_length); + next->next = input_sections; + next->missing = 1; + input_sections = next; + } + } + } + + /* Default to section "Miscellaneous" if no sections specified. */ + if (input_sections == 0) + { + input_sections + = (struct spec_section *) xmalloc (sizeof (struct spec_section)); + input_sections->name = "Miscellaneous"; + input_sections->next = 0; + input_sections->missing = 1; + } + + /* Now find the directory entries specified in the file + and put them on entries_to_add. But not if entries + were specified explicitly with command options. */ + + if (entries_to_add == 0) + { + char *start_of_this_entry = 0; + for (i = 0; i < input_nlines; i++) + { + if (!strncmp ("START-INFO-DIR-ENTRY", input_lines[i].start, + input_lines[i].size) + && sizeof ("START-INFO-DIR-ENTRY") - 1 == input_lines[i].size) + { + if (start_of_this_entry != 0) + fatal ("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"); + start_of_this_entry = input_lines[i + 1].start; + } + if (!strncmp ("END-INFO-DIR-ENTRY", input_lines[i].start, + input_lines[i].size) + && sizeof ("END-INFO-DIR-ENTRY") - 1 == input_lines[i].size) + { + if (start_of_this_entry != 0) + { + struct spec_entry *next + = (struct spec_entry *) xmalloc (sizeof (struct spec_entry)); + next->text = copy_string (start_of_this_entry, + input_lines[i].start - start_of_this_entry); + next->next = entries_to_add; + entries_to_add = next; + n_entries_to_add++; + start_of_this_entry = 0; + } + else + fatal ("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"); + } + } + if (start_of_this_entry != 0) + fatal ("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"); + } + + if (!delete_flag) + if (entries_to_add == 0) + fatal ("no info dir entry in `%s'", infile); + + /* Now read in the Info dir file. */ + dir_data = readfile (dirfile, &dir_size); + dir_lines = findlines (dir_data, dir_size, &dir_nlines); + + /* We will be comparing the entries in the dir file against the + current filename, so need to strip off any directory prefix and any + .info suffix. */ + { + unsigned basename_len; + extern char *strrchr (); + char *infile_basename = strrchr (infile, '/'); + if (infile_basename) + infile_basename++; + else + infile_basename = infile; + + basename_len = strlen (infile_basename); + infile_sans_info + = (strlen (infile_basename) > 5 + && strcmp (infile_basename + basename_len - 5, ".info") == 0) + ? copy_string (infile_basename, basename_len - 5) + : infile_basename; + + infilelen_sans_info = strlen (infile_sans_info); + } + + /* Parse the dir file. Find all the nodes, and their menus, + and the sections of their menus. */ + + dir_nodes = 0; + node_header_flag = 0; + for (i = 0; i < dir_nlines; i++) + { + /* Parse node header lines. */ + if (node_header_flag) + { + int j, end; + for (j = 0; j < dir_lines[i].size; j++) + /* Find the node name and store it in the `struct node'. */ + if (!strncmp ("Node:", dir_lines[i].start + j, 5)) + { + char *line = dir_lines[i].start; + /* Find the start of the node name. */ + j += 5; + while (line[j] == ' ' || line[j] == '\t') + j++; + /* Find the end of the node name. */ + end = j; + while (line[end] != 0 && line[end] != ',' && line[end] != '\n' + && line[end] != '\t') + end++; + dir_nodes->name = copy_string (line + j, end - j); + } + node_header_flag = 0; + } + + /* Notice the start of a node. */ + if (*dir_lines[i].start == 037) + { + struct node *next + = (struct node *) xmalloc (sizeof (struct node)); + next->next = dir_nodes; + next->name = NULL; + next->start_line = i; + next->end_line = 0; + next->menu_start = NULL; + next->sections = NULL; + next->last_section = NULL; + + if (dir_nodes != 0) + dir_nodes->end_line = i; + /* Fill in the end of the last menu section + of the previous node. */ + if (dir_nodes != 0 && dir_nodes->last_section != 0) + dir_nodes->last_section->end_line = i; + + dir_nodes = next; + + /* The following line is the header of this node; + parse it. */ + node_header_flag = 1; + } + + /* Notice the lines that start menus. */ + if (dir_nodes != 0 + && !strncmp ("* Menu:", dir_lines[i].start, 7)) + dir_nodes->menu_start = dir_lines[i + 1].start; + + /* Notice sections in menus. */ + if (dir_nodes != 0 + && dir_nodes->menu_start != 0 + && *dir_lines[i].start != '\n' + && *dir_lines[i].start != '*' + && *dir_lines[i].start != ' ' + && *dir_lines[i].start != '\t') + { + /* Add this menu section to the node's list. + This list grows in forward order. */ + struct menu_section *next + = (struct menu_section *) xmalloc (sizeof (struct menu_section)); + next->start_line = i + 1; + next->next = 0; + next->end_line = 0; + next->name = copy_string (dir_lines[i].start, dir_lines[i].size); + if (dir_nodes->sections) + { + dir_nodes->last_section->next = next; + dir_nodes->last_section->end_line = i; + } + else + dir_nodes->sections = next; + dir_nodes->last_section = next; + } + + /* Check for an existing entry that should be deleted. + Delete all entries which specify this file name. */ + if (*dir_lines[i].start == '*') + { + char *p = dir_lines[i].start; + + while (*p != 0 && *p != ':') + p++; + p++; + while (*p == ' ') p++; + if (*p == '(') + { + p++; + if ((dir_lines[i].size + > (p - dir_lines[i].start + infilelen_sans_info)) + && !strncmp (p, infile_sans_info, infilelen_sans_info) + && p[infilelen_sans_info] == ')') + dir_lines[i].delete = 1; + } + } + /* Treat lines that start with whitespace + as continuations; if we are deleting an entry, + delete all its continuations as well. */ + else if (i > 0 + && (*dir_lines[i].start == ' ' + || *dir_lines[i].start == '\t')) + { + dir_lines[i].delete = dir_lines[i - 1].delete; + something_deleted = 1; + } + } + + /* Finish the info about the end of the last node. */ + if (dir_nodes != 0) + { + dir_nodes->end_line = dir_nlines; + if (dir_nodes->last_section != 0) + dir_nodes->last_section->end_line = dir_nlines; + } + + /* Decide where to add the new entries (unless --delete was used). + Find the menu sections to add them in. + In each section, find the proper alphabetical place to add + each of the entries. */ + + if (!delete_flag) + { + struct node *node; + struct menu_section *section; + struct spec_section *spec; + + for (node = dir_nodes; node; node = node->next) + for (section = node->sections; section; section = section->next) + { + for (i = section->end_line; i > section->start_line; i--) + if (dir_lines[i - 1].size != 0) + break; + section->end_line = i; + + for (spec = input_sections; spec; spec = spec->next) + if (!strcmp (spec->name, section->name)) + break; + if (spec) + { + int add_at_line = section->end_line; + struct spec_entry *entry; + /* Say we have found at least one section with this name, + so we need not add such a section. */ + spec->missing = 0; + /* For each entry, find the right place in this section + to add it. */ + for (entry = entries_to_add; entry; entry = entry->next) + { + int textlen = strlen (entry->text); + /* Subtract one because dir_lines is zero-based, + but the `end_line' and `start_line' members are + one-based. */ + for (i = section->end_line - 1; + i >= section->start_line - 1; i--) + { + /* If an entry exists with the same name, + and was not marked for deletion + (which means it is for some other file), + we are in trouble. */ + if (dir_lines[i].start[0] == '*' + && menu_line_equal (entry->text, textlen, + dir_lines[i].start, + dir_lines[i].size) + && !dir_lines[i].delete) + fatal ("menu item `%s' already exists, for file `%s'", + extract_menu_item_name (entry->text), + extract_menu_file_name (dir_lines[i].start)); + if (dir_lines[i].start[0] == '*' + && menu_line_lessp (entry->text, textlen, + dir_lines[i].start, + dir_lines[i].size)) + add_at_line = i; + } + insert_entry_here (entry, add_at_line, + dir_lines, n_entries_to_add); + } + } + } + + /* Mark the end of the Top node as the place to add any + new sections that are needed. */ + for (node = dir_nodes; node; node = node->next) + if (node->name && strcmp (node->name, "Top") == 0) + dir_lines[node->end_line].add_sections_before = 1; + } + + if (delete_flag && !something_deleted && !quiet_flag) + warning ("no entries found for `%s'; nothing deleted", infile); + + /* Output the old dir file, interpolating the new sections + and/or new entries where appropriate. */ + + output = fopen (dirfile, "w"); + if (!output) + { + perror (dirfile); + exit (1); + } + + for (i = 0; i <= dir_nlines; i++) + { + int j; + + /* If we decided to output some new entries before this line, + output them now. */ + if (dir_lines[i].add_entries_before) + for (j = 0; j < n_entries_to_add; j++) + { + struct spec_entry *this = dir_lines[i].add_entries_before[j]; + if (this == 0) + break; + fputs (this->text, output); + } + /* If we decided to add some sections here + because there are no such sections in the file, + output them now. */ + if (dir_lines[i].add_sections_before) + { + struct spec_section *spec; + struct spec_section **sections; + int n_sections = 0; + + /* Count the sections and allocate a vector for all of them. */ + for (spec = input_sections; spec; spec = spec->next) + n_sections++; + sections = ((struct spec_section **) + xmalloc (n_sections * sizeof (struct spec_section *))); + + /* Fill the vector SECTIONS with pointers to all the sections, + and sort them. */ + j = 0; + for (spec = input_sections; spec; spec = spec->next) + sections[j++] = spec; + qsort (sections, n_sections, sizeof (struct spec_section *), + compare_section_names); + + /* Generate the new sections in alphabetical order. + In each new section, output all of our entries. */ + for (j = 0; j < n_sections; j++) + { + spec = sections[j]; + if (spec->missing) + { + struct spec_entry *entry; + + putc ('\n', output); + fputs (spec->name, output); + putc ('\n', output); + for (entry = entries_to_add; entry; entry = entry->next) + fputs (entry->text, output); + } + } + + free (sections); + } + + /* Output the original dir lines unless marked for deletion. */ + if (i < dir_nlines && !dir_lines[i].delete) + { + fwrite (dir_lines[i].start, 1, dir_lines[i].size, output); + putc ('\n', output); + } + } + + fclose (output); + + exit (0); +} + +/* Read all of file FILNAME into memory + and return the address of the data. + Store the size into SIZEP. + If there is trouble, do a fatal error. */ + +char * +readfile (filename, sizep) + char *filename; + int *sizep; +{ + int data_size = 1024; + char *data = (char *) xmalloc (data_size); + int filled = 0; + int nread = 0; + + int desc = open (filename, O_RDONLY); + + if (desc < 0) + pfatal_with_name (filename); + + while (1) + { + nread = read (desc, data + filled, data_size - filled); + if (nread < 0) + pfatal_with_name (filename); + if (nread == 0) + break; + + filled += nread; + if (filled == data_size) + { + data_size *= 2; + data = (char *) xrealloc (data, data_size); + } + } + + *sizep = filled; + return data; +} + +/* Divide the text at DATA (of SIZE bytes) into lines. + Return a vector of struct line_data describing the lines. + Store the length of that vector into *NLINESP. */ + +struct line_data * +findlines (data, size, nlinesp) + char *data; + int size; + int *nlinesp; +{ + struct line_data *lines; + int lines_allocated = 512; + int filled = 0; + int i = 0; + int lineflag; + + lines = (struct line_data *) xmalloc (lines_allocated * sizeof (struct line_data)); + + lineflag = 1; + for (i = 0; i < size; i++) + { + if (lineflag) + { + if (filled == lines_allocated) + { + lines_allocated *= 2; + lines = (struct line_data *) xrealloc (lines, lines_allocated * sizeof (struct line_data)); + } + lines[filled].start = &data[i]; + lines[filled].add_entries_before = 0; + lines[filled].add_sections_before = 0; + lines[filled].delete = 0; + if (filled > 0) + lines[filled - 1].size + = lines[filled].start - lines[filled - 1].start - 1; + filled++; + } + lineflag = (data[i] == '\n'); + } + if (filled > 0) + lines[filled - 1].size = &data[i] - lines[filled - 1].start - lineflag; + + /* Do not leave garbage in the last element. */ + lines[filled].start = NULL; + lines[filled].add_entries_before = NULL; + lines[filled].add_sections_before = 0; + lines[filled].delete = 0; + lines[filled].size = 0; + + *nlinesp = filled; + return lines; +} + +/* Compare the menu item names in LINE1 (line length LEN1) + and LINE2 (line length LEN2). Return 1 if the item name + in LINE1 is less, 0 otherwise. */ + +int +menu_line_lessp (line1, len1, line2, len2) + char *line1; + int len1; + char *line2; + int len2; +{ + int minlen = (len1 < len2 ? len1 : len2); + int i; + + for (i = 0; i < minlen; i++) + { + /* If one item name is a prefix of the other, + the former one is less. */ + if (line1[i] == ':' && line2[i] != ':') + return 1; + if (line2[i] == ':' && line1[i] != ':') + return 0; + /* If they both continue and differ, one is less. */ + if (line1[i] < line2[i]) + return 1; + if (line1[i] > line2[i]) + return 0; + } + /* With a properly formatted dir file, + we can only get here if the item names are equal. */ + return 0; +} + +/* Compare the menu item names in LINE1 (line length LEN1) + and LINE2 (line length LEN2). Return 1 if the item names are equal, + 0 otherwise. */ + +int +menu_line_equal (line1, len1, line2, len2) + char *line1; + int len1; + char *line2; + int len2; +{ + int minlen = (len1 < len2 ? len1 : len2); + int i; + + for (i = 0; i < minlen; i++) + { + /* If both item names end here, they are equal. */ + if (line1[i] == ':' && line2[i] == ':') + return 1; + /* If they both continue and differ, one is less. */ + if (line1[i] != line2[i]) + return 0; + } + /* With a properly formatted dir file, + we can only get here if the item names are equal. */ + return 1; +} + +/* This is the comparison function for qsort + for a vector of pointers to struct spec_section. + Compare the section names. */ + +int +compare_section_names (sec1, sec2) + struct spec_section **sec1, **sec2; +{ + char *name1 = (*sec1)->name; + char *name2 = (*sec2)->name; + return strcmp (name1, name2); +} + +/* Insert ENTRY into the add_entries_before vector + for line number LINE_NUMBER of the dir file. + DIR_LINES and N_ENTRIES carry information from like-named variables + in main. */ + +void +insert_entry_here (entry, line_number, dir_lines, n_entries) + struct spec_entry *entry; + int line_number; + struct line_data *dir_lines; + int n_entries; +{ + int i; + + if (dir_lines[line_number].add_entries_before == 0) + { + dir_lines[line_number].add_entries_before + = (struct spec_entry **) xmalloc (n_entries * sizeof (struct spec_entry *)); + for (i = 0; i < n_entries; i++) + dir_lines[line_number].add_entries_before[i] = 0; + } + + for (i = 0; i < n_entries; i++) + if (dir_lines[line_number].add_entries_before[i] == 0) + break; + + if (i == n_entries) + abort (); + + dir_lines[line_number].add_entries_before[i] = entry; +} diff --git a/gnu/usr.bin/texinfo/util/mkinstalldirs b/gnu/usr.bin/texinfo/util/mkinstalldirs index cd1fe0a7947..fd12278841c 100644 --- a/gnu/usr.bin/texinfo/util/mkinstalldirs +++ b/gnu/usr.bin/texinfo/util/mkinstalldirs @@ -4,6 +4,8 @@ # Created: 1993-05-16 # Public domain +# $Id: mkinstalldirs,v 1.1.1.3 1996/12/15 21:39:32 downsj Exp $ + errstatus=0 for file @@ -12,7 +14,8 @@ do shift pathcomp= - for d in ${1+"$@"} ; do + for d + do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; @@ -20,7 +23,12 @@ do if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" || errstatus=$? + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi fi pathcomp="$pathcomp/" diff --git a/gnu/usr.bin/texinfo/util/texi2dvi b/gnu/usr.bin/texinfo/util/texi2dvi index f3076c59930..ef22ce9a3e0 100644 --- a/gnu/usr.bin/texinfo/util/texi2dvi +++ b/gnu/usr.bin/texinfo/util/texi2dvi @@ -1,9 +1,9 @@ #! /bin/sh # texi2dvi --- smartly produce DVI files from texinfo sources -# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# $Id: texi2dvi,v 1.1.1.1 1995/12/22 16:47:17 niklas Exp $ +# $Id: texi2dvi,v 1.1.1.2 1996/12/15 21:39:34 downsj 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 @@ -47,37 +47,43 @@ progname=`echo "$0" | sed -e 's/[^\/]*\///g'` # This string is expanded by rcs automatically when this file is checked out. -rcs_revision='$Revision: 1.1.1.1 $' +rcs_revision='$Revision: 1.1.1.2 $' version=`set - $rcs_revision; echo $2` # To prevent hairy quoting and escaping later. bq='`' eq="'" -usage="Usage: $progname {options} [file1] {file2 {...}} -(version $version) +usage="Usage: $0 [OPTION]... FILE... +Run a Texinfo document through TeX. -Options are: +Options: -D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq). --h, --help You're looking at it. --v, --version Print version number. +-t, --texinfo CMD Insert CMD after @setfilename before running TeX. +--verbose Report on what is done. +-h, --help Display this help and exit. +-v, --version Display version information and exit. -Arguments in brackets are required. Those in braces are optional. +The values of the TEX, TEXINDEX, and MAKEINFO environment variables are +used to run those commands, if they are set. + +Email bug reports to bug-texinfo@prep.ai.mit.edu. " # Initialize variables. # Don't use `unset' since old bourne shells don't have this command. # Instead, assign them an empty value. -# Some of these, like TEX and TEXINDEX, may be inherited from the environment -backup_extension=.bak +# Some of these, like TEX and TEXINDEX, may be inherited from the environment. +backup_extension=.bak # these files get deleted if all goes well. debug= orig_pwd="`pwd`" -verbose= +textra= +verbose=false +makeinfo="${MAKEINFO-makeinfo}" texindex="${TEXINDEX-texindex}" tex="${TEX-tex}" -# Save this so we can construct a new TEXINPUTS path for each file to be -# processed. +# Save this so we can construct a new TEXINPUTS path for each file. TEXINPUTS_orig="$TEXINPUTS" export TEXINPUTS @@ -89,18 +95,18 @@ export TEXINPUTS while : ; do case $# in 0) break ;; esac case "$1" in - -D | --debug | --d* ) - debug=t - shift - ;; - -h | --help | --h* ) - echo "$usage" 1>&2 - exit 0 - ;; - -v | --version | --v* ) - echo "texi2dvi version $version" 1>&2 - exit 0 - ;; + -D | --debug | --d* ) debug=t; shift ;; + -h | --help | --h* ) echo "$usage"; exit 0 ;; + # OK, we should do real option parsing here, but be lazy for now. + -t | --texinfo | --t*) shift; textra="$textra $1"; shift ;; + -v | --vers* ) + echo "$progname (Texinfo 3.9) $version" + echo "Copyright (C) 1996 Free Software Foundation, Inc. +There is NO warranty. You may redistribute this software +under the terms of the GNU General Public License. +For more information about these matters, see the files named COPYING." + exit 0 ;; + --verb* ) verbose=echo; shift ;; -- ) # Stop option processing shift break @@ -111,8 +117,8 @@ while : ; do * ) arg="$1" ;; esac exec 1>&2 - echo "$progname: unknown or ambiguous option $bq$arg$eq" - echo "$progname: Use $bq--help$eq for a list of options." + echo "$progname: Unknown or ambiguous option $bq$arg$eq." + echo "$progname: Try $bq--help$eq for more information." exit 1 ;; * ) @@ -122,154 +128,240 @@ while : ; do done # See if there are any command line args left (which will be interpreted as -# filename arguments) -case $# in - 0 ) - exec 1>&2 - echo "$progname: at least one file name is required as an argument." - echo "$progname: Use $bq--help$eq for a description of command syntax." - exit 2 - ;; -esac - -case "$debug" in t ) set -x ;; esac +# filename arguments). +if test $# -eq 0; then + exec 1>&2 + echo "$progname: At least one file name is required as an argument." + echo "$progname: Try $bq--help$eq for more information." + exit 2 +fi + +test "$debug" = t && set -x # Texify files for command_line_filename in ${1+"$@"} ; do - # Roughly equivalent to `dirname ...`, but more portable - directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`" - filename_texi="`basename ${command_line_filename}`" - # Strip off the last extension part (probably .texinfo or .texi) - filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`" - - # If directory and file are the same, then it's probably because there's - # no pathname component. Set dirname to `.', the current directory. - if test "z${directory}" = "z${command_line_filename}" ; then - directory="." - fi - - # Source file might @include additional texinfo sources. Put `.' and - # directory where source file(s) reside in TEXINPUTS before anything - # else. `.' goes first to ensure that any old .aux, .cps, etc. files in - # ${directory} don't get used in preference to fresher files in `.'. - TEXINPUTS=".:${directory}:${TEXINPUTS_orig}" - - # "Unset" variables that might have values from previous iterations and - # which won't be completely reset later. - definite_index_files="" - - # See if file exists here. If it doesn't we're in trouble since, even - # though the user may be able to reenter a valid filename at the tex - # prompt (assuming they're attending the terminal), this script won't be - # able to find the right index files and so forth. - if test ! -r "${command_line_filename}" ; then - echo "${progname}: ${command_line_filename}: No such file or permission denied." 1>&2 - continue; - fi - - # Find all files having root filename with a two-letter extension, - # determine whether they're really index files, and save them. Foo.aux - # is actually the cross-references file, but we need to keep track of - # that too. - possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" - for this_file in ${possible_index_files} ; do - # If file is empty, forget it. - if test ! -s "${this_file}" ; then - continue; - fi - - # Examine first character of file. If it's not a backslash or - # single quote, then it's definitely not an index or xref file. - first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" - if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then + $verbose "Processing $command_line_filename ..." + + # See if file exists. If it doesn't we're in trouble since, even + # though the user may be able to reenter a valid filename at the tex + # prompt (assuming they're attending the terminal), this script won't + # be able to find the right index files and so forth. + if test ! -r "${command_line_filename}" ; then + echo "$0: Could not read ${command_line_filename}." >&2 + continue + fi + + # Roughly equivalent to `dirname ...`, but more portable + directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`" + filename_texi="`basename ${command_line_filename}`" + # Strip off the last extension part (probably .texinfo or .texi) + filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`" + + # Use same basename since we want to generate aux files with the same + # basename as the manual. Use extension .texi for the temp file so + # that TeX will ignore it. Thus, we must use a subdirectory. + # + # Output the macro-expanded file to here. + tmp_dir=${TMPDIR-/tmp}/$$ + filename_tmp=$tmp_dir/$filename_noext.texi + # Output the file with the user's extra commands to here. + filename_tmp2=$tmp_dir.2/$filename_noext.texi + mkdir $tmp_dir $tmp_dir.2 + + # If directory and file are the same, then it's probably because there's + # no pathname component. Set dirname to `.', the current directory. + if test "z${directory}" = "z${command_line_filename}" ; then + directory=. + fi + + # Source file might @include additional texinfo sources. Put `.' and + # directory where source file(s) reside in TEXINPUTS before anything + # else. `.' goes first to ensure that any old .aux, .cps, etc. files in + # ${directory} don't get used in preference to fresher files in `.'. + TEXINPUTS=".:${directory}:${TEXINPUTS_orig}" + + # Expand macro commands in the original source file using Makeinfo; + # the macro syntax bfox implemented is impossible to implement in TeX. + # Always use `end' footnote style, since the `separate' style + # generates different output (arguably this is a bug in -E). + # Discard main info output, the user asked to run TeX, not makeinfo. + # Redirect output to /dev/null to throw away `Making info file...' msg. + $verbose "Macro-expanding $command_line_filename to $filename_tmp ..." + $makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \ + $command_line_filename >/dev/null + + # But if there were no macros, or makeinfo failed for some reason, + # just use the original file. (It shouldn't make any difference, but + # let's be safe.) + if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then + $verbose "Reverting to $command_line_filename ..." + filename_input=$command_line_filename + else + filename_input=$filename_tmp + fi + + # Used most commonly for @finalout, @smallbook, etc. + if test -n "$textra"; then + $verbose "Inserting extra commands: $textra." + sed '/^@setfilename/a\ +'"$textra" $filename_input >$filename_tmp2 + filename_input=$filename_tmp2 + fi + + while true; do # will break out of loop below + # "Unset" variables that might have values from previous iterations and + # which won't be completely reset later. + definite_index_files= + + # Find all files having root filename with a two-letter extension, + # determine whether they're really index files, and save them. Foo.aux + # is actually the cross-references file, but we need to keep track of + # that too. + possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" + for this_file in ${possible_index_files} ; do + # If file is empty, forget it. + test -s "${this_file}" || continue + + # Examine first character of file. If it's not suitable to be an + # index or xref file, don't process it. + first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" + if test "x${first_character}" = "x\\" \ + || test "x${first_character}" = "x'"; then + definite_index_files="${definite_index_files} ${this_file}" + fi + done + orig_index_files="${definite_index_files}" + orig_index_files_sans_aux="`echo ${definite_index_files} \ + | sed 's/'${filename_noext}'\.aux//; + s/^[ ]*//;s/[ ]*$//;'`" + + # Now save copies of original index files so we have some means of + # comparison later. + $verbose "Backing up current index files: $orig_index_files ..." + for index_file_to_save in ${orig_index_files} ; do + cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}" + done + + # Run texindex on current index files. If they already exist, and + # after running TeX a first time the index files don't change, then + # there's no reason to run TeX again. But we won't know that if the + # index files are out of date or nonexistent. + if test -n "${orig_index_files_sans_aux}" ; then + $verbose "Running $texindex $orig_index_files_sans_aux ..." + ${texindex} ${orig_index_files_sans_aux} + fi + + # Finally, run TeX. + $verbose "Running $tex $filename_input ..." + ${tex} "$filename_input" + + # Check if index files changed. + # + definite_index_files= + # Get list of new index files. + possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" + for this_file in ${possible_index_files} ; do + # If file is empty, forget it. + test -s "${this_file}" || continue + + # Examine first character of file. If it's not a backslash or + # single quote, then it's definitely not an index or xref file. + # (Will have to check for @ when we switch to Texinfo syntax in + # all these files...) + first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" + if test "x${first_character}" = "x\\" \ + || test "x${first_character}" = "x'"; then definite_index_files="${definite_index_files} ${this_file}" - fi - done - orig_index_files="${definite_index_files}" - orig_index_files_sans_aux="`echo ${definite_index_files} \ - | sed 's/'${filename_noext}'\.aux//; - s/^[ ]*//;s/[ ]*$//;'`" - - # Now save copies of original index files so we have some means of - # comparison later. - for index_file_to_save in ${orig_index_files} ; do - cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}" - done - - # Run texindex on current index files. If they already exist, and - # after running TeX a first time the index files don't change, then - # there's no reason to run TeX again. But we won't know that if the - # index files are out of date or nonexistent. - if test "${orig_index_files_sans_aux}" ; then - ${texindex} ${orig_index_files_sans_aux} - fi - - if ${tex} ${command_line_filename} ; then # TeX run first time - definite_index_files="" - # Get list of new index files - possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" - for this_file in ${possible_index_files} ; do - # If file is empty, forget it. - if test ! -s ${this_file} ; then - continue; - fi - - # Examine first character of file. If it's not a backslash or - # single quote, then it's definitely not an index or xref file. - first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" - if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then - definite_index_files="${definite_index_files} ${this_file}" - fi + fi + done + new_index_files="${definite_index_files}" + new_index_files_sans_aux="`echo ${definite_index_files} \ + | sed 's/'${filename_noext}'\.aux//; + s/^[ ]*//;s/[ ]*$//;'`" + + # If old and new list don't at least have the same file list, then one + # file or another has definitely changed. + $verbose "Original index files =$orig_index_files" + $verbose "New index files =$new_index_files" + if test "z${orig_index_files}" != "z${new_index_files}" ; then + index_files_changed_p=t + else + # File list is the same. We must compare each file until we find a + # difference. + index_files_changed_p= + for this_file in ${new_index_files} ; do + $verbose "Comparing index file $this_file ..." + # cmp -s will return nonzero exit status if files differ. + cmp -s "${this_file}" "${this_file}${backup_extension}" + if test $? -ne 0 ; then + # We only need to keep comparing until we find *one* that + # differs, because we'll have to run texindex & tex no + # matter what. + index_files_changed_p=t + $verbose "Index file $this_file differed:" + test $verbose = echo \ + && diff -c "${this_file}${backup_extension}" "${this_file}" + break + fi done - new_index_files="${definite_index_files}" - new_index_files_sans_aux="`echo ${definite_index_files} \ - | sed 's/'${filename_noext}'\.aux//; - s/^[ ]*//;s/[ ]*$//;'`" - - # If old and new list don't at least have the same file list, then one - # file or another has definitely changed. - if test "${orig_index_files}" != "${new_index_files}" ; then - index_files_changed_p=t - else - # File list is the same. We must compare each file until we find a - # difference. - index_files_changed_p="" - for this_file in ${new_index_files} ; do - # cmp -s will return nonzero exit status if files differ. - cmp -s "${this_file}" "${this_file}${backup_extension}" - if test $? -ne 0 ; then - # We only need to keep comparing until we find *one* that - # differs, because we'll have to run texindex & tex no - # matter what. - index_files_changed_p=t - break - fi - done - fi - - # If index files have changed since TeX has been run, or if the aux - # file wasn't present originally, run texindex and TeX again. - if test "${index_files_changed_p}" ; then - retval=0 - if test "${new_index_files_sans_aux}" ; then - ${texindex} ${new_index_files_sans_aux} - retval=$? - fi - if test ${retval} -eq 0 ; then - ${tex} "${command_line_filename}" - fi - fi - fi - - # Generate list of files to delete, then call rm once with the entire - # list. This is significantly faster than multiple executions of rm. - file_list="" - for file in ${orig_index_files} ; do - file_list="${file_list} ${file}${backup_extension}" - done - if test "${file_list}" ; then - rm -f ${file_list} - fi + fi + + # If index files have changed since TeX has been run, or if the aux + # file wasn't present originally, run texindex and TeX again. + if test "${index_files_changed_p}" ; then :; else + # Nothing changed. We're done with TeX. + break + fi + done + + # Generate list of files to delete, then call rm once with the entire + # list. This is significantly faster than multiple executions of rm. + file_list= + for file in ${orig_index_files} ; do + file_list="${file_list} ${file}${backup_extension}" + done + if test -n "${file_list}" ; then + $verbose "Removing $file_list $tmp_dir $tmp_dir.2 ..." + rm -f ${file_list} + rm -rf $tmp_dir $tmp_dir.2 + fi done +$verbose "$0 done." +true # exit successfully. + # texi2dvi ends here +# $Log: texi2dvi,v $ +# Revision 1.1.1.2 1996/12/15 21:39:34 downsj +# Import of texinfo-3.9. +# +# 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 . +# +# 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. +# Various expansion safety measures added for test; avoid use of -o. +# diff --git a/gnu/usr.bin/texinfo/util/texindex.c b/gnu/usr.bin/texinfo/util/texindex.c index f9a3003dc3b..fd5ae7101b5 100644 --- a/gnu/usr.bin/texinfo/util/texindex.c +++ b/gnu/usr.bin/texinfo/util/texindex.c @@ -1,8 +1,7 @@ /* Prepare TeX index dribble output into an actual index. + $Id: texindex.c,v 1.1.1.2 1996/12/15 21:39:35 downsj Exp $ - Version 1.45 - - Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc. + Copyright (C) 1987, 91, 92, 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 @@ -17,14 +16,13 @@ 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. */ - #include #include #include #include "getopt.h" -#define TEXINDEX_VERSION_STRING "GNU Texindex 2.0 for Texinfo release 3.4" +#define TEXINDEX_VERSION_STRING "GNU Texindex (Texinfo 3.9) 2.1" #if defined (emacs) # include "../src/config.h" @@ -91,10 +89,12 @@ char *mktemp (); # define SEEK_END 2 #endif /* !SEEK_SET */ -#if !defined (errno) +#ifndef errno extern int errno; #endif -char *strerror (); +#ifndef strerror +extern char *strerror (); +#endif /* When sorting in core, this structure describes one line and the position and length of its first keyfield. */ @@ -282,14 +282,15 @@ typedef struct TEXINDEX_OPTION texindex_options[] = { { "--keep", "-k", &keep_tempfiles, 1, (char *)NULL, - "Keep temporary files around after processing" }, + "keep temporary files around after processing" }, { "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL, - "Do not keep temporary files around after processing (default)" }, + "do not keep temporary files around after processing (default)" }, { "--output", "-o", (int *)NULL, 0, "FILE", - "Send output to FILE" }, + "send output to FILE" }, { "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL, - "Show version information" }, - { "--help", "-h", (int *)NULL, 0, (char *)NULL, "Produce this listing" }, + "display version information and exit" }, + { "--help", "-h", (int *)NULL, 0, (char *)NULL, + "display this help and exit" }, { (char *)NULL, (char *)NULL, (int *)NULL, 0, (char *)NULL } }; @@ -298,26 +299,28 @@ usage (result_value) int result_value; { register int i; + FILE *f = result_value ? stderr : stdout; - fprintf (stderr, "Usage: %s [OPTIONS] FILE...\n", program_name); - fprintf (stderr, " Generate a permuted index for the TeX files given.\n"); - fprintf (stderr, " Usually FILE... is `foo.??' for the source file `foo.tex'.\n"); - fprintf (stderr, " The OPTIONS are:\n"); + fprintf (f, "Usage: %s [OPTION]... FILE...\n", program_name); + fprintf (f, "Generate a sorted index for each TeX output FILE.\n"); + /* Avoid trigraph nonsense. */ + fprintf (f, "Usually FILE... is `foo.??\' for a document `foo.texi'.\n"); + fprintf (f, "\nOptions:\n"); for (i = 0; texindex_options[i].long_name; i++) { - fprintf (stderr, " %s %s", + if (texindex_options[i].short_name) + fprintf (f, "%s, ", texindex_options[i].short_name); + + fprintf (f, "%s %s", texindex_options[i].long_name, - texindex_options[i].arg_name ? - texindex_options[i].arg_name : ""); + texindex_options[i].arg_name + ? texindex_options[i].arg_name : ""); - if (texindex_options[i].short_name) - fprintf (stderr, " \n or %s %s", - texindex_options[i].short_name, - texindex_options[i].arg_name ? - texindex_options[i].arg_name : ""); - fprintf (stderr, "\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."); + exit (result_value); } @@ -364,7 +367,11 @@ decode_command (argc, argv) { if (strcmp (arg, "--version") == 0) { - fprintf (stderr, "%s\n", TEXINDEX_VERSION_STRING); + puts (TEXINDEX_VERSION_STRING); +puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU General Public License.\n\ +For more information about these matters, see the files named COPYING."); exit (0); } else if ((strcmp (arg, "--keep") == 0) || @@ -1102,7 +1109,8 @@ sort_in_core (infile, total, outfile) lp->key.number = find_value (lp->key.text, lp->keylen); } - qsort (lineinfo, nextline - linearray, sizeof (struct lineinfo), compare_prepared); + qsort (lineinfo, nextline - linearray, sizeof (struct lineinfo), + compare_prepared); for (lp = lineinfo, p = linearray; p != nextline; lp++, p++) *p = lp->text;